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

Get the width of the image, in texels.

Get the height of the image, in texels.

Get the format of the image data that is returned by the texel_bytes method.

Get the raw texel data of the image data, as a u8 slice.

Implementors