pub struct Vec3 { /* private fields */ }Expand description
Three-dimensional floating-point vector for 3D positions, directions, normals, and RGB radiance.
Implementations§
Source§impl Vec3
Vector arithmetic, normalization, dot/cross products, and reflection helpers for Vec3.
impl Vec3
Vector arithmetic, normalization, dot/cross products, and reflection helpers for Vec3.
Sourcepub fn from_color(c: Color) -> Self
pub fn from_color(c: Color) -> Self
Sourcepub fn to_aces_rgba8(self) -> [u8; 4]
pub fn to_aces_rgba8(self) -> [u8; 4]
Sourcepub fn aces_rgba8_luma_4x(
r: [f32; 4],
g: [f32; 4],
b: [f32; 4],
) -> ([[u8; 4]; 4], [u8; 4])
pub fn aces_rgba8_luma_4x( r: [f32; 4], g: [f32; 4], b: [f32; 4], ) -> ([[u8; 4]; 4], [u8; 4])
Vectorized 4-pixel ACES filmic tone mapper returning RGBA8 pixels and Rec.601 luma bytes.
§Arguments
[f32; 4]- Four linear HDR red channel values.[f32; 4]- Four linear HDR green channel values.[f32; 4]- Four linear HDR blue channel values.
§Returns
([[u8; 4]; 4], [u8; 4])- Tone-mapped RGBA8 pixels and corresponding Rec.601 luma values.
Source§impl Vec3
impl Vec3
pub fn get_x(&self) -> f32
pub fn get_mut_x(&mut self) -> &mut f32
pub fn set_x(&mut self, val: f32) -> &mut Self
pub fn get_y(&self) -> f32
pub fn get_mut_y(&mut self) -> &mut f32
pub fn set_y(&mut self, val: f32) -> &mut Self
pub fn get_z(&self) -> f32
pub fn get_mut_z(&mut self) -> &mut f32
pub fn set_z(&mut self, val: f32) -> &mut Self
Trait Implementations§
impl Copy for Vec3
impl StructuralPartialEq for Vec3
Auto Trait Implementations§
impl Forget for Vec3
impl Freeze for Vec3
impl Move for Vec3
impl RefUnwindSafe for Vec3
impl Send for Vec3
impl Sync for Vec3
impl Unpin for Vec3
impl UnsafeUnpin for Vec3
impl UnwindSafe for Vec3
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