|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API size_t MayaFlux::Kakshya::storage_element_size | ( | Portal::Graphics::ImageFormat | format | ) |
Byte width of the DataVariant element backing a given ImageFormat.
Returns 1 for uint8 storage, 2 for uint16, 4 for float. Defaults to 1 for any format without an explicit mapping.
Size determines the alternative unambiguously only because DataVariant's pixel alternatives are uint8, uint16, and float: 4 means float, not uint32. Half-float formats return 2, since the uint16 bits are the IEEE-754 binary16 encoding rather than a UNORM value; consumers needing the decoded magnitude must check is_float_format().
| format | Pixel format. |