pub trait GenericPixelBuffer: Debug {
// Required methods
fn get_buffer(&self) -> &Buffer;
fn get_channel_type(&self) -> ChannelType;
fn get_component_type(&self) -> ComponentType;
// Provided methods
fn size_in_bytes(&self) -> usize { ... }
fn bind<'a>(&'a self) -> Result<BufferBind<'a>, TextureError> { ... }
}
Expand description
The GenericPixelBuffer
trait helps the PixelBuffer
struct to be able to turn into an object
Required Methods§
Sourcefn get_buffer(&self) -> &Buffer
fn get_buffer(&self) -> &Buffer
Get the underlying buffer
Sourcefn get_channel_type(&self) -> ChannelType
fn get_channel_type(&self) -> ChannelType
Get the channel type
Sourcefn get_component_type(&self) -> ComponentType
fn get_component_type(&self) -> ComponentType
Get the component type
Provided Methods§
Sourcefn size_in_bytes(&self) -> usize
fn size_in_bytes(&self) -> usize
Get the size of the buffer
Sourcefn bind<'a>(&'a self) -> Result<BufferBind<'a>, TextureError>
fn bind<'a>(&'a self) -> Result<BufferBind<'a>, TextureError>
Create a BufferBind
to use the RAII system to manage the binding state