Struct vnc::config::PixelFormat
source · 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: u16blue_max: u16red_shift: u8the number of shifts needed to get the red value in a pixel to the least significant bit
green_shift: u8blue_shift: u8Implementations
sourceimpl PixelFormat
impl PixelFormat
pub fn bgra() -> PixelFormat
pub fn rgba() -> PixelFormat
Trait Implementations
sourceimpl Clone for PixelFormat
impl Clone for PixelFormat
sourcefn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for PixelFormat
impl Debug for PixelFormat
sourceimpl Default for PixelFormat
impl Default for PixelFormat
sourceimpl From<PixelFormat> for Vec<u8>
impl From<PixelFormat> for Vec<u8>
sourcefn from(pf: PixelFormat) -> Vec<u8>
fn from(pf: PixelFormat) -> Vec<u8>
Converts to this type from the input type.
sourceimpl TryFrom<[u8; 16]> for PixelFormat
impl TryFrom<[u8; 16]> for PixelFormat
impl Copy 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more