pub struct ColorTransformConfiguration {
pub color_inversion_enabled: Option<bool>,
pub color_correction: Option<ColorCorrectionMode>,
pub color_adjustment_matrix: Option<[f32; 9]>,
pub color_adjustment_pre_offset: Option<[f32; 3]>,
pub color_adjustment_post_offset: Option<[f32; 3]>,
/* private fields */
}
Expand description
The current configuration for accessibility color transforms, which includes color inversion and color correction. This always includes the matrix required to apply the appropriate transforms. Color correction and color inversion may be active simultaneously.
For original RGB value (r, g, b) (each component ranged between 0 and 1), the RGB value of corrected color (r’, g’, b’) is (r’, g’, b’) = color_adjustment_post_offset + color_adjustment_matrix . ((r, g, b) + color_adjustment_pre_offset).
Fields§
§color_inversion_enabled: Option<bool>
When color_inversion_enabled is true, certain colors are inverted across the entire screen. If this field is omitted behavior should remain unchanged.
color_correction: Option<ColorCorrectionMode>
When color_correction is set to DISABLED, colors are displayed normally. When color_correction has different value, colors are modified to correct for the specified type of color blindness. If this field is omitted behavior should remain unchanged.
color_adjustment_matrix: Option<[f32; 9]>
3x3 Matrix in row-major form which will be used by root presenter to apply color correction and color inversion, or a combination fo the two. This field should always be set.
color_adjustment_pre_offset: Option<[f32; 3]>
3x1 vector which is used by root presenter as an offset added to the original RGB color, before it multiplies with the |color_adjustment_matrix|. This field should always be set.
color_adjustment_post_offset: Option<[f32; 3]>
3x1 vector which is used by root presenter as an offset added to the multiplied result of |color_adjustment_matrix| and original RGB color. This field should always be set.
Implementations§
Trait Implementations§
source§impl Clone for ColorTransformConfiguration
impl Clone for ColorTransformConfiguration
source§fn clone(&self) -> ColorTransformConfiguration
fn clone(&self) -> ColorTransformConfiguration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ColorTransformConfiguration
impl Debug for ColorTransformConfiguration
source§impl Decodable for ColorTransformConfiguration
impl Decodable for ColorTransformConfiguration
source§fn decode(&mut self, decoder: &mut Decoder<'_>, offset: usize) -> Result<()>
fn decode(&mut self, decoder: &mut Decoder<'_>, offset: usize) -> Result<()>
self
.
Callers must ensure that offset
is a multiple of
Layout::inline_align
, and that decoder.buf
has room for reading
Layout::inline_size
bytes at offset
. Read moresource§impl Encodable for ColorTransformConfiguration
impl Encodable for ColorTransformConfiguration
source§fn encode(
&mut self,
encoder: &mut Encoder<'_, '_>,
offset: usize,
recursion_depth: usize
) -> Result<()>
fn encode( &mut self, encoder: &mut Encoder<'_, '_>, offset: usize, recursion_depth: usize ) -> Result<()>
Handle::INVALID
. Callers must ensure that offset
is a
multiple of Layout::inline_align
, and that encoder.buf
has room for
writing Layout::inline_size
bytes at offset
. Read moresource§impl Layout for ColorTransformConfiguration
impl Layout for ColorTransformConfiguration
source§fn inline_align(_context: &Context) -> usize
fn inline_align(_context: &Context) -> usize
source§fn inline_size(_context: &Context) -> usize
fn inline_size(_context: &Context) -> usize
inline_align
.§fn supports_simple_copy() -> boolwhere
Self: Sized,
fn supports_simple_copy() -> boolwhere Self: Sized,
source§impl PartialEq<ColorTransformConfiguration> for ColorTransformConfiguration
impl PartialEq<ColorTransformConfiguration> for ColorTransformConfiguration
source§fn eq(&self, other: &ColorTransformConfiguration) -> bool
fn eq(&self, other: &ColorTransformConfiguration) -> bool
self
and other
values to be equal, and is used
by ==
.impl Persistable for ColorTransformConfiguration
impl StructuralPartialEq for ColorTransformConfiguration
impl TopLevel for ColorTransformConfiguration
Auto Trait Implementations§
impl RefUnwindSafe for ColorTransformConfiguration
impl Send for ColorTransformConfiguration
impl Sync for ColorTransformConfiguration
impl Unpin for ColorTransformConfiguration
impl UnwindSafe for ColorTransformConfiguration
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutObject for Twhere
T: Layout,
impl<T> LayoutObject for Twhere T: Layout,
§fn inline_align(&self, context: &Context) -> usize
fn inline_align(&self, context: &Context) -> usize
Layout::inline_align
.§fn inline_size(&self, context: &Context) -> usize
fn inline_size(&self, context: &Context) -> usize
Layout::inline_size
.