MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ denormalise_to_uint8() [2/2]

MAYAFLUX_API void MayaFlux::Kakshya::denormalise_to_uint8 ( std::span< const float >  src,
std::span< uint8_t >  dst 
)

Convert a normalised float span back to uint8_t pixels.

Multiplies each value by 255 and clamps to [0, 255]. Output size must equal src.size(). Single-channel input with channels=1 writes one byte per pixel. Three or four channel input writes interleaved bytes.

Parameters
srcNormalised float span, values in [0, 1].
dstOutput span, size must equal src.size().

Definition at line 95 of file DataUtils.cpp.

96{
97 Parallel::transform(Parallel::par_unseq, src.begin(), src.end(), dst.begin(),
98 [](float v) {
99 return static_cast<uint8_t>(std::clamp(v * 255.0F, 0.0F, 255.0F));
100 });
101}

Referenced by denormalise_to_uint8().

+ Here is the caller graph for this function: