Skip to main content

TestImage

Struct TestImage 

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

A deterministic test image with contiguous (tightly-packed) rows.

Implementations§

Source§

impl TestImage

Source

pub fn rgba8_gradient(width: u32, height: u32) -> Self

An RGBA8 image whose channels vary with position, so any row/column transposition shows up as a pixel diff.

Source

pub fn rgb8_gradient(width: u32, height: u32) -> Self

An RGB8 image with the same gradient pattern.

Source

pub fn rgba8_gradient_seeded(width: u32, height: u32, seed: u8) -> Self

An RGBA8 gradient offset by seed, so distinct same-size frames (for animation tests) differ in content and a frame-ordering bug is visible.

Source

pub fn rgb8_gradient_seeded(width: u32, height: u32, seed: u8) -> Self

An opaque RGB8 gradient offset by seed: distinct frames for codecs whose animations carry no partial transparency (GIF).

Source

pub fn as_slice(&self) -> PixelSlice<'_>

Borrow the whole image as a [PixelSlice].

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> 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, 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.