Enum vizia::vg::ColorType

#[repr(i32)]
pub enum ColorType {
Show 26 variants Unknown = 0, Alpha8 = 1, RGB565 = 2, ARGB4444 = 3, RGBA8888 = 4, RGB888x = 5, BGRA8888 = 6, RGBA1010102 = 7, BGRA1010102 = 8, RGB101010x = 9, BGR101010x = 10, BGR101010xXR = 11, BGRA10101010XR = 12, RGBA10x6 = 13, Gray8 = 14, RGBAF16Norm = 15, RGBAF16 = 16, RGBAF32 = 17, R8G8UNorm = 18, A16Float = 19, R16G16Float = 20, A16UNorm = 21, R16G16UNorm = 22, R16G16B16A16UNorm = 23, SRGBA8888 = 24, R8UNorm = 25,
}

Variants§

§

Unknown = 0

uninitialized

§

Alpha8 = 1

pixel with alpha in 8-bit byte

§

RGB565 = 2

pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word

§

ARGB4444 = 3

pixel with 4 bits for alpha, red, green, blue; in 16-bit word

§

RGBA8888 = 4

pixel with 8 bits for red, green, blue, alpha; in 32-bit word

§

RGB888x = 5

pixel with 8 bits each for red, green, blue; in 32-bit word

§

BGRA8888 = 6

pixel with 8 bits for blue, green, red, alpha; in 32-bit word

§

RGBA1010102 = 7

10 bits for red, green, blue; 2 bits for alpha; in 32-bit word

§

BGRA1010102 = 8

10 bits for blue, green, red; 2 bits for alpha; in 32-bit word

§

RGB101010x = 9

pixel with 10 bits each for red, green, blue; in 32-bit word

§

BGR101010x = 10

pixel with 10 bits each for blue, green, red; in 32-bit word

§

BGR101010xXR = 11

pixel with 10 bits each for blue, green, red; in 32-bit word, extended range

§

BGRA10101010XR = 12

pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range

§

RGBA10x6 = 13

pixel with 10 used bits (most significant) followed by 6 unused bits for red, green, blue, alpha; in 64-bit word

§

Gray8 = 14

pixel with grayscale level in 8-bit byte

§

RGBAF16Norm = 15

pixel with half floats in [0,1] for red, green, blue, alpha in 64-bit word

§

RGBAF16 = 16

pixel with half floats for red, green, blue, alpha in 64-bit word

§

RGBAF32 = 17

pixel using C float for red, green, blue, alpha; in 128-bit word

§

R8G8UNorm = 18

pixel with a uint8_t for red and green

§

A16Float = 19

pixel with a half float for alpha

§

R16G16Float = 20

pixel with a half float for red and green

§

A16UNorm = 21

pixel with a little endian uint16_t for alpha

§

R16G16UNorm = 22

pixel with a little endian uint16_t for red and green

§

R16G16B16A16UNorm = 23

pixel with a little endian uint16_t for red, green, blue and alpha

§

SRGBA8888 = 24

§

R8UNorm = 25

Implementations§

§

impl ColorType

pub const fn n32() -> ColorType

👎Deprecated since 0.51.0: Use ColorType::N32

pub const N32: ColorType = _

pub const COUNT: usize = 26usize

pub fn bytes_per_pixel(self) -> usize

pub fn is_always_opaque(self) -> bool

pub fn validate_alpha_type(self, alpha_type: SkAlphaType) -> Option<SkAlphaType>

Trait Implementations§

§

impl Clone for ColorType

§

fn clone(&self) -> ColorType

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
§

impl Debug for ColorType

§

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

Formats the value using the given formatter. Read more
§

impl Hash for ColorType

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq for ColorType

§

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

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

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

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

impl Copy for ColorType

§

impl Eq for ColorType

§

impl StructuralPartialEq for ColorType

Auto Trait Implementations§

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
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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 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.

§

impl<N, T> NativeTransmutableWrapper<N> for T
where T: NativeTransmutable<N>,

§

fn wrap(native: N) -> T

§

fn unwrap(self) -> N

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

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>,

source§

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>,

source§

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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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