Expand description
Linear algebra primitives, color types, and bit-manipulation utilities.
Provides Vec2, Vec3, and Vec4 floating-point vectors with
swizzle accessors, scalar-valued color types (R8U, R32F, Rg8U,
Rg32F, Rgb8U, Rgb32F, Rgba8U, Rgba32F, Rgb565,
Yiq32F), axis-aligned bounding regions (Region3, Rect),
bit-interleaving helpers, and PCA-based axis estimation.
Structs§
- R8U
- A single-channel 8-bit unsigned color (red).
- R32F
- A single-channel color represented as one
f32. - Rect
- An axis-aligned rectangle.
- Region2
- A region in 2D space defined by a points on a diagonal.
- Region3
- A region in 3D space defined by a points on a diagonal.
- Rg8U
- A two-channel 8-bit unsigned color (red, green).
- Rg32F
- A two-channel (red, green) color represented as 2
f32s. - Rgb8U
- An RGB color with 8 bit unsigned normalized integers per channel.
- Rgb32F
- An RGB color represented as 3 floats.
- Rgb565
- An RGB color with 5,6 and 5 bits unsigned normalized integers per channel.
- Rgba8U
- An RGBA color with 8 bit unsigned normalized integers per channel.
- Rgba32F
- An RGBA color represented as 4
f32s. - Vec2
- A 2D vector.
- Vec3
- A 3D vector.
- Vec4
- A 4D vector.
- Yiq32F
- An YIQ color represented as 3 floats.
Traits§
- Delta
- Delta allows calculating “difference” between base and current value, and reconstructing current value from base and delta.
- One
- Trait to create multiplicative identity element.
- Vector
- Zero
- Trait to create additive identity element.
Functions§
- compact6_
3 - Extracts every-third bit from a 16-bit value back into 6 bits.
- compact8_
2 - Extracts even bit positions from a 16-bit value back into 8 bits.
- compact8_
3 - Extracts every-third bit from a value back into 8 bits.
- compact8_
4 - Extracts every-fourth bit from a 32-bit value back into 8 bits.
- compact16_
2 - Extracts even bit positions from a 32-bit value back into 16 bits.
- compact32_
2 - Extracts even bit positions from a 64-bit value back into 32 bits.
- deinterleave8_
2 - Deinterleaves a 16-bit Morton code into two 8-bit values.
- deinterleave8_
3 - Deinterleaves a 24-bit Morton code into three 8-bit values.
- deinterleave8_
4 - Deinterleaves a 32-bit Morton code into four 8-bit values.
- deinterleave16_
2 - Deinterleaves a 32-bit Morton code into two 16-bit values.
- deinterleave32_
2 - Deinterleaves a 64-bit Morton code into two 32-bit values.
- deinterleave655_
3 - Deinterleaves a 16-bit Morton code into three values (6, 5, 5 bits).
- interleave8_
2 - Interleaves the bits of two 8-bit values into a 16-bit Morton code.
- interleave8_
3 - Interleaves the bits of three 8-bit values into a 24-bit Morton code.
- interleave8_
4 - Interleaves the bits of four 8-bit values into a 32-bit Morton code.
- interleave16_
2 - Interleaves the bits of two 16-bit values into a 32-bit Morton code.
- interleave32_
2 - Interleaves the bits of two 32-bit values into a 64-bit Morton code.
- interleave655_
3 - Interleaves three values (6, 5, 5 bits) into a 16-bit Morton code.
- lerp
- Linearly interpolates between
aandbby factort. - max_
variance_ diagonal_ axis2 - Returns the bounding-box diagonal axis along which the given samples have the greatest variance.
- max_
variance_ diagonal_ axis3 - Returns the bounding-box diagonal axis along which the given samples have the greatest variance.
- pca_
axis2 - Estimates the principal component axis of a set of 3D points via power iteration on the covariance matrix.
- pca_
axis3 - Estimates the principal component axis of a set of 3D points via power iteration on the covariance matrix.
- round_
down - Rounds
valuedown to the nearest multiple ofround. - round_
up - Rounds
valueup to the nearest multiple ofround. - spread6_
3 - Spreads 6 bits into every-third bit position of a 16-bit value.
- spread8_
2 - Spreads 8 bits into even bit positions of a 16-bit value.
- spread8_
3 - Spreads 8 bits into every-third bit position of a 24-bit value.
- spread8_
4 - Spreads 8 bits into every-fourth bit position of a 32-bit value.
- spread16_
2 - Spreads 16 bits into even bit positions of a 32-bit value.
- spread32_
2 - Spreads 32 bits into even bit positions of a 64-bit value (2-way interleave building block).