Struct ytesrev::ditherer::Ditherer

source ·
pub struct Ditherer<T: ImageContainer + 'static> {
    pub inner: T,
    pub dither: Option<Vec<Vec<u64>>>,
    pub dither_in_time: f64,
    pub dither_out_time: f64,
    pub dither_fn: Box<dyn Fn(&T, (usize, usize)) -> u64>,
    pub direction: DitherDirection,
    /* private fields */
}
Expand description

The ditherer itself. The inner type T is the thing to be dithered

Fields

inner: T

The inner object to be dithered

dither: Option<Vec<Vec<u64>>>

The time each pixel will be dithered in

dither_in_time: f64

How long the ditherer has been dithering in for

dither_out_time: f64

How long the ditherer has been dithering out for

dither_fn: Box<dyn Fn(&T, (usize, usize)) -> u64>

The function to determine what regionso to dither first

direction: DitherDirection

The direction to dither in

Implementations

Create a new ditherer instance, dithering using alpha_dither_fn.

Create a new ditherer that is already dithered in

Convert a ditherer to use a specific dither function

Convert a ditherer to use a specific direction function

Start dither in this object

Start dither out this object

Trait Implementations

What this object contains
What this object contains, mutably
Load all content
Tick the object
When the user presses space, the state of the presentation is advanced. This method is what is called. Read more
What state the object is in
Draw everything
Register all content. This is mostly just used by LatexObjs, that need to be registered before loaded. Read more
When any event occurs
Retrieve the data in the image
Retrieve the data in the image, mutably
Retrieve the data in the image, consuming the object
Convert the object to a dynamic KnownSize object, as rust doesn’t support calling KnownSize -methods directly on this object Read more
The width of the object
The height of the object

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.