[−][src]Struct ytesrev::image::PngImage
A PNG image. Currently only supports RGB and RGBA color types
Fields
width: usize
The width of the image
height: usize
The height of the image
data: Vec<u8>
The data in the image, stored in chunks of 4 per pixel, containing the image in RGBA order
Methods
impl PngImage
[src]
pub fn load_from_path<R: Read>(r: R) -> Result<Self, DecodingError>
[src]
Load an image from a specified source.
pub fn load_from_path_transform<R: Read, F: Fn(Color) -> Color>(
r: R,
transform: F
) -> Result<Self, DecodingError>
[src]
r: R,
transform: F
) -> Result<Self, DecodingError>
Load an image and apply a function to each pixel. Mostly used by LatexObj
to fix alpha
Trait Implementations
impl Drawable for PngImage
[src]
fn content(&self) -> Vec<&dyn Drawable>
[src]
fn content_mut(&mut self) -> Vec<&mut dyn Drawable>
[src]
fn draw(
&self,
canvas: &mut Canvas<Window>,
pos: &Position,
_settings: DrawSettings
)
[src]
&self,
canvas: &mut Canvas<Window>,
pos: &Position,
_settings: DrawSettings
)
fn step(&mut self)
[src]
fn state(&self) -> State
[src]
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 load(&mut self)
[src]
Load all content
fn event(&mut self, e: Event)
[src]
When any event occurs
fn update(&mut self, dt: f64)
[src]
Tick the object
impl KnownSize for PngImage
[src]
impl ImageContainer for PngImage
[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 Clone for PngImage
[src]
Auto Trait Implementations
impl Sync for PngImage
impl Send for PngImage
impl Unpin for PngImage
impl RefUnwindSafe for PngImage
impl UnwindSafe for PngImage
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,