MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / alphaBlend

Function alphaBlend

examples/image_processing/image_editing.cpp:66–70  ·  view source on GitHub ↗

* a - foregound image * b - background image * mask - mask map * */

Source from the content-addressed store, hash-verified

64 * mask - mask map
65 * */
66array alphaBlend(const array &a, const array &b, const array &mask) {
67 array tiledMask;
68 if (mask.dims(2) != a.dims(2)) tiledMask = tile(mask, 1, 1, a.dims(2));
69 return a * tiledMask + (1.0f - tiledMask) * b;
70}
71
72void normalizeImage(array &in) {
73 float min = af::min<float>(in);

Callers 1

mainFunction · 0.85

Calls 2

tileFunction · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected