MCPcopy Create free account
hub / github.com/creatale/node-dv / cvtScaleAbs_

Function cvtScaleAbs_

deps/opencv/modules/core/src/convert.cpp:589–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587{
588
589template<typename T, typename DT, typename WT> static void
590cvtScaleAbs_( const T* src, size_t sstep,
591 DT* dst, size_t dstep, Size size,
592 WT scale, WT shift )
593{
594 sstep /= sizeof(src[0]);
595 dstep /= sizeof(dst[0]);
596
597 for( ; size.height--; src += sstep, dst += dstep )
598 {
599 int x = 0;
600 #if CV_ENABLE_UNROLLED
601 for( ; x <= size.width - 4; x += 4 )
602 {
603 DT t0, t1;
604 t0 = saturate_cast<DT>(std::abs(src[x]*scale + shift));
605 t1 = saturate_cast<DT>(std::abs(src[x+1]*scale + shift));
606 dst[x] = t0; dst[x+1] = t1;
607 t0 = saturate_cast<DT>(std::abs(src[x+2]*scale + shift));
608 t1 = saturate_cast<DT>(std::abs(src[x+3]*scale + shift));
609 dst[x+2] = t0; dst[x+3] = t1;
610 }
611 #endif
612 for( ; x < size.width; x++ )
613 dst[x] = saturate_cast<DT>(std::abs(src[x]*scale + shift));
614 }
615}
616
617
618template<typename T, typename DT, typename WT> static void

Callers

nothing calls this directly

Calls 1

absFunction · 0.70

Tested by

no test coverage detected