Changeset 20858
- Timestamp:
- 10/06/08 23:09:47 (3 months ago)
- Location:
- lang/cpluspluscli/OpenCvSharp/trunk/OpenCvSharp
- Files:
-
- 2 added
- 2 modified
-
Extras.cpp (added)
-
Extras.h (added)
-
OpenCvSharp.vcproj (modified) (2 diffs)
-
WriteableBitmapConverter.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cpluspluscli/OpenCvSharp/trunk/OpenCvSharp/OpenCvSharp.vcproj
r20286 r20858 208 208 </File> 209 209 <File 210 RelativePath=".\Extras.cpp" 211 > 212 </File> 213 <File 210 214 RelativePath=".\OpenCV.cpp" 211 215 > … … 426 430 > 427 431 <File 432 RelativePath=".\Extras.h" 433 > 434 </File> 435 <File 428 436 RelativePath=".\ICvObject.h" 429 437 > -
lang/cpluspluscli/OpenCvSharp/trunk/OpenCvSharp/WriteableBitmapConverter.cpp
r17367 r20858 49 49 } 50 50 N::IplImage^ ipl = OpenCV::cvCreateImage(N::CvSize(w, h), (BitDepth)depth, channels); 51 byte* p = (byte*)(void*)ipl->ImageData; 52 51 53 52 // bpp1�͎��ƂŃR�s�[54 // 1bpp�͎��ƂŃR�s�[ 53 55 if (bpp == 1) { 54 56 // BitmapImage�̃f�[�^���R�s�[ 55 // �v�f1�ɉ�8�s�N�Z�����̃f�[�^������� 56 int stride = (w / 8) + 1; 57 array<Byte>^ pixels = gcnew array<Byte>(h * stride); 58 src->CopyPixels(pixels, stride, 0); 59 byte* p = (byte*)(void*)ipl->ImageData; 57 // �v�f1�ɉ�8�s�N�Z�����̃f�[�^������� 58 int stride = (w / 8) + 1; 59 array<Byte>^ pixels = gcnew array<Byte>(h * stride); 60 src->CopyPixels(pixels, stride, 0); 60 61 int offset = 0; 61 62 int x = 0; … … 86 87 x = 0; 87 88 } 88 89 // 8bpp 90 } else if(bpp == 8){ 91 int stride = w; 92 array<Byte>^ pixels = gcnew array<Byte>(h * stride); 93 src->CopyPixels(pixels, stride, 0); 94 for (int y=0; y<h; y++) { 95 for(int x=0; x<w; x++){ 96 p[ipl->WidthStep * y + x] = pixels[y * stride + x]; 97 } 98 } 89 99 } else { 90 100 int stride = w * ((bpp + 7) / 8); … … 164 174 } 165 175 dst->WritePixels(Int32Rect(0, 0, w, h), pixels, stride, 0); 166 } else { 176 177 /*} else if(bpp == 8){ 178 int stride = w; 179 array<Byte>^ pixels = gcnew array<Byte>(h * stride); 180 byte* p = (byte*)(void*)src->ImageData; 181 for (int y=0; y<h; y++) { 182 for(int x=0; x<w; x++){ 183 pixels[y * stride + x] = p[src->WidthStep * y + x]; 184 } 185 } 186 dst->WritePixels(Int32Rect(0, 0, w, h), pixels, stride, 0); 187 188 */} else { 167 189 dst->WritePixels(Int32Rect(0, 0, w, h), src->ImageData, src->ImageSize, src->WidthStep); 168 190 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)