Skip to content

File semantics.hpp

File List > data_format > semantics.hpp

Go to the documentation of this file

#pragma once

#include "illixr/switchboard.hpp"

#include 
#include 
#include 

namespace ILLIXR::data_format {

struct camera_intrinsics {
    float   fx     = 0.f; 
    float   fy     = 0.f; 
    float   cx     = 0.f; 
    float   cy     = 0.f; 
    int32_t width  = 0;
    int32_t height = 0;
};

struct semantic_frame : switchboard::event {
    // ----- RGB -----
    std::vector<uint8_t> image;      
    camera_intrinsics    intrinsics; 

    // ----- Depth -----
    std::vector<uint8_t> depth; 
    float                depth_near_z{0.f};
    camera_intrinsics    depth_intrinsics;

    // ----- Poses (row-major 4x4 matrices) -----
    float rgb_camera_pose[16]{0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f};
    float depth_pose[16]{0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f};

    // ----- Metadata -----
    float   max_depth{0.f};
    int32_t frame_number{0};

    // ----- Timestamps -----
    int64_t rgb_timestamp_ns   = 0; 
    int64_t depth_timestamp_ns = 0; 

    semantic_frame() = default;
};
} // namespace ILLIXR::data_format