FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    VncFramebuffer

    struct · ferroui-headless-vnc · v0.5.0

    struct VncFramebuffer
    

    Stores pixel data for a VNC session.

    View source

    Members

    new

    fn new(name: &str, width: i32, height: i32, pixel_format: VncPixelFormat) -> Arc<VncFramebuffer>
    

    Initializes a new instance of the VncFramebuffer class.

    name is the framebuffer name (many VNC clients set their title bar to it), width and height its size, pixel_format its pixel format.

    Panics

    When the width or the height is negative (ArgumentOutOfRangeException).

    Source

    name

    fn name(self: &Self) -> &str
    

    Gets the framebuffer name. Many VNC clients set their title bar to this name.

    Source

    width

    fn width(self: &Self) -> i32
    

    Gets the framebuffer width.

    Source

    height

    fn height(self: &Self) -> i32
    

    Gets the framebuffer height.

    Source

    stride

    fn stride(self: &Self) -> i32
    

    Gets the framebuffer stride. This is the number of bytes between one Y coordinate and the next.

    Source

    pixel_format

    fn pixel_format(self: &Self) -> &VncPixelFormat
    

    Gets the framebuffer pixel format.

    Source

    get_buffer

    fn get_buffer(self: &Self) -> MutexGuard<'_, Vec<u8>>
    

    Returns the memory underlying this framebuffer, locked: the lock of SyncRoot of the original, held as long as the guard lives. Hold it while reading the framebuffer to avoid tearing artifacts.

    Source

    set_pixel

    fn set_pixel(self: &Self, x: i32, y: i32, color: i32)
    

    Sets the RGB color of a single pixel.

    Panics

    As set_pixel_bytes.

    Source

    set_pixel_bytes

    fn set_pixel_bytes(self: &Self, x: i32, y: i32, color: &[u8])
    

    Sets the color of a single pixel: color is the pixel color as a byte-encoded integer.

    Panics

    When the pixel is outside the framebuffer (ArgumentOutOfRangeException) or the pixel format is not of four bytes (NotSupportedException).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • Same
    • IVncFramebufferSource
    • Debug
    • ErasedDestructor
    • IntoEither

    Availability

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