Struct rich_sdl2_rust::color::pixel::PixelFormat
source · pub struct PixelFormat { /* private fields */ }
Expand description
A pixel format.
Implementations§
source§impl PixelFormat
impl PixelFormat
sourcepub fn new(kind: PixelFormatKind) -> Result<Self>
pub fn new(kind: PixelFormatKind) -> Result<Self>
Constructs a pixel format from PixelFormatKind
.
§Errors
Returns Err
if failed to allocate the memory for the format, or construct the format.
sourcepub fn kind(&self) -> PixelFormatKind
pub fn kind(&self) -> PixelFormatKind
Returns the kind of the format.
sourcepub fn bits_per_pixel(&self) -> u8
pub fn bits_per_pixel(&self) -> u8
Returns the bits per pixel of the format.
sourcepub fn bytes_per_pixel(&self) -> u8
pub fn bytes_per_pixel(&self) -> u8
Returns the bytes per pixel of the format.
sourcepub fn property(&self) -> PixelFormatProperty
pub fn property(&self) -> PixelFormatProperty
Returns the property of the format.
sourcepub fn set_palette(&self, palette: &Palette)
pub fn set_palette(&self, palette: &Palette)
Overwrites the palette with a new Palette
.
Trait Implementations§
source§impl Debug for PixelFormat
impl Debug for PixelFormat
Auto Trait Implementations§
impl RefUnwindSafe for PixelFormat
impl !Send for PixelFormat
impl !Sync for PixelFormat
impl Unpin 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