pub struct Image {
pub width: usize,
pub height: usize,
pub meta: ImageMeta,
pub bitmap: ImageData,
}
Expand description
The pixels are in the Image::bitmap
field
Use Image::into_rgba
if you don’t want to deal with multiple pixel formats.
Pixels will be in sRGB color space.
Fields§
§width: usize
§height: usize
§meta: ImageMeta
§bitmap: ImageData
Implementations§
Source§impl Image
impl Image
Sourcepub fn into_rgba(self) -> (ImgVec<RGBA8>, ImageMeta)
pub fn into_rgba(self) -> (ImgVec<RGBA8>, ImageMeta)
Convert pixels to RGBA format. The second returned element is the ImageMeta
object.
Sourcepub const fn is_opaque(&self) -> bool
pub const fn is_opaque(&self) -> bool
True if pixel format doesn’t support alpha. This function doesn’t check pixels.
Sourcepub fn as_imgref(&self) -> ImgRefKind<'_>
pub fn as_imgref(&self) -> ImgRefKind<'_>
Returns an enum with Img<&[Pixel]>
, which is like a 2D slice.
Sourcepub fn into_imgvec(self) -> ImgVecKind
pub fn into_imgvec(self) -> ImgVecKind
Returns an enum with Img<Vec<Pixel>>
pub fn rotated(self, r: Rotate) -> Self
Trait Implementations§
Source§impl FromOptions<Img<Vec<GrayAlpha_v08<u16>>>> for Image
impl FromOptions<Img<Vec<GrayAlpha_v08<u16>>>> for Image
Source§impl FromOptions<Img<Vec<GrayAlpha_v08<u8>>>> for Image
impl FromOptions<Img<Vec<GrayAlpha_v08<u8>>>> for Image
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more