Trait glitter::image_data::Image2d
[−]
[src]
pub trait Image2d { fn width(&self) -> usize; fn height(&self) -> usize; fn format(&self) -> ImageFormat; fn texel_bytes(&self) -> &[u8]; }
A trait for types that that contain 2D image data, which can
be uploaded to a texture using a Texture2dBuilder
or using the gl.image_2d
method.
See Pixels
for a simple Image2d
.
Required Methods
fn width(&self) -> usize
Get the width of the image, in texels.
fn height(&self) -> usize
Get the height of the image, in texels.
fn format(&self) -> ImageFormat
Get the format of the image data that is returned by the
texel_bytes
method.
fn texel_bytes(&self) -> &[u8]
Get the raw texel data of the image data, as a u8
slice.
Implementors
impl Image2d for Pixels