MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / div_image

Function div_image

example_transcoding/utils.cpp:463–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463static void div_image(const imagef& src1, const imagef& src2, imagef& dst, const vec4F& scale)
464{
465 dst.resize(src1);
466
467//#pragma omp parallel for
468 for (int y = 0; y < (int)dst.get_height(); y++)
469 {
470 for (uint32_t x = 0; x < dst.get_width(); x++)
471 {
472 const vec4F& s1 = src1(x, y);
473 const vec4F& s2 = src2(x, y);
474
475 vec4F d;
476
477 for (uint32_t c = 0; c < 4; c++)
478 {
479 float v = s2[c];
480 if (v == 0.0f)
481 d[c] = 0.0f;
482 else
483 d[c] = (s1[c] * scale[c]) / v;
484 }
485
486 dst(x, y) = d;
487 }
488 }
489}
490
491static vec4F avg_image(const imagef& src)
492{

Callers 1

compute_ssimFunction · 0.70

Calls 3

resizeMethod · 0.45
get_heightMethod · 0.45
get_widthMethod · 0.45

Tested by

no test coverage detected