[][src]Struct sunrise_vi::Buffer

struct Buffer {
    top: i32,
    left: i32,
    width: u32,
    height: u32,
    mem: MappedSharedMemory,
}

Internal representation of a window.

Fields

top: i32left: i32width: u32height: u32mem: MappedSharedMemory

Implementations

impl Buffer[src]

fn get_real_bounds(
    &self,
    framebuffer_width: u32,
    framebuffer_height: u32
) -> (u32, u32, u32, u32)
[src]

Returns the buffer's bounds within the given width/height, cropping as necessary.

Panics

Panics on overflow if top + height overflows.

fn width(&self) -> u32[src]

Get the width of this buffer.

fn height(&self) -> u32[src]

Get the height of this buffer.

pub fn get_buffer(&self) -> &[AtomicU32][src]

Gets the underlying framebuffer

pub fn get_px_offset(&self, x: usize, y: usize) -> usize[src]

Gets the offset in memory of a pixel based on an x and y.

Panics

Panics if y >= self.height() or x >= self.width()

fn draw(&self)[src]

Blit the buffer to the framebuffer.

Trait Implementations

impl Debug for Buffer[src]

Auto Trait Implementations

impl RefUnwindSafe for Buffer

impl Send for Buffer

impl Sync for Buffer

impl Unpin for Buffer

impl UnwindSafe for Buffer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.