pub struct TextureChannel(/* private fields */);Expand description
Represents the different format channels of a texture format.
Implementations§
Source§impl TextureChannel
impl TextureChannel
Sourcepub const RED: TextureChannel
pub const RED: TextureChannel
Texture format contains a red channel.
Sourcepub const GREEN: TextureChannel
pub const GREEN: TextureChannel
Texture format contains a green channel.
Sourcepub const BLUE: TextureChannel
pub const BLUE: TextureChannel
Texture format contains a blue channel.
Sourcepub const ALPHA: TextureChannel
pub const ALPHA: TextureChannel
Texture format contains an alpha channel.
Sourcepub const STENCIL: TextureChannel
pub const STENCIL: TextureChannel
Texture format contains a stencil channel.
Sourcepub const DEPTH: TextureChannel
pub const DEPTH: TextureChannel
Texture format contains a depth channel.
Sourcepub const LUMINANCE: TextureChannel
pub const LUMINANCE: TextureChannel
Texture format contains a luminance channel.
Sourcepub const CHROMINANCE_BLUE: TextureChannel
pub const CHROMINANCE_BLUE: TextureChannel
Texture format contains a blue-difference channel.
Sourcepub const CHROMINANCE_RED: TextureChannel
pub const CHROMINANCE_RED: TextureChannel
Texture format contains a red-difference channel.
Sourcepub const RG: TextureChannel
pub const RG: TextureChannel
Texture format contains channels for red and green.
Sourcepub const RGB: TextureChannel
pub const RGB: TextureChannel
Texture format contains channels for red, green and blue.
Sourcepub const RGBA: TextureChannel
pub const RGBA: TextureChannel
Texture format contains channels for red, green, blue and alpha.
Sourcepub const DEPTH_STENCIL: TextureChannel
pub const DEPTH_STENCIL: TextureChannel
Texture format contains channels for depth and stencil.
Sourcepub const LUMINANCE_CHROMINANCE: TextureChannel
pub const LUMINANCE_CHROMINANCE: TextureChannel
Texture format contains a luminance (Y), blue-difference (Cb) and red-difference (Cr) channel.
Source§impl TextureChannel
impl TextureChannel
Sourcepub const fn empty() -> TextureChannel
pub const fn empty() -> TextureChannel
Get a flags value with all bits unset.
Sourcepub const fn all() -> TextureChannel
pub const fn all() -> TextureChannel
Get a flags value with all known bits set.
Sourcepub const fn bits(&self) -> u16
pub const fn bits(&self) -> u16
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u16) -> Option<TextureChannel>
pub const fn from_bits(bits: u16) -> Option<TextureChannel>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u16) -> TextureChannel
pub const fn from_bits_truncate(bits: u16) -> TextureChannel
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u16) -> TextureChannel
pub const fn from_bits_retain(bits: u16) -> TextureChannel
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<TextureChannel>
pub fn from_name(name: &str) -> Option<TextureChannel>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: TextureChannel) -> bool
pub const fn intersects(&self, other: TextureChannel) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: TextureChannel) -> bool
pub const fn contains(&self, other: TextureChannel) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn insert(&mut self, other: TextureChannel)
pub fn insert(&mut self, other: TextureChannel)
The bitwise or (|) of the bits in two flags values.
Sourcepub fn remove(&mut self, other: TextureChannel)
pub fn remove(&mut self, other: TextureChannel)
The intersection of a source flags value with the complement of a target flags
value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
Sourcepub fn toggle(&mut self, other: TextureChannel)
pub fn toggle(&mut self, other: TextureChannel)
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub fn set(&mut self, other: TextureChannel, value: bool)
pub fn set(&mut self, other: TextureChannel, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: TextureChannel) -> TextureChannel
pub const fn intersection(self, other: TextureChannel) -> TextureChannel
The bitwise and (&) of the bits in two flags values.
Sourcepub const fn union(self, other: TextureChannel) -> TextureChannel
pub const fn union(self, other: TextureChannel) -> TextureChannel
The bitwise or (|) of the bits in two flags values.
Sourcepub const fn difference(self, other: TextureChannel) -> TextureChannel
pub const fn difference(self, other: TextureChannel) -> TextureChannel
The intersection of a source flags value with the complement of a target flags
value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Sourcepub const fn symmetric_difference(self, other: TextureChannel) -> TextureChannel
pub const fn symmetric_difference(self, other: TextureChannel) -> TextureChannel
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub const fn complement(self) -> TextureChannel
pub const fn complement(self) -> TextureChannel
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§impl TextureChannel
impl TextureChannel
Sourcepub const fn iter(&self) -> Iter<TextureChannel> ⓘ
pub const fn iter(&self) -> Iter<TextureChannel> ⓘ
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<TextureChannel> ⓘ
pub const fn iter_names(&self) -> IterNames<TextureChannel> ⓘ
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl Binary for TextureChannel
impl Binary for TextureChannel
Source§impl BitAnd for TextureChannel
impl BitAnd for TextureChannel
Source§fn bitand(self, other: TextureChannel) -> TextureChannel
fn bitand(self, other: TextureChannel) -> TextureChannel
The bitwise and (&) of the bits in two flags values.
Source§type Output = TextureChannel
type Output = TextureChannel
& operator.Source§impl BitAndAssign for TextureChannel
impl BitAndAssign for TextureChannel
Source§fn bitand_assign(&mut self, other: TextureChannel)
fn bitand_assign(&mut self, other: TextureChannel)
The bitwise and (&) of the bits in two flags values.
Source§impl BitOr for TextureChannel
impl BitOr for TextureChannel
Source§fn bitor(self, other: TextureChannel) -> TextureChannel
fn bitor(self, other: TextureChannel) -> TextureChannel
The bitwise or (|) of the bits in two flags values.
Source§type Output = TextureChannel
type Output = TextureChannel
| operator.Source§impl BitOrAssign for TextureChannel
impl BitOrAssign for TextureChannel
Source§fn bitor_assign(&mut self, other: TextureChannel)
fn bitor_assign(&mut self, other: TextureChannel)
The bitwise or (|) of the bits in two flags values.
Source§impl BitXor for TextureChannel
impl BitXor for TextureChannel
Source§fn bitxor(self, other: TextureChannel) -> TextureChannel
fn bitxor(self, other: TextureChannel) -> TextureChannel
The bitwise exclusive-or (^) of the bits in two flags values.
Source§type Output = TextureChannel
type Output = TextureChannel
^ operator.Source§impl BitXorAssign for TextureChannel
impl BitXorAssign for TextureChannel
Source§fn bitxor_assign(&mut self, other: TextureChannel)
fn bitxor_assign(&mut self, other: TextureChannel)
The bitwise exclusive-or (^) of the bits in two flags values.
Source§impl Clone for TextureChannel
impl Clone for TextureChannel
Source§fn clone(&self) -> TextureChannel
fn clone(&self) -> TextureChannel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TextureChannel
Source§impl Debug for TextureChannel
impl Debug for TextureChannel
Source§impl<'de> Deserialize<'de> for TextureChannel
impl<'de> Deserialize<'de> for TextureChannel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextureChannel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextureChannel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for TextureChannel
Source§impl Extend<TextureChannel> for TextureChannel
impl Extend<TextureChannel> for TextureChannel
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = TextureChannel>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = TextureChannel>,
The bitwise or (|) of the bits in each flags value.
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl Flags for TextureChannel
impl Flags for TextureChannel
Source§const FLAGS: &'static [Flag<TextureChannel>]
const FLAGS: &'static [Flag<TextureChannel>]
Source§fn from_bits_retain(bits: u16) -> TextureChannel
fn from_bits_retain(bits: u16) -> TextureChannel
Source§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
Source§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
Source§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self> ⓘ
fn iter_names(&self) -> IterNames<Self> ⓘ
Source§fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
Self::FLAGS.Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in two flags values.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!). Read moreSource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in two flags values.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in a flags value, truncating the result.Source§impl FromIterator<TextureChannel> for TextureChannel
impl FromIterator<TextureChannel> for TextureChannel
Source§fn from_iter<T>(iterator: T) -> TextureChannelwhere
T: IntoIterator<Item = TextureChannel>,
fn from_iter<T>(iterator: T) -> TextureChannelwhere
T: IntoIterator<Item = TextureChannel>,
The bitwise or (|) of the bits in each flags value.
Source§impl Hash for TextureChannel
impl Hash for TextureChannel
Source§impl IntoIterator for TextureChannel
impl IntoIterator for TextureChannel
Source§type Item = TextureChannel
type Item = TextureChannel
Source§type IntoIter = Iter<TextureChannel>
type IntoIter = Iter<TextureChannel>
Source§fn into_iter(self) -> <TextureChannel as IntoIterator>::IntoIter
fn into_iter(self) -> <TextureChannel as IntoIterator>::IntoIter
Source§impl LowerHex for TextureChannel
impl LowerHex for TextureChannel
Source§impl Not for TextureChannel
impl Not for TextureChannel
Source§fn not(self) -> TextureChannel
fn not(self) -> TextureChannel
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§type Output = TextureChannel
type Output = TextureChannel
! operator.Source§impl Octal for TextureChannel
impl Octal for TextureChannel
Source§impl Ord for TextureChannel
impl Ord for TextureChannel
Source§fn cmp(&self, other: &TextureChannel) -> Ordering
fn cmp(&self, other: &TextureChannel) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TextureChannel
impl PartialEq for TextureChannel
Source§impl PartialOrd for TextureChannel
impl PartialOrd for TextureChannel
Source§impl Serialize for TextureChannel
impl Serialize for TextureChannel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for TextureChannel
Source§impl Sub for TextureChannel
impl Sub for TextureChannel
Source§fn sub(self, other: TextureChannel) -> TextureChannel
fn sub(self, other: TextureChannel) -> TextureChannel
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Source§type Output = TextureChannel
type Output = TextureChannel
- operator.Source§impl SubAssign for TextureChannel
impl SubAssign for TextureChannel
Source§fn sub_assign(&mut self, other: TextureChannel)
fn sub_assign(&mut self, other: TextureChannel)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Auto Trait Implementations§
impl Forget for TextureChannel
impl Freeze for TextureChannelwhere
InternalBitFlags: Freeze,
impl Move for TextureChannel
impl RefUnwindSafe for TextureChannelwhere
InternalBitFlags: RefUnwindSafe,
impl Send for TextureChannelwhere
InternalBitFlags: Send,
impl Sync for TextureChannelwhere
InternalBitFlags: Sync,
impl Unpin for TextureChannelwhere
InternalBitFlags: Unpin,
impl UnsafeUnpin for TextureChannelwhere
InternalBitFlags: UnsafeUnpin,
impl UnwindSafe for TextureChannelwhere
InternalBitFlags: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CommonTraits for T
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.