Skip to main content

WideColor

Struct WideColor 

Source
pub struct WideColor { /* private fields */ }
Expand description

Immutable bounded-SDR color in linear Display P3/D65, with straight input alpha. Prepared textures store associated RGB/alpha and require a wide-capable host.

Native Metal and D3D11 window presentation accept this output when the host has enabled WideGamutSdr. Windows native execution/display validation remains outstanding. Other backends return an explicit preparation error. Preparation allocates a texture; output caching/pooling is not provided yet.

Implementations§

Source§

impl WideColor

Source

pub fn linear_p3(rgba: [f32; 4]) -> Result<Self>

Construct from finite straight linear P3 RGB and alpha in 0..=1. This does not decode sRGB, load an image profile or enable a window mode.

Trait Implementations§

Source§

impl CustomContent for WideColor

Source§

fn prepare( &self, backend: &dyn Any, extent: Size<DevicePixels>, ) -> Result<Box<dyn Any>>

Prepare content on the host device. Return an explicit error for unsupported backends.
Source§

fn image_color_transform(&self) -> [[f32; 4]; 3]

Encoded-sRGB RGB affine rows, applied after sampling/unassociation and before coverage/opacity. Alpha is preserved. Identity keeps legacy output.
Source§

fn image_source_size(&self) -> Option<Size<DevicePixels>>

Actual dimensions of an immutable source-sized texture. A large virtual destination need not allocate a destination-sized preparation target. Only valid for retained source-sized outputs, without geometry coverage.
Source§

fn image_sample_opacity(&self) -> f32

Sampling visibility independent of preparation. Zero permits warming a source without compositing it over a progressive fallback.
Source§

fn image_color_mode(&self) -> ImageColorMode

Source color interpretation and explicit output policy.
Source§

fn image_linear_adjustments(&self) -> Option<LinearImagePaint>

Linear matrix and vignette in the declared working primaries. Replaces encoded image_color_transform; does not change source identity.
Source§

fn prepare_in_frame( &self, backend: &(dyn Any + 'static), request: &PreparationRequest, _frame: &PreparationFrame, ) -> Result<Box<dyn Any>, Error>

Prepare within shared scene-frame admission. Existing producers retain their request-aware behavior without a new required implementation.
Source§

fn prepare_with_request( &self, backend: &(dyn Any + 'static), request: &PreparationRequest, ) -> Result<Box<dyn Any>, Error>

Prepare using logical geometry and the renderer’s exact raster extent. Existing producers receive the same physical size through prepare. Request-aware producers may override this without changing submission.
Source§

impl Debug for WideColor

Source§

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

Formats the value using the given formatter. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more