Lines Matching refs:image
216 *image; in ReadVIFFImage() local
267 image=AcquireImage(image_info,exception); in ReadVIFFImage()
268 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); in ReadVIFFImage()
271 image=DestroyImageList(image); in ReadVIFFImage()
277 count=ReadBlob(image,1,&viff_info.identifier); in ReadVIFFImage()
288 (void) ReadBlob(image,sizeof(viff_info.file_type),&viff_info.file_type); in ReadVIFFImage()
289 (void) ReadBlob(image,sizeof(viff_info.release),&viff_info.release); in ReadVIFFImage()
290 (void) ReadBlob(image,sizeof(viff_info.version),&viff_info.version); in ReadVIFFImage()
291 (void) ReadBlob(image,sizeof(viff_info.machine_dependency), in ReadVIFFImage()
293 (void) ReadBlob(image,sizeof(viff_info.reserve),viff_info.reserve); in ReadVIFFImage()
294 count=ReadBlob(image,512,(unsigned char *) viff_info.comment); in ReadVIFFImage()
299 (void) SetImageProperty(image,"comment",viff_info.comment,exception); in ReadVIFFImage()
302 image->endian=LSBEndian; in ReadVIFFImage()
304 image->endian=MSBEndian; in ReadVIFFImage()
305 viff_info.rows=ReadBlobLong(image); in ReadVIFFImage()
306 viff_info.columns=ReadBlobLong(image); in ReadVIFFImage()
307 viff_info.subrows=ReadBlobLong(image); in ReadVIFFImage()
308 viff_info.x_offset=ReadBlobSignedLong(image); in ReadVIFFImage()
309 viff_info.y_offset=ReadBlobSignedLong(image); in ReadVIFFImage()
310 viff_info.x_bits_per_pixel=(float) ReadBlobLong(image); in ReadVIFFImage()
311 viff_info.y_bits_per_pixel=(float) ReadBlobLong(image); in ReadVIFFImage()
312 viff_info.location_type=ReadBlobLong(image); in ReadVIFFImage()
313 viff_info.location_dimension=ReadBlobLong(image); in ReadVIFFImage()
314 viff_info.number_of_images=ReadBlobLong(image); in ReadVIFFImage()
315 viff_info.number_data_bands=ReadBlobLong(image); in ReadVIFFImage()
316 viff_info.data_storage_type=ReadBlobLong(image); in ReadVIFFImage()
317 viff_info.data_encode_scheme=ReadBlobLong(image); in ReadVIFFImage()
318 viff_info.map_scheme=ReadBlobLong(image); in ReadVIFFImage()
319 viff_info.map_storage_type=ReadBlobLong(image); in ReadVIFFImage()
320 viff_info.map_rows=ReadBlobLong(image); in ReadVIFFImage()
321 viff_info.map_columns=ReadBlobLong(image); in ReadVIFFImage()
322 viff_info.map_subrows=ReadBlobLong(image); in ReadVIFFImage()
323 viff_info.map_enable=ReadBlobLong(image); in ReadVIFFImage()
324 viff_info.maps_per_cycle=ReadBlobLong(image); in ReadVIFFImage()
325 viff_info.color_space_model=ReadBlobLong(image); in ReadVIFFImage()
327 (void) ReadBlobByte(image); in ReadVIFFImage()
328 if (EOFBlob(image) != MagickFalse) in ReadVIFFImage()
331 if (number_pixels > GetBlobSize(image)) in ReadVIFFImage()
337 image->columns=viff_info.rows; in ReadVIFFImage()
338 image->rows=viff_info.columns; in ReadVIFFImage()
339 image->depth=viff_info.x_bits_per_pixel <= 8 ? 8UL : in ReadVIFFImage()
341 image->alpha_trait=viff_info.number_data_bands == 4 ? BlendPixelTrait : in ReadVIFFImage()
343 status=SetImageExtent(image,image->columns,image->rows,exception); in ReadVIFFImage()
345 return(DestroyImageList(image)); in ReadVIFFImage()
346 (void) SetImageBackgroundColor(image,exception); in ReadVIFFImage()
388 image->colors=2; in ReadVIFFImage()
391 image->colors=256UL; in ReadVIFFImage()
393 image->colors=image->depth <= 8 ? 256UL : 65536UL; in ReadVIFFImage()
394 status=AcquireImageColormap(image,image->colors,exception); in ReadVIFFImage()
418 image->colors=viff_info.map_columns; in ReadVIFFImage()
419 if ((MagickSizeType) (viff_info.map_rows*image->colors) > GetBlobSize(image)) in ReadVIFFImage()
421 if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) in ReadVIFFImage()
423 if ((MagickSizeType) viff_info.map_rows > GetBlobSize(image)) in ReadVIFFImage()
428 viff_colormap=(unsigned char *) AcquireQuantumMemory(image->colors, in ReadVIFFImage()
435 count=ReadBlob(image,bytes_per_pixel*image->colors*viff_info.map_rows, in ReadVIFFImage()
445 MSBOrderShort(viff_colormap,(bytes_per_pixel*image->colors* in ReadVIFFImage()
452 MSBOrderLong(viff_colormap,(bytes_per_pixel*image->colors* in ReadVIFFImage()
458 for (i=0; i < (ssize_t) (viff_info.map_rows*image->colors); i++) in ReadVIFFImage()
468 if (i < (ssize_t) image->colors) in ReadVIFFImage()
470 image->colormap[i].red=(MagickRealType) in ReadVIFFImage()
472 image->colormap[i].green=(MagickRealType) in ReadVIFFImage()
474 image->colormap[i].blue=(MagickRealType) in ReadVIFFImage()
478 if (i < (ssize_t) (2*image->colors)) in ReadVIFFImage()
479 image->colormap[i % image->colors].green=(MagickRealType) in ReadVIFFImage()
482 if (i < (ssize_t) (3*image->colors)) in ReadVIFFImage()
483 image->colormap[i % image->colors].blue=(MagickRealType) in ReadVIFFImage()
493 if (image->scene >= (image_info->scene+image_info->number_scenes-1)) in ReadVIFFImage()
500 image->colors=2; in ReadVIFFImage()
501 if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) in ReadVIFFImage()
503 image->colorspace=GRAYColorspace; in ReadVIFFImage()
518 if (HeapOverflowSanityCheck((image->columns+7UL) >> 3UL,image->rows) != MagickFalse) in ReadVIFFImage()
520 max_packets=((image->columns+7UL) >> 3UL)*image->rows; in ReadVIFFImage()
528 if ((MagickSizeType) (bytes_per_pixel*max_packets) > GetBlobSize(image)) in ReadVIFFImage()
536 count=ReadBlob(image,bytes_per_pixel*max_packets,pixels); in ReadVIFFImage()
639 for (y=0; y < (ssize_t) image->rows; y++) in ReadVIFFImage()
641 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadVIFFImage()
644 for (x=0; x < (ssize_t) (image->columns-7); x+=8) in ReadVIFFImage()
649 SetPixelRed(image,quantum == 0 ? 0 : QuantumRange,q); in ReadVIFFImage()
650 SetPixelGreen(image,quantum == 0 ? 0 : QuantumRange,q); in ReadVIFFImage()
651 SetPixelBlue(image,quantum == 0 ? 0 : QuantumRange,q); in ReadVIFFImage()
652 if (image->storage_class == PseudoClass) in ReadVIFFImage()
653 SetPixelIndex(image,(Quantum) quantum,q); in ReadVIFFImage()
654 q+=GetPixelChannels(image); in ReadVIFFImage()
658 if ((image->columns % 8) != 0) in ReadVIFFImage()
660 for (bit=0; bit < (int) (image->columns % 8); bit++) in ReadVIFFImage()
663 SetPixelRed(image,quantum == 0 ? 0 : QuantumRange,q); in ReadVIFFImage()
664 SetPixelGreen(image,quantum == 0 ? 0 : QuantumRange,q); in ReadVIFFImage()
665 SetPixelBlue(image,quantum == 0 ? 0 : QuantumRange,q); in ReadVIFFImage()
666 if (image->storage_class == PseudoClass) in ReadVIFFImage()
667 SetPixelIndex(image,(Quantum) quantum,q); in ReadVIFFImage()
668 q+=GetPixelChannels(image); in ReadVIFFImage()
672 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadVIFFImage()
674 if (image->previous == (Image *) NULL) in ReadVIFFImage()
676 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, in ReadVIFFImage()
677 image->rows); in ReadVIFFImage()
684 if (image->storage_class == PseudoClass) in ReadVIFFImage()
685 for (y=0; y < (ssize_t) image->rows; y++) in ReadVIFFImage()
687 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadVIFFImage()
690 for (x=0; x < (ssize_t) image->columns; x++) in ReadVIFFImage()
692 SetPixelIndex(image,*p++,q); in ReadVIFFImage()
693 q+=GetPixelChannels(image); in ReadVIFFImage()
695 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadVIFFImage()
697 if (image->previous == (Image *) NULL) in ReadVIFFImage()
699 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, in ReadVIFFImage()
700 image->rows); in ReadVIFFImage()
710 number_pixels=(MagickSizeType) image->columns*image->rows; in ReadVIFFImage()
711 for (y=0; y < (ssize_t) image->rows; y++) in ReadVIFFImage()
713 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadVIFFImage()
716 for (x=0; x < (ssize_t) image->columns; x++) in ReadVIFFImage()
718 SetPixelRed(image,ScaleCharToQuantum(*p),q); in ReadVIFFImage()
719 SetPixelGreen(image,ScaleCharToQuantum(*(p+number_pixels)),q); in ReadVIFFImage()
720 SetPixelBlue(image,ScaleCharToQuantum(*(p+2*number_pixels)),q); in ReadVIFFImage()
721 if (image->colors != 0) in ReadVIFFImage()
726 index=(ssize_t) GetPixelRed(image,q); in ReadVIFFImage()
727 SetPixelRed(image,ClampToQuantum(image->colormap[ in ReadVIFFImage()
728 ConstrainColormapIndex(image,index,exception)].red),q); in ReadVIFFImage()
729 index=(ssize_t) GetPixelGreen(image,q); in ReadVIFFImage()
730 SetPixelGreen(image,ClampToQuantum(image->colormap[ in ReadVIFFImage()
731 ConstrainColormapIndex(image,index,exception)].green),q); in ReadVIFFImage()
732 index=(ssize_t) GetPixelBlue(image,q); in ReadVIFFImage()
733 SetPixelBlue(image,ClampToQuantum(image->colormap[ in ReadVIFFImage()
734 ConstrainColormapIndex(image,index,exception)].blue),q); in ReadVIFFImage()
736 SetPixelAlpha(image,image->alpha_trait != UndefinedPixelTrait ? in ReadVIFFImage()
739 q+=GetPixelChannels(image); in ReadVIFFImage()
741 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadVIFFImage()
743 if (image->previous == (Image *) NULL) in ReadVIFFImage()
745 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, in ReadVIFFImage()
746 image->rows); in ReadVIFFImage()
753 if (image->storage_class == PseudoClass) in ReadVIFFImage()
754 (void) SyncImage(image,exception); in ReadVIFFImage()
755 if (EOFBlob(image) != MagickFalse) in ReadVIFFImage()
758 image->filename); in ReadVIFFImage()
765 if (image->scene >= (image_info->scene+image_info->number_scenes-1)) in ReadVIFFImage()
767 count=ReadBlob(image,1,&viff_info.identifier); in ReadVIFFImage()
773 AcquireNextImage(image_info,image,exception); in ReadVIFFImage()
774 if (GetNextImageInList(image) == (Image *) NULL) in ReadVIFFImage()
776 image=DestroyImageList(image); in ReadVIFFImage()
779 image=SyncNextImageInList(image); in ReadVIFFImage()
780 status=SetImageProgress(image,LoadImagesTag,TellBlob(image), in ReadVIFFImage()
781 GetBlobSize(image)); in ReadVIFFImage()
786 (void) CloseBlob(image); in ReadVIFFImage()
788 return(DestroyImageList(image)); in ReadVIFFImage()
789 return(GetFirstImageInList(image)); in ReadVIFFImage()
887 Image *image,ExceptionInfo *exception) in WriteVIFFImage() argument
985 assert(image != (Image *) NULL); in WriteVIFFImage()
986 assert(image->signature == MagickCoreSignature); in WriteVIFFImage()
987 if (image->debug != MagickFalse) in WriteVIFFImage()
988 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); in WriteVIFFImage()
991 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); in WriteVIFFImage()
996 imageListLength=GetImageListLength(image); in WriteVIFFImage()
1002 (void) TransformImageColorspace(image,sRGBColorspace,exception); in WriteVIFFImage()
1011 value=GetImageProperty(image,"comment",exception); in WriteVIFFImage()
1015 viff_info.rows=image->columns; in WriteVIFFImage()
1016 viff_info.columns=image->rows; in WriteVIFFImage()
1033 number_pixels=(MagickSizeType) image->columns*image->rows; in WriteVIFFImage()
1034 if (image->storage_class == DirectClass) in WriteVIFFImage()
1039 viff_info.number_data_bands=image->alpha_trait ? 4U : 3U; in WriteVIFFImage()
1050 if (SetImageGray(image,exception) == MagickFalse) in WriteVIFFImage()
1058 viff_info.map_columns=(unsigned int) image->colors; in WriteVIFFImage()
1061 if (image->colors <= 2) in WriteVIFFImage()
1067 packets=((image->columns+7) >> 3)*image->rows; in WriteVIFFImage()
1073 (void) WriteBlob(image,sizeof(viff_info.identifier),(unsigned char *) in WriteVIFFImage()
1075 (void) WriteBlob(image,sizeof(viff_info.file_type),(unsigned char *) in WriteVIFFImage()
1077 (void) WriteBlob(image,sizeof(viff_info.release),(unsigned char *) in WriteVIFFImage()
1079 (void) WriteBlob(image,sizeof(viff_info.version),(unsigned char *) in WriteVIFFImage()
1081 (void) WriteBlob(image,sizeof(viff_info.machine_dependency), in WriteVIFFImage()
1083 (void) WriteBlob(image,sizeof(viff_info.reserve),(unsigned char *) in WriteVIFFImage()
1085 (void) WriteBlob(image,512,(unsigned char *) viff_info.comment); in WriteVIFFImage()
1086 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.rows); in WriteVIFFImage()
1087 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.columns); in WriteVIFFImage()
1088 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.subrows); in WriteVIFFImage()
1089 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.x_offset); in WriteVIFFImage()
1090 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.y_offset); in WriteVIFFImage()
1092 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.x_bits_per_pixel); in WriteVIFFImage()
1094 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.y_bits_per_pixel); in WriteVIFFImage()
1095 (void) WriteBlobMSBLong(image,viff_info.location_type); in WriteVIFFImage()
1096 (void) WriteBlobMSBLong(image,viff_info.location_dimension); in WriteVIFFImage()
1097 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.number_of_images); in WriteVIFFImage()
1098 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.number_data_bands); in WriteVIFFImage()
1099 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.data_storage_type); in WriteVIFFImage()
1100 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.data_encode_scheme); in WriteVIFFImage()
1101 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_scheme); in WriteVIFFImage()
1102 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_storage_type); in WriteVIFFImage()
1103 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_rows); in WriteVIFFImage()
1104 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_columns); in WriteVIFFImage()
1105 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_subrows); in WriteVIFFImage()
1106 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_enable); in WriteVIFFImage()
1107 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.maps_per_cycle); in WriteVIFFImage()
1108 (void) WriteBlobMSBLong(image,(unsigned int) viff_info.color_space_model); in WriteVIFFImage()
1110 (void) WriteBlobByte(image,'\0'); in WriteVIFFImage()
1119 if (image->storage_class == DirectClass) in WriteVIFFImage()
1124 number_pixels=(MagickSizeType) image->columns*image->rows; in WriteVIFFImage()
1125 for (y=0; y < (ssize_t) image->rows; y++) in WriteVIFFImage()
1127 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteVIFFImage()
1130 for (x=0; x < (ssize_t) image->columns; x++) in WriteVIFFImage()
1132 *q=ScaleQuantumToChar(GetPixelRed(image,p)); in WriteVIFFImage()
1133 *(q+number_pixels)=ScaleQuantumToChar(GetPixelGreen(image,p)); in WriteVIFFImage()
1134 *(q+number_pixels*2)=ScaleQuantumToChar(GetPixelBlue(image,p)); in WriteVIFFImage()
1135 if (image->alpha_trait != UndefinedPixelTrait) in WriteVIFFImage()
1137 (GetPixelAlpha(image,p))); in WriteVIFFImage()
1138 p+=GetPixelChannels(image); in WriteVIFFImage()
1141 if (image->previous == (Image *) NULL) in WriteVIFFImage()
1143 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, in WriteVIFFImage()
1144 image->rows); in WriteVIFFImage()
1151 if (SetImageGray(image,exception) == MagickFalse) in WriteVIFFImage()
1159 viff_colormap=(unsigned char *) AcquireQuantumMemory(image->colors, in WriteVIFFImage()
1164 for (i=0; i < (ssize_t) image->colors; i++) in WriteVIFFImage()
1165 *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].red)); in WriteVIFFImage()
1166 for (i=0; i < (ssize_t) image->colors; i++) in WriteVIFFImage()
1167 *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].green)); in WriteVIFFImage()
1168 for (i=0; i < (ssize_t) image->colors; i++) in WriteVIFFImage()
1169 *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].blue)); in WriteVIFFImage()
1170 (void) WriteBlob(image,3*image->colors,viff_colormap); in WriteVIFFImage()
1176 for (y=0; y < (ssize_t) image->rows; y++) in WriteVIFFImage()
1178 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteVIFFImage()
1181 for (x=0; x < (ssize_t) image->columns; x++) in WriteVIFFImage()
1183 *q++=(unsigned char) GetPixelIndex(image,p); in WriteVIFFImage()
1184 p+=GetPixelChannels(image); in WriteVIFFImage()
1186 if (image->previous == (Image *) NULL) in WriteVIFFImage()
1188 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, in WriteVIFFImage()
1189 image->rows); in WriteVIFFImage()
1196 if (image->colors <= 2) in WriteVIFFImage()
1209 for (y=0; y < (ssize_t) image->rows; y++) in WriteVIFFImage()
1211 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteVIFFImage()
1216 for (x=0; x < (ssize_t) image->columns; x++) in WriteVIFFImage()
1219 if (GetPixelLuma(image,p) < (QuantumRange/2.0)) in WriteVIFFImage()
1228 p+=GetPixelChannels(image); in WriteVIFFImage()
1232 if (image->previous == (Image *) NULL) in WriteVIFFImage()
1234 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) in WriteVIFFImage()
1235 y,image->rows); in WriteVIFFImage()
1246 for (y=0; y < (ssize_t) image->rows; y++) in WriteVIFFImage()
1248 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteVIFFImage()
1251 for (x=0; x < (ssize_t) image->columns; x++) in WriteVIFFImage()
1253 *q++=(unsigned char) ClampToQuantum(GetPixelLuma(image,p)); in WriteVIFFImage()
1254 p+=GetPixelChannels(image); in WriteVIFFImage()
1256 if (image->previous == (Image *) NULL) in WriteVIFFImage()
1258 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) in WriteVIFFImage()
1259 y,image->rows); in WriteVIFFImage()
1265 (void) WriteBlob(image,(size_t) packets,pixels); in WriteVIFFImage()
1267 if (GetNextImageInList(image) == (Image *) NULL) in WriteVIFFImage()
1269 image=SyncNextImageInList(image); in WriteVIFFImage()
1270 status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength); in WriteVIFFImage()
1274 (void) CloseBlob(image); in WriteVIFFImage()