[−][src]Struct ytesrev::ditherer::Ditherer
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
Methods
impl<T: ImageContainer> Ditherer<T>
[src]
pub fn new(inner: T) -> Ditherer<T>
[src]
Create a new ditherer instance, dithering using alpha_dither_fn
.
pub fn dithered_in(inner: T) -> Ditherer<T>
[src]
Create a new ditherer that is already dithered in
pub fn dithering_in(inner: T) -> Ditherer<T>
[src]
Create a new ditherer that is already dithered in
pub fn with_dither_fn<F: Fn(&T, (usize, usize)) -> u64>(
self,
f: F
) -> Ditherer<T> where
F: 'static,
[src]
self,
f: F
) -> Ditherer<T> where
F: 'static,
Convert a ditherer to use a specific dither function
pub fn with_direction(self, dir: DitherDirection) -> Ditherer<T>
[src]
Convert a ditherer to use a specific direction function
pub fn dither_in(&mut self)
[src]
Start dither in this object
pub fn dither_out(&mut self)
[src]
Start dither out this object
Trait Implementations
impl<T: ImageContainer> Drawable for Ditherer<T>
[src]
fn content(&self) -> Vec<&dyn Drawable>
[src]
fn content_mut(&mut self) -> Vec<&mut dyn Drawable>
[src]
fn load(&mut self)
[src]
fn update(&mut self, dt: f64)
[src]
fn step(&mut self)
[src]
fn state(&self) -> State
[src]
fn draw(
&self,
canvas: &mut Canvas<Window>,
pos: &Position,
settings: DrawSettings
)
[src]
&self,
canvas: &mut Canvas<Window>,
pos: &Position,
settings: DrawSettings
)
fn register(&mut self)
[src]
Register all content. This is mostly just used by [LatexObj
]s, that need to be registered before loaded. Read more
fn event(&mut self, e: Event)
[src]
When any event occurs
impl<T: ImageContainer + KnownSize> KnownSize for Ditherer<T>
[src]
impl<T: ImageContainer + KnownSize> ImageContainer for Ditherer<T>
[src]
fn get_data(&self) -> &Vec<u8>
[src]
fn get_data_mut(&mut self) -> &mut Vec<u8>
[src]
fn into_data(self) -> Vec<u8>
[src]
fn as_knownsize(&self) -> &dyn KnownSize
[src]
Convert the object to a dynamic KnownSize object, as rust doesn't support calling KnownSize -methods directly on this object Read more
impl<T: ImageContainer> Send for Ditherer<T>
[src]
Auto Trait Implementations
impl<T> Unpin for Ditherer<T> where
T: Unpin,
T: Unpin,
impl<T> !Sync for Ditherer<T>
impl<T> !UnwindSafe for Ditherer<T>
impl<T> !RefUnwindSafe for Ditherer<T>
Blanket Implementations
impl<T> Layerable for T where
T: Drawable,
[src]
T: Drawable,
fn as_drawable(&Self) -> &dyn Drawable
[src]
fn as_drawable_mut(&mut Self) -> &mut dyn Drawable
[src]
impl<T> Stackable for T where
T: Drawable + KnownSize,
[src]
T: Drawable + KnownSize,
fn as_drawable(&Self) -> &dyn Drawable
[src]
fn as_drawable_mut(&mut Self) -> &mut dyn Drawable
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,