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

source§

fn clone(&self) -> TextureData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TextureData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl PartialEq<TextureData> for TextureData

source§

fn eq(&self, other: &TextureData) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for TextureData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> SerializableAny for Twhere T: 'static + Any + Clone + Send + Sync,