#[repr(C, align(4))]pub struct RGBE8 {
pub r: u8,
pub g: u8,
pub b: u8,
pub e: u8,
}Expand description
Aligned representation of Radiance RGBE8 pixel. r, g, and b are subnormal mantissas and e (taking the place of the alpha channel) is a common exponent. This is commonly loaded from Radiance pictures (.hdr).
As it uses 4 u8 components, this format can also be used with PNG compression, with the exponent taking the place of the alpha channel. This will preserve chroma but distort luminance if loaded as a normal PNG, making thumbnailers somewhat useful for image identification.
Fields§
§r: u8§g: u8§b: u8§e: u8Implementations§
Source§impl RGBE8
impl RGBE8
Sourcepub fn pack(rgb: [f32; 3]) -> Self
pub fn pack(rgb: [f32; 3]) -> Self
Pack a triple of RGB float values into an RGBE8. This is not as optimized as RGB9E5::pack since it is designed for use in tooling instead of asset loading.
Sourcepub fn repack_rgb9e5(self) -> RGB9E5
pub fn repack_rgb9e5(self) -> RGB9E5
Repack RGBE8 into RGB9E5 for use on the GPU. This can cause saturation or loss of precision if the exponent is outside the range of RGB9E5.
Trait Implementations§
impl Copy for RGBE8
impl Eq for RGBE8
impl Pod for RGBE8
impl StructuralPartialEq for RGBE8
Auto Trait Implementations§
impl Freeze for RGBE8
impl RefUnwindSafe for RGBE8
impl Send for RGBE8
impl Sync for RGBE8
impl Unpin for RGBE8
impl UnsafeUnpin for RGBE8
impl UnwindSafe for RGBE8
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> 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
bits
as &Self.