#[repr(C)]pub struct ColorMapItem { /* private fields */ }
Expand description
Represents a ColorMap entry item.
HLS mode:
x
: [0, 360] hue angley
: [0, 100] lightness percentagez
: [0, 100] saturation percentage
RGB mode:
x
: [0, 100] red percentagey
: [0, 100] green percentagez
: [0, 100] blue percentage
Implementations§
Source§impl ColorMapItem
impl ColorMapItem
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new ColorMapItem.
Sourcepub const fn create_hls(
number: usize,
degree: u16,
lightness: u16,
saturation: u16,
) -> Self
pub const fn create_hls( number: usize, degree: u16, lightness: u16, saturation: u16, ) -> Self
Creates a ColorMapItem in HLS mode.
Sourcepub const fn create_rgb(number: usize, red: u8, green: u8, blue: u8) -> Self
pub const fn create_rgb(number: usize, red: u8, green: u8, blue: u8) -> Self
Creates a ColorMapItem in RGB mode.
Parameters:
red
: red hue value in hex [0x00, 0xff]
green
: green hue value in hex [0x00, 0xff]
blue
: blue hue value in hex [0x00, 0xff]
Sourcepub const fn is_black(&self) -> bool
pub const fn is_black(&self) -> bool
Gets whether the ColorMapItem is black.
Sourcepub const fn number(&self) -> usize
pub const fn number(&self) -> usize
Gets the ColorMapItem index number.
Sourcepub fn set_number(&mut self, val: usize)
pub fn set_number(&mut self, val: usize)
Sets the ColorMapItem index number
parameter.
Sourcepub fn with_number(self, val: usize) -> Self
pub fn with_number(self, val: usize) -> Self
Builder function that sets the ColorMapItem index number
parameter.
Sourcepub const fn color_mode(&self) -> ColorMode
pub const fn color_mode(&self) -> ColorMode
Gets the ColorMode.
Sourcepub fn set_color_mode(&mut self, val: ColorMode)
pub fn set_color_mode(&mut self, val: ColorMode)
Sets the ColorMode.
Sourcepub fn with_color_mode(self, val: ColorMode) -> Self
pub fn with_color_mode(self, val: ColorMode) -> Self
Builder function that sets the ColorMode.
Sourcepub const fn x(&self) -> u16
pub const fn x(&self) -> u16
Gets the ColorMapItem x
parameter.
Meaning:
hls
: hue degree ([0, 360]
)rgb
: red hue percentage ([0, 100]
)
Sourcepub fn set_x(&mut self, val: u16)
pub fn set_x(&mut self, val: u16)
Sets the ColorMapItem x
parameter.
Meaning:
hls
: hue degree ([0, 360]
)rgb
: red hue percentage ([0, 100]
)
Sourcepub fn with_x(self, val: u16) -> Self
pub fn with_x(self, val: u16) -> Self
Builder function that sets the ColorMapItem x
parameter.
Meaning:
hls
: hue degree ([0, 360]
)rgb
: red hue percentage ([0, 100]
)
Sourcepub const fn y(&self) -> u16
pub const fn y(&self) -> u16
Gets the ColorMapItem y
parameter.
Meaning:
hls
: lightness percentage ([0, 100]
)rgb
: green hue percentage ([0, 100]
)
Sourcepub fn set_y(&mut self, val: u16)
pub fn set_y(&mut self, val: u16)
Sets the ColorMapItem y
parameter.
Meaning:
hls
: lightness percentage ([0, 100]
)rgb
: green hue percentage ([0, 100]
)
Sourcepub fn with_y(self, val: u16) -> Self
pub fn with_y(self, val: u16) -> Self
Builder function that sets the ColorMapItem y
parameter.
Meaning:
hls
: lightness percentage ([0, 100]
)rgb
: green hue percentage ([0, 100]
)
Sourcepub const fn z(&self) -> u16
pub const fn z(&self) -> u16
Gets the ColorMapItem z
parameter.
Meaning:
hls
: saturation percentage ([0, 100]
)rgb
: blue hue percentage ([0, 100]
)
Sourcepub fn set_z(&mut self, val: u16)
pub fn set_z(&mut self, val: u16)
Sets the ColorMapItem z
parameter.
Meaning:
hls
: saturation percentage ([0, 100]
)rgb
: blue hue percentage ([0, 100]
)
Sourcepub fn with_z(self, val: u16) -> Self
pub fn with_z(self, val: u16) -> Self
Builder function that sets the ColorMapItem z
parameter.
Meaning:
hls
: saturation percentage ([0, 100]
)rgb
: blue hue percentage ([0, 100]
)
Trait Implementations§
Source§impl Clone for ColorMapItem
impl Clone for ColorMapItem
Source§fn clone(&self) -> ColorMapItem
fn clone(&self) -> ColorMapItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more