Struct glium::texture::RawImage2d [] [src]

pub struct RawImage2d<'a, T: Clone + 'a> {
    pub data: Cow<'a, [T]>,
    pub width: u32,
    pub height: u32,
    pub format: ClientFormat,
}

Represents raw data for a two-dimensional image.

Fields

data

A contiguous array of pixel data.

The data must start by the bottom-left hand corner pixel and progress left-to-right and bottom-to-top.

data.len() must be equal to width * height * format.get_size() / mem::size_of::<T>().

width

Number of pixels per column.

height

Number of pixels per row.

format

Formats of the pixels.

Methods

impl<'a, T: Clone + 'a> RawImage2d<'a, T>

fn from_vec_raw1d(arr: &Vec<RawImage1d<'a, T>>) -> RawImage2d<'a, T>

Transforms a Vec into a RawImage2d

Trait Implementations

impl<'a, P: PixelValue + Clone> Texture2dDataSource<'a> for RawImage2d<'a, P>

type Data = P

fn into_raw(self) -> RawImage2d<'a, P>