Struct sixtyfps::SharedPixelBuffer [−]
#[repr(C)]pub struct SharedPixelBuffer<Pixel> { /* fields omitted */ }
Expand description
SharedPixelBuffer is a container for storing image data as pixels. It is internally reference counted and cheap to clone.
You can construct new a new empty shared pixel buffer with SharedPixelBuffer::new
,
or you can clone it from an existing contiguous buffer that you might already have, using
SharedPixelBuffer::clone_from_slice
.
See the documentation for Image
for examples how to use this type to integrate
SixtyFPS with external rendering functions.
Implementations
impl<Pixel> SharedPixelBuffer<Pixel>
impl<Pixel> SharedPixelBuffer<Pixel>
impl<Pixel> SharedPixelBuffer<Pixel> where
Pixel: Clone,
impl<Pixel> SharedPixelBuffer<Pixel> where
Pixel: Clone,
impl<Pixel> SharedPixelBuffer<Pixel> where
Pixel: Clone + Pod,
[Pixel]: ComponentBytes<u8>,
impl<Pixel> SharedPixelBuffer<Pixel> where
Pixel: Clone + Pod,
[Pixel]: ComponentBytes<u8>,
Returns the pixels interpreted as raw bytes.
impl<Pixel> SharedPixelBuffer<Pixel>
impl<Pixel> SharedPixelBuffer<Pixel>
impl<Pixel> SharedPixelBuffer<Pixel> where
Pixel: Clone + Default,
impl<Pixel> SharedPixelBuffer<Pixel> where
Pixel: Clone + Default,
pub fn new(width: usize, height: usize) -> SharedPixelBuffer<Pixel>
pub fn new(width: usize, height: usize) -> SharedPixelBuffer<Pixel>
Creates a new SharedPixelBuffer with the given width and height. Each pixel will be initialized with the value
that Default::default()
returns for the Pixel type.
impl<Pixel> SharedPixelBuffer<Pixel> where
Pixel: Clone,
impl<Pixel> SharedPixelBuffer<Pixel> where
Pixel: Clone,
pub fn clone_from_slice<SourcePixelType>(
pixel_slice: &[SourcePixelType],
width: usize,
height: usize
) -> SharedPixelBuffer<Pixel> where
[SourcePixelType]: AsPixels<Pixel>,
pub fn clone_from_slice<SourcePixelType>(
pixel_slice: &[SourcePixelType],
width: usize,
height: usize
) -> SharedPixelBuffer<Pixel> where
[SourcePixelType]: AsPixels<Pixel>,
Creates a new SharedPixelBuffer by cloning and converting pixels from an existing slice. This function is useful when another crate was used to allocate an image and you would like to convert it for use in SixtyFPS.
Trait Implementations
impl<Pixel> Clone for SharedPixelBuffer<Pixel> where
Pixel: Clone,
impl<Pixel> Clone for SharedPixelBuffer<Pixel> where
Pixel: Clone,
pub fn clone(&self) -> SharedPixelBuffer<Pixel>
pub fn clone(&self) -> SharedPixelBuffer<Pixel>
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<Pixel> RefUnwindSafe for SharedPixelBuffer<Pixel> where
Pixel: RefUnwindSafe,
impl<Pixel> !Send for SharedPixelBuffer<Pixel>
impl<Pixel> !Sync for SharedPixelBuffer<Pixel>
impl<Pixel> Unpin for SharedPixelBuffer<Pixel>
impl<Pixel> UnwindSafe for SharedPixelBuffer<Pixel> where
Pixel: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more