Lines Matching refs:image

241     *image;  in ReadSUNImage()  local
290 image=AcquireImage(image_info,exception); in ReadSUNImage()
291 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); in ReadSUNImage()
294 image=DestroyImageList(image); in ReadSUNImage()
301 sun_info.magic=ReadBlobMSBLong(image); in ReadSUNImage()
309 sun_info.width=ReadBlobMSBLong(image); in ReadSUNImage()
310 sun_info.height=ReadBlobMSBLong(image); in ReadSUNImage()
311 sun_info.depth=ReadBlobMSBLong(image); in ReadSUNImage()
312 sun_info.length=ReadBlobMSBLong(image); in ReadSUNImage()
313 sun_info.type=ReadBlobMSBLong(image); in ReadSUNImage()
314 sun_info.maptype=ReadBlobMSBLong(image); in ReadSUNImage()
315 sun_info.maplength=ReadBlobMSBLong(image); in ReadSUNImage()
316 if (sun_info.maplength > GetBlobSize(image)) in ReadSUNImage()
332 image->columns=sun_info.width; in ReadSUNImage()
333 image->rows=sun_info.height; in ReadSUNImage()
334 image->depth=sun_info.depth <= 8 ? sun_info.depth : in ReadSUNImage()
341 image->colors=sun_info.maplength; in ReadSUNImage()
344 image->colors=one << sun_info.depth; in ReadSUNImage()
346 image->colors=sun_info.maplength/3; in ReadSUNImage()
347 if (image->colors == 0) in ReadSUNImage()
349 if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) in ReadSUNImage()
364 sun_colormap=(unsigned char *) AcquireQuantumMemory(image->colors, in ReadSUNImage()
368 count=ReadBlob(image,image->colors,sun_colormap); in ReadSUNImage()
369 if (count != (ssize_t) image->colors) in ReadSUNImage()
374 for (i=0; i < (ssize_t) image->colors; i++) in ReadSUNImage()
375 image->colormap[i].red=(MagickRealType) ScaleCharToQuantum( in ReadSUNImage()
377 count=ReadBlob(image,image->colors,sun_colormap); in ReadSUNImage()
378 if (count != (ssize_t) image->colors) in ReadSUNImage()
383 for (i=0; i < (ssize_t) image->colors; i++) in ReadSUNImage()
384 image->colormap[i].green=(MagickRealType) ScaleCharToQuantum( in ReadSUNImage()
386 count=ReadBlob(image,image->colors,sun_colormap); in ReadSUNImage()
387 if (count != (ssize_t) image->colors) in ReadSUNImage()
392 for (i=0; i < (ssize_t) image->colors; i++) in ReadSUNImage()
393 image->colormap[i].blue=(MagickRealType) ScaleCharToQuantum( in ReadSUNImage()
410 count=ReadBlob(image,sun_info.maplength,sun_colormap); in ReadSUNImage()
419 image->alpha_trait=sun_info.depth == 32 ? BlendPixelTrait : in ReadSUNImage()
421 image->columns=sun_info.width; in ReadSUNImage()
422 image->rows=sun_info.height; in ReadSUNImage()
425 (void) CloseBlob(image); in ReadSUNImage()
426 return(GetFirstImageInList(image)); in ReadSUNImage()
428 status=SetImageExtent(image,image->columns,image->rows,exception); in ReadSUNImage()
430 return(DestroyImageList(image)); in ReadSUNImage()
433 number_pixels=(MagickSizeType) (image->columns*image->rows); in ReadSUNImage()
440 if (sun_info.length > GetBlobSize(image)) in ReadSUNImage()
446 count=(ssize_t) ReadBlob(image,sun_info.length,sun_data); in ReadSUNImage()
474 sun_pixels=(unsigned char *) AcquireQuantumMemory(pixels_length+image->rows, in ReadSUNImage()
481 (void) memset(sun_pixels,0,(pixels_length+image->rows)* in ReadSUNImage()
509 for (y=0; y < (ssize_t) image->rows; y++) in ReadSUNImage()
511 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadSUNImage()
514 for (x=0; x < ((ssize_t) image->columns-7); x+=8) in ReadSUNImage()
518 SetPixelIndex(image,(Quantum) ((*p) & (0x01 << bit) ? 0x00 : 0x01), in ReadSUNImage()
520 q+=GetPixelChannels(image); in ReadSUNImage()
524 if ((image->columns % 8) != 0) in ReadSUNImage()
526 for (bit=7; bit >= (int) (8-(image->columns % 8)); bit--) in ReadSUNImage()
528 SetPixelIndex(image,(Quantum) ((*p) & (0x01 << bit) ? 0x00 : in ReadSUNImage()
530 q+=GetPixelChannels(image); in ReadSUNImage()
534 if ((((image->columns/8)+(image->columns % 8 ? 1 : 0)) % 2) != 0) in ReadSUNImage()
536 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadSUNImage()
538 if (image->previous == (Image *) NULL) in ReadSUNImage()
540 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, in ReadSUNImage()
541 image->rows); in ReadSUNImage()
547 if (image->storage_class == PseudoClass) in ReadSUNImage()
549 for (y=0; y < (ssize_t) image->rows; y++) in ReadSUNImage()
551 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadSUNImage()
554 for (x=0; x < (ssize_t) image->columns; x++) in ReadSUNImage()
556 SetPixelIndex(image,ConstrainColormapIndex(image,*p,exception),q); in ReadSUNImage()
558 q+=GetPixelChannels(image); in ReadSUNImage()
560 if ((image->columns % 2) != 0) in ReadSUNImage()
562 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadSUNImage()
564 if (image->previous == (Image *) NULL) in ReadSUNImage()
566 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, in ReadSUNImage()
567 image->rows); in ReadSUNImage()
579 if (image->alpha_trait != UndefinedPixelTrait) in ReadSUNImage()
582 bytes_per_line=bytes_per_pixel*image->columns; in ReadSUNImage()
583 for (y=0; y < (ssize_t) image->rows; y++) in ReadSUNImage()
585 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadSUNImage()
588 for (x=0; x < (ssize_t) image->columns; x++) in ReadSUNImage()
590 if (image->alpha_trait != UndefinedPixelTrait) in ReadSUNImage()
591 SetPixelAlpha(image,ScaleCharToQuantum(*p++),q); in ReadSUNImage()
594 SetPixelBlue(image,ScaleCharToQuantum(*p++),q); in ReadSUNImage()
595 SetPixelGreen(image,ScaleCharToQuantum(*p++),q); in ReadSUNImage()
596 SetPixelRed(image,ScaleCharToQuantum(*p++),q); in ReadSUNImage()
600 SetPixelRed(image,ScaleCharToQuantum(*p++),q); in ReadSUNImage()
601 SetPixelGreen(image,ScaleCharToQuantum(*p++),q); in ReadSUNImage()
602 SetPixelBlue(image,ScaleCharToQuantum(*p++),q); in ReadSUNImage()
604 if (image->colors != 0) in ReadSUNImage()
606 SetPixelRed(image,ClampToQuantum(image->colormap[(ssize_t) in ReadSUNImage()
607 GetPixelRed(image,q)].red),q); in ReadSUNImage()
608 SetPixelGreen(image,ClampToQuantum(image->colormap[(ssize_t) in ReadSUNImage()
609 GetPixelGreen(image,q)].green),q); in ReadSUNImage()
610 SetPixelBlue(image,ClampToQuantum(image->colormap[(ssize_t) in ReadSUNImage()
611 GetPixelBlue(image,q)].blue),q); in ReadSUNImage()
613 q+=GetPixelChannels(image); in ReadSUNImage()
615 if (((bytes_per_pixel*image->columns) % 2) != 0) in ReadSUNImage()
617 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadSUNImage()
619 if (image->previous == (Image *) NULL) in ReadSUNImage()
621 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, in ReadSUNImage()
622 image->rows); in ReadSUNImage()
628 if (image->storage_class == PseudoClass) in ReadSUNImage()
629 (void) SyncImage(image,exception); in ReadSUNImage()
631 if (EOFBlob(image) != MagickFalse) in ReadSUNImage()
634 image->filename); in ReadSUNImage()
641 if (image->scene >= (image_info->scene+image_info->number_scenes-1)) in ReadSUNImage()
643 sun_info.magic=ReadBlobMSBLong(image); in ReadSUNImage()
649 AcquireNextImage(image_info,image,exception); in ReadSUNImage()
650 if (GetNextImageInList(image) == (Image *) NULL) in ReadSUNImage()
655 image=SyncNextImageInList(image); in ReadSUNImage()
656 status=SetImageProgress(image,LoadImagesTag,TellBlob(image), in ReadSUNImage()
657 GetBlobSize(image)); in ReadSUNImage()
662 (void) CloseBlob(image); in ReadSUNImage()
664 return(DestroyImageList(image)); in ReadSUNImage()
665 return(GetFirstImageInList(image)); in ReadSUNImage()
762 static MagickBooleanType WriteSUNImage(const ImageInfo *image_info,Image *image, in WriteSUNImage() argument
814 assert(image != (Image *) NULL); in WriteSUNImage()
815 assert(image->signature == MagickCoreSignature); in WriteSUNImage()
816 if (image->debug != MagickFalse) in WriteSUNImage()
817 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); in WriteSUNImage()
820 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); in WriteSUNImage()
824 imageListLength=GetImageListLength(image); in WriteSUNImage()
830 (void) TransformImageColorspace(image,sRGBColorspace,exception); in WriteSUNImage()
832 if ((image->columns != (unsigned int) image->columns) || in WriteSUNImage()
833 (image->rows != (unsigned int) image->rows)) in WriteSUNImage()
835 sun_info.width=(unsigned int) image->columns; in WriteSUNImage()
836 sun_info.height=(unsigned int) image->rows; in WriteSUNImage()
838 (image->storage_class == DirectClass ? RT_FORMAT_RGB : RT_STANDARD); in WriteSUNImage()
841 number_pixels=(MagickSizeType) image->columns*image->rows; in WriteSUNImage()
844 if (image->storage_class == DirectClass) in WriteSUNImage()
849 sun_info.depth=(unsigned int) image->alpha_trait != in WriteSUNImage()
851 sun_info.length=(unsigned int) ((image->alpha_trait != in WriteSUNImage()
853 sun_info.length+=sun_info.length & 0x01 ? (unsigned int) image->rows : in WriteSUNImage()
857 if (SetImageMonochrome(image,exception) != MagickFalse) in WriteSUNImage()
863 sun_info.length=(unsigned int) (((image->columns+7) >> 3)* in WriteSUNImage()
864 image->rows); in WriteSUNImage()
865 sun_info.length+=(unsigned int) (((image->columns/8)+(image->columns % in WriteSUNImage()
866 8 ? 1 : 0)) % 2 ? image->rows : 0); in WriteSUNImage()
875 sun_info.length+=(unsigned int) (image->columns & 0x01 ? image->rows : in WriteSUNImage()
878 sun_info.maplength=(unsigned int) (3*image->colors); in WriteSUNImage()
883 (void) WriteBlobMSBLong(image,sun_info.magic); in WriteSUNImage()
884 (void) WriteBlobMSBLong(image,sun_info.width); in WriteSUNImage()
885 (void) WriteBlobMSBLong(image,sun_info.height); in WriteSUNImage()
886 (void) WriteBlobMSBLong(image,sun_info.depth); in WriteSUNImage()
887 (void) WriteBlobMSBLong(image,sun_info.length); in WriteSUNImage()
888 (void) WriteBlobMSBLong(image,sun_info.type); in WriteSUNImage()
889 (void) WriteBlobMSBLong(image,sun_info.maptype); in WriteSUNImage()
890 (void) WriteBlobMSBLong(image,sun_info.maplength); in WriteSUNImage()
896 if (image->storage_class == DirectClass) in WriteSUNImage()
912 if (image->alpha_trait != UndefinedPixelTrait) in WriteSUNImage()
914 length=image->columns; in WriteSUNImage()
921 for (y=0; y < (ssize_t) image->rows; y++) in WriteSUNImage()
923 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteSUNImage()
927 for (x=0; x < (ssize_t) image->columns; x++) in WriteSUNImage()
929 if (image->alpha_trait != UndefinedPixelTrait) in WriteSUNImage()
930 *q++=ScaleQuantumToChar(GetPixelAlpha(image,p)); in WriteSUNImage()
931 *q++=ScaleQuantumToChar(GetPixelRed(image,p)); in WriteSUNImage()
932 *q++=ScaleQuantumToChar(GetPixelGreen(image,p)); in WriteSUNImage()
933 *q++=ScaleQuantumToChar(GetPixelBlue(image,p)); in WriteSUNImage()
934 p+=GetPixelChannels(image); in WriteSUNImage()
936 if (((bytes_per_pixel*image->columns) & 0x01) != 0) in WriteSUNImage()
938 (void) WriteBlob(image,(size_t) (q-pixels),pixels); in WriteSUNImage()
939 if (image->previous == (Image *) NULL) in WriteSUNImage()
941 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, in WriteSUNImage()
942 image->rows); in WriteSUNImage()
950 if (SetImageMonochrome(image,exception) != MagickFalse) in WriteSUNImage()
959 (void) SetImageType(image,BilevelType,exception); in WriteSUNImage()
960 for (y=0; y < (ssize_t) image->rows; y++) in WriteSUNImage()
962 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteSUNImage()
967 for (x=0; x < (ssize_t) image->columns; x++) in WriteSUNImage()
970 if (GetPixelLuma(image,p) < (QuantumRange/2.0)) in WriteSUNImage()
975 (void) WriteBlobByte(image,byte); in WriteSUNImage()
979 p+=GetPixelChannels(image); in WriteSUNImage()
982 (void) WriteBlobByte(image,(unsigned char) (byte << (8-bit))); in WriteSUNImage()
983 if ((((image->columns/8)+ in WriteSUNImage()
984 (image->columns % 8 ? 1 : 0)) % 2) != 0) in WriteSUNImage()
985 (void) WriteBlobByte(image,0); /* pad scanline */ in WriteSUNImage()
986 if (image->previous == (Image *) NULL) in WriteSUNImage()
988 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, in WriteSUNImage()
989 image->rows); in WriteSUNImage()
1000 for (i=0; i < (ssize_t) image->colors; i++) in WriteSUNImage()
1001 (void) WriteBlobByte(image,ScaleQuantumToChar( in WriteSUNImage()
1002 ClampToQuantum(image->colormap[i].red))); in WriteSUNImage()
1003 for (i=0; i < (ssize_t) image->colors; i++) in WriteSUNImage()
1004 (void) WriteBlobByte(image,ScaleQuantumToChar( in WriteSUNImage()
1005 ClampToQuantum(image->colormap[i].green))); in WriteSUNImage()
1006 for (i=0; i < (ssize_t) image->colors; i++) in WriteSUNImage()
1007 (void) WriteBlobByte(image,ScaleQuantumToChar( in WriteSUNImage()
1008 ClampToQuantum(image->colormap[i].blue))); in WriteSUNImage()
1012 for (y=0; y < (ssize_t) image->rows; y++) in WriteSUNImage()
1014 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteSUNImage()
1017 for (x=0; x < (ssize_t) image->columns; x++) in WriteSUNImage()
1019 (void) WriteBlobByte(image,(unsigned char) in WriteSUNImage()
1020 GetPixelIndex(image,p)); in WriteSUNImage()
1021 p+=GetPixelChannels(image); in WriteSUNImage()
1023 if (image->columns & 0x01) in WriteSUNImage()
1024 (void) WriteBlobByte(image,0); /* pad scanline */ in WriteSUNImage()
1025 if (image->previous == (Image *) NULL) in WriteSUNImage()
1027 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, in WriteSUNImage()
1028 image->rows); in WriteSUNImage()
1034 if (GetNextImageInList(image) == (Image *) NULL) in WriteSUNImage()
1036 image=SyncNextImageInList(image); in WriteSUNImage()
1037 status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength); in WriteSUNImage()
1041 (void) CloseBlob(image); in WriteSUNImage()