Struct vulkano_framing::Buffer
[−]
[src]
pub struct Buffer<T> { /* fields omitted */ }
Wraps a buffer, providing functions that allow the user to interpret it as a frame instead of as a bunch of pixels.
Methods
impl<T> Buffer<T> where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
fn new(
inner: Arc<CpuAccessibleBuffer<[T]>>,
width: usize,
height: usize
) -> Result<Self, BadLength>
inner: Arc<CpuAccessibleBuffer<[T]>>,
width: usize,
height: usize
) -> Result<Self, BadLength>
Creates the wrapper.
Expects a width and height in pixels, and a buffer of length
width * height
. A buffer of incorrect length will cause a BadLength
error to be returned.
impl<T: 'static> Buffer<T>
[src]
fn read(&self) -> Result<Reader<T>, ReadLockError>
Try to get a read-only frame from the buffer.
fn write(&self) -> Result<Writer<T>, WriteLockError>
Try to get a mutable frame from the buffer.
impl<T> Buffer<T>
[src]
fn buffer(&self) -> &Arc<CpuAccessibleBuffer<[T]>>
Get back the underlying buffer.
fn width(&self) -> usize
The width of the image, in pixels.
fn height(&self) -> usize
The height of the image, in pixels.
Trait Implementations
impl<T: Clone> Clone for Buffer<T>
[src]
fn clone(&self) -> Buffer<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more