pub struct PixelFormat {
pub bits_per_pixel: u8,
pub depth: u8,
pub big_endian_flag: u8,
pub true_color_flag: u8,
pub red_max: u16,
pub green_max: u16,
pub blue_max: u16,
pub red_shift: u8,
pub green_shift: u8,
pub blue_shift: u8,
/* private fields */
}Expand description
Pixel Format Data Structure according to RFC6143
+--------------+--------------+-----------------+
| No. of bytes | Type [Value] | Description |
+--------------+--------------+-----------------+
| 1 | U8 | bits-per-pixel |
| 1 | U8 | depth |
| 1 | U8 | big-endian-flag |
| 1 | U8 | true-color-flag |
| 2 | U16 | red-max |
| 2 | U16 | green-max |
| 2 | U16 | blue-max |
| 1 | U8 | red-shift |
| 1 | U8 | green-shift |
| 1 | U8 | blue-shift |
| 3 | | padding |
+--------------+--------------+-----------------+Fields§
§bits_per_pixel: u8the number of bits used for each pixel value on the wire
8, 16, 32(usually) only
depth: u8Although the depth should
be consistent with the bits-per-pixel and the various -max values,
clients do not use it when interpreting pixel data.
big_endian_flag: u8true if multi-byte pixels are interpreted as big endian
true_color_flag: u8true then the last six items specify how to extract the red, green and blue intensities from the pixel value
red_max: u16the next three always in big-endian order
no matter how the big_endian_flag is set
green_max: u16§blue_max: u16§red_shift: u8the number of shifts needed to get the red value in a pixel to the least significant bit
green_shift: u8§blue_shift: u8Implementations§
Source§impl PixelFormat
impl PixelFormat
pub fn bgra() -> PixelFormat
pub fn rgba() -> PixelFormat
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 · 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 Default for PixelFormat
impl Default for PixelFormat
impl Copy 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