This is not very well documented at the moment.
Would be nice to have something similar to:
#include <rerun.hpp>
#include <fstream>
#include <vector>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_image");
rec.spawn().exit_on_failure();
auto path = "test.jpeg";
std::ifstream source_file{path, std::ios::binary};
auto length{std::filesystem::file_size(path)};
std::vector<uint8_t> jpeg_data(length);
// Parsing the jpeg header is out of scope
const int HEIGHT = 300;
const int WIDTH = 300;
source_file.read(reinterpret_cast<char*>(jpeg_data.data()), static_cast<long>(length));
rec.log("image", rerun::Image({HEIGHT, WIDTH, 3}, rerun::TensorBuffer::jpeg(jpeg_data)));
}
though including a helper for parsing the header would certainly make it a lot cleaner.
This is not very well documented at the moment.
Would be nice to have something similar to:
though including a helper for parsing the header would certainly make it a lot cleaner.