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§
source§impl 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§
source§impl PartialEq for ImageInfo
impl PartialEq for ImageInfo
impl Copy for ImageInfo
impl Eq for ImageInfo
impl StructuralPartialEq for ImageInfo
Auto Trait Implementations§
impl Freeze for ImageInfo
impl RefUnwindSafe for ImageInfo
impl Send for ImageInfo
impl Sync for ImageInfo
impl Unpin for ImageInfo
impl UnwindSafe for ImageInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.