pub enum ImageSource {
Encoded(Vec<u8>),
Rgba {
width: u32,
height: u32,
pixels: Vec<u8>,
},
Bgra {
width: u32,
height: u32,
pixels: Vec<u8>,
},
Rgba16 {
width: u32,
height: u32,
pixels: Vec<u16>,
},
}Expand description
O conteúdo de uma Image.
Variants§
Encoded(Vec<u8>)
Arquivo de imagem como está no disco (o canvas decodifica).
Rgba
Pixels RGBA (4 bytes por pixel, linha a linha, sem pré-multiplicar o alfa).
Bgra
Pixels BGRA (a ordem que decodificadores de vídeo e o Windows costumam entregar), opacos ou já pré-multiplicados: o Direct2D os usa sem converter.
Rgba16
Pixels RGBA de 16 bits por canal (0 a 65535, sem pré-multiplicar o alfa): a imagem médica
e a fotografia de 16 bits. Com a saída de 10 bits ou a HDR (color_output), o Direct2D e
o Skia desenham sem perder os tons; nos outros casos (e no navegador, de 8 bits), sai
como a de 8 (ImageSource::to_rgba8).
Implementations§
Trait Implementations§
Source§impl Debug for ImageSource
impl Debug for ImageSource
Source§impl PartialEq for ImageSource
impl PartialEq for ImageSource
impl StructuralPartialEq for ImageSource
Auto Trait Implementations§
impl Forget for ImageSource
impl Freeze for ImageSource
impl Move for ImageSource
impl RefUnwindSafe for ImageSource
impl Send for ImageSourcewhere
RawVecInner: Send,
impl Sync for ImageSourcewhere
RawVecInner: Sync,
impl Unpin for ImageSource
impl UnsafeUnpin for ImageSource
impl UnwindSafe for ImageSourcewhere
RawVecInner: UnwindSafe,
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