pub enum PixelFormat {
Rgba8,
BgraPremultiplied8,
}Expand description
The byte layout a consumer needs.
A parameter rather than a fixed output, and that is not speculative
generality — GPUI’s RenderImage is premultiplied BGRA while a
terminal graphics protocol wants straight RGBA. Converting at the
consumer would put a per-pixel loop in the paint path, which is the exact
thing this crate exists to keep out of it, so the swap happens inside the
same off-thread decode and is cached in that form.
Variants§
Rgba8
Straight RGBA8. What image files decode to, and what a kitty / sixel path would want.
BgraPremultiplied8
Premultiplied BGRA8 — gpui::RenderImage’s required layout.
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
Source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PixelFormat
Source§impl Debug for PixelFormat
impl Debug for PixelFormat
Source§impl Default for PixelFormat
impl Default for PixelFormat
Source§fn default() -> PixelFormat
fn default() -> PixelFormat
Returns the “default value” for a type. Read more
impl Eq for PixelFormat
Source§impl Hash for PixelFormat
impl Hash for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
impl StructuralPartialEq for PixelFormat
Auto Trait Implementations§
impl Freeze for PixelFormat
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnsafeUnpin for PixelFormat
impl UnwindSafe for PixelFormat
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