Enum three_d::core::texture::TextureData
source · pub enum TextureData {
RU8(Vec<u8, Global>),
RgU8(Vec<[u8; 2], Global>),
RgbU8(Vec<[u8; 3], Global>),
RgbaU8(Vec<[u8; 4], Global>),
RF16(Vec<f16, Global>),
RgF16(Vec<[f16; 2], Global>),
RgbF16(Vec<[f16; 3], Global>),
RgbaF16(Vec<[f16; 4], Global>),
RF32(Vec<f32, Global>),
RgF32(Vec<[f32; 2], Global>),
RgbF32(Vec<[f32; 3], Global>),
RgbaF32(Vec<[f32; 4], Global>),
}Expand description
The pixel/texel data for a Texture2D or Texture3D.
If 2D data, the data array should start with the top left texel and then one row at a time.
The indices (row, column) into the 2D data would look like
[
(0, 0), (1, 0), .., // First row
(0, 1), (1, 1), .., // Second row
..
]
If 3D data, the data array would look like the 2D data, one layer/image at a time.
The indices (row, column, layer) into the 3D data would look like
[
(0, 0, 0), (1, 0, 0), .., // First row in first layer
(0, 1, 0), (1, 1, 0), .., // Second row in first layer
..
(0, 0, 1), (1, 0, 1), .., // First row in second layer
(0, 1, 1), (1, 1, 1), .., // Second row in second layer
..
]
Variants§
RU8(Vec<u8, Global>)
One byte in the red channel.
RgU8(Vec<[u8; 2], Global>)
One byte in the red and green channel.
RgbU8(Vec<[u8; 3], Global>)
One byte in the red, green and blue channel.
RgbaU8(Vec<[u8; 4], Global>)
One byte in the red, green, blue and alpha channel.
RF16(Vec<f16, Global>)
16-bit float in the red channel.
RgF16(Vec<[f16; 2], Global>)
16-bit float in the red and green channel.
RgbF16(Vec<[f16; 3], Global>)
16-bit float in the red, green and blue channel.
RgbaF16(Vec<[f16; 4], Global>)
16-bit float in the red, green, blue and alpha channel.
RF32(Vec<f32, Global>)
32-bit float in the red channel.
RgF32(Vec<[f32; 2], Global>)
32-bit float in the red and green channel.
RgbF32(Vec<[f32; 3], Global>)
32-bit float in the red, green and blue channel.
RgbaF32(Vec<[f32; 4], Global>)
32-bit float in the red, green, blue and alpha channel.
Trait Implementations§
source§impl Clone for TextureData
impl Clone for TextureData
source§fn clone(&self) -> TextureData
fn clone(&self) -> TextureData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TextureData
impl Debug for TextureData
source§impl PartialEq<TextureData> for TextureData
impl PartialEq<TextureData> for TextureData
source§fn eq(&self, other: &TextureData) -> bool
fn eq(&self, other: &TextureData) -> bool
self and other values to be equal, and is used
by ==.