pub struct PixelFormat { /* private fields */ }Expand description
A pixel format, i.e. a set of masks that define how to pack and unpack pixel data. This is used to convert between pixel data and surface data. It wraps an SDL_PixelFormat.
Implementations§
Source§impl PixelFormat
impl PixelFormat
pub const unsafe fn raw(&self) -> SDL_PixelFormat
Source§impl PixelFormat
impl PixelFormat
pub const unsafe fn from_ll(raw: SDL_PixelFormat) -> PixelFormat
Source§impl PixelFormat
impl PixelFormat
pub unsafe fn unknown() -> PixelFormat
pub unsafe fn pixel_format_details(&self) -> *const SDL_PixelFormatDetails
pub fn from_masks(masks: PixelMasks) -> PixelFormat
pub fn into_masks(self) -> Result<PixelMasks, String>
Sourcepub fn byte_size_from_pitch_and_height(
self,
pitch: usize,
height: usize,
) -> usize
pub fn byte_size_from_pitch_and_height( self, pitch: usize, height: usize, ) -> usize
Calculates the total byte size of an image buffer, given its pitch and height.
pub fn byte_size_of_pixels(self, num_of_pixels: usize) -> usize
pub fn byte_size_per_pixel(self) -> usize
pub fn supports_alpha(self) -> bool
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
Source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PixelFormat
impl Debug for PixelFormat
Source§impl From<PixelFormat> for SDL_PixelFormat
impl From<PixelFormat> for SDL_PixelFormat
Source§fn from(pf: PixelFormat) -> SDL_PixelFormat
fn from(pf: PixelFormat) -> SDL_PixelFormat
Converts to this type from the input type.
Source§impl From<i64> for PixelFormat
impl From<i64> for PixelFormat
Source§fn from(format: i64) -> PixelFormat
fn from(format: i64) -> PixelFormat
Converts to this type from the input type.
Source§impl Hash for PixelFormat
impl Hash for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
Source§impl TryFrom<SDL_PixelFormat> for PixelFormat
impl TryFrom<SDL_PixelFormat> for PixelFormat
impl Copy for PixelFormat
impl Eq 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 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