void Revert(Im2D_U_INT1 anIm) { for (INT y=0; y<anIm.ty() ; y++) for (INT x1=0,x2 =anIm.tx()-1; x1<x2 ;x1++,x2-- ) ElSwap(anIm.data()[y][x1],anIm.data()[y][x2]); }
void drawPoint(Im2D_U_INT1 &aImage, const Pt2dr &aPoint, U_INT1 aValue, unsigned int aSize) { const int sizei = (int)aSize; int x = round_ni(aPoint.x), y = round_ni(aPoint.y); if (x < 0 || x >= aImage.tx() || y < 0 || y >= aImage.ty()) { ELISE_WARNING("point (" << x << ',' << y << ") out of rectangle " << aImage.sz()); return; } drawPoint(aImage, x, y, aValue); for (int j = -sizei; j <= sizei; j++) for (int i = -sizei; i < sizei; i++) { drawPoint(aImage, x + i, y + j, aValue); } }
void bench_fr_front_to_surf ( Flux_Pts front, Im2D_U_INT1 i0, Neighbourhood v ) { Pt2di sz (i0.tx(),i0.ty()); Im2D_U_INT1 i1(sz.x,sz.y,0); ELISE_COPY(i0.all_pts(),i0.in(),i1.out()); ELISE_COPY ( dilate ( select ( i1.all_pts(), i1.in()==1 ), sel_func(v,i1.in()==0) ), 2, i1.out() ); ELISE_COPY(front,2,i0.out()); INT dif; ELISE_COPY ( i1.all_pts(), Abs(i1.in()-i0.in()), sigma(dif) ); BENCH_ASSERT(dif == 0); }
void drawPoint(Im2D_U_INT1 &aImage, int aX, int aY, U_INT1 aValue) { if (aX >=0 && aX < aImage.tx() && aY >= 0 && aY < aImage.ty()) aImage.data()[aY][aX] = aValue; }