Struct gbm::MappedBufferObjectRW
[−]
[src]
pub struct MappedBufferObjectRW<'a, T: 'static> { /* fields omitted */ }
A read-write mapped buffer object
Methods from Deref<Target = BufferObject<'a, T>>
fn width(&self) -> u32
[src]
Get the width of the buffer object
fn height(&self) -> u32
[src]
Get the height of the buffer object
fn stride(&self) -> u32
[src]
Get the stride of the buffer object
fn format(&self) -> Format
[src]
Get the format of the buffer object
fn handle(&self) -> BufferObjectHandle
[src]
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.
fn map(
&'a self,
x: u32,
y: u32,
width: u32,
height: u32
) -> IoResult<MappedBufferObject<'a, T>>
[src]
&'a self,
x: u32,
y: u32,
width: u32,
height: u32
) -> IoResult<MappedBufferObject<'a, T>>
Map a region of a gbm buffer object for cpu access
This function maps a region of a gbm bo for cpu read access.
fn map_mut(
&'a mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> IoResult<MappedBufferObjectRW<'a, T>>
[src]
&'a mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> IoResult<MappedBufferObjectRW<'a, T>>
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.
fn write(&mut self, buffer: &[u8]) -> IoResult<()>
[src]
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.
fn set_userdata(&mut self, userdata: T) -> Option<T>
[src]
Sets the userdata of the buffer object.
If previously userdata was set, it is returned.
fn clear_userdata(&mut self)
[src]
Clears the set userdata of the buffer object.
fn userdata(&self) -> Option<&T>
[src]
Returns a reference to set userdata, if any.
fn userdata_mut(&mut self) -> Option<&mut T>
[src]
Returns a mutable reference to set userdata, if any.
fn take_userdata(&mut self) -> Option<T>
[src]
Takes ownership of previously set userdata, if any.
This removes the userdata from the buffer object.
Trait Implementations
impl<'a, T: 'static> Deref for MappedBufferObjectRW<'a, T>
[src]
type Target = BufferObject<'a, T>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.
impl<'a, T: 'static> DerefMut for MappedBufferObjectRW<'a, T>
[src]
impl<'a, T: 'static> ReadableMappedBufferObject<'a> for MappedBufferObjectRW<'a, T>
[src]
fn stride(&self) -> u32
[src]
Get the stride of the buffer object Read more
fn height(&self) -> u32
[src]
The height of the mapped region for the buffer
fn width(&self) -> u32
[src]
The width of the mapped region for the buffer
fn x(&self) -> u32
[src]
The X (top left origin) starting position of the mapped region for the buffer
fn y(&self) -> u32
[src]
The Y (top left origin) starting position of the mapped region for the buffer
fn buffer(&'a self) -> &'a [u8]
[src]
Access to the underlying image buffer
impl<'a, T: 'static> WritableMappedBufferObject<'a> for MappedBufferObjectRW<'a, T>
[src]
fn buffer_mut(&'a mut self) -> &'a mut [u8]
[src]
Mutable access to the underlying image buffer