Enum gltf::mesh::util::ReadColors

source ·
pub enum ReadColors<'a> {
    RgbU8(Iter<'a, [u8; 3]>),
    RgbU16(Iter<'a, [u16; 3]>),
    RgbF32(Iter<'a, [f32; 3]>),
    RgbaU8(Iter<'a, [u8; 4]>),
    RgbaU16(Iter<'a, [u16; 4]>),
    RgbaF32(Iter<'a, [f32; 4]>),
}
Expand description

Vertex colors.

Variants§

§

RgbU8(Iter<'a, [u8; 3]>)

RGB vertex color of type [u8; 3]>.

§

RgbU16(Iter<'a, [u16; 3]>)

RGB vertex color of type [u16; 3]>.

§

RgbF32(Iter<'a, [f32; 3]>)

RGB vertex color of type [f32; 3].

§

RgbaU8(Iter<'a, [u8; 4]>)

RGBA vertex color of type [u8; 4]>.

§

RgbaU16(Iter<'a, [u16; 4]>)

RGBA vertex color of type [u16; 4]>.

§

RgbaF32(Iter<'a, [f32; 4]>)

RGBA vertex color of type [f32; 4].

Implementations§

source§

impl<'a> ReadColors<'a>

source

pub fn into_rgb_u8(self) -> CastingIter<'a, RgbU8>

Reinterpret colors as RGB u8, discarding alpha, if present. Lossy if the underlying iterator yields u16, f32 or any RGBA.

source

pub fn into_rgb_u16(self) -> CastingIter<'a, RgbU16>

Reinterpret colors as RGB u16, discarding alpha, if present. Lossy if the underlying iterator yields f32 or any RGBA.

source

pub fn into_rgb_f32(self) -> CastingIter<'a, RgbF32>

Reinterpret colors as RGB f32, discarding alpha, if present. Lossy if the underlying iterator yields u16 or any RGBA.

source

pub fn into_rgba_u8(self) -> CastingIter<'a, RgbaU8>

Reinterpret colors as RGBA u8, with default alpha 255. Lossy if the underlying iterator yields u16 or f32.

source

pub fn into_rgba_u16(self) -> CastingIter<'a, RgbaU16>

Reinterpret colors as RGBA u16, with default alpha 65535. Lossy if the underlying iterator yields f32.

source

pub fn into_rgba_f32(self) -> CastingIter<'a, RgbaF32>

Reinterpret colors as RGBA f32, with default alpha 1.0. Lossy if the underlying iterator yields u16.

Trait Implementations§

source§

impl<'a> Clone for ReadColors<'a>

source§

fn clone(&self) -> ReadColors<'a>

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<'a> Debug for ReadColors<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for ReadColors<'a>

§

impl<'a> Send for ReadColors<'a>

§

impl<'a> Sync for ReadColors<'a>

§

impl<'a> Unpin for ReadColors<'a>

§

impl<'a> UnwindSafe for ReadColors<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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 T
where 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 T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.