Struct slint::SharedPixelBuffer
[−]#[repr(C)]pub struct SharedPixelBuffer<Pixel> { /* private fields */ }
Expand description
SharedPixelBuffer is a container for storing image data as pixels. It is internally reference counted and cheap to clone.
You can construct 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
Slint 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>,
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: u32, height: u32) -> SharedPixelBuffer<Pixel>
pub fn new(width: u32, height: u32) -> 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: u32,
height: u32
) -> SharedPixelBuffer<Pixel> where
[SourcePixelType]: AsPixels<Pixel>,
pub fn clone_from_slice<SourcePixelType>(
pixel_slice: &[SourcePixelType],
width: u32,
height: u32
) -> 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 Slint.
Trait Implementations
impl<Pixel> Clone for SharedPixelBuffer<Pixel> where
Pixel: Clone,
impl<Pixel> Clone for SharedPixelBuffer<Pixel> where
Pixel: Clone,
fn clone(&self) -> SharedPixelBuffer<Pixel>
fn clone(&self) -> SharedPixelBuffer<Pixel>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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> where
Pixel: Send,
impl<Pixel> !Sync for SharedPixelBuffer<Pixel>
impl<Pixel> Unpin for SharedPixelBuffer<Pixel>
impl<Pixel> UnwindSafe for SharedPixelBuffer<Pixel> where
Pixel: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more