pub struct ColorState { /* private fields */ }
v4_16
only.Expand description
A ColorState
object provides the information to interpret
colors and pixels in a variety of ways.
They are also known as color spaces.
Crucially, GTK knows how to convert colors from one color state to another.
ColorState
objects are immutable and therefore threadsafe.
GLib type: Shared boxed type with reference counted clone semantics.
Implementations§
Source§impl ColorState
impl ColorState
Sourcepub fn as_ptr(&self) -> *mut GdkColorState
pub fn as_ptr(&self) -> *mut GdkColorState
Return the inner pointer to the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut GdkColorState) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GdkColorState) -> &Self
Borrows the underlying C value.
Source§impl ColorState
impl ColorState
Sourcepub fn create_cicp_params(&self) -> Option<CicpParams>
pub fn create_cicp_params(&self) -> Option<CicpParams>
Create a CicpParams
representing the colorstate.
It is not guaranteed that every ColorState
can be
represented with Cicp parameters. If that is the case,
this function returns NULL
.
§Returns
A new CicpParams
Sourcepub fn oklab() -> ColorState
Available on crate feature v4_18
only.
pub fn oklab() -> ColorState
v4_18
only.Returns the color state object representing the oklab color space.
This is a perceptually uniform color state.
§Returns
the color state object for oklab
Sourcepub fn oklch() -> ColorState
Available on crate feature v4_18
only.
pub fn oklch() -> ColorState
v4_18
only.Returns the color state object representing the oklch color space.
This is the polar variant of oklab, in which the hue is encoded as a polar coordinate.
§Returns
the color state object for oklch
Sourcepub fn rec2100_linear() -> ColorState
pub fn rec2100_linear() -> ColorState
Returns the color state object representing the linear rec2100 color space.
This color state uses the primaries defined by BT.2020-2 and BT.2100-0 and a linear transfer function.
It is equivalent to the Cicp tuple 9/8/0/1.
See e.g. the CSS HDR Module for details about this colorstate.
§Returns
the color state object for linearized rec2100
Sourcepub fn rec2100_pq() -> ColorState
pub fn rec2100_pq() -> ColorState
Returns the color state object representing the rec2100-pq color space.
This color state uses the primaries defined by BT.2020-2 and BT.2100-0 and the transfer function defined by SMPTE ST 2084 and BT.2100-2.
It is equivalent to the Cicp tuple 9/16/0/1.
See e.g. the CSS HDR Module for details about this colorstate.
§Returns
the color state object for rec2100-pq
Sourcepub fn srgb() -> ColorState
pub fn srgb() -> ColorState
Returns the color state object representing the sRGB color space.
This color state uses the primaries defined by BT.709-6 and the transfer function defined by IEC 61966-2-1.
It is equivalent to the Cicp tuple 1/13/0/1.
See e.g. the CSS Color Module for details about this colorstate.
§Returns
the color state object for sRGB
Sourcepub fn srgb_linear() -> ColorState
pub fn srgb_linear() -> ColorState
Returns the color state object representing the linearized sRGB color space.
This color state uses the primaries defined by BT.709-6 and a linear transfer function.
It is equivalent to the Cicp tuple 1/8/0/1.
See e.g. the CSS Color Module for details about this colorstate.
§Returns
the color state object for linearized sRGB
Trait Implementations§
Source§impl Clone for ColorState
impl Clone for ColorState
Source§impl Debug for ColorState
impl Debug for ColorState
Source§impl From<ColorState> for Value
impl From<ColorState> for Value
Source§fn from(s: ColorState) -> Self
fn from(s: ColorState) -> Self
Source§impl HasParamSpec for ColorState
impl HasParamSpec for ColorState
type ParamSpec = ParamSpecBoxed
Source§type SetValue = ColorState
type SetValue = ColorState
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, ColorState>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Hash for ColorState
impl Hash for ColorState
Source§impl Ord for ColorState
impl Ord for ColorState
Source§fn cmp(&self, other: &ColorState) -> Ordering
fn cmp(&self, other: &ColorState) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ColorState
impl PartialEq for ColorState
Source§impl PartialOrd for ColorState
impl PartialOrd for ColorState
Source§impl StaticType for ColorState
impl StaticType for ColorState
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.