Skip to main content

PixelSink

Trait PixelSink 

Source
pub trait PixelSink {
    // Required methods
    fn sink_width(&self) -> u32;
    fn sink_height(&self) -> u32;
    fn sink_format(&self) -> &PixelFormat;
    fn sink_row_mut(&mut self, y: u32) -> Result<&mut [u8], At<BufferError>>;

    // Provided methods
    fn sink_finish(&mut self, _claims: SampleClaims, _hdr: HdrMetadata) { ... }
    fn sink_set_origin(&mut self, _origin: ColorOrigin) { ... }
    fn sink_set_orientation(&mut self, _orientation: Orientation) { ... }
}
Expand description

Uniform write interface across PixelViewMut, PixelBuf, and BandedBuf.

Required Methods§

Source

fn sink_width(&self) -> u32

Frame width in pixels.

Source

fn sink_height(&self) -> u32

Frame height in rows.

Source

fn sink_format(&self) -> &PixelFormat

Authoritative destination specification.

Source

fn sink_row_mut(&mut self, y: u32) -> Result<&mut [u8], At<BufferError>>

Fallibly borrow mutable active bytes of row y.

Owned sinks backed by immutable external storage perform copy-on-write promotion fallibly, returning BufferError::AllocationFailed on OOM without mutating backing storage or metadata.

§Panics

Out-of-range row indices (y >= self.sink_height()) remain a caller-contract panic; Err is reserved for runtime write or copy-on-write failures such as BufferError::AllocationFailed.

Provided Methods§

Source

fn sink_finish(&mut self, _claims: SampleClaims, _hdr: HdrMetadata)

Propagate output claims & HDR metadata on owned sinks (no-op on borrowed views).

Source

fn sink_set_origin(&mut self, _origin: ColorOrigin)

Propagate original container color provenance onto owned sinks (no-op on borrowed views).

Source

fn sink_set_orientation(&mut self, _orientation: Orientation)

Propagate pending EXIF display orientation onto sinks.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§