Lines Matching refs:dib_info

462     dib_info;  in ReadDIBImage()  local
521 (void) memset(&dib_info,0,sizeof(dib_info)); in ReadDIBImage()
522 dib_info.size=ReadBlobLSBLong(image); in ReadDIBImage()
523 if (dib_info.size != 40) in ReadDIBImage()
528 dib_info.width=ReadBlobLSBSignedLong(image); in ReadDIBImage()
529 dib_info.height=ReadBlobLSBSignedLong(image); in ReadDIBImage()
530 dib_info.planes=ReadBlobLSBShort(image); in ReadDIBImage()
531 dib_info.bits_per_pixel=ReadBlobLSBShort(image); in ReadDIBImage()
532 if (dib_info.bits_per_pixel > 32) in ReadDIBImage()
534 dib_info.compression=ReadBlobLSBLong(image); in ReadDIBImage()
535 dib_info.image_size=ReadBlobLSBLong(image); in ReadDIBImage()
536 dib_info.x_pixels=ReadBlobLSBLong(image); in ReadDIBImage()
537 dib_info.y_pixels=ReadBlobLSBLong(image); in ReadDIBImage()
538 dib_info.number_colors=ReadBlobLSBLong(image); in ReadDIBImage()
539 dib_info.colors_important=ReadBlobLSBLong(image); in ReadDIBImage()
540 if ((dib_info.bits_per_pixel != 1) && (dib_info.bits_per_pixel != 4) && in ReadDIBImage()
541 (dib_info.bits_per_pixel != 8) && (dib_info.bits_per_pixel != 16) && in ReadDIBImage()
542 (dib_info.bits_per_pixel != 24) && (dib_info.bits_per_pixel != 32)) in ReadDIBImage()
544 if ((dib_info.compression == BI_BITFIELDS) && in ReadDIBImage()
545 ((dib_info.bits_per_pixel == 16) || (dib_info.bits_per_pixel == 32))) in ReadDIBImage()
547 dib_info.red_mask=(unsigned short) ReadBlobLSBLong(image); in ReadDIBImage()
548 dib_info.green_mask=(unsigned short) ReadBlobLSBLong(image); in ReadDIBImage()
549 dib_info.blue_mask=(unsigned short) ReadBlobLSBLong(image); in ReadDIBImage()
553 if (dib_info.width <= 0) in ReadDIBImage()
555 if (dib_info.height == 0) in ReadDIBImage()
557 if (dib_info.planes != 1) in ReadDIBImage()
559 if ((dib_info.bits_per_pixel != 1) && (dib_info.bits_per_pixel != 4) && in ReadDIBImage()
560 (dib_info.bits_per_pixel != 8) && (dib_info.bits_per_pixel != 16) && in ReadDIBImage()
561 (dib_info.bits_per_pixel != 24) && (dib_info.bits_per_pixel != 32)) in ReadDIBImage()
563 if ((dib_info.bits_per_pixel < 16) && in ReadDIBImage()
564 (dib_info.number_colors > (unsigned int) (1UL << dib_info.bits_per_pixel))) in ReadDIBImage()
566 if ((dib_info.compression == 1) && (dib_info.bits_per_pixel != 8)) in ReadDIBImage()
568 if ((dib_info.compression == 2) && (dib_info.bits_per_pixel != 4)) in ReadDIBImage()
570 if ((dib_info.compression == 3) && (dib_info.bits_per_pixel < 16)) in ReadDIBImage()
572 switch (dib_info.compression) in ReadDIBImage()
586 image->columns=(size_t) MagickAbsoluteValue((ssize_t) dib_info.width); in ReadDIBImage()
587 image->rows=(size_t) MagickAbsoluteValue((ssize_t) dib_info.height); in ReadDIBImage()
589 image->alpha_trait=dib_info.bits_per_pixel == 32 ? BlendPixelTrait : in ReadDIBImage()
591 if ((dib_info.number_colors > 256) || (dib_info.colors_important > 256)) in ReadDIBImage()
593 if ((dib_info.number_colors != 0) && (dib_info.bits_per_pixel > 8)) in ReadDIBImage()
595 if ((dib_info.image_size != 0U) && (dib_info.image_size > GetBlobSize(image))) in ReadDIBImage()
597 if ((dib_info.number_colors != 0) || (dib_info.bits_per_pixel < 8)) in ReadDIBImage()
603 image->colors=dib_info.number_colors; in ReadDIBImage()
606 image->colors=one << dib_info.bits_per_pixel; in ReadDIBImage()
666 if (dib_info.compression == BI_RLE4) in ReadDIBImage()
667 dib_info.bits_per_pixel<<=1; in ReadDIBImage()
668 bytes_per_line=4*((image->columns*dib_info.bits_per_pixel+31)/32); in ReadDIBImage()
677 if ((dib_info.compression == BI_RGB) || in ReadDIBImage()
678 (dib_info.compression == BI_BITFIELDS)) in ReadDIBImage()
692 status=DecodeImage(image,dib_info.compression ? MagickTrue : MagickFalse, in ReadDIBImage()
705 image->resolution.x=(double) dib_info.x_pixels/100.0; in ReadDIBImage()
706 image->resolution.y=(double) dib_info.y_pixels/100.0; in ReadDIBImage()
710 switch (dib_info.bits_per_pixel) in ReadDIBImage()
805 if ((dib_info.compression == BI_RLE8) || in ReadDIBImage()
806 (dib_info.compression == BI_RLE4)) in ReadDIBImage()
843 if (dib_info.compression == BI_RLE8) in ReadDIBImage()
855 if (dib_info.red_mask == 0) in ReadDIBImage()
970 if (dib_info.height < 0) in ReadDIBImage()
1095 dib_info; in WriteDIBImage() local
1146 dib_info.number_colors=0; in WriteDIBImage()
1147 dib_info.bits_per_pixel=(unsigned short) (image->alpha_trait ? 32 : 24); in WriteDIBImage()
1154 dib_info.bits_per_pixel=8; in WriteDIBImage()
1156 dib_info.bits_per_pixel=16; in WriteDIBImage()
1158 dib_info.bits_per_pixel=1; in WriteDIBImage()
1159 dib_info.number_colors=(unsigned int) (dib_info.bits_per_pixel == 16 ? 0 : in WriteDIBImage()
1160 (1UL << dib_info.bits_per_pixel)); in WriteDIBImage()
1162 bytes_per_line=4*((image->columns*dib_info.bits_per_pixel+31)/32); in WriteDIBImage()
1163 dib_info.size=40; in WriteDIBImage()
1164 dib_info.width=(int) image->columns; in WriteDIBImage()
1165 dib_info.height=(int) image->rows; in WriteDIBImage()
1166 dib_info.planes=1; in WriteDIBImage()
1167 dib_info.compression=(unsigned int) (dib_info.bits_per_pixel == 16 ? in WriteDIBImage()
1169 dib_info.image_size=(unsigned int) (bytes_per_line*image->rows); in WriteDIBImage()
1170 dib_info.x_pixels=75*39; in WriteDIBImage()
1171 dib_info.y_pixels=75*39; in WriteDIBImage()
1177 dib_info.x_pixels=(unsigned int) (100.0*image->resolution.x/2.54); in WriteDIBImage()
1178 dib_info.y_pixels=(unsigned int) (100.0*image->resolution.y/2.54); in WriteDIBImage()
1183 dib_info.x_pixels=(unsigned int) (100.0*image->resolution.x); in WriteDIBImage()
1184 dib_info.y_pixels=(unsigned int) (100.0*image->resolution.y); in WriteDIBImage()
1188 dib_info.colors_important=dib_info.number_colors; in WriteDIBImage()
1196 (void) memset(pixels,0,dib_info.image_size); in WriteDIBImage()
1197 switch (dib_info.bits_per_pixel) in WriteDIBImage()
1322 if (dib_info.bits_per_pixel == 24) in WriteDIBImage()
1333 if (dib_info.bits_per_pixel == 8) in WriteDIBImage()
1350 dib_info.image_size=(unsigned int) EncodeImage(image,bytes_per_line, in WriteDIBImage()
1354 dib_info.compression = BI_RLE8; in WriteDIBImage()
1359 (void) WriteBlobLSBLong(image,dib_info.size); in WriteDIBImage()
1360 (void) WriteBlobLSBLong(image,(unsigned int) dib_info.width); in WriteDIBImage()
1361 (void) WriteBlobLSBLong(image,(unsigned int) dib_info.height); in WriteDIBImage()
1362 (void) WriteBlobLSBShort(image,(unsigned short) dib_info.planes); in WriteDIBImage()
1363 (void) WriteBlobLSBShort(image,dib_info.bits_per_pixel); in WriteDIBImage()
1364 (void) WriteBlobLSBLong(image,dib_info.compression); in WriteDIBImage()
1365 (void) WriteBlobLSBLong(image,dib_info.image_size); in WriteDIBImage()
1366 (void) WriteBlobLSBLong(image,dib_info.x_pixels); in WriteDIBImage()
1367 (void) WriteBlobLSBLong(image,dib_info.y_pixels); in WriteDIBImage()
1368 (void) WriteBlobLSBLong(image,dib_info.number_colors); in WriteDIBImage()
1369 (void) WriteBlobLSBLong(image,dib_info.colors_important); in WriteDIBImage()
1372 if (dib_info.bits_per_pixel <= 8) in WriteDIBImage()
1381 (1UL << dib_info.bits_per_pixel),4*sizeof(*dib_colormap)); in WriteDIBImage()
1388 for (i=0; i < (ssize_t) MagickMin(image->colors,dib_info.number_colors); i++) in WriteDIBImage()
1395 for ( ; i < (ssize_t) (1L << dib_info.bits_per_pixel); i++) in WriteDIBImage()
1402 (void) WriteBlob(image,(size_t) (4*(1 << dib_info.bits_per_pixel)), in WriteDIBImage()
1407 if ((dib_info.bits_per_pixel == 16) && in WriteDIBImage()
1408 (dib_info.compression == BI_BITFIELDS)) in WriteDIBImage()
1415 (void) WriteBlob(image,dib_info.image_size,pixels); in WriteDIBImage()