Struct gbm::MappedBufferObject
source · [−]pub struct MappedBufferObject<'a, T: 'static> { /* private fields */ }
Expand description
A mapped buffer object
Implementations
Get the stride of the buffer object
This is calculated by the backend when it does the allocation of the buffer.
The X (top left origin) starting position of the mapped region for the buffer
The Y (top left origin) starting position of the mapped region for the buffer
Access to the underlying image buffer
Methods from Deref<Target = BufferObject<T>>
Get the width of the buffer object
Get the height of the buffer object
Get the stride of the buffer object
Get the stride of the buffer object
Get the format of the buffer object
Get the bits per pixel of the buffer object
Get the offset for a plane of the buffer object
Get the plane count of the buffer object
Get the modifier of the buffer object
Get a DMA-BUF file descriptor for the buffer object
This function creates a DMA-BUF (also known as PRIME) file descriptor
handle for the buffer object. Each call to Self::fd()
returns a new
file descriptor and the caller is responsible for closing the file
descriptor.
Get the handle of the buffer object
This is stored in the platform generic union BufferObjectHandle
type. However
the format of this handle is platform specific.
pub fn handle_for_plane(
&self,
plane: i32
) -> Result<BufferObjectHandle, DeviceDestroyedError>
pub fn handle_for_plane(
&self,
plane: i32
) -> Result<BufferObjectHandle, DeviceDestroyedError>
Get the handle of a plane of the buffer object
This is stored in the platform generic union BufferObjectHandle
type. However
the format of this handle is platform specific.
Map a region of a GBM buffer object for cpu access
This function maps a region of a GBM bo for cpu read access.
Map a region of a GBM buffer object for cpu access
This function maps a region of a GBM bo for cpu read/write access.
Write data into the buffer object
If the buffer object was created with the BufferObjectFlags::WRITE
flag,
this function can be used to write data into the buffer object. The
data is copied directly into the object and it’s the responsibility
of the caller to make sure the data represents valid pixel data,
according to the width, height, stride and format of the buffer object.
Sets the userdata of the buffer object.
If previously userdata was set, it is returned.
Clears the set userdata of the buffer object.
Returns a reference to set userdata, if any.
Returns a mutable reference to set userdata, if any.
Takes ownership of previously set userdata, if any.
This removes the userdata from the buffer object.
Trait Implementations
type Target = BufferObject<T>
type Target = BufferObject<T>
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for MappedBufferObject<'a, T>
impl<'a, T> !Send for MappedBufferObject<'a, T>
impl<'a, T> !Sync for MappedBufferObject<'a, T>
impl<'a, T> Unpin for MappedBufferObject<'a, T>
impl<'a, T> !UnwindSafe for MappedBufferObject<'a, T>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more