FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    VncPixelFormat

    struct · ferroui-headless-vnc · v0.5.0

    struct VncPixelFormat
    

    Describes the low-level arrangement of a framebuffer pixel.

    View source

    Members

    RGB32

    const RGB32: VncPixelFormat
    

    A VncPixelFormat with 8 bits of red, green and blue channels: 32 bits a pixel, little-endian, red shifted by 16, green by 8, blue by 0 (in memory: blue, green, red, unused).

    Source

    new

    fn new(bits_per_pixel: i32, bit_depth: i32, red_bits: i32, red_shift: i32, green_bits: i32, green_shift: i32, blue_bits: i32, blue_shift: i32, is_little_endian: bool, is_palettized: bool) -> Self
    

    Initializes a new instance of the VncPixelFormat class.

    bits_per_pixel is the number of bits used to store a pixel (currently 8, 16, or 32); bit_depth the bit depth of the pixel (currently 6 or 24); the bits and shifts of each colour say how many bits represent it and how many bits left its value is shifted.

    Panics

    When a value is out of its range (ArgumentOutOfRangeException).

    Source

    rgb32

    fn rgb32() -> VncPixelFormat
    

    Gets a VncPixelFormat with 8 bits of red, green and blue channels.

    Source

    bits_per_pixel

    fn bits_per_pixel(self: &Self) -> i32
    

    Gets the number of bits used to store a pixel.

    Source

    bytes_per_pixel

    fn bytes_per_pixel(self: &Self) -> i32
    

    Gets the number of bytes used to store a pixel.

    Source

    bit_depth

    fn bit_depth(self: &Self) -> i32
    

    Gets the bit depth of the pixel.

    Source

    red_bits

    fn red_bits(self: &Self) -> i32
    

    Gets the number of bits used to represent red.

    Source

    red_shift

    fn red_shift(self: &Self) -> i32
    

    Gets the number of bits left the red value is shifted.

    Source

    green_bits

    fn green_bits(self: &Self) -> i32
    

    Gets the number of bits used to represent green.

    Source

    red_max

    fn red_max(self: &Self) -> u16
    

    Gets the maximum value of the red color.

    Source

    blue_max

    fn blue_max(self: &Self) -> u16
    

    Gets the maximum value of the blue color.

    Source

    green_max

    fn green_max(self: &Self) -> u16
    

    Gets the maximum value of the green color.

    Source

    green_shift

    fn green_shift(self: &Self) -> i32
    

    Gets the number of bits left the green value is shifted.

    Source

    blue_bits

    fn blue_bits(self: &Self) -> i32
    

    Gets the number of bits used to represent blue.

    Source

    blue_shift

    fn blue_shift(self: &Self) -> i32
    

    Gets the number of bits left the blue value is shifted.

    Source

    is_little_endian

    fn is_little_endian(self: &Self) -> bool
    

    Gets a value indicating whether the pixel is little-endian.

    Source

    is_palettized

    fn is_palettized(self: &Self) -> bool
    

    Gets a value indicating whether the framebuffer stores palette indices (true) or colors (false).

    Source

    copy

    fn copy(source: &[u8], source_width: i32, source_stride: i32, source_format: &VncPixelFormat, source_rectangle: VncRectangle, target: &mut [u8], target_width: i32, target_stride: i32, target_format: &VncPixelFormat, target_x: i32, target_y: i32)
    

    Copies pixels between two byte arrays. A format conversion is performed if necessary (between formats of true colour; a target of another format is left as it is).

    Be sure to lock the framebuffer first to avoid tearing, if the connection is active.

    source holds the source image (source_width pixels wide, source_stride bytes between one Y coordinate and the next, in source_format); source_rectangle is the rectangle of it to copy. target holds the target image in the same terms; target_x and target_y are where in it the upper-left pixel goes.

    Source

    copy_from_framebuffer

    fn copy_from_framebuffer(source: &VncFramebuffer, source_rectangle: VncRectangle, target: &mut [u8], stride: i32, target_x: i32, target_y: i32)
    

    Copies a region of the framebuffer into a bitmap of the default format (RGB32) whose rows are stride bytes apart; target_x and target_y are where the upper-left pixel goes.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Same
    • Clone
    • Copy
    • Debug
    • Default
    • PartialEq
    • Eq
    • Hash
    • Display
    • ErasedDestructor
    • IntoEither

    Availability

    Extracted for x86_64-unknown-linux-gnu, aarch64-apple-darwin. Cargo features are listed in the crate index.