Cirrus Logic CS485 Dokumentacja Strona 106

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 319
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 105
Intel
®
Image Processing Library Reference Manual
4-52
4
Example 4-9 Converting a DIB Image Into an IplImage (continued)
dibh->biCompression = BI_RGB;
dibh->biSizeImage = size;
dibh->biClrUsed = 256;
dibh->biClrImportant = 0;
// fill in colors of the bitmap
for( i=0; i<256; i++)
rgb[i].rgbBlue = rgb[i].rgbGreen = rgb[i].rgbRed=
(unsigned char)i;
// set the bitmap data
for( i=0; i<WIDTH*HEIGHT; i++)
data[i] = (unsigned char)(100 + i);
// create header of the desired image
img = iplCreateImageHeader( 1,0, IPL_DEPTH_16U,
"GRAY", "GRAY", IPL_DATA_ORDER_PIXEL,
IPL_ORIGIN_BL, // bottom left as in DIB
IPL_ALIGN_QWORD, WIDTH, HEIGHT, NULL, NULL, NULL,
NULL);
if( NULL == img ) return 0;
// create ipl image converting 8u to 16u
iplConvertFromDIB ( dibh, img );
if( !img->imageData ) return 0;
}
__finally {
if( dib ) free( dib );
iplDeallocate(img,IPL_IMAGE_HEADER|IPL_IMAGE_DATA);
}
return IPL_StsOk == iplGetErrStatus();
}
As necessary, the conversion result is saturated.
Przeglądanie stron 105
1 2 ... 101 102 103 104 105 106 107 108 109 110 111 ... 318 319

Komentarze do niniejszej Instrukcji

Brak uwag