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

◆ blend_frames()

MAYAFLUX_API bool MayaFlux::Kakshya::blend_frames ( ImageFormat  format,
std::span< const uint8_t >  a,
std::span< const uint8_t >  b,
uint8_t *  out,
double  weight 
)

Linearly blend two frames of the same size and format.

Works on 8-bit and 32-bit float storage. Returns false, leaving out untouched, for any other element size or when the frames differ in size.

Parameters
formatPixel format of both frames.
aFrame at weight 0.
bFrame at weight 1.
outDestination for a.size() bytes.
weightBlend factor from a to b.
Returns
True if out holds the blend.

Definition at line 135 of file PixelStorage.cpp.

137{
138 if (a.size() != b.size()) {
139 return false;
140 }
141
142 switch (storage_element_size(format)) {
143 case 1:
144 blend_typed<uint8_t>(a, b, out, weight);
145 return true;
146 case 4:
147 blend_typed<float>(a, b, out, weight);
148 return true;
149 default:
150 return false;
151 }
152}
bool format
size_t a
double weight
size_t b
std::vector< float > * out

References a, b, format, out, storage_element_size(), and weight.

Referenced by MayaFlux::Kriya::Chimera::feed(), and MayaFlux::Kakshya::FrameSeekProcessor::process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: