Lines Matching defs:bmp_info

497     bmp_info;
561 (void) ResetMagickMemory(&bmp_info,0,sizeof(bmp_info));
562 bmp_info.ba_offset=0;
582 if (bmp_info.ba_offset == 0)
584 bmp_info.ba_offset=0;
587 bmp_info.file_size=ReadBlobLSBLong(image);
588 bmp_info.ba_offset=ReadBlobLSBLong(image);
589 bmp_info.offset_bits=ReadBlobLSBLong(image);
600 bmp_info.file_size=ReadBlobLSBLong(image);
602 bmp_info.offset_bits=ReadBlobLSBLong(image);
603 bmp_info.size=ReadBlobLSBLong(image);
606 bmp_info.size);
607 if (bmp_info.size == 12)
613 bmp_info.width=(ssize_t) ((short) ReadBlobLSBShort(image));
614 bmp_info.height=(ssize_t) ((short) ReadBlobLSBShort(image));
615 bmp_info.planes=ReadBlobLSBShort(image);
616 bmp_info.bits_per_pixel=ReadBlobLSBShort(image);
617 bmp_info.x_pixels=0;
618 bmp_info.y_pixels=0;
619 bmp_info.number_colors=0;
620 bmp_info.compression=BI_RGB;
621 bmp_info.image_size=0;
622 bmp_info.alpha_mask=0;
628 " Geometry: %.20gx%.20g",(double) bmp_info.width,(double)
629 bmp_info.height);
637 if (bmp_info.size < 40)
639 bmp_info.width=(ssize_t) ReadBlobLSBSignedLong(image);
640 bmp_info.height=(ssize_t) ReadBlobLSBSignedLong(image);
641 bmp_info.planes=ReadBlobLSBShort(image);
642 bmp_info.bits_per_pixel=ReadBlobLSBShort(image);
643 bmp_info.compression=ReadBlobLSBLong(image);
644 bmp_info.image_size=ReadBlobLSBLong(image);
645 bmp_info.x_pixels=ReadBlobLSBLong(image);
646 bmp_info.y_pixels=ReadBlobLSBLong(image);
647 bmp_info.number_colors=ReadBlobLSBLong(image);
648 bmp_info.colors_important=ReadBlobLSBLong(image);
656 " Geometry: %.20gx%.20g",(double) bmp_info.width,(double)
657 bmp_info.height);
659 " Bits per pixel: %.20g",(double) bmp_info.bits_per_pixel);
660 switch ((int) bmp_info.compression)
701 " Compression: UNKNOWN (%lu)",bmp_info.compression);
705 " Number of colors: %lu",bmp_info.number_colors);
707 bmp_info.red_mask=ReadBlobLSBLong(image);
708 bmp_info.green_mask=ReadBlobLSBLong(image);
709 bmp_info.blue_mask=ReadBlobLSBLong(image);
710 if (bmp_info.size > 40)
718 bmp_info.alpha_mask=ReadBlobLSBLong(image);
719 bmp_info.colorspace=ReadBlobLSBSignedLong(image);
724 bmp_info.red_primary.x=(double) ReadBlobLSBLong(image)/BMP_DENOM;
725 bmp_info.red_primary.y=(double) ReadBlobLSBLong(image)/BMP_DENOM;
726 bmp_info.red_primary.z=(double) ReadBlobLSBLong(image)/BMP_DENOM;
727 bmp_info.green_primary.x=(double) ReadBlobLSBLong(image)/BMP_DENOM;
728 bmp_info.green_primary.y=(double) ReadBlobLSBLong(image)/BMP_DENOM;
729 bmp_info.green_primary.z=(double) ReadBlobLSBLong(image)/BMP_DENOM;
730 bmp_info.blue_primary.x=(double) ReadBlobLSBLong(image)/BMP_DENOM;
731 bmp_info.blue_primary.y=(double) ReadBlobLSBLong(image)/BMP_DENOM;
732 bmp_info.blue_primary.z=(double) ReadBlobLSBLong(image)/BMP_DENOM;
734 gamma=bmp_info.red_primary.x+bmp_info.red_primary.y+
735 bmp_info.red_primary.z;
737 bmp_info.red_primary.x*=gamma;
738 bmp_info.red_primary.y*=gamma;
739 image->chromaticity.red_primary.x=bmp_info.red_primary.x;
740 image->chromaticity.red_primary.y=bmp_info.red_primary.y;
742 gamma=bmp_info.green_primary.x+bmp_info.green_primary.y+
743 bmp_info.green_primary.z;
745 bmp_info.green_primary.x*=gamma;
746 bmp_info.green_primary.y*=gamma;
747 image->chromaticity.green_primary.x=bmp_info.green_primary.x;
748 image->chromaticity.green_primary.y=bmp_info.green_primary.y;
750 gamma=bmp_info.blue_primary.x+bmp_info.blue_primary.y+
751 bmp_info.blue_primary.z;
753 bmp_info.blue_primary.x*=gamma;
754 bmp_info.blue_primary.y*=gamma;
755 image->chromaticity.blue_primary.x=bmp_info.blue_primary.x;
756 image->chromaticity.blue_primary.y=bmp_info.blue_primary.y;
761 bmp_info.gamma_scale.x=(double) ReadBlobLSBLong(image)/0x10000;
762 bmp_info.gamma_scale.y=(double) ReadBlobLSBLong(image)/0x10000;
763 bmp_info.gamma_scale.z=(double) ReadBlobLSBLong(image)/0x10000;
767 image->gamma=(bmp_info.gamma_scale.x+bmp_info.gamma_scale.y+
768 bmp_info.gamma_scale.z)/3.0;
773 if (bmp_info.size > 108)
812 if ((MagickSizeType) bmp_info.file_size > GetBlobSize(image))
816 if ((MagickSizeType) bmp_info.file_size < GetBlobSize(image))
820 if (bmp_info.width <= 0)
822 if (bmp_info.height == 0)
824 if (bmp_info.planes != 1)
826 if ((bmp_info.bits_per_pixel != 1) && (bmp_info.bits_per_pixel != 4) &&
827 (bmp_info.bits_per_pixel != 8) && (bmp_info.bits_per_pixel != 16) &&
828 (bmp_info.bits_per_pixel != 24) && (bmp_info.bits_per_pixel != 32))
830 if (bmp_info.bits_per_pixel < 16 &&
831 bmp_info.number_colors > (1U << bmp_info.bits_per_pixel))
833 if ((bmp_info.compression == 1) && (bmp_info.bits_per_pixel != 8))
835 if ((bmp_info.compression == 2) && (bmp_info.bits_per_pixel != 4))
837 if ((bmp_info.compression == 3) && (bmp_info.bits_per_pixel < 16))
839 switch (bmp_info.compression)
857 image->columns=(size_t) MagickAbsoluteValue(bmp_info.width);
858 image->rows=(size_t) MagickAbsoluteValue(bmp_info.height);
859 image->depth=bmp_info.bits_per_pixel <= 8 ? bmp_info.bits_per_pixel : 8;
860 image->alpha_trait=((bmp_info.alpha_mask != 0) &&
861 (bmp_info.compression == BI_BITFIELDS)) ? BlendPixelTrait :
863 if (bmp_info.bits_per_pixel < 16)
869 image->colors=bmp_info.number_colors;
872 image->colors=one << bmp_info.bits_per_pixel;
894 if ((bmp_info.size == 12) || (bmp_info.size == 64))
898 offset=SeekBlob(image,start_position+14+bmp_info.size,SEEK_SET);
915 image->resolution.x=(double) bmp_info.x_pixels/100.0;
916 image->resolution.y=(double) bmp_info.y_pixels/100.0;
927 offset=SeekBlob(image,start_position+bmp_info.offset_bits,SEEK_SET);
930 if (bmp_info.compression == BI_RLE4)
931 bmp_info.bits_per_pixel<<=1;
932 bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32);
939 if ((bmp_info.compression == BI_RGB) ||
940 (bmp_info.compression == BI_BITFIELDS))
958 status=DecodeImage(image,bmp_info.compression,pixels);
969 if (bmp_info.compression == BI_RGB)
978 if ((image->alpha_trait == UndefinedPixelTrait) && (bmp_info.size == 40) &&
979 (bmp_info.bits_per_pixel == 32))
997 bmp_info.alpha_mask=image->alpha_trait != UndefinedPixelTrait ?
999 bmp_info.red_mask=0x00ff0000U;
1000 bmp_info.green_mask=0x0000ff00U;
1001 bmp_info.blue_mask=0x000000ffU;
1002 if (bmp_info.bits_per_pixel == 16)
1007 bmp_info.red_mask=0x00007c00U;
1008 bmp_info.green_mask=0x000003e0U;
1009 bmp_info.blue_mask=0x0000001fU;
1014 if ((bmp_info.bits_per_pixel == 16) || (bmp_info.bits_per_pixel == 32))
1022 if (bmp_info.red_mask != 0)
1023 while (((bmp_info.red_mask << shift.red) & 0x80000000UL) == 0)
1025 if (bmp_info.green_mask != 0)
1026 while (((bmp_info.green_mask << shift.green) & 0x80000000UL) == 0)
1028 if (bmp_info.blue_mask != 0)
1029 while (((bmp_info.blue_mask << shift.blue) & 0x80000000UL) == 0)
1031 if (bmp_info.alpha_mask != 0)
1032 while (((bmp_info.alpha_mask << shift.alpha) & 0x80000000UL) == 0)
1035 while (((bmp_info.red_mask << sample) & 0x80000000UL) != 0)
1039 while (((bmp_info.green_mask << sample) & 0x80000000UL) != 0)
1043 while (((bmp_info.blue_mask << sample) & 0x80000000UL) != 0)
1047 while (((bmp_info.alpha_mask << sample) & 0x80000000UL) != 0)
1051 switch (bmp_info.bits_per_pixel)
1146 if ((bmp_info.compression == BI_RLE8) ||
1147 (bmp_info.compression == BI_RLE4))
1186 if (bmp_info.compression != BI_RGB &&
1187 bmp_info.compression != BI_BITFIELDS)
1205 red=((pixel & bmp_info.red_mask) << shift.red) >> 16;
1210 green=((pixel & bmp_info.green_mask) << shift.green) >> 16;
1217 blue=((pixel & bmp_info.blue_mask) << shift.blue) >> 16;
1228 alpha=((pixel & bmp_info.alpha_mask) << shift.alpha) >> 16;
1287 if ((bmp_info.compression != BI_RGB) &&
1288 (bmp_info.compression != BI_BITFIELDS))
1311 red=((pixel & bmp_info.red_mask) << shift.red) >> 16;
1314 green=((pixel & bmp_info.green_mask) << shift.green) >> 16;
1317 blue=((pixel & bmp_info.blue_mask) << shift.blue) >> 16;
1326 alpha=((pixel & bmp_info.alpha_mask) << shift.alpha) >> 16;
1362 if (bmp_info.height < 0)
1385 if (bmp_info.ba_offset != 0)
1387 offset=SeekBlob(image,(MagickOffsetType) bmp_info.ba_offset,SEEK_SET);
1526 bmp_info;
1607 (void) ResetMagickMemory(&bmp_info,0,sizeof(bmp_info));
1608 bmp_info.file_size=14+12;
1610 bmp_info.file_size+=28;
1611 bmp_info.offset_bits=bmp_info.file_size;
1612 bmp_info.compression=BI_RGB;
1620 bmp_info.bits_per_pixel=8;
1622 bmp_info.bits_per_pixel=1;
1625 bmp_info.bits_per_pixel=4;
1628 bmp_info.bits_per_pixel=8;
1630 bmp_info.bits_per_pixel=8;
1631 bmp_info.number_colors=1U << bmp_info.bits_per_pixel;
1635 if ((size_t) bmp_info.number_colors < image->colors)
1639 bmp_info.file_size+=3*(1UL << bmp_info.bits_per_pixel);
1640 bmp_info.offset_bits+=3*(1UL << bmp_info.bits_per_pixel);
1643 bmp_info.file_size+=(1UL << bmp_info.bits_per_pixel);
1644 bmp_info.offset_bits+=(1UL << bmp_info.bits_per_pixel);
1653 bmp_info.number_colors=0;
1654 bmp_info.bits_per_pixel=(unsigned short)
1656 bmp_info.compression=(unsigned int) ((type > 3) &&
1662 bmp_info.bits_per_pixel=32;
1665 bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32);
1666 bmp_info.ba_offset=0;
1672 bmp_info.size=12;
1678 bmp_info.size=40;
1685 bmp_info.size=108;
1690 bmp_info.size=124;
1693 bmp_info.file_size+=extra_size;
1694 bmp_info.offset_bits+=extra_size;
1696 bmp_info.width=(ssize_t) image->columns;
1697 bmp_info.height=(ssize_t) image->rows;
1698 bmp_info.planes=1;
1699 bmp_info.image_size=(unsigned int) (bytes_per_line*image->rows);
1700 bmp_info.file_size+=bmp_info.image_size;
1701 bmp_info.x_pixels=75*39;
1702 bmp_info.y_pixels=75*39;
1708 bmp_info.x_pixels=(unsigned int) (100.0*image->resolution.x/2.54);
1709 bmp_info.y_pixels=(unsigned int) (100.0*image->resolution.y/2.54);
1714 bmp_info.x_pixels=(unsigned int) (100.0*image->resolution.x);
1715 bmp_info.y_pixels=(unsigned int) (100.0*image->resolution.y);
1719 bmp_info.colors_important=bmp_info.number_colors;
1723 pixel_info=AcquireVirtualMemory((size_t) bmp_info.image_size,
1728 (void) ResetMagickMemory(pixels,0,(size_t) bmp_info.image_size);
1729 switch (bmp_info.bits_per_pixel)
1921 if ((type > 2) && (bmp_info.bits_per_pixel == 8))
1938 bmp_info.file_size-=bmp_info.image_size;
1939 bmp_info.image_size=(unsigned int) EncodeImage(image,bytes_per_line,
1941 bmp_info.file_size+=bmp_info.image_size;
1945 bmp_info.compression=BI_RLE8;
1969 " BMP bits_per_pixel=%.20g",(double) bmp_info.bits_per_pixel);
1970 switch ((int) bmp_info.compression)
1993 " Compression=UNKNOWN (%lu)",bmp_info.compression);
1997 if (bmp_info.number_colors == 0)
2002 " Number_colors=%lu",bmp_info.number_colors);
2005 (void) WriteBlobLSBLong(image,bmp_info.file_size);
2006 (void) WriteBlobLSBLong(image,bmp_info.ba_offset); /* always 0 */
2007 (void) WriteBlobLSBLong(image,bmp_info.offset_bits);
2013 (void) WriteBlobLSBLong(image,bmp_info.size);
2014 (void) WriteBlobLSBSignedShort(image,(signed short) bmp_info.width);
2015 (void) WriteBlobLSBSignedShort(image,(signed short) bmp_info.height);
2016 (void) WriteBlobLSBShort(image,bmp_info.planes);
2017 (void) WriteBlobLSBShort(image,bmp_info.bits_per_pixel);
2024 (void) WriteBlobLSBLong(image,bmp_info.size);
2025 (void) WriteBlobLSBSignedLong(image,(signed int) bmp_info.width);
2026 (void) WriteBlobLSBSignedLong(image,(signed int) bmp_info.height);
2027 (void) WriteBlobLSBShort(image,bmp_info.planes);
2028 (void) WriteBlobLSBShort(image,bmp_info.bits_per_pixel);
2029 (void) WriteBlobLSBLong(image,bmp_info.compression);
2030 (void) WriteBlobLSBLong(image,bmp_info.image_size);
2031 (void) WriteBlobLSBLong(image,bmp_info.x_pixels);
2032 (void) WriteBlobLSBLong(image,bmp_info.y_pixels);
2033 (void) WriteBlobLSBLong(image,bmp_info.number_colors);
2034 (void) WriteBlobLSBLong(image,bmp_info.colors_important);
2069 (bmp_info.gamma_scale.x*0x10000));
2071 (bmp_info.gamma_scale.y*0x10000));
2073 (bmp_info.gamma_scale.z*0x10000));
2126 bmp_info.bits_per_pixel),4*sizeof(*bmp_colormap));
2130 for (i=0; i < (ssize_t) MagickMin((ssize_t) image->colors,(ssize_t) bmp_info.number_colors); i++)
2138 for ( ; i < (ssize_t) (1UL << bmp_info.bits_per_pixel); i++)
2147 (void) WriteBlob(image,(size_t) (3*(1L << bmp_info.bits_per_pixel)),
2150 (void) WriteBlob(image,(size_t) (4*(1L << bmp_info.bits_per_pixel)),
2156 " Pixels: %lu bytes",bmp_info.image_size);
2157 (void) WriteBlob(image,(size_t) bmp_info.image_size,pixels);