export default `
syntax = "proto2";
package mipmap.engine.message;

message Point3d {
    required double x = 1;
    required double y = 2;
    required double z = 3;
}

message Point2f {
    required float x = 1;
    required float y = 2;
}

message Point3f {
    required float x = 1;
    required float y = 2;
    required float z = 3;
}

message ImageRect {
    required int32 x = 1;
    required int32 y = 2;
    required int32 width = 3;
    required int32 height = 4;
}

message BoundingBox3d {
    repeated Point3d corner = 1; //长度为8，按照Eigen::BoundingBox3d排列
}

message CoordinateSystem {
    enum CoordinateSystemType {
        LOCAL_ENU = 0;
        LOCAL = 1;
        Geographic = 2;
        Projected = 3;
        Geocentric = 4;
        Unsupported = 5;
    };
    required CoordinateSystemType type = 1;
    optional int32 epsg_code  = 2;
    optional string wkt = 3;
    repeated double offset = 4;
    repeated double origin_point = 5;
}

message ImageMetaData {
    optional Point3d position = 2;
    optional CoordinateSystem position_cs = 201;
    optional Point3d position_sigma = 3;
    optional Point3d pitch_roll_yaw = 4;
    repeated double rotation_c2w = 5; //size = 9
    optional double relative_altitude = 6;
    optional double absolute_altitude = 7;

    enum BandType {
        RGB = 1;
        Red = 2;
        Green= 3;
        Blue = 4;
        NIR = 5;
        RedEdge = 6;
    };
    optional BandType band_type = 8;
    optional string capture_uuid = 9;
    optional string drone_id = 10;
    // 多光谱影像相关参数
    optional double black_current = 11;
    repeated double vignetting_data = 12; //size = 6
    optional double sensor_gain = 13;
    optional double sensor_gain_adjustment = 14;
    optional double exposure_time = 15;
    optional double irradiance = 16;

    optional string camera_model = 17;
    required int32 width = 18;
    required int32 height = 19;
    optional bool dewrap_flag = 20;
    optional int32 rtk_flag = 21;
    optional uint64 capture_time = 22;
    optional uint32 focal_length_in_35mm = 23;
    optional uint32 camera_id = 24;
    repeated double pre_calib_parameters = 25;
    optional bool position_constant = 26;
    optional double f_number = 27;
    optional double ios_speed_rating = 28;
}

message ControlPoint {
    required string ctrl_id = 1;
    required uint32 usage = 2; // 0 for control point, 1 for check point, 2 for no usage
    required Point3d point = 3;
    required Point3d sigma = 4;
    repeated uint32 img_id = 5;
    repeated Point2f observation = 6;
}

message ControlPointGroup {
    repeated ControlPoint points = 1;
    required CoordinateSystem coordiante_system = 2;
}

message MVSCamera {
    enum DistortionType {
        OPENCV_K1K2K3P1P2 = 1;
        UnKnow = 2;
    };
    required DistortionType distortion_type = 1;
    optional int32 camera_id = 2;
    repeated double camera_params = 3;
    required int32 width = 4;
    required int32 height = 5;
}

message MVSImage {
    required uint32 img_id = 1;
    optional string img_path = 2;
    required uint32 camera_id = 3;
    repeated double projection_matrix = 4;
    required ImageRect image_rect = 5;
    repeated double color_params = 6;
}

message MVSPoint {
    required Point3d point = 1;
    optional int32 rgb = 2; // (r << 16) | (g << 8) | b
}

message MVSObservation {
    required float x = 1;
    required float y = 2;
    required int32 img_index = 3;
    required int32 pnt_index = 4;
    optional int32 rgb = 5; // (r << 16) | (g << 8) | b
}

message ImageMetaDataWithID {
    required uint32 id=1;
    required ImageMetaData meta_data=2;
} 

message MVSBlock {
    repeated MVSCamera camera = 1;
    repeated MVSImage image = 2;
    repeated MVSPoint point = 3;
    required CoordinateSystem mvs_image_coordinate_system = 5;
    required BoundingBox3d bounding_box = 6;
    required BoundingBox3d tight_bounding_box = 7;
    optional CoordinateSystem meta_data_coordinate_system = 9;
    optional ControlPointGroup control_point_group = 10;
    optional string version = 11;
}
`