Lines Matching refs:image
212 static void PushRunlengthPacket(Image *image,const unsigned char *pixels, in PushRunlengthPacket() argument
219 if (image->storage_class == PseudoClass) in PushRunlengthPacket()
222 switch (image->depth) in PushRunlengthPacket()
226 pixel->index=(MagickRealType) ConstrainColormapIndex(image,(ssize_t) in PushRunlengthPacket()
234 pixel->index=(MagickRealType) ConstrainColormapIndex(image,(ssize_t) in PushRunlengthPacket()
241 pixel->index=(MagickRealType) ConstrainColormapIndex(image, in PushRunlengthPacket()
248 CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename); in PushRunlengthPacket()
250 switch (image->depth) in PushRunlengthPacket()
257 if (image->alpha_trait != UndefinedPixelTrait) in PushRunlengthPacket()
269 if (image->alpha_trait != UndefinedPixelTrait) in PushRunlengthPacket()
272 pixel->alpha=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
282 if (image->alpha_trait != UndefinedPixelTrait) in PushRunlengthPacket()
285 pixel->alpha=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
292 CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename); in PushRunlengthPacket()
297 switch (image->depth) in PushRunlengthPacket()
308 if (IsGrayColorspace(image->colorspace) == MagickFalse) in PushRunlengthPacket()
315 if (image->colorspace == CMYKColorspace) in PushRunlengthPacket()
320 if (image->alpha_trait != UndefinedPixelTrait) in PushRunlengthPacket()
333 pixel->red=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
337 if (IsGrayColorspace(image->colorspace) == MagickFalse) in PushRunlengthPacket()
340 pixel->green=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
343 pixel->blue=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
346 if (image->colorspace == CMYKColorspace) in PushRunlengthPacket()
349 pixel->black=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
352 if (image->alpha_trait != UndefinedPixelTrait) in PushRunlengthPacket()
355 pixel->alpha=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
366 pixel->red=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
370 if (IsGrayColorspace(image->colorspace) == MagickFalse) in PushRunlengthPacket()
373 pixel->green=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
376 pixel->blue=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
379 if (image->colorspace == CMYKColorspace) in PushRunlengthPacket()
382 pixel->black=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
385 if (image->alpha_trait != UndefinedPixelTrait) in PushRunlengthPacket()
388 pixel->alpha=(MagickRealType) (quantum >> (image->depth- in PushRunlengthPacket()
395 "ImageDepthNotSupported","`%s'",image->filename); in PushRunlengthPacket()
456 *image; in ReadMIFFImage() local
528 image=AcquireImage(image_info,exception); in ReadMIFFImage()
529 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); in ReadMIFFImage()
532 image=DestroyImageList(image); in ReadMIFFImage()
538 c=ReadBlobByte(image); in ReadMIFFImage()
558 image->depth=8UL; in ReadMIFFImage()
559 image->compression=NoCompression; in ReadMIFFImage()
577 c=ReadBlobByte(image); in ReadMIFFImage()
579 c=ReadBlobByte(image); in ReadMIFFImage()
601 (void) SetImageProperty(image,"comment",comment,exception); in ReadMIFFImage()
603 c=ReadBlobByte(image); in ReadMIFFImage()
619 c=ReadBlobByte(image); in ReadMIFFImage()
624 c=ReadBlobByte(image); in ReadMIFFImage()
630 c=ReadBlobByte(image); in ReadMIFFImage()
644 c=ReadBlobByte(image); in ReadMIFFImage()
647 c=ReadBlobByte(image); in ReadMIFFImage()
651 c=ReadBlobByte(image); in ReadMIFFImage()
682 image->alpha_trait=(PixelTrait) alpha_trait; in ReadMIFFImage()
685 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
694 &image->background_color,exception); in ReadMIFFImage()
700 image->chromaticity.blue_primary.x=geometry_info.rho; in ReadMIFFImage()
701 image->chromaticity.blue_primary.y=geometry_info.sigma; in ReadMIFFImage()
703 image->chromaticity.blue_primary.y= in ReadMIFFImage()
704 image->chromaticity.blue_primary.x; in ReadMIFFImage()
710 &image->border_color,exception); in ReadMIFFImage()
713 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
728 image->storage_class=(ClassType) storage_class; in ReadMIFFImage()
745 image->colorspace=(ColorspaceType) colorspace; in ReadMIFFImage()
757 image->compression=(CompressionType) compression; in ReadMIFFImage()
762 image->columns=StringToUnsignedLong(options); in ReadMIFFImage()
765 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
773 image->delay=StringToUnsignedLong(options); in ReadMIFFImage()
778 image->depth=StringToUnsignedLong(options); in ReadMIFFImage()
790 image->dispose=(DisposeType) dispose; in ReadMIFFImage()
793 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
808 image->endian=(EndianType) endian; in ReadMIFFImage()
811 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
819 image->gamma=StringToDouble(options,(char **) NULL); in ReadMIFFImage()
831 image->gravity=(GravityType) gravity; in ReadMIFFImage()
837 image->chromaticity.green_primary.x=geometry_info.rho; in ReadMIFFImage()
838 image->chromaticity.green_primary.y=geometry_info.sigma; in ReadMIFFImage()
840 image->chromaticity.green_primary.y= in ReadMIFFImage()
841 image->chromaticity.green_primary.x; in ReadMIFFImage()
844 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
857 image->iterations=StringToUnsignedLong(options); in ReadMIFFImage()
860 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
875 image->alpha_trait=matte == 0 ? UndefinedPixelTrait : in ReadMIFFImage()
882 &image->matte_color,exception); in ReadMIFFImage()
887 (void) CloneString(&image->montage,options); in ReadMIFFImage()
890 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
905 image->orientation=(OrientationType) orientation; in ReadMIFFImage()
908 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
920 (void) ParseAbsoluteGeometry(geometry,&image->page); in ReadMIFFImage()
933 image->intensity=(PixelIntensityMethod) intensity; in ReadMIFFImage()
944 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
952 image->quality=StringToUnsignedLong(options); in ReadMIFFImage()
968 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
977 image->chromaticity.red_primary.x=geometry_info.rho; in ReadMIFFImage()
978 image->chromaticity.red_primary.y=geometry_info.sigma; in ReadMIFFImage()
980 image->chromaticity.red_primary.y= in ReadMIFFImage()
981 image->chromaticity.red_primary.x; in ReadMIFFImage()
993 image->rendering_intent=(RenderingIntent) rendering_intent; in ReadMIFFImage()
999 image->resolution.x=geometry_info.rho; in ReadMIFFImage()
1000 image->resolution.y=geometry_info.sigma; in ReadMIFFImage()
1002 image->resolution.y=image->resolution.x; in ReadMIFFImage()
1007 image->rows=StringToUnsignedLong(options); in ReadMIFFImage()
1010 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
1018 image->scene=StringToUnsignedLong(options); in ReadMIFFImage()
1021 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
1029 image->ticks_per_second=(ssize_t) StringToLong(options); in ReadMIFFImage()
1038 (void) ParseAbsoluteGeometry(geometry,&image->tile_offset); in ReadMIFFImage()
1051 image->type=(ImageType) type; in ReadMIFFImage()
1054 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
1069 image->units=(ResolutionType) units; in ReadMIFFImage()
1072 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
1083 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
1092 image->chromaticity.white_point.x=geometry_info.rho; in ReadMIFFImage()
1093 image->chromaticity.white_point.y=geometry_info.sigma; in ReadMIFFImage()
1095 image->chromaticity.white_point.y= in ReadMIFFImage()
1096 image->chromaticity.white_point.x; in ReadMIFFImage()
1099 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
1104 (void) SetImageProperty(image,keyword,options,exception); in ReadMIFFImage()
1110 c=ReadBlobByte(image); in ReadMIFFImage()
1112 c=ReadBlobByte(image); in ReadMIFFImage()
1115 (void) ReadBlobByte(image); in ReadMIFFImage()
1120 (image->storage_class == UndefinedClass) || in ReadMIFFImage()
1121 (image->compression == UndefinedCompression) || in ReadMIFFImage()
1122 (image->colorspace == UndefinedColorspace) || in ReadMIFFImage()
1123 (image->columns == 0) || (image->rows == 0) || in ReadMIFFImage()
1124 (image->depth == 0) || (image->depth > 64)) in ReadMIFFImage()
1128 if (image->previous == (Image *) NULL) in ReadMIFFImage()
1130 DeleteImageFromList(&image); in ReadMIFFImage()
1132 CorruptImageError,"ImproperImageHeader","`%s'",image->filename); in ReadMIFFImage()
1135 if (image->montage != (char *) NULL) in ReadMIFFImage()
1144 image->directory=AcquireString((char *) NULL); in ReadMIFFImage()
1145 p=image->directory; in ReadMIFFImage()
1156 image->directory=(char *) ResizeQuantumMemory(image->directory, in ReadMIFFImage()
1157 extent+MagickPathExtent,sizeof(*image->directory)); in ReadMIFFImage()
1158 if (image->directory == (char *) NULL) in ReadMIFFImage()
1160 p=image->directory+length; in ReadMIFFImage()
1162 c=ReadBlobByte(image); in ReadMIFFImage()
1184 length=ReadBlobMSBLong(image); in ReadMIFFImage()
1185 if ((MagickSizeType) length > GetBlobSize(image)) in ReadMIFFImage()
1190 count=ReadBlob(image,length,GetStringInfoDatum(profile)); in ReadMIFFImage()
1196 status=SetImageProfile(image,name,profile,exception); in ReadMIFFImage()
1204 image->depth=GetImageQuantumDepth(image,MagickFalse); in ReadMIFFImage()
1205 if (image->storage_class == PseudoClass) in ReadMIFFImage()
1213 packet_size=(size_t) (3UL*image->depth/8UL); in ReadMIFFImage()
1214 if ((MagickSizeType) colors > GetBlobSize(image)) in ReadMIFFImage()
1216 if (((MagickSizeType) packet_size*colors) > GetBlobSize(image)) in ReadMIFFImage()
1218 status=AcquireImageColormap(image,colors != 0 ? colors : 256,exception); in ReadMIFFImage()
1229 colormap=(unsigned char *) AcquireQuantumMemory(image->colors, in ReadMIFFImage()
1233 count=ReadBlob(image,packet_size*image->colors,colormap); in ReadMIFFImage()
1235 switch (image->depth) in ReadMIFFImage()
1248 for (i=0; i < (ssize_t) image->colors; i++) in ReadMIFFImage()
1251 image->colormap[i].red=(MagickRealType) in ReadMIFFImage()
1254 image->colormap[i].green=(MagickRealType) in ReadMIFFImage()
1257 image->colormap[i].blue=(MagickRealType) in ReadMIFFImage()
1267 for (i=0; i < (ssize_t) image->colors; i++) in ReadMIFFImage()
1270 image->colormap[i].red=(MagickRealType) in ReadMIFFImage()
1273 image->colormap[i].green=(MagickRealType) in ReadMIFFImage()
1276 image->colormap[i].blue=(MagickRealType) in ReadMIFFImage()
1286 for (i=0; i < (ssize_t) image->colors; i++) in ReadMIFFImage()
1289 image->colormap[i].red=(MagickRealType) in ReadMIFFImage()
1292 image->colormap[i].green=(MagickRealType) in ReadMIFFImage()
1295 image->colormap[i].blue=(MagickRealType) in ReadMIFFImage()
1305 if (image->scene >= (image_info->scene+image_info->number_scenes-1)) in ReadMIFFImage()
1307 status=SetImageExtent(image,image->columns,image->rows,exception); in ReadMIFFImage()
1309 return(DestroyImageList(image)); in ReadMIFFImage()
1310 status=ResetImagePixels(image,exception); in ReadMIFFImage()
1312 return(DestroyImageList(image)); in ReadMIFFImage()
1316 quantum_info=AcquireQuantumInfo(image_info,image); in ReadMIFFImage()
1321 status=SetQuantumFormat(image,quantum_info,quantum_format); in ReadMIFFImage()
1326 if (image->storage_class == DirectClass) in ReadMIFFImage()
1328 if (IsGrayColorspace(image->colorspace) != MagickFalse) in ReadMIFFImage()
1330 if (image->alpha_trait != UndefinedPixelTrait) in ReadMIFFImage()
1332 if (image->colorspace == CMYKColorspace) in ReadMIFFImage()
1334 if (image->compression == RLECompression) in ReadMIFFImage()
1337 image->columns),LZMAMaxExtent(packet_size*image->columns)), in ReadMIFFImage()
1338 ZipMaxExtent(packet_size*image->columns)); in ReadMIFFImage()
1339 if (compress_extent < (packet_size*image->columns)) in ReadMIFFImage()
1349 if (image->alpha_trait != UndefinedPixelTrait) in ReadMIFFImage()
1351 if (image->colorspace == CMYKColorspace) in ReadMIFFImage()
1354 if (image->alpha_trait != UndefinedPixelTrait) in ReadMIFFImage()
1357 if (IsGrayColorspace(image->colorspace) != MagickFalse) in ReadMIFFImage()
1360 if (image->alpha_trait != UndefinedPixelTrait) in ReadMIFFImage()
1363 if (image->storage_class == PseudoClass) in ReadMIFFImage()
1366 if (image->alpha_trait != UndefinedPixelTrait) in ReadMIFFImage()
1370 GetPixelInfo(image,&pixel); in ReadMIFFImage()
1380 switch (image->compression) in ReadMIFFImage()
1390 bzip_info.opaque=(void *) image; in ReadMIFFImage()
1406 allocator.opaque=(void *) image; in ReadMIFFImage()
1424 zip_info.opaque=(voidpf) image; in ReadMIFFImage()
1438 for (y=0; y < (ssize_t) image->rows; y++) in ReadMIFFImage()
1448 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadMIFFImage()
1452 switch (image->compression) in ReadMIFFImage()
1458 bzip_info.avail_out=(unsigned int) (packet_size*image->columns); in ReadMIFFImage()
1467 length=(size_t) BZipMaxExtent(packet_size*image->columns); in ReadMIFFImage()
1469 length=(size_t) ReadBlobMSBLong(image); in ReadMIFFImage()
1471 bzip_info.avail_in=(unsigned int) ReadBlob(image,length, in ReadMIFFImage()
1490 extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, in ReadMIFFImage()
1499 lzma_info.avail_out=packet_size*image->columns; in ReadMIFFImage()
1508 length=(size_t) ReadBlobMSBLong(image); in ReadMIFFImage()
1510 lzma_info.avail_in=(unsigned int) ReadBlob(image,length, in ReadMIFFImage()
1529 extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, in ReadMIFFImage()
1539 zip_info.avail_out=(uInt) (packet_size*image->columns); in ReadMIFFImage()
1548 length=(size_t) ZipMaxExtent(packet_size*image->columns); in ReadMIFFImage()
1550 length=(size_t) ReadBlobMSBLong(image); in ReadMIFFImage()
1552 zip_info.avail_in=(unsigned int) ReadBlob(image,length, in ReadMIFFImage()
1571 extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, in ReadMIFFImage()
1578 for (x=0; x < (ssize_t) image->columns; x++) in ReadMIFFImage()
1582 count=ReadBlob(image,packet_size,pixels); in ReadMIFFImage()
1585 PushRunlengthPacket(image,pixels,&length,&pixel,exception); in ReadMIFFImage()
1588 if (image->storage_class == PseudoClass) in ReadMIFFImage()
1589 SetPixelIndex(image,ClampToQuantum(pixel.index),q); in ReadMIFFImage()
1592 SetPixelRed(image,ClampToQuantum(pixel.red),q); in ReadMIFFImage()
1593 SetPixelGreen(image,ClampToQuantum(pixel.green),q); in ReadMIFFImage()
1594 SetPixelBlue(image,ClampToQuantum(pixel.blue),q); in ReadMIFFImage()
1595 if (image->colorspace == CMYKColorspace) in ReadMIFFImage()
1596 SetPixelBlack(image,ClampToQuantum(pixel.black),q); in ReadMIFFImage()
1598 if (image->alpha_trait != UndefinedPixelTrait) in ReadMIFFImage()
1599 SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q); in ReadMIFFImage()
1600 q+=GetPixelChannels(image); in ReadMIFFImage()
1607 count=ReadBlob(image,packet_size*image->columns,pixels); in ReadMIFFImage()
1608 if (count != (ssize_t) (packet_size*image->columns)) in ReadMIFFImage()
1610 extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, in ReadMIFFImage()
1615 if (extent < image->columns) in ReadMIFFImage()
1617 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadMIFFImage()
1620 SetQuantumImageType(image,quantum_type); in ReadMIFFImage()
1621 switch (image->compression) in ReadMIFFImage()
1634 offset=SeekBlob(image,-((MagickOffsetType) bzip_info.avail_in), in ReadMIFFImage()
1673 offset=SeekBlob(image,-((MagickOffsetType) zip_info.avail_in), in ReadMIFFImage()
1692 if (((y != (ssize_t) image->rows)) || (status == MagickFalse)) in ReadMIFFImage()
1694 image=DestroyImageList(image); in ReadMIFFImage()
1697 if (EOFBlob(image) != MagickFalse) in ReadMIFFImage()
1700 image->filename); in ReadMIFFImage()
1707 if (image->scene >= (image_info->scene+image_info->number_scenes-1)) in ReadMIFFImage()
1711 c=ReadBlobByte(image); in ReadMIFFImage()
1718 AcquireNextImage(image_info,image,exception); in ReadMIFFImage()
1719 if (GetNextImageInList(image) == (Image *) NULL) in ReadMIFFImage()
1724 image=SyncNextImageInList(image); in ReadMIFFImage()
1725 status=SetImageProgress(image,LoadImagesTag,TellBlob(image), in ReadMIFFImage()
1726 GetBlobSize(image)); in ReadMIFFImage()
1731 (void) CloseBlob(image); in ReadMIFFImage()
1733 return(DestroyImageList(image)); in ReadMIFFImage()
1734 return(GetFirstImageInList(image)); in ReadMIFFImage()
1843 static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels, in PopRunlengthPacket() argument
1846 if (image->storage_class != DirectClass) in PopRunlengthPacket()
1852 switch (image->depth) in PopRunlengthPacket()
1868 CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename); in PopRunlengthPacket()
1870 switch (image->depth) in PopRunlengthPacket()
1877 if (image->alpha_trait != UndefinedPixelTrait) in PopRunlengthPacket()
1889 if (image->alpha_trait != UndefinedPixelTrait) in PopRunlengthPacket()
1901 if (image->alpha_trait != UndefinedPixelTrait) in PopRunlengthPacket()
1911 CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename); in PopRunlengthPacket()
1916 switch (image->depth) in PopRunlengthPacket()
1925 if (IsGrayColorspace(image->colorspace) == MagickFalse) in PopRunlengthPacket()
1932 if (image->colorspace == CMYKColorspace) in PopRunlengthPacket()
1937 if (image->alpha_trait != UndefinedPixelTrait) in PopRunlengthPacket()
1951 if (IsGrayColorspace(image->colorspace) == MagickFalse) in PopRunlengthPacket()
1958 if (image->colorspace == CMYKColorspace) in PopRunlengthPacket()
1963 if (image->alpha_trait != UndefinedPixelTrait) in PopRunlengthPacket()
1977 if (IsGrayColorspace(image->colorspace) == MagickFalse) in PopRunlengthPacket()
1985 if (image->colorspace == CMYKColorspace) in PopRunlengthPacket()
1991 if (image->alpha_trait != UndefinedPixelTrait) in PopRunlengthPacket()
2001 "ImageDepthNotSupported","`%s'",image->filename); in PopRunlengthPacket()
2008 Image *image,ExceptionInfo *exception) in WriteMIFFImage() argument
2076 assert(image != (Image *) NULL); in WriteMIFFImage()
2077 assert(image->signature == MagickCoreSignature); in WriteMIFFImage()
2078 if (image->debug != MagickFalse) in WriteMIFFImage()
2079 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); in WriteMIFFImage()
2082 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); in WriteMIFFImage()
2086 imageListLength=GetImageListLength(image); in WriteMIFFImage()
2092 if ((image->storage_class == PseudoClass) && in WriteMIFFImage()
2093 (image->colors > (size_t) (GetQuantumRange(image->depth)+1))) in WriteMIFFImage()
2094 (void) SetImageStorageClass(image,DirectClass,exception); in WriteMIFFImage()
2095 image->depth=image->depth <= 8 ? 8UL : image->depth <= 16 ? 16UL : in WriteMIFFImage()
2096 image->depth <= 32 ? 32UL : 64UL; in WriteMIFFImage()
2097 quantum_info=AcquireQuantumInfo(image_info,image); in WriteMIFFImage()
2100 if ((image->storage_class != PseudoClass) && (image->depth >= 16) && in WriteMIFFImage()
2102 (IsHighDynamicRangeImage(image,exception) != MagickFalse)) in WriteMIFFImage()
2104 status=SetQuantumFormat(image,quantum_info,FloatingPointQuantumFormat); in WriteMIFFImage()
2112 if (image->depth < 16) in WriteMIFFImage()
2113 (void) DeleteImageProperty(image,"quantum:format"); in WriteMIFFImage()
2133 GetPixelInfo(image,&target); in WriteMIFFImage()
2140 if (image->storage_class == DirectClass) in WriteMIFFImage()
2142 if (IsGrayColorspace(image->colorspace) != MagickFalse) in WriteMIFFImage()
2144 if (image->alpha_trait != UndefinedPixelTrait) in WriteMIFFImage()
2146 if (image->colorspace == CMYKColorspace) in WriteMIFFImage()
2150 length=MagickMax(BZipMaxExtent(packet_size*image->columns),ZipMaxExtent( in WriteMIFFImage()
2151 packet_size*image->columns)); in WriteMIFFImage()
2162 (void) WriteBlobString(image,"id=ImageMagick version=1.0\n"); in WriteMIFFImage()
2165 MagickClassOptions,image->storage_class),(double) image->colors, in WriteMIFFImage()
2167 image->alpha_trait)); in WriteMIFFImage()
2168 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2169 if (image->alpha_trait != UndefinedPixelTrait) in WriteMIFFImage()
2170 (void) WriteBlobString(image,"matte=True\n"); in WriteMIFFImage()
2172 "columns=%.20g rows=%.20g depth=%.20g\n",(double) image->columns, in WriteMIFFImage()
2173 (double) image->rows,(double) image->depth); in WriteMIFFImage()
2174 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2175 if (image->type != UndefinedType) in WriteMIFFImage()
2178 CommandOptionToMnemonic(MagickTypeOptions,image->type)); in WriteMIFFImage()
2179 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2181 if (image->colorspace != UndefinedColorspace) in WriteMIFFImage()
2184 CommandOptionToMnemonic(MagickColorspaceOptions,image->colorspace)); in WriteMIFFImage()
2185 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2187 if (image->intensity != UndefinedPixelIntensityMethod) in WriteMIFFImage()
2191 MagickPixelIntensityOptions,image->intensity)); in WriteMIFFImage()
2192 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2194 if (image->endian != UndefinedEndian) in WriteMIFFImage()
2197 CommandOptionToMnemonic(MagickEndianOptions,image->endian)); in WriteMIFFImage()
2198 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2204 compression),(double) image->quality); in WriteMIFFImage()
2205 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2207 if (image->units != UndefinedResolution) in WriteMIFFImage()
2210 CommandOptionToMnemonic(MagickResolutionOptions,image->units)); in WriteMIFFImage()
2211 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2213 if ((image->resolution.x != 0) || (image->resolution.y != 0)) in WriteMIFFImage()
2216 "resolution=%gx%g\n",image->resolution.x,image->resolution.y); in WriteMIFFImage()
2217 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2219 if ((image->page.width != 0) || (image->page.height != 0)) in WriteMIFFImage()
2222 "page=%.20gx%.20g%+.20g%+.20g\n",(double) image->page.width,(double) in WriteMIFFImage()
2223 image->page.height,(double) image->page.x,(double) image->page.y); in WriteMIFFImage()
2224 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2227 if ((image->page.x != 0) || (image->page.y != 0)) in WriteMIFFImage()
2230 (long) image->page.x,(long) image->page.y); in WriteMIFFImage()
2231 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2233 if ((image->tile_offset.x != 0) || (image->tile_offset.y != 0)) in WriteMIFFImage()
2236 "tile-offset=%+ld%+ld\n",(long) image->tile_offset.x,(long) in WriteMIFFImage()
2237 image->tile_offset.y); in WriteMIFFImage()
2238 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2240 if ((GetNextImageInList(image) != (Image *) NULL) || in WriteMIFFImage()
2241 (GetPreviousImageInList(image) != (Image *) NULL)) in WriteMIFFImage()
2243 if (image->scene == 0) in WriteMIFFImage()
2245 "delay=%.20g ticks-per-second=%.20g\n",(double) image->iterations, in WriteMIFFImage()
2246 (double) image->delay,(double) image->ticks_per_second); in WriteMIFFImage()
2250 image->scene,(double) image->iterations,(double) image->delay, in WriteMIFFImage()
2251 (double) image->ticks_per_second); in WriteMIFFImage()
2252 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2256 if (image->scene != 0) in WriteMIFFImage()
2259 (double) image->scene); in WriteMIFFImage()
2260 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2262 if (image->iterations != 0) in WriteMIFFImage()
2265 "iterations=%.20g\n",(double) image->iterations); in WriteMIFFImage()
2266 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2268 if (image->delay != 0) in WriteMIFFImage()
2271 (double) image->delay); in WriteMIFFImage()
2272 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2274 if (image->ticks_per_second != UndefinedTicksPerSecond) in WriteMIFFImage()
2277 "ticks-per-second=%.20g\n",(double) image->ticks_per_second); in WriteMIFFImage()
2278 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2281 if (image->gravity != UndefinedGravity) in WriteMIFFImage()
2284 CommandOptionToMnemonic(MagickGravityOptions,image->gravity)); in WriteMIFFImage()
2285 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2287 if (image->dispose != UndefinedDispose) in WriteMIFFImage()
2290 CommandOptionToMnemonic(MagickDisposeOptions,image->dispose)); in WriteMIFFImage()
2291 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2293 if (image->rendering_intent != UndefinedIntent) in WriteMIFFImage()
2297 image->rendering_intent)); in WriteMIFFImage()
2298 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2300 if (image->gamma != 0.0) in WriteMIFFImage()
2303 image->gamma); in WriteMIFFImage()
2304 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2306 if (image->chromaticity.white_point.x != 0.0) in WriteMIFFImage()
2313 image->chromaticity.red_primary.x,image->chromaticity.red_primary.y, in WriteMIFFImage()
2314 image->chromaticity.green_primary.x, in WriteMIFFImage()
2315 image->chromaticity.green_primary.y, in WriteMIFFImage()
2316 image->chromaticity.blue_primary.x, in WriteMIFFImage()
2317 image->chromaticity.blue_primary.y); in WriteMIFFImage()
2318 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2320 "white-point=%g,%g\n",image->chromaticity.white_point.x, in WriteMIFFImage()
2321 image->chromaticity.white_point.y); in WriteMIFFImage()
2322 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2324 if (image->orientation != UndefinedOrientation) in WriteMIFFImage()
2327 CommandOptionToMnemonic(MagickOrientationOptions,image->orientation)); in WriteMIFFImage()
2328 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2330 if (image->profiles != (void *) NULL) in WriteMIFFImage()
2341 ResetImageProfileIterator(image); in WriteMIFFImage()
2342 for (name=GetNextImageProfile(image); name != (const char *) NULL; ) in WriteMIFFImage()
2344 profile=GetImageProfile(image,name); in WriteMIFFImage()
2349 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2351 name=GetNextImageProfile(image); in WriteMIFFImage()
2354 if (image->montage != (char *) NULL) in WriteMIFFImage()
2357 image->montage); in WriteMIFFImage()
2358 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2361 (void) SetImageProperty(image,"quantum:format","floating-point", in WriteMIFFImage()
2363 ResetImagePropertyIterator(image); in WriteMIFFImage()
2364 property=GetNextImageProperty(image); in WriteMIFFImage()
2368 (void) WriteBlobString(image,buffer); in WriteMIFFImage()
2369 value=GetImageProperty(image,property,exception); in WriteMIFFImage()
2378 (void) WriteBlob(image,length,(const unsigned char *) value); in WriteMIFFImage()
2381 (void) WriteBlobByte(image,'{'); in WriteMIFFImage()
2383 (void) WriteBlob(image,length,(const unsigned char *) value); in WriteMIFFImage()
2388 (void) WriteBlobByte(image,'\\'); in WriteMIFFImage()
2389 (void) WriteBlobByte(image,(unsigned char) value[i]); in WriteMIFFImage()
2391 (void) WriteBlobByte(image,'}'); in WriteMIFFImage()
2394 (void) WriteBlobByte(image,'\n'); in WriteMIFFImage()
2395 property=GetNextImageProperty(image); in WriteMIFFImage()
2397 (void) WriteBlobString(image,"\f\n:\032"); in WriteMIFFImage()
2398 if (image->montage != (char *) NULL) in WriteMIFFImage()
2403 if (image->directory != (char *) NULL) in WriteMIFFImage()
2404 (void) WriteBlob(image,strlen(image->directory),(unsigned char *) in WriteMIFFImage()
2405 image->directory); in WriteMIFFImage()
2406 (void) WriteBlobByte(image,'\0'); in WriteMIFFImage()
2408 if (image->profiles != 0) in WriteMIFFImage()
2419 ResetImageProfileIterator(image); in WriteMIFFImage()
2420 name=GetNextImageProfile(image); in WriteMIFFImage()
2423 profile=GetImageProfile(image,name); in WriteMIFFImage()
2424 (void) WriteBlobMSBLong(image,(unsigned int) in WriteMIFFImage()
2426 (void) WriteBlob(image,GetStringInfoLength(profile), in WriteMIFFImage()
2428 name=GetNextImageProfile(image); in WriteMIFFImage()
2431 if (image->storage_class == PseudoClass) in WriteMIFFImage()
2443 colormap=(unsigned char *) AcquireQuantumMemory(image->colors, in WriteMIFFImage()
2451 for (i=0; i < (ssize_t) image->colors; i++) in WriteMIFFImage()
2463 image->colormap[i].red); in WriteMIFFImage()
2466 image->colormap[i].green); in WriteMIFFImage()
2469 image->colormap[i].blue); in WriteMIFFImage()
2479 image->colormap[i].red); in WriteMIFFImage()
2482 image->colormap[i].green); in WriteMIFFImage()
2485 image->colormap[i].blue); in WriteMIFFImage()
2495 image->colormap[i].red); in WriteMIFFImage()
2498 image->colormap[i].green); in WriteMIFFImage()
2501 image->colormap[i].blue); in WriteMIFFImage()
2507 (void) WriteBlob(image,colormap_size*image->colors,colormap); in WriteMIFFImage()
2526 code=BZ2_bzCompressInit(&bzip_info,(int) (image->quality == in WriteMIFFImage()
2527 UndefinedCompressionQuality ? 7 : MagickMin(image->quality/10,9)), in WriteMIFFImage()
2545 code=lzma_easy_encoder(&lzma_info,(uint32_t) (image->quality/10), in WriteMIFFImage()
2562 code=deflateInit(&zip_info,(int) (image->quality == in WriteMIFFImage()
2563 UndefinedCompressionQuality ? 7 : MagickMin(image->quality/10,9))); in WriteMIFFImage()
2572 quantum_type=GetQuantumType(image,exception); in WriteMIFFImage()
2574 for (y=0; y < (ssize_t) image->rows; y++) in WriteMIFFImage()
2584 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteMIFFImage()
2594 bzip_info.avail_in=(unsigned int) (packet_size*image->columns); in WriteMIFFImage()
2595 (void) ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, in WriteMIFFImage()
2604 image->columns); in WriteMIFFImage()
2611 (void) WriteBlobMSBLong(image,(unsigned int) length); in WriteMIFFImage()
2612 (void) WriteBlob(image,length,compress_pixels); in WriteMIFFImage()
2622 lzma_info.avail_in=packet_size*image->columns; in WriteMIFFImage()
2623 (void) ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, in WriteMIFFImage()
2631 lzma_info.avail_out=LZMAMaxExtent(packet_size*image->columns); in WriteMIFFImage()
2638 (void) WriteBlobMSBLong(image,(unsigned int) length); in WriteMIFFImage()
2639 (void) WriteBlob(image,length,compress_pixels); in WriteMIFFImage()
2650 zip_info.avail_in=(uInt) (packet_size*image->columns); in WriteMIFFImage()
2651 (void) ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, in WriteMIFFImage()
2659 zip_info.avail_out=(uInt) ZipMaxExtent(packet_size*image->columns); in WriteMIFFImage()
2666 (void) WriteBlobMSBLong(image,(unsigned int) length); in WriteMIFFImage()
2667 (void) WriteBlob(image,length,compress_pixels); in WriteMIFFImage()
2676 GetPixelInfoPixel(image,p,&pixel); in WriteMIFFImage()
2677 p+=GetPixelChannels(image); in WriteMIFFImage()
2678 for (x=1; x < (ssize_t) image->columns; x++) in WriteMIFFImage()
2680 GetPixelInfoPixel(image,p,&target); in WriteMIFFImage()
2686 q=PopRunlengthPacket(image,q,length,&pixel,exception); in WriteMIFFImage()
2689 GetPixelInfoPixel(image,p,&pixel); in WriteMIFFImage()
2690 p+=GetPixelChannels(image); in WriteMIFFImage()
2692 q=PopRunlengthPacket(image,q,length,&pixel,exception); in WriteMIFFImage()
2693 (void) WriteBlob(image,(size_t) (q-pixels),pixels); in WriteMIFFImage()
2698 (void) ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, in WriteMIFFImage()
2700 (void) WriteBlob(image,packet_size*image->columns,pixels); in WriteMIFFImage()
2704 if (image->previous == (Image *) NULL) in WriteMIFFImage()
2706 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, in WriteMIFFImage()
2707 image->rows); in WriteMIFFImage()
2726 image->columns); in WriteMIFFImage()
2731 (void) WriteBlobMSBLong(image,(unsigned int) length); in WriteMIFFImage()
2732 (void) WriteBlob(image,length,compress_pixels); in WriteMIFFImage()
2754 lzma_info.avail_out=packet_size*image->columns; in WriteMIFFImage()
2759 (void) WriteBlobMSBLong(image,(unsigned int) length); in WriteMIFFImage()
2760 (void) WriteBlob(image,length,compress_pixels); in WriteMIFFImage()
2781 zip_info.avail_out=(uInt) ZipMaxExtent(packet_size*image->columns); in WriteMIFFImage()
2786 (void) WriteBlobMSBLong(image,(unsigned int) length); in WriteMIFFImage()
2787 (void) WriteBlob(image,length,compress_pixels); in WriteMIFFImage()
2803 if (GetNextImageInList(image) == (Image *) NULL) in WriteMIFFImage()
2805 image=SyncNextImageInList(image); in WriteMIFFImage()
2806 status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength); in WriteMIFFImage()
2810 (void) CloseBlob(image); in WriteMIFFImage()