Struct luminance::buffer::Buffer [] [src]

pub struct Buffer<C, T> where C: HasBuffer {
    pub repr: C::ABuffer,
    pub size: usize,
    // some fields omitted
}

A Buffer is a GPU region you can picture as an array. It has a static size and cannot be resized. The size is expressed in number of elements lying in the buffer, not in bytes.

Fields

repr: C::ABuffer size: usize

Methods

impl<C, T> Buffer<C, T> where C: HasBuffer
[src]

fn new(size: usize) -> Buffer<C, T>

Create a new Buffer with a given number of elements.

fn get(&self, i: u32) -> Option<T> where T: Copy

Retrieve an element from the Buffer.

Checks boundaries.

fn whole(&self) -> Vec<T> where T: Copy

Retrieve the whole content of the Buffer.

fn set(&mut self, i: u32, x: T) -> Result<()BufferError> where T: Copy

Set a value at a given index in the Buffer.

Checks boundaries.

fn clear(&self, x: T) where T: Copy

Fill the Buffer with a single value.

fn fill(&self, values: &[T])

Fill the whole buffer with an array.

Trait Implementations

impl<C: Debug, T: Debug> Debug for Buffer<C, T> where C: HasBuffer, C::ABuffer: Debug
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<C, T> Drop for Buffer<C, T> where C: HasBuffer
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more