#[repr(u8)]pub enum ImageType {
I1 = 0,
I4 = 1,
I8 = 2,
Ia4 = 3,
Ia8 = 4,
Ia16 = 5,
Ci4 = 6,
Ci8 = 7,
Rgba16 = 8,
Rgba32 = 9,
}
Expand description
Represents the type of image.
This enum is used to specify the type of image, which determines the size and format of the image data. Each variant corresponds to a specific image type, such as indexed color (Ci), grayscale (I), grayscale with alpha (Ia), or red-green-blue-alpha (RGBA).
Variants§
Implementations§
source§impl ImageType
impl ImageType
sourcepub fn get_size(&self) -> ImageSize
pub fn get_size(&self) -> ImageSize
Returns the size of the image type.
This function returns the size of the image type, which represents the number of bits used to store each pixel. The size is determined based on the image type variant.
§Returns
ImageSize
- The size of the image type.
sourcepub fn get_format(&self) -> ImageFormat
pub fn get_format(&self) -> ImageFormat
Returns the format of the image type.
This method returns the format of the image type, which represents the color model used by the image. The format is determined based on the image type variant.
§Returns
ImageFormat
- The format of the image type.
Trait Implementations§
source§impl IntoEnumIterator for ImageType
impl IntoEnumIterator for ImageType
type Iterator = ImageTypeIter
fn iter() -> ImageTypeIter ⓘ
source§impl PartialEq for ImageType
impl PartialEq for ImageType
source§impl TryFrom<u8> for ImageType
impl TryFrom<u8> for ImageType
§type Error = TryFromPrimitiveError<ImageType>
type Error = TryFromPrimitiveError<ImageType>
The type returned in the event of a conversion error.
source§impl TryFromPrimitive for ImageType
impl TryFromPrimitive for ImageType
impl Copy for ImageType
impl Eq for ImageType
impl StructuralPartialEq for ImageType
Auto Trait Implementations§
impl Freeze for ImageType
impl RefUnwindSafe for ImageType
impl Send for ImageType
impl Sync for ImageType
impl Unpin for ImageType
impl UnwindSafe for ImageType
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
Mutably borrows from an owned value. Read more