#[repr(C)]pub struct ColorMatrixUniforms {
pub row0: [f32; 4],
pub row1: [f32; 4],
pub row2: [f32; 4],
pub row3: [f32; 4],
pub offset: [f32; 4],
}Expand description
Uniforms for color matrix shader
Memory layout (80 bytes total):
- row0-row3: 4 x
vec4<f32>(64 bytes) - 4x4 matrix rows - offset:
vec4<f32>(16 bytes) - offset/bias for each channel
Fields§
§row0: [f32; 4]Row 0: [m0, m1, m2, m3] - R coefficients
row1: [f32; 4]Row 1: [m5, m6, m7, m8] - G coefficients
row2: [f32; 4]Row 2: [m10, m11, m12, m13] - B coefficients
row3: [f32; 4]Row 3: [m15, m16, m17, m18] - A coefficients
offset: [f32; 4]Offset: [m4, m9, m14, m19] - bias for R, G, B, A
Implementations§
Source§impl ColorMatrixUniforms
impl ColorMatrixUniforms
Sourcepub fn from_matrix(matrix: &[f32; 20]) -> Self
pub fn from_matrix(matrix: &[f32; 20]) -> Self
Create from a 4x5 matrix (row-major, 20 elements)
Trait Implementations§
Source§impl Clone for ColorMatrixUniforms
impl Clone for ColorMatrixUniforms
Source§fn clone(&self) -> ColorMatrixUniforms
fn clone(&self) -> ColorMatrixUniforms
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColorMatrixUniforms
impl Debug for ColorMatrixUniforms
Source§impl Default for ColorMatrixUniforms
impl Default for ColorMatrixUniforms
impl Copy for ColorMatrixUniforms
impl Pod for ColorMatrixUniforms
Auto Trait Implementations§
impl Freeze for ColorMatrixUniforms
impl RefUnwindSafe for ColorMatrixUniforms
impl Send for ColorMatrixUniforms
impl Sync for ColorMatrixUniforms
impl Unpin for ColorMatrixUniforms
impl UnsafeUnpin for ColorMatrixUniforms
impl UnwindSafe for ColorMatrixUniforms
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
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.