about summary refs log tree commit diff
path: root/lri-proto
diff options
context:
space:
mode:
Diffstat (limited to 'lri-proto')
-rw-r--r--lri-proto/.gitignore1
-rw-r--r--lri-proto/Cargo.lock45
-rw-r--r--lri-proto/Cargo.toml13
-rw-r--r--lri-proto/LICENSE21
-rw-r--r--lri-proto/README.md2
-rw-r--r--lri-proto/build.rs50
-rw-r--r--lri-proto/proto/camera_id.proto22
-rw-r--r--lri-proto/proto/camera_module.proto67
-rw-r--r--lri-proto/proto/color_calibration.proto47
-rw-r--r--lri-proto/proto/dead_pixel_map.proto9
-rw-r--r--lri-proto/proto/device_temp.proto11
-rw-r--r--lri-proto/proto/distortion.proto31
-rw-r--r--lri-proto/proto/face_data.proto18
-rw-r--r--lri-proto/proto/flash_calibration.proto12
-rw-r--r--lri-proto/proto/geometric_calibration.proto64
-rw-r--r--lri-proto/proto/gps_data.proto49
-rw-r--r--lri-proto/proto/hot_pixel_map.proto16
-rw-r--r--lri-proto/proto/hw_info.proto64
-rw-r--r--lri-proto/proto/imu_data.proto17
-rw-r--r--lri-proto/proto/lightheader.proto106
-rw-r--r--lri-proto/proto/matrix3x3f.proto15
-rw-r--r--lri-proto/proto/matrix4x4f.proto22
-rw-r--r--lri-proto/proto/mirror_system.proto50
-rw-r--r--lri-proto/proto/point2f.proto8
-rw-r--r--lri-proto/proto/point2i.proto8
-rw-r--r--lri-proto/proto/point3f.proto9
-rw-r--r--lri-proto/proto/proximity_sensors.proto11
-rw-r--r--lri-proto/proto/range2f.proto8
-rw-r--r--lri-proto/proto/rectanglei.proto10
-rw-r--r--lri-proto/proto/sensor_characterization.proto26
-rw-r--r--lri-proto/proto/sensor_type.proto12
-rw-r--r--lri-proto/proto/time_stamp.proto13
-rw-r--r--lri-proto/proto/tof_calibration.proto10
-rw-r--r--lri-proto/proto/view_preferences.proto94
-rw-r--r--lri-proto/proto/vignetting_characterization.proto30
-rw-r--r--lri-proto/src/lib.rs4
36 files changed, 995 insertions, 0 deletions
diff --git a/lri-proto/.gitignore b/lri-proto/.gitignore
new file mode 100644
index 0000000..c1aa2a7
--- /dev/null
+++ b/lri-proto/.gitignore
@@ -0,0 +1 @@
+src/proto
\ No newline at end of file
diff --git a/lri-proto/Cargo.lock b/lri-proto/Cargo.lock
new file mode 100644
index 0000000..35e50c9
--- /dev/null
+++ b/lri-proto/Cargo.lock
@@ -0,0 +1,45 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "bytes"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
+
+[[package]]
+name = "lri-proto"
+version = "0.1.0"
+dependencies = [
+ "protobuf",
+ "protobuf-codegen-pure",
+]
+
+[[package]]
+name = "protobuf"
+version = "2.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
+dependencies = [
+ "bytes",
+]
+
+[[package]]
+name = "protobuf-codegen"
+version = "2.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6"
+dependencies = [
+ "protobuf",
+]
+
+[[package]]
+name = "protobuf-codegen-pure"
+version = "2.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95a29399fc94bcd3eeaa951c715f7bea69409b2445356b00519740bcd6ddd865"
+dependencies = [
+ "protobuf",
+ "protobuf-codegen",
+]
diff --git a/lri-proto/Cargo.toml b/lri-proto/Cargo.toml
new file mode 100644
index 0000000..2dd0cd7
--- /dev/null
+++ b/lri-proto/Cargo.toml
@@ -0,0 +1,13 @@
+[package]
+name = "lri-proto"
+version = "0.1.0"
+#authors = ["Daniel L. Lu <daniel@lawrence.lu>"]
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+protobuf = { version = "3.2", features = ["with-bytes"] }
+
+[build-dependencies]
+protobuf-codegen = "3"
diff --git a/lri-proto/LICENSE b/lri-proto/LICENSE
new file mode 100644
index 0000000..b5ef890
--- /dev/null
+++ b/lri-proto/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2021 Daniel Lawrence Lu
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/lri-proto/README.md b/lri-proto/README.md
new file mode 100644
index 0000000..fa4d7ed
--- /dev/null
+++ b/lri-proto/README.md
@@ -0,0 +1,2 @@
+# lri-proto
+Rust crate holding the protobuf definitions for lri-rs. A gently modified version of [dllu/lri.rs](https://github.com/dllu/lri-rs)
\ No newline at end of file
diff --git a/lri-proto/build.rs b/lri-proto/build.rs
new file mode 100644
index 0000000..31aee5a
--- /dev/null
+++ b/lri-proto/build.rs
@@ -0,0 +1,50 @@
+use std::fs;
+
+use protobuf_codegen::Customize;
+use std::path::Path;
+
+fn main() {
+    let proto_dir = "src/proto";
+
+    if Path::new(&proto_dir).exists() {
+        fs::remove_dir_all(&proto_dir).unwrap();
+    }
+    fs::create_dir(&proto_dir).unwrap();
+
+    protobuf_codegen::Codegen::new()
+        .pure()
+        .customize(Customize::default().gen_mod_rs(true).lite_runtime(true))
+        .out_dir(proto_dir)
+        .input("proto/camera_id.proto")
+        .input("proto/camera_module.proto")
+        .input("proto/color_calibration.proto")
+        .input("proto/dead_pixel_map.proto")
+        .input("proto/device_temp.proto")
+        .input("proto/distortion.proto")
+        .input("proto/face_data.proto")
+        .input("proto/flash_calibration.proto")
+        .input("proto/geometric_calibration.proto")
+        .input("proto/gps_data.proto")
+        .input("proto/hot_pixel_map.proto")
+        .input("proto/hw_info.proto")
+        .input("proto/imu_data.proto")
+        .input("proto/lightheader.proto")
+        .input("proto/matrix3x3f.proto")
+        .input("proto/matrix4x4f.proto")
+        .input("proto/mirror_system.proto")
+        .input("proto/point2f.proto")
+        .input("proto/point2i.proto")
+        .input("proto/point3f.proto")
+        .input("proto/proximity_sensors.proto")
+        .input("proto/range2f.proto")
+        .input("proto/rectanglei.proto")
+        .input("proto/sensor_characterization.proto")
+        .input("proto/sensor_type.proto")
+        .input("proto/time_stamp.proto")
+        .input("proto/tof_calibration.proto")
+        .input("proto/view_preferences.proto")
+        .input("proto/vignetting_characterization.proto")
+        .include("proto")
+        .run()
+        .unwrap();
+}
diff --git a/lri-proto/proto/camera_id.proto b/lri-proto/proto/camera_id.proto
new file mode 100644
index 0000000..f34e474
--- /dev/null
+++ b/lri-proto/proto/camera_id.proto
@@ -0,0 +1,22 @@
+syntax = "proto2";
+
+package ltpb;
+
+enum CameraID {
+    A1 = 0;
+    A2 = 1;
+    A3 = 2;
+    A4 = 3;
+    A5 = 4;
+    B1 = 5;
+    B2 = 6;
+    B3 = 7;
+    B4 = 8;
+    B5 = 9;
+    C1 = 10;
+    C2 = 11;
+    C3 = 12;
+    C4 = 13;
+    C5 = 14;
+    C6 = 15;
+}
diff --git a/lri-proto/proto/camera_module.proto b/lri-proto/proto/camera_module.proto
new file mode 100644
index 0000000..9506941
--- /dev/null
+++ b/lri-proto/proto/camera_module.proto
@@ -0,0 +1,67 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "camera_id.proto";
+import "point2i.proto";
+import "point2f.proto";
+
+message CameraModule {
+    optional AFInfo af_info = 1;
+    message AFInfo {
+        required AFMode mode = 1;
+        enum AFMode {
+            AUTO = 0;
+        }
+        
+        optional Point2F roi_center = 2;
+        optional float disparity_focus_distance = 3;
+        optional float contrast_focus_distance = 4;
+        optional bool lens_timeout = 5;
+        optional bool mirror_timeout = 6;
+        optional int32 mirror_position = 7;
+    }
+    
+    required CameraID id = 2;
+    optional bool is_enabled = 3 [default = true];
+    optional int32 mirror_position = 4 [default = 0];
+    required int32 lens_position = 5;
+    required float sensor_analog_gain = 7;
+    required uint64 sensor_exposure = 8;
+    
+    required Surface sensor_data_surface = 9;
+    message Surface {
+        required Point2I start = 1;
+        required Point2I size = 2;
+        
+        required FormatType format = 3;
+        enum FormatType {
+            RAW_BAYER_JPEG = 0;
+            RAW_RESERVED_0 = 1;
+            RAW_RESERVED_1 = 2;
+            RAW_RESERVED_2 = 3;
+            RAW_RESERVED_3 = 4;
+            RAW_RESERVED_4 = 5;
+            RAW_RESERVED_5 = 6;
+            RAW_PACKED_10BPP = 7;
+            RAW_PACKED_12BPP = 8;
+            RAW_PACKED_14BPP = 9;
+        }
+        
+        required uint32 row_stride = 4;
+        required uint64 data_offset = 5;
+        optional Point2F data_scale = 6;
+    }
+    
+    optional sint32 sensor_temparature = 10;
+    optional bool sensor_is_horizontal_flip = 11 [default = false];
+    optional bool sensor_is_vertical_flip = 12 [default = false];
+    optional Point2I sensor_bayer_red_override = 13;
+    optional float sensor_digital_gain = 14;
+    optional uint32 frame_index = 15;
+    optional bool sensor_dpc_on = 16 [default = true];
+    optional sint32 sensor_exp_start_offset = 17;
+    optional float sensor_scan_speed = 18;
+    
+    reserved 6;
+}
diff --git a/lri-proto/proto/color_calibration.proto b/lri-proto/proto/color_calibration.proto
new file mode 100644
index 0000000..bef82f7
--- /dev/null
+++ b/lri-proto/proto/color_calibration.proto
@@ -0,0 +1,47 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "matrix3x3f.proto";
+import "point3f.proto";
+import "point2f.proto";
+
+message ColorCalibration {
+    required IlluminantType type = 1;
+    enum IlluminantType {
+        A = 0;
+        D50 = 1;
+        D65 = 2;
+        D75 = 3;
+        F2 = 4;
+        F7 = 5;
+        F11 = 6;
+        TL84 = 7;
+        UNKNOWN = 99;
+    }
+    
+    required Matrix3x3F forward_matrix = 2;
+    required Matrix3x3F color_matrix = 3;
+    required float rg_ratio = 4;
+    required float bg_ratio = 5;
+    repeated Point3F macbeth_data = 6;
+    repeated Point2F illuminant_spd = 7;
+    
+    optional SpectralData spectral_data = 8;
+    message SpectralData {
+        required ChannelFormat format = 1;
+        enum ChannelFormat {
+            MONO = 0;
+            RGB = 1;
+            BAYER_RGGB = 2;
+        }
+        
+        repeated SpectralSensitivity channel_data = 2;
+    }
+    
+    message SpectralSensitivity {
+        required uint32 start = 1;
+        required uint32 end = 2;
+        repeated float data = 3 [packed = true];
+    }
+}
diff --git a/lri-proto/proto/dead_pixel_map.proto b/lri-proto/proto/dead_pixel_map.proto
new file mode 100644
index 0000000..b4df63b
--- /dev/null
+++ b/lri-proto/proto/dead_pixel_map.proto
@@ -0,0 +1,9 @@
+syntax = "proto2";
+
+package ltpb;
+
+message DeadPixelMap {
+    required uint64 data_offset = 1;
+    required uint32 data_size = 2;
+    optional float black_level_threshold = 3;
+}
diff --git a/lri-proto/proto/device_temp.proto b/lri-proto/proto/device_temp.proto
new file mode 100644
index 0000000..1412a82
--- /dev/null
+++ b/lri-proto/proto/device_temp.proto
@@ -0,0 +1,11 @@
+syntax = "proto2";
+
+package ltpb;
+
+message DeviceTemp {
+    optional sint32 sensor_1 = 1;
+    optional sint32 sensor_2 = 2;
+    optional sint32 sensor_3 = 3;
+    optional sint32 sensor_4 = 4;
+    optional sint32 flex_sensor_1 = 5;
+}
diff --git a/lri-proto/proto/distortion.proto b/lri-proto/proto/distortion.proto
new file mode 100644
index 0000000..cdd8f33
--- /dev/null
+++ b/lri-proto/proto/distortion.proto
@@ -0,0 +1,31 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "point2f.proto";
+import "rectanglei.proto";
+
+message Distortion {
+    optional Polynomial polynomial = 1;
+    message Polynomial {
+        required Point2F distortion_center = 1;
+        required Point2F normalization = 2;
+        repeated float coeffs = 3 [packed = true];
+        optional float fit_cost = 4;
+        optional RectangleI valid_roi = 5;
+    }
+    
+    optional CRA cra = 2;
+    message CRA {
+        required Point2F distortion_center = 1;
+        required float sensor_distance = 2;
+        required float exit_pupil_distance = 3;
+        required float pixel_size = 4;
+        repeated Point2F cra = 5;
+        repeated Point2F coeffs = 6;
+        optional float fit_cost = 7;
+        optional RectangleI valid_roi = 8;
+        optional float lens_hall_code = 9;
+        optional float distance_hall_ratio = 10;
+    }
+}
diff --git a/lri-proto/proto/face_data.proto b/lri-proto/proto/face_data.proto
new file mode 100644
index 0000000..669970a
--- /dev/null
+++ b/lri-proto/proto/face_data.proto
@@ -0,0 +1,18 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "camera_id.proto";
+import "rectanglei.proto";
+
+message FaceData {
+    required CameraID id = 1;
+    required uint32 frame_index = 2;
+    
+    repeated ROI rois = 3;
+    message ROI {
+        optional uint32 id = 1;
+        optional RectangleI roi = 2;
+        optional float confidence = 3;
+    }
+}
diff --git a/lri-proto/proto/flash_calibration.proto b/lri-proto/proto/flash_calibration.proto
new file mode 100644
index 0000000..1327442
--- /dev/null
+++ b/lri-proto/proto/flash_calibration.proto
@@ -0,0 +1,12 @@
+syntax = "proto2";
+
+package ltpb;
+
+message FlashCalibration {
+    required float ledcool_lux = 1;
+    required float ledcool_max_lumens = 2;
+    required float ledcool_cct = 3;
+    required float ledwarm_lux = 4;
+    required float ledwarm_max_lumens = 5;
+    required float ledwarm_cct = 6;
+}
diff --git a/lri-proto/proto/geometric_calibration.proto b/lri-proto/proto/geometric_calibration.proto
new file mode 100644
index 0000000..d89d2e7
--- /dev/null
+++ b/lri-proto/proto/geometric_calibration.proto
@@ -0,0 +1,64 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "mirror_system.proto";
+import "matrix3x3f.proto";
+import "point3f.proto";
+import "distortion.proto";
+import "range2f.proto";
+import "device_temp.proto";
+import "point2f.proto";
+
+message GeometricCalibration {
+    optional MirrorType mirror_type = 1;
+    enum MirrorType {
+        NONE = 0;
+        GLUED = 1;
+        MOVABLE = 2;
+    }
+    
+    repeated CalibrationFocusBundle per_focus_calibration = 2;
+    message CalibrationFocusBundle {
+        required float focus_distance = 1;
+        optional Intrinsics intrinsics = 2;
+        optional Extrinsics extrinsics = 3;
+        optional sint32 sensor_temp = 4;
+        optional DeviceTemp device_temp = 5;
+        optional float focus_hall_code = 6;
+    }
+    
+    optional Distortion distortion = 3;
+    optional Range2F lens_hall_code_range = 4;
+    optional Range2F focus_distance_range = 5;
+    
+    optional AngleOpticalCenterMapping angle_optical_center_mapping = 6;
+    message AngleOpticalCenterMapping {
+        required Point2F center_start = 1;
+        required Point2F center_end = 2;
+        required float angle_offset = 3;
+        required float t_scale = 4;
+        required float t_offset = 5;
+    }
+    
+    message Intrinsics {
+        required Matrix3x3F k_mat = 1;
+        optional float rms_error = 2;
+    }
+    
+    message Extrinsics {
+        optional CanonicalFormat canonical = 1;
+        message CanonicalFormat {
+            required Matrix3x3F rotation = 1;
+            required Point3F translation = 2;
+            optional float stereo_error = 3;
+            optional float reprojection_error = 4;
+        }
+        
+        optional MovableMirrorFormat moveable_mirror = 2;
+        message MovableMirrorFormat {
+            optional MirrorSystem mirror_system = 1;
+            optional MirrorActuatorMapping mirror_actuator_mapping = 2;
+        }
+    }
+}
diff --git a/lri-proto/proto/gps_data.proto b/lri-proto/proto/gps_data.proto
new file mode 100644
index 0000000..bc57f14
--- /dev/null
+++ b/lri-proto/proto/gps_data.proto
@@ -0,0 +1,49 @@
+syntax = "proto2";
+
+package ltpb;
+
+message GPSData {
+    optional double latitude = 1;
+    optional double longitude = 2;
+    optional uint64 timestamp = 3;
+    optional double dop = 4;
+    
+    optional Track track = 5;
+    message Track {
+        required double value = 1;
+        required ReferenceNorth ref = 2;
+    }
+    
+    optional Heading heading = 6;
+    message Heading {
+        required double value = 1;
+        required ReferenceNorth ref = 2;
+    }
+    
+    optional Altitude altitude = 7;
+    message Altitude {
+        required double value = 1;
+        required ReferenceAltitude ref = 2;
+    }
+    
+    optional double speed = 8;
+    
+    optional ProcessingMethod processing_method = 9;
+    enum ProcessingMethod {
+        PROCESSING_METHOD_UNKNOWN = 0;
+        PROCESSING_METHOD_GPS = 1;
+        PROCESSING_METHOD_CELLID = 2;
+        PROCESSING_METHOD_WLAN = 3;
+        PROCESSING_METHOD_MANUAL = 4;
+        PROCESSING_METHOD_FUSED = 5;
+    }
+    
+    enum ReferenceNorth {
+        REFERENCE_NORTH_MAGNETIC = 0;
+        REFERENCE_NORTH_TRUE = 1;
+    }
+    
+    enum ReferenceAltitude {
+        REFERENCE_ALTITUDE_SEA_LEVEL = 0;
+    }
+}
diff --git a/lri-proto/proto/hot_pixel_map.proto b/lri-proto/proto/hot_pixel_map.proto
new file mode 100644
index 0000000..4cd53dc
--- /dev/null
+++ b/lri-proto/proto/hot_pixel_map.proto
@@ -0,0 +1,16 @@
+syntax = "proto2";
+
+package ltpb;
+
+message HotPixelMap {
+    repeated HotPixelMeasurement data = 1;
+    message HotPixelMeasurement {
+        required uint64 data_offset = 1;
+        required uint32 data_size = 2;
+        required uint32 data_exposure = 3;
+        required int32 sensor_temparature = 4;
+        required float sensor_gain = 5;
+        optional float pixel_variance = 6;
+        optional float threshold = 7;
+    }
+}
diff --git a/lri-proto/proto/hw_info.proto b/lri-proto/proto/hw_info.proto
new file mode 100644
index 0000000..70bd90f
--- /dev/null
+++ b/lri-proto/proto/hw_info.proto
@@ -0,0 +1,64 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "sensor_type.proto";
+import "camera_id.proto";
+
+message CameraModuleHwInfo {
+    required CameraID id = 1;
+    required SensorType sensor = 2;
+    
+    optional LensType lens = 3 [default = LENS_UNKNOWN];
+    enum LensType {
+        LENS_UNKNOWN = 0;
+        LENS_SHOWIN = 1;
+        LENS_LARGAN = 2;
+        LENS_SUNNY = 3;
+        LENS_KANTATSU = 4;
+    }
+    
+    optional MirrorActuatorType mirror_actuator = 4 [default = MIRROR_ACTUATOR_UNKNOWN];
+    enum MirrorActuatorType {
+        MIRROR_ACTUATOR_UNKNOWN = 0;
+        MIRROR_ACTUATOR_PZT = 1;
+    }
+    
+    optional MirrorType mirror = 5 [default = MIRROR_UNKNOWN];
+    enum MirrorType {
+        MIRROR_UNKNOWN = 0;
+        MIRROR_DIELECTRIC_SNX = 1;
+        MIRROR_SILVER_ZUISHO = 2;
+    }
+    
+    enum LensActuatorType {
+        LENS_ACTUATOR_UNKNOWN = 0;
+        LENS_ACTUATOR_SHICOH = 1;
+        LENS_ACTUATOR_PZT = 2;
+    }
+}
+
+message HwInfo {
+    repeated CameraModuleHwInfo camera = 1;
+    
+    optional FlashType flash = 2 [default = FLASH_UNKNOWN];
+    enum FlashType {
+        FLASH_UNKNOWN = 0;
+        FLASH_OSRAM_CBLPM1 = 1;
+    }
+    
+    optional ToFType tof = 3 [default = TOF_UNKNOWN];
+    enum ToFType {
+        TOF_UNKNOWN = 0;
+        TOF_STMICRO_VL53L0 = 1;
+    }
+    
+    optional ModelType model = 4;
+    enum ModelType {
+        MODEL_P1 = 0;
+        MODEL_P1_1 = 1;
+        MODEL_P2 = 2;
+    }
+    
+    optional string manufacturer = 5;
+}
diff --git a/lri-proto/proto/imu_data.proto b/lri-proto/proto/imu_data.proto
new file mode 100644
index 0000000..7106fa3
--- /dev/null
+++ b/lri-proto/proto/imu_data.proto
@@ -0,0 +1,17 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "point3f.proto";
+
+message IMUData {
+    required uint32 frame_index = 1;
+    
+    repeated Sample accelerometer = 2;
+    message Sample {
+        required uint32 row_idx = 1;
+        required Point3F data = 2;
+    }
+    
+    repeated Sample gyroscope = 3;
+}
diff --git a/lri-proto/proto/lightheader.proto b/lri-proto/proto/lightheader.proto
new file mode 100644
index 0000000..6a729bb
--- /dev/null
+++ b/lri-proto/proto/lightheader.proto
@@ -0,0 +1,106 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "camera_module.proto";
+import "camera_id.proto";
+import "time_stamp.proto";
+import "geometric_calibration.proto";
+import "color_calibration.proto";
+import "sensor_characterization.proto";
+import "vignetting_characterization.proto";
+import "hot_pixel_map.proto";
+import "device_temp.proto";
+import "dead_pixel_map.proto";
+import "tof_calibration.proto";
+import "flash_calibration.proto";
+import "sensor_type.proto";
+import "hw_info.proto";
+import "view_preferences.proto";
+import "proximity_sensors.proto";
+import "imu_data.proto";
+import "gps_data.proto";
+import "face_data.proto";
+
+message FactoryDeviceCalibration {
+    optional FlashCalibration flash = 1;
+    optional ToFCalibration tof = 2;
+    optional TimeStamp time_stamp = 3;
+}
+
+message FactoryModuleCalibration {
+    required CameraID camera_id = 1;
+    repeated ColorCalibration color = 2;
+    optional GeometricCalibration geometry = 3;
+    optional VignettingCharacterization vignetting = 4;
+    optional HotPixelMap hot_pixel_map = 5;
+    optional DeadPixelMap dead_pixel_map = 6;
+    optional TimeStamp time_stamp = 7;
+}
+
+message ColorCalibrationGold {
+    required CameraID camera_id = 1;
+    repeated ColorCalibration data = 2;
+    optional TimeStamp time_stamp = 3;
+}
+
+message SensorData {
+    required SensorType type = 1;
+    required SensorCharacterization data = 2;
+    optional TimeStamp time_stamp = 3;
+}
+
+message FlashData {
+    required Mode mode = 1;
+    enum Mode {
+        NOFLASH = 0;
+        FLASH = 1;
+        TORCH = 2;
+    }
+    
+    optional uint32 ledcool_current = 2;
+    optional uint32 ledwarm_current = 3;
+    optional uint32 flash_duration = 4;
+    optional int32 offset_duration = 5;
+}
+
+message AFDebugInfo {
+    optional bool focus_achieved = 1;
+    optional int32 image_focal_length = 2;
+}
+
+message Compatibility {
+    required uint32 version = 1;
+    repeated string features = 2;
+}
+
+message LightHeader {
+    optional uint64 image_unique_id_low = 1;
+    optional uint64 image_unique_id_high = 2;
+    optional TimeStamp image_time_stamp = 3;
+    optional int32 image_focal_length = 4;
+    optional CameraID image_reference_camera = 5;
+    optional uint64 device_unique_id_low = 6;
+    optional uint64 device_unique_id_high = 7;
+    optional string device_model_name = 8;
+    optional string device_fw_version = 9;
+    optional string device_asic_fw_version = 10;
+    optional DeviceTemp device_temperature = 11;
+    repeated CameraModule modules = 12;
+    repeated FactoryModuleCalibration module_calibration = 13;
+    optional FactoryDeviceCalibration device_calibration = 14;
+    repeated ColorCalibrationGold gold_cc = 15;
+    repeated SensorData sensor_data = 16;
+    optional float tof_range = 17;
+    optional HwInfo hw_info = 18;
+    optional ViewPreferences view_preferences = 19;
+    optional ProximitySensors proximity_sensors = 20;
+    optional FlashData flash_data = 22;
+    repeated IMUData imu_data = 23;
+    optional AFDebugInfo af_info = 24;
+    optional GPSData gps_data = 25;
+    optional Compatibility compatibility = 26;
+    repeated FaceData face_data = 27;
+    
+    reserved 21;
+}
diff --git a/lri-proto/proto/matrix3x3f.proto b/lri-proto/proto/matrix3x3f.proto
new file mode 100644
index 0000000..a1558b2
--- /dev/null
+++ b/lri-proto/proto/matrix3x3f.proto
@@ -0,0 +1,15 @@
+syntax = "proto2";
+
+package ltpb;
+
+message Matrix3x3F {
+    required float x00 = 1;
+    required float x01 = 2;
+    required float x02 = 3;
+    required float x10 = 4;
+    required float x11 = 5;
+    required float x12 = 6;
+    required float x20 = 7;
+    required float x21 = 8;
+    required float x22 = 9;
+}
diff --git a/lri-proto/proto/matrix4x4f.proto b/lri-proto/proto/matrix4x4f.proto
new file mode 100644
index 0000000..de2de61
--- /dev/null
+++ b/lri-proto/proto/matrix4x4f.proto
@@ -0,0 +1,22 @@
+syntax = "proto2";
+
+package ltpb;
+
+message Matrix4x4F {
+    required float x00 = 1;
+    required float x01 = 2;
+    required float x02 = 3;
+    required float x03 = 4;
+    required float x10 = 5;
+    required float x11 = 6;
+    required float x12 = 7;
+    required float x13 = 8;
+    required float x20 = 9;
+    required float x21 = 10;
+    required float x22 = 11;
+    required float x23 = 12;
+    required float x30 = 13;
+    required float x31 = 14;
+    required float x32 = 15;
+    required float x33 = 16;
+}
diff --git a/lri-proto/proto/mirror_system.proto b/lri-proto/proto/mirror_system.proto
new file mode 100644
index 0000000..4bb057e
--- /dev/null
+++ b/lri-proto/proto/mirror_system.proto
@@ -0,0 +1,50 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "matrix3x3f.proto";
+import "point3f.proto";
+import "range2f.proto";
+
+message MirrorSystem {
+    required Point3F real_camera_location = 1;
+    required Matrix3x3F real_camera_orientation = 2;
+    required Point3F rotation_axis = 3;
+    required Point3F point_on_rotation_axis = 4;
+    required float distance_mirror_plane_to_point_on_rotation_axis = 5;
+    required Point3F mirror_normal_at_zero_degrees = 6;
+    required bool flip_img_around_x = 7;
+    required Range2F mirror_angle_range = 8;
+    optional float reprojection_error = 9;
+}
+
+message MirrorActuatorMapping {
+    required TransformationType transformation_type = 1;
+    enum TransformationType {
+        MEAN_STD_NORMALIZE = 0;
+        TAN_HALF_THETA = 1;
+    }
+    
+    required float actuator_length_offset = 2;
+    required float actuator_length_scale = 3;
+    required float mirror_angle_offset = 4;
+    required float mirror_angle_scale = 5;
+    
+    repeated ActuatorAnglePair actuator_angle_pair_vec = 6;
+    message ActuatorAnglePair {
+        required int32 hall_code = 1;
+        required float angle = 2;
+    }
+    
+    required QuadraticModel quadratic_model = 7;
+    message QuadraticModel {
+        required bool use_rplus_for_left_segment = 1;
+        required bool use_rplus_for_right_segment = 2;
+        required float inflection_value = 3;
+        repeated float model_coeffs = 4 [packed = true];
+    }
+    
+    optional float angle_to_hall_code_error = 8;
+    optional float hall_code_to_angle_error = 9;
+    optional Range2F hall_code_range = 10;
+}
diff --git a/lri-proto/proto/point2f.proto b/lri-proto/proto/point2f.proto
new file mode 100644
index 0000000..726d594
--- /dev/null
+++ b/lri-proto/proto/point2f.proto
@@ -0,0 +1,8 @@
+syntax = "proto2";
+
+package ltpb;
+
+message Point2F {
+    required float x = 1;
+    required float y = 2;
+}
diff --git a/lri-proto/proto/point2i.proto b/lri-proto/proto/point2i.proto
new file mode 100644
index 0000000..3da325d
--- /dev/null
+++ b/lri-proto/proto/point2i.proto
@@ -0,0 +1,8 @@
+syntax = "proto2";
+
+package ltpb;
+
+message Point2I {
+    required int32 x = 1;
+    required int32 y = 2;
+}
diff --git a/lri-proto/proto/point3f.proto b/lri-proto/proto/point3f.proto
new file mode 100644
index 0000000..71e5cbd
--- /dev/null
+++ b/lri-proto/proto/point3f.proto
@@ -0,0 +1,9 @@
+syntax = "proto2";
+
+package ltpb;
+
+message Point3F {
+    required float x = 1;
+    required float y = 2;
+    required float z = 3;
+}
diff --git a/lri-proto/proto/proximity_sensors.proto b/lri-proto/proto/proximity_sensors.proto
new file mode 100644
index 0000000..e7c6ab4
--- /dev/null
+++ b/lri-proto/proto/proximity_sensors.proto
@@ -0,0 +1,11 @@
+syntax = "proto2";
+
+package ltpb;
+
+message ProximitySensors {
+    required bool sensor_1 = 1;
+    required bool sensor_2 = 2;
+    required bool sensor_3 = 3;
+    required bool sensor_4 = 4;
+    required bool sensor_5 = 5;
+}
diff --git a/lri-proto/proto/range2f.proto b/lri-proto/proto/range2f.proto
new file mode 100644
index 0000000..8c905fe
--- /dev/null
+++ b/lri-proto/proto/range2f.proto
@@ -0,0 +1,8 @@
+syntax = "proto2";
+
+package ltpb;
+
+message Range2F {
+    required float min_val = 1;
+    required float max_val = 2;
+}
diff --git a/lri-proto/proto/rectanglei.proto b/lri-proto/proto/rectanglei.proto
new file mode 100644
index 0000000..8360ee4
--- /dev/null
+++ b/lri-proto/proto/rectanglei.proto
@@ -0,0 +1,10 @@
+syntax = "proto2";
+
+package ltpb;
+
+message RectangleI {
+    required int32 x = 1;
+    required int32 y = 2;
+    required int32 width = 3;
+    required int32 height = 4;
+}
diff --git a/lri-proto/proto/sensor_characterization.proto b/lri-proto/proto/sensor_characterization.proto
new file mode 100644
index 0000000..d66aa4a
--- /dev/null
+++ b/lri-proto/proto/sensor_characterization.proto
@@ -0,0 +1,26 @@
+syntax = "proto2";
+
+package ltpb;
+
+message SensorCharacterization {
+    required float black_level = 1;
+    required float white_level = 2;
+    optional float cliff_slope = 3;
+    
+    repeated VstNoiseModel vst_model = 4;
+    message VstNoiseModel {
+        required uint32 gain = 1;
+        required float threshold = 2;
+        required float scale = 3;
+        
+        required VstModel red = 4;
+        message VstModel {
+            required float a = 1;
+            required float b = 2;
+        }
+        
+        required VstModel green = 5;
+        required VstModel blue = 6;
+        optional VstModel panchromatic = 7;
+    }
+}
diff --git a/lri-proto/proto/sensor_type.proto b/lri-proto/proto/sensor_type.proto
new file mode 100644
index 0000000..98cc824
--- /dev/null
+++ b/lri-proto/proto/sensor_type.proto
@@ -0,0 +1,12 @@
+syntax = "proto2";
+
+package ltpb;
+
+enum SensorType {
+    SENSOR_UNKNOWN = 0;
+    SENSOR_AR835 = 1;
+    SENSOR_AR1335 = 2;
+    SENSOR_AR1335_MONO = 3;
+    SENSOR_IMX386 = 4;
+    SENSOR_IMX386_MONO = 5;
+}
diff --git a/lri-proto/proto/time_stamp.proto b/lri-proto/proto/time_stamp.proto
new file mode 100644
index 0000000..238eebe
--- /dev/null
+++ b/lri-proto/proto/time_stamp.proto
@@ -0,0 +1,13 @@
+syntax = "proto2";
+
+package ltpb;
+
+message TimeStamp {
+    required uint32 year = 1;
+    required uint32 month = 2;
+    required uint32 day = 3;
+    required uint32 hour = 4;
+    required uint32 minute = 5;
+    required uint32 second = 6;
+    optional sint32 tz_offset = 7;
+}
diff --git a/lri-proto/proto/tof_calibration.proto b/lri-proto/proto/tof_calibration.proto
new file mode 100644
index 0000000..441eb5e
--- /dev/null
+++ b/lri-proto/proto/tof_calibration.proto
@@ -0,0 +1,10 @@
+syntax = "proto2";
+
+package ltpb;
+
+message ToFCalibration {
+    required float offset_distance = 1;
+    required float offset_measurement = 2;
+    required float xtalk_distance = 3;
+    required float xtalk_measurement = 4;
+}
diff --git a/lri-proto/proto/view_preferences.proto b/lri-proto/proto/view_preferences.proto
new file mode 100644
index 0000000..592fc6f
--- /dev/null
+++ b/lri-proto/proto/view_preferences.proto
@@ -0,0 +1,94 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "point2f.proto";
+
+message ViewPreferences {
+    optional float f_number = 1;
+    optional float ev_offset = 2;
+    optional bool disable_cropping = 3;
+    
+    optional HDRMode hdr_mode = 4;
+    enum HDRMode {
+        HDR_MODE_NONE = 0;
+        HDR_MODE_DEFAULT = 1;
+        HDR_MODE_NATURAL = 2;
+        HDR_MODE_SURREAL = 3;
+    }
+    
+    optional ViewPresets view_preset = 5;
+    enum ViewPresets {
+        VIEW_PRESET_NONE = 0;
+        VIEW_PRESET_NATURAL = 1;
+        VIEW_PRESET_FAITHFUL = 2;
+        VIEW_PRESET_LANDSCAPE = 3;
+        VIEW_PRESET_PORTRAIT = 4;
+    }
+    
+    optional SceneMode scene_mode = 6;
+    enum SceneMode {
+        SCENE_MODE_PORTRAIT = 0;
+        SCENE_MODE_LANDSCAPE = 1;
+        SCENE_MODE_SPORT = 2;
+        SCENE_MODE_MACRO = 3;
+        SCENE_MODE_NIGHT = 4;
+        SCENE_MODE_NONE = 5;
+    }
+    
+    optional AWBMode awb_mode = 7;
+    enum AWBMode {
+        AWB_MODE_AUTO = 0;
+        AWB_MODE_DAYLIGHT = 1;
+        AWB_MODE_SHADE = 2;
+        AWB_MODE_CLOUDY = 3;
+        AWB_MODE_TUNGSTEN = 4;
+        AWB_MODE_FLUORESCENT = 5;
+        AWB_MODE_FLASH = 6;
+        AWB_MODE_CUSTOM = 7;
+        AWB_MODE_KELVIN = 8;
+    }
+    
+    optional Orientation orientation = 9;
+    enum Orientation {
+        ORIENTATION_NORMAL = 0;
+        ORIENTATION_ROT90_CW = 1;
+        ORIENTATION_ROT90_CCW = 2;
+        ORIENTATION_ROT90_CW_VFLIP = 3;
+        ORIENTATION_ROT90_CCW_VFLIP = 4;
+        ORIENTATION_VFLIP = 5;
+        ORIENTATION_HFLIP = 6;
+        ORIENTATION_ROT180 = 7;
+    }
+    
+    optional float image_gain = 10;
+    optional uint64 image_integration_time_ns = 11;
+    optional uint32 user_rating = 12;
+    
+    optional AspectRatio aspect_ratio = 13;
+    enum AspectRatio {
+        ASPECT_RATIO_4_3 = 0;
+        ASPECT_RATIO_16_9 = 1;
+    }
+    
+    optional Crop crop = 14;
+    message Crop {
+        required Point2F start = 1;
+        required Point2F size = 2;
+    }
+    
+    optional ChannelGain awb_gains = 15;
+    message ChannelGain {
+        required float r = 1;
+        required float g_r = 2;
+        required float g_b = 3;
+        required float b = 4;
+    }
+    
+    optional bool is_on_tripod = 16;
+    optional float qc_lux_index = 17;
+    optional float display_gain = 18;
+    optional uint64 display_integration_time_ns = 19;
+    
+    reserved 8;
+}
diff --git a/lri-proto/proto/vignetting_characterization.proto b/lri-proto/proto/vignetting_characterization.proto
new file mode 100644
index 0000000..ccf93ec
--- /dev/null
+++ b/lri-proto/proto/vignetting_characterization.proto
@@ -0,0 +1,30 @@
+syntax = "proto2";
+
+package ltpb;
+
+import "matrix4x4f.proto";
+
+message VignettingCharacterization {
+    required CrosstalkModel crosstalk = 1;
+    message CrosstalkModel {
+        required uint32 width = 1;
+        required uint32 height = 2;
+        repeated Matrix4x4F data = 3;
+        repeated float data_packed = 4 [packed = true];
+    }
+    
+    repeated MirrorVignettingModel vignetting = 2;
+    message MirrorVignettingModel {
+        required int32 hall_code = 1;
+        required VignettingModel vignetting = 2;
+    }
+    
+    optional float relative_brightness = 3;
+    optional int32 lens_hall_code = 4;
+    
+    message VignettingModel {
+        required uint32 width = 1;
+        required uint32 height = 2;
+        repeated float data = 3 [packed = true];
+    }
+}
diff --git a/lri-proto/src/lib.rs b/lri-proto/src/lib.rs
new file mode 100644
index 0000000..02c0048
--- /dev/null
+++ b/lri-proto/src/lib.rs
@@ -0,0 +1,4 @@
+mod proto;
+
+pub use proto::*;
+pub use protobuf::Message;