Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

template<class ArrayT, class RgbT>
void Impala::Core::Array::Pattern::FuncRgbOp ( ArrayT *  src,
UInt8 *  pixels,
int  resWidth,
int  resHeight,
Geometry::GeoIntType  gi,
RgbT &  rgb 
)

Function for RgbOp2d template <class DataPtrT, class RgbT> void FuncRgbOp2d(DataPtrT imPtr, Sizes imSize, int* pixels, int resWidth, int resHeight, Geometry::GeoIntType gi, RgbT& rgb) { int width = imSize.x(); int height = imSize.y();.

if (((resWidth == -1) && (resHeight == -1)) || ((resWidth == width) && (resHeight == height))) { int nPix = width * height; DataPtrT p = imPtr; while (--nPix >= 0) { pixels++ = rgb.DoIt(p.read()); p.incX(); } return; }

double sx = (double) width / resWidth; double sy = (double) height / resHeight; if (gi == NEAREST) { for (int y=0 ; y<resHeight ; y++) { for (int x=0 ; x<resWidth ; x++) { DataPtrT p = imPtr; p.incXYZ((int) (sx * x + 0.5), (int) (sy * y + 0.5), 0); pixels++ = rgb.DoIt(p.read()); } } return; }

typedef typename RgbT::ArithTypeDouble ArithTypeDouble; ArithTypeDouble result; for (int y=0 ; y<resHeight ; y++) { for (int x=0 ; x<resWidth ; x++) { result = Func2dSample(imPtr, result, sx * x, sy * y, 0, gi); pixels++ = rgb.DoItDouble(result); } } }

Definition at line 64 of file FuncRgbOp.h.

References ArrayCH(), ArrayCPB(), ArrayCW(), and PtrRead().

Referenced by PatRgbOp().

00066 {
00067     typedef typename ArrayT::StorType StorT;
00068     typedef typename ArrayT::ArithType ArithT;
00069 
00070     int width = ArrayCW(src);
00071     int height = ArrayCH(src);
00072 
00073     if (((resWidth == -1) && (resHeight == -1)) ||
00074                 ((resWidth == width) && (resHeight == height)))
00075     {
00076         for (int y=0 ; y<height ; y++)
00077         {
00078             StorT* sPtr = ArrayCPB(src, 0, y);
00079             for (int x=0 ; x<width ; x++)
00080             {
00081                 rgb.DoIt(PtrRead(sPtr, ArithT()), pixels);
00082                 sPtr += ArrayT::ElemSize();
00083                 pixels += 3;
00084             }
00085         }
00086         return;
00087     }
00088     /*
00089     double sx = (double) width / resWidth;
00090     double sy = (double) height / resHeight;
00091     if (gi == NEAREST) {
00092         for (int y=0 ; y<resHeight ; y++) {
00093             for (int x=0 ; x<resWidth ; x++) {
00094                 DataPtrT p = imPtr;
00095                 p.incXYZ((int) (sx * x + 0.5), (int) (sy * y + 0.5), 0);
00096                 *pixels++ = rgb.DoIt(p.read());
00097             }
00098         }
00099         return;
00100     }
00101 
00102     typedef typename RgbT::ArithTypeDouble ArithTypeDouble;
00103     ArithTypeDouble result;
00104     for (int y=0 ; y<resHeight ; y++) {
00105         for (int x=0 ; x<resWidth ; x++) {
00106             result = Func2dSample(imPtr, result, sx * x, sy * y, 0, gi);
00107             *pixels++ = rgb.DoItDouble(result);
00108         }
00109     }
00110     */
00111 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:01:46 2010 for ImpalaSrc by  doxygen 1.5.1