realsense_rust/kind/color_scheme.rs
1//! Color scheme choices used by colorizer processing blocks.
2
3use num_derive::{FromPrimitive, ToPrimitive};
4
5/// A type describing the various color scheme choices for colorizer processing blocks.
6///
7/// This name of this type is not preceded with `Rs2` because this does not map to a librealsense2
8/// type from the low-level `realsense-sys` crate. Instead, this is just a selection of better
9/// names when setting the `Rs2Option::ColorScheme` option in a processing block that colorizes
10/// depth output.
11///
12/// This enum, much like many others in the `kind` module maps integers of some form to the enum
13/// values, and inherits both [`FromPrimitive`](num_traits::FromPrimitive) and
14/// [`ToPrimitive`](num_traits::ToPrimitive) from the `num_traits` crate. This is because we want
15/// to be able to take advantage of the [`to_f32()`](num_traits::ToPrimitive::to_f32()) function in
16/// the low-level API, but use actual color scheme names at a higher level.
17#[repr(usize)]
18#[derive(FromPrimitive, ToPrimitive, Debug, Clone, Copy, PartialEq, Eq, Hash)]
19pub enum ColorScheme {
20 /// Jet color scheme
21 Jet = 0,
22 /// Classic color scheme
23 Classic = 1,
24 /// White to black color scheme
25 WhiteToBlack = 2,
26 /// Black to white color scheme
27 BlackToWhite = 3,
28 /// Bio color scheme
29 Bio = 4,
30 /// Cold color scheme
31 Cold = 5,
32 /// Warm color scheme
33 Warm = 6,
34 /// Quantized color scheme
35 Quantized = 7,
36 /// Pattern color scheme
37 Pattern = 8,
38 /// Hue color scheme
39 Hue = 9,
40}