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: u8

the number of bits used for each pixel value on the wire

8, 16, 32(usually) only

depth: u8

Although 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: u8

true if multi-byte pixels are interpreted as big endian

true_color_flag: u8

true then the last six items specify how to extract the red, green and blue intensities from the pixel value

red_max: u16

the next three always in big-endian order no matter how the big_endian_flag is set

green_max: u16blue_max: u16red_shift: u8

the number of shifts needed to get the red value in a pixel to the least significant bit

green_shift: u8blue_shift: u8

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more