pub struct BufferSource { /* private fields */ }Expand description
A producer over pixels already in memory.
The buffer is shared, not copied, so cloning is cheap and two graphs can root at the same pixels.
Implementations§
Source§impl BufferSource
impl BufferSource
Sourcepub fn new(descriptor: ImageDescriptor, buffer: Arc<TileBuf>) -> Result<Self>
pub fn new(descriptor: ImageDescriptor, buffer: Arc<TileBuf>) -> Result<Self>
Wrap a whole-image buffer as a producer.
§Errors
Returns PixelsError::InvalidArgument if buffer does not start at
the image origin or does not match descriptor.
Trait Implementations§
Source§impl Clone for BufferSource
impl Clone for BufferSource
Source§impl Debug for BufferSource
impl Debug for BufferSource
Source§impl Producer for BufferSource
impl Producer for BufferSource
Source§fn descriptor(&self) -> ImageDescriptor
fn descriptor(&self) -> ImageDescriptor
The shape of the image this producer yields. Read more
Source§fn capability(&self) -> DecodeCapability
fn capability(&self) -> DecodeCapability
Whether this producer can serve arbitrary regions, or only forward ones. Read more
Source§fn reduced_descriptor(&self, target: (u32, u32)) -> Option<ImageDescriptor>
fn reduced_descriptor(&self, target: (u32, u32)) -> Option<ImageDescriptor>
What this producer would emit if asked for
target or larger, when it
can reach that size more cheaply than by producing full resolution. Read moreAuto Trait Implementations§
impl Freeze for BufferSource
impl RefUnwindSafe for BufferSource
impl Send for BufferSource
impl Sync for BufferSource
impl Unpin for BufferSource
impl UnsafeUnpin for BufferSource
impl UnwindSafe for BufferSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more