Struct vulkano::sampler::ComponentMapping
source · pub struct ComponentMapping {
pub r: ComponentSwizzle,
pub g: ComponentSwizzle,
pub b: ComponentSwizzle,
pub a: ComponentSwizzle,
}
Expand description
A mapping between components of a source format and components read by a shader.
Fields§
§r: ComponentSwizzle
First component.
g: ComponentSwizzle
Second component.
b: ComponentSwizzle
Third component.
a: ComponentSwizzle
Fourth component.
Implementations§
source§impl ComponentMapping
impl ComponentMapping
sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Returns true
if all components are identity swizzled,
meaning that all the members are Identity
or the name of that member.
Certain operations require views that are identity swizzled, and will return an error otherwise. For example, attaching a view to a framebuffer is only possible if the view is identity swizzled.
sourcepub fn r_is_identity(&self) -> bool
pub fn r_is_identity(&self) -> bool
Returns true
if the red component mapping is identity swizzled.
sourcepub fn g_is_identity(&self) -> bool
pub fn g_is_identity(&self) -> bool
Returns true
if the green component mapping is identity swizzled.
sourcepub fn b_is_identity(&self) -> bool
pub fn b_is_identity(&self) -> bool
Returns true
if the blue component mapping is identity swizzled.
sourcepub fn a_is_identity(&self) -> bool
pub fn a_is_identity(&self) -> bool
Returns true
if the alpha component mapping is identity swizzled.
sourcepub fn component_map(&self) -> [Option<usize>; 4]
pub fn component_map(&self) -> [Option<usize>; 4]
Returns the component indices that each component reads from. The index is None
if the
component has a fixed value and is not read from anywhere (Zero
or One
).
Trait Implementations§
source§impl Clone for ComponentMapping
impl Clone for ComponentMapping
source§fn clone(&self) -> ComponentMapping
fn clone(&self) -> ComponentMapping
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ComponentMapping
impl Debug for ComponentMapping
source§impl Default for ComponentMapping
impl Default for ComponentMapping
source§fn default() -> ComponentMapping
fn default() -> ComponentMapping
source§impl From<ComponentMapping> for ComponentMapping
impl From<ComponentMapping> for ComponentMapping
source§fn from(value: ComponentMapping) -> Self
fn from(value: ComponentMapping) -> Self
source§impl PartialEq<ComponentMapping> for ComponentMapping
impl PartialEq<ComponentMapping> for ComponentMapping
source§fn eq(&self, other: &ComponentMapping) -> bool
fn eq(&self, other: &ComponentMapping) -> bool
self
and other
values to be equal, and is used
by ==
.