Expand description
Multimedia (Audio, Raster) Channel Newtypes and Conversions
The unsigned
and signed
modules are enabled by features with the same
name.
The types provided by the unsigned
and signed
module are Ch8
, Ch12
,
Ch16
, Ch24
for integers, and Ch32
and Ch64
for floating-point.
Math operations on integer channels won’t exceed the range of their minimum
and maximum values, while math on floating-point channels can.
Math operations on floating-point channels will only result in normal
numbers or ±infinity. Floating-point channels implement Eq
and Ord
since NaN is always flushed to zero.
Channels support casting with the bytemuck
crate, after which integer
channels may contain out of range values and floating-point channels could
contain NaN or denormals. To flush denormals and NaN to zero and clamp
integer ranges you can use ops::Difference::sub()
on each channel value.
Re-exports§
pub use bytemuck;
Modules§
- convert
- Low-level float / integer channel conversions
- downscale
- Low-level integer channel upscaling conversions
- ops
- Constant “trait” operations
- signed
- Signed channel newtypes
- unsigned
- Unsigned channel newtypes
- upscale
- Low-level integer channel upscaling conversions