Trait GenericPixelBuffer

Source
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§

Source

fn get_buffer(&self) -> &Buffer

Get the underlying buffer

Source

fn get_channel_type(&self) -> ChannelType

Get the channel type

Source

fn get_component_type(&self) -> ComponentType

Get the component type

Provided Methods§

Source

fn size_in_bytes(&self) -> usize

Get the size of the buffer

Source

fn bind<'a>(&'a self) -> Result<BufferBind<'a>, TextureError>

Create a BufferBind to use the RAII system to manage the binding state

Implementors§

Source§

impl<B, BP> GenericPixelBuffer for PixelBuffer<B, BP>
where B: BufferVec<BP>, BP: BufferVecItem,