Struct ColorMapItem

Source
#[repr(C)]
pub struct ColorMapItem { /* private fields */ }
Expand description

Represents a ColorMap entry item.

HLS mode:

  • x: [0, 360] hue angle
  • y: [0, 100] lightness percentage
  • z: [0, 100] saturation percentage

RGB mode:

  • x: [0, 100] red percentage
  • y: [0, 100] green percentage
  • z: [0, 100] blue percentage

Implementations§

Source§

impl ColorMapItem

Source

pub const fn new() -> Self

Creates a new ColorMapItem.

Source

pub const fn create_hls( number: usize, degree: u16, lightness: u16, saturation: u16, ) -> Self

Creates a ColorMapItem in HLS mode.

Source

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]

Source

pub const fn is_black(&self) -> bool

Gets whether the ColorMapItem is black.

Source

pub const fn number(&self) -> usize

Gets the ColorMapItem index number.

Source

pub fn set_number(&mut self, val: usize)

Sets the ColorMapItem index number parameter.

Source

pub fn with_number(self, val: usize) -> Self

Builder function that sets the ColorMapItem index number parameter.

Source

pub const fn color_mode(&self) -> ColorMode

Gets the ColorMode.

Source

pub fn set_color_mode(&mut self, val: ColorMode)

Sets the ColorMode.

Source

pub fn with_color_mode(self, val: ColorMode) -> Self

Builder function that sets the ColorMode.

Source

pub const fn x(&self) -> u16

Gets the ColorMapItem x parameter.

Meaning:

  • hls: hue degree ([0, 360])
  • rgb: red hue percentage ([0, 100])
Source

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])
Source

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])
Source

pub const fn y(&self) -> u16

Gets the ColorMapItem y parameter.

Meaning:

  • hls: lightness percentage ([0, 100])
  • rgb: green hue percentage ([0, 100])
Source

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])
Source

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])
Source

pub const fn z(&self) -> u16

Gets the ColorMapItem z parameter.

Meaning:

  • hls: saturation percentage ([0, 100])
  • rgb: blue hue percentage ([0, 100])
Source

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])
Source

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

Source§

fn clone(&self) -> ColorMapItem

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColorMapItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ColorMapItem

Source§

fn default() -> ColorMapItem

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ColorMapItem

Source§

fn eq(&self, other: &ColorMapItem) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ColorMapItem

Source§

impl StructuralPartialEq for ColorMapItem

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.