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

void Impala::Core::Feature::Grid::RetrievalGridBuffers ( BYTE *  im,
BYTE **  buf_list,
int  nWidth,
int  nHeight 
) [inline]

Definition at line 50 of file Grid.h.

References BYTE, mCol, mRow, and Impala::Core::Feature::Bitmap::SaveRgb2BitmapFile().

Referenced by Impala::Core::Feature::Color64::ComputeGrid().

00051     {
00052 
00053 #ifdef __BITMAP_FUNC__
00054         Core::Feature::Bitmap bitmap;
00055         bitmap.SaveRgb2BitmapFile("rgb_00.bmp", im, nWidth, nHeight);
00056 #endif
00057 
00058         //--------------
00059         //   1   |   2
00060         //--------------
00061         //   3   |   4
00062         //--------------
00063         for (int x=0; x<mRow; x++)
00064         {
00065             for (int y=0; y<mCol; y++)
00066             {
00067                 int nFrameWidth = nWidth;
00068                 int nFrameHeight = nHeight;
00069 
00070                 int nGridWidth = nWidth/mCol;
00071                 int nGridHeight = nHeight/mRow;
00072 
00073                 int idx = y+x*mCol;
00074 
00075                 BYTE* cur_buf = buf_list[idx];
00076                 // process each row of the buffer
00077                 for (int j=0; j<nGridHeight; j++)
00078                 {
00079                     int nCurSize = nGridWidth*3*sizeof(BYTE);
00080 
00081                     //memcpy(cur_buf + j*nGridWidth*3, im + j*nFrameWidth*3, nCurSize);
00082                     BYTE* dst = cur_buf + j*nGridWidth*3;
00083                     //BYTE* src = im + j*nFrameWidth*3 + (nGridWidth*3*y+x*nGridWidth*nGridHeight*3*2);
00084                     int nFrameRowOffset1 = (nGridHeight * x) * nFrameWidth * 3; // three entry points
00085                     int nFrameRowOffset2 = j * nFrameWidth * 3;                 // within one grid row
00086                     int nFrameColOffset = nGridWidth * y * 3;                   // in column dimension   
00087                     
00088                     int nOffset = nFrameRowOffset1 + nFrameRowOffset2 + nFrameColOffset;
00089                     BYTE* src = im + nOffset;
00090                     memcpy(dst, src, nCurSize);
00091                 }
00092 
00093                 //verificatiion of the buffers
00094 #ifdef __BITMAP_FUNC__
00095                 String fileName, idxStr;
00096                 char index[128];
00097                 itoa(idx+1,index,10);
00098                 idxStr = index;
00099                 fileName = "rgb_grid_0" + idxStr + ".bmp";
00100 
00101                 Core::Feature::Bitmap bitmap;
00102                 bitmap.SaveRgb2BitmapFile(fileName.c_str(), cur_buf, nGridWidth, nGridHeight);
00103 #endif
00104             }
00105         }
00106 
00107     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:09:40 2010 for ImpalaSrc by  doxygen 1.5.1