Struct show_image::ImageInfo
source · [−]pub struct ImageInfo {
pub pixel_format: PixelFormat,
pub size: UVec2,
pub stride: UVec2,
}
Expand description
Information describing the binary data of an image.
Fields
pixel_format: PixelFormat
The pixel format of the image data.
size: UVec2
The size of the image in pixels
stride: UVec2
The stride of the image data in bytes for both X and Y.
Implementations
sourceimpl ImageInfo
impl ImageInfo
sourcepub fn new(pixel_format: PixelFormat, width: u32, height: u32) -> Self
pub fn new(pixel_format: PixelFormat, width: u32, height: u32) -> Self
Create a new info struct with the given format, width and height.
The row stride is automatically calculated based on the image width and pixel format. If you wish to use a different row stride, construct the struct directly.
sourcepub fn mono8(width: u32, height: u32) -> Self
pub fn mono8(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit monochrome image with the given width and height.
sourcepub fn mono_alpha8(width: u32, height: u32) -> Self
pub fn mono_alpha8(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit monochrome image with with alpha channel and the given width and height.
sourcepub fn mono_alpha8_premultiplied(width: u32, height: u32) -> Self
pub fn mono_alpha8_premultiplied(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit monochrome image with premultiplied alpha channel and the given width and height.
sourcepub fn bgr8(width: u32, height: u32) -> Self
pub fn bgr8(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit BGR image with the given width and height.
sourcepub fn bgra8(width: u32, height: u32) -> Self
pub fn bgra8(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit BGRA image with the given width and height.
sourcepub fn bgra8_premultiplied(width: u32, height: u32) -> Self
pub fn bgra8_premultiplied(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit BGRA image with premultiplied alpha channel and the given width and height.
sourcepub fn rgb8(width: u32, height: u32) -> Self
pub fn rgb8(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit RGB image with the given width and height.
sourcepub fn rgba8(width: u32, height: u32) -> Self
pub fn rgba8(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit RGBA image with the given width and height.
sourcepub fn rgba8_premultiplied(width: u32, height: u32) -> Self
pub fn rgba8_premultiplied(width: u32, height: u32) -> Self
Create a new info struct for an 8-bit RGBA image with premultiplied alpha channel and the given width and height.
Trait Implementations
impl Copy for ImageInfo
impl Eq for ImageInfo
impl StructuralEq for ImageInfo
impl StructuralPartialEq for ImageInfo
Auto Trait Implementations
impl RefUnwindSafe for ImageInfo
impl Send for ImageInfo
impl Sync for ImageInfo
impl Unpin for ImageInfo
impl UnwindSafe for ImageInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more