Definition at line 65 of file Grid.h. References BYTE, mCol, mRow, and Impala::Core::Array::WritePng(). Referenced by Impala::Core::Feature::Color64::ComputeGrid(). 00066 { 00067 String fileName; 00068 00069 #ifdef __BITMAP_FUNC__ 00070 //Core::Feature::Bitmap bitmap; 00071 //bitmap.SaveRgb2BitmapFile("rgb_00.bmp", im, nWidth, nHeight); 00072 00073 Array::Array2dVec3UInt8* buf = Array::ArrayCreate<Array::Array2dVec3UInt8> 00074 (nWidth, nHeight, 0, 0, im, true); 00075 fileName = "rgb_00.png"; 00076 Core::Array::WritePng(buf, fileName, vs->GetDatabase()); 00077 #endif 00078 00079 //-------------- 00080 // 1 | 2 00081 //-------------- 00082 // 3 | 4 00083 //-------------- 00084 for (int x=0; x<mRow; x++) 00085 { 00086 for (int y=0; y<mCol; y++) 00087 { 00088 int nFrameWidth = nWidth; 00089 int nFrameHeight = nHeight; 00090 00091 int nGridWidth = nWidth/mCol; 00092 int nGridHeight = nHeight/mRow; 00093 00094 int idx = y+x*mCol; 00095 00096 BYTE* cur_buf = buf_list[idx]; 00097 // process each row of the buffer 00098 for (int j=0; j<nGridHeight; j++) 00099 { 00100 int nCurSize = nGridWidth*3*sizeof(BYTE); 00101 00102 //memcpy(cur_buf + j*nGridWidth*3, im + j*nFrameWidth*3, nCurSize); 00103 BYTE* dst = cur_buf + j*nGridWidth*3; 00104 //BYTE* src = im + j*nFrameWidth*3 + (nGridWidth*3*y+x*nGridWidth*nGridHeight*3*2); 00105 int nFrameRowOffset1 = (nGridHeight * x) * nFrameWidth * 3; // three entry points 00106 int nFrameRowOffset2 = j * nFrameWidth * 3; // within one grid row 00107 int nFrameColOffset = nGridWidth * y * 3; // in column dimension 00108 00109 int nOffset = nFrameRowOffset1 + nFrameRowOffset2 + nFrameColOffset; 00110 BYTE* src = im + nOffset; 00111 memcpy(dst, src, nCurSize); 00112 } 00113 00114 //verificatiion of the buffers 00115 #ifdef __BITMAP_FUNC__ 00116 String idxStr; 00117 char index[128]; 00118 itoa(idx+1,index,10); 00119 idxStr = index; 00120 fileName = "rgb_grid_0" + idxStr + ".bmp"; 00121 00122 //Core::Feature::Bitmap bitmap; 00123 //bitmap.SaveRgb2BitmapFile(fileName.c_str(), cur_buf, nGridWidth, nGridHeight); 00124 00125 Array::Array2dVec3UInt8* sc = Array::ArrayCreate<Array::Array2dVec3UInt8> 00126 (nGridWidth, nGridHeight, 0, 0, cur_buf, true); 00127 fileName = "rgb_grid_0" + idxStr + ".png"; 00128 Core::Array::WritePng(sc, fileName, vs->GetDatabase()); 00129 #endif 00130 } 00131 } 00132 00133 }
Here is the call graph for this function:
|