Archetype: The AnnotationContext
provides additional information on how to display entities.
Entities can use ClassId
s and KeypointId
s to provide annotations, and the labels and colors will be looked up in the appropriate AnnotationContext
. We use the first annotation context we find in the path-hierarchy when searching up through the ancestors of a given entity path.
Example
Segmentation
![image](https://static.rerun.io/annotation_context_segmentation/0e21c0a04e456fec41d16b0deaa12c00cddf2d9b/full.png)
#include <rerun.hpp>
#include <algorithm>
#include <vector>
int main() {
rec.spawn().exit_on_failure();
rec.log_timeless(
"segmentation",
})
);
const int HEIGHT = 200;
const int WIDTH = 300;
std::vector<uint8_t> data(WIDTH * HEIGHT, 0);
for (auto y = 50; y <100; ++y) {
std::fill_n(data.begin() + y * WIDTH + 50, 70, static_cast<uint8_t>(1));
}
for (auto y = 100; y <180; ++y) {
std::fill_n(data.begin() + y * WIDTH + 130, 150, static_cast<uint8_t>(2));
}
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:57
Archetype: The AnnotationContext provides additional information on how to display entities.
Definition annotation_context.hpp:63
Archetype: An image made up of integer class-ids.
Definition segmentation_image.hpp:70
Datatype: Annotation info annotating a class id or key-point id.
Definition annotation_info.hpp:25
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition rgba32.hpp:27