realsense_rust/kind/
product_line.rs

1//! Type for describing different product lines that work with librealsense2.
2//!
3//! As of Feb 22, 2021, The RealSense source code defines the following constants as
4//! possible options for the Product Line flag. Some flags are just aliases, while
5//! others are general groupings. The full list of flags is provided below for
6//! convenience.
7//!
8//! | Product Line Name            | Flag (in hex)                                                                |
9//! | ---------------------------- | ---------------------------------------------------------------------------- |
10//! | `RS2_PRODUCT_LINE_ANY`       | `0xff`                                                                       |
11//! | `RS2_PRODUCT_LINE_ANY_INTEL` | `0xfe`                                                                       |
12//! | `RS2_PRODUCT_LINE_NON_INTEL` | `0x01`                                                                       |
13//! | `RS2_PRODUCT_LINE_D400`      | `0x02`                                                                       |
14//! | `RS2_PRODUCT_LINE_SR300`     | `0x04`                                                                       |
15//! | `RS2_PRODUCT_LINE_L500`      | `0x08`                                                                       |
16//! | `RS2_PRODUCT_LINE_T200`      | `0x10`                                                                       |
17//! | `RS2_PRODUCT_LINE_DEPTH`     | `(RS2_PRODUCT_LINE_L500 or RS2_PRODUCT_LINE_SR300 or RS2_PRODUCT_LINE_D400)` |
18//! | `RS2_PRODUCT_LINE_TRACKING`  | `RS2_PRODUCT_LINE_T200`                                                      |
19//!
20
21use num_derive::{FromPrimitive, ToPrimitive};
22use realsense_sys as sys;
23
24/// Type describing possible options for RealSense-supported product lines.
25#[repr(u32)]
26#[derive(FromPrimitive, ToPrimitive, Debug, Clone, Copy, PartialEq, Eq, Hash)]
27pub enum Rs2ProductLine {
28    /// Any product compatible with librealsense2
29    Any = sys::RS2_PRODUCT_LINE_ANY,
30    /// Any Intel product compatible with librealsense2
31    AnyIntel = sys::RS2_PRODUCT_LINE_ANY_INTEL,
32    /// Any non-Intel product compatible with librealsense2
33    NonIntel = sys::RS2_PRODUCT_LINE_NON_INTEL,
34    /// Any D400 series camera
35    D400 = sys::RS2_PRODUCT_LINE_D400,
36    /// Any SR300 series camera
37    Sr300 = sys::RS2_PRODUCT_LINE_SR300,
38    /// Any L500 series LiDAR / camera
39    L500 = sys::RS2_PRODUCT_LINE_L500,
40    /// Any T200 series product
41    ///
42    /// This is aliased to
43    /// [`RS2_PRODUCT_LINE_TRACKING`](realsense_sys::RS2_PRODUCT_LINE_TRACKING)
44    T200 = sys::RS2_PRODUCT_LINE_T200,
45    /// Any device that has a depth feed
46    Depth = sys::RS2_PRODUCT_LINE_DEPTH,
47}