Lines Matching refs:image
236 *image; in ReadPALMImage() local
299 image=AcquireImage(image_info,exception); in ReadPALMImage()
300 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); in ReadPALMImage()
303 (void) DestroyImageList(image); in ReadPALMImage()
309 image->columns=ReadBlobMSBShort(image); in ReadPALMImage()
310 image->rows=ReadBlobMSBShort(image); in ReadPALMImage()
311 if (EOFBlob(image) != MagickFalse) in ReadPALMImage()
313 if ((image->columns == 0) || (image->rows == 0)) in ReadPALMImage()
315 status=SetImageExtent(image,image->columns,image->rows,exception); in ReadPALMImage()
317 return(DestroyImageList(image)); in ReadPALMImage()
318 (void) SetImageBackgroundColor(image,exception); in ReadPALMImage()
319 bytes_per_row=ReadBlobMSBShort(image); in ReadPALMImage()
320 flags=ReadBlobMSBShort(image); in ReadPALMImage()
321 bits_per_pixel=(size_t) ReadBlobByte(image); in ReadPALMImage()
326 version=(size_t) ReadBlobByte(image); in ReadPALMImage()
329 nextDepthOffset=(size_t) ReadBlobMSBShort(image); in ReadPALMImage()
330 transparentIndex=(size_t) ReadBlobByte(image); in ReadPALMImage()
331 compressionType=(size_t) ReadBlobByte(image); in ReadPALMImage()
336 pad=ReadBlobMSBShort(image); in ReadPALMImage()
343 (AcquireImageColormap(image,one << bits_per_pixel,exception) == MagickFalse)) in ReadPALMImage()
345 GetPixelInfo(image,&transpix); in ReadPALMImage()
348 redbits=(size_t) ReadBlobByte(image); /* # of bits of red */ in ReadPALMImage()
350 greenbits=(size_t) ReadBlobByte(image); /* # of bits of green */ in ReadPALMImage()
352 bluebits=(size_t) ReadBlobByte(image); /* # of bits of blue */ in ReadPALMImage()
354 ReadBlobByte(image); /* reserved by Palm */ in ReadPALMImage()
355 ReadBlobByte(image); /* reserved by Palm */ in ReadPALMImage()
356 transpix.red=(double) (QuantumRange*ReadBlobByte(image)/31); in ReadPALMImage()
357 transpix.green=(double) (QuantumRange*ReadBlobByte(image)/63); in ReadPALMImage()
358 transpix.blue=(double) (QuantumRange*ReadBlobByte(image)/31); in ReadPALMImage()
367 count=(ssize_t) ReadBlobMSBShort(image); in ReadPALMImage()
370 ReadBlobByte(image); in ReadPALMImage()
371 index=ConstrainColormapIndex(image,255-i,exception); in ReadPALMImage()
372 image->colormap[index].red=(MagickRealType) in ReadPALMImage()
373 ScaleCharToQuantum((unsigned char) ReadBlobByte(image)); in ReadPALMImage()
374 image->colormap[index].green=(MagickRealType) in ReadPALMImage()
375 ScaleCharToQuantum((unsigned char) ReadBlobByte(image)); in ReadPALMImage()
376 image->colormap[index].blue=(MagickRealType) in ReadPALMImage()
377 ScaleCharToQuantum((unsigned char) ReadBlobByte(image)); in ReadPALMImage()
383 index=ConstrainColormapIndex(image,255-i,exception); in ReadPALMImage()
384 image->colormap[index].red=(MagickRealType) in ReadPALMImage()
386 image->colormap[index].green=(MagickRealType) in ReadPALMImage()
388 image->colormap[index].blue=(MagickRealType) in ReadPALMImage()
393 size=ReadBlobMSBShort(image); in ReadPALMImage()
395 image->storage_class=DirectClass; in ReadPALMImage()
398 image->storage_class=PseudoClass; in ReadPALMImage()
399 image->depth=8; in ReadPALMImage()
403 (void) CloseBlob(image); in ReadPALMImage()
404 return(image); in ReadPALMImage()
406 status=SetImageExtent(image,image->columns,image->rows,exception); in ReadPALMImage()
408 return(DestroyImageList(image)); in ReadPALMImage()
409 extent=MagickMax(bytes_per_row,2*image->columns); in ReadPALMImage()
418 2*image->columns),sizeof(*last_row)); in ReadPALMImage()
424 (void) memset(last_row,0,MagickMax(bytes_per_row,2*image->columns)* in ReadPALMImage()
428 for (y=0; y < (ssize_t) image->rows; y++) in ReadPALMImage()
433 image->compression=NoCompression; in ReadPALMImage()
434 count=ReadBlob(image,bytes_per_row,one_row); in ReadPALMImage()
443 image->compression=RLECompression; in ReadPALMImage()
446 count=(ssize_t) ReadBlobByte(image); in ReadPALMImage()
450 byte=(size_t) ReadBlobByte(image); in ReadPALMImage()
463 image->compression=FaxCompression; in ReadPALMImage()
466 count=(ssize_t) ReadBlobByte(image); in ReadPALMImage()
473 one_row[i+bit]=(unsigned char) ReadBlobByte(image); in ReadPALMImage()
482 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadPALMImage()
487 if (image->columns > (2*bytes_per_row)) in ReadPALMImage()
494 for (x=0; x < (ssize_t) image->columns; x++) in ReadPALMImage()
498 SetPixelRed(image,(Quantum) ((QuantumRange*((color16 >> 11) & in ReadPALMImage()
500 SetPixelGreen(image,(Quantum) ((QuantumRange*((color16 >> 5) & in ReadPALMImage()
502 SetPixelBlue(image,(Quantum) ((QuantumRange*((color16 >> 0) & in ReadPALMImage()
504 SetPixelAlpha(image,OpaqueAlpha,q); in ReadPALMImage()
505 q+=GetPixelChannels(image); in ReadPALMImage()
511 for (x=0; x < (ssize_t) image->columns; x++) in ReadPALMImage()
521 SetPixelIndex(image,index,q); in ReadPALMImage()
522 SetPixelViaPixelInfo(image,image->colormap+(ssize_t) index,q); in ReadPALMImage()
530 q+=GetPixelChannels(image); in ReadPALMImage()
532 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadPALMImage()
535 if (image->previous == (Image *) NULL) in ReadPALMImage()
537 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, in ReadPALMImage()
538 image->rows); in ReadPALMImage()
545 ssize_t index=ConstrainColormapIndex(image,(ssize_t) (mask- in ReadPALMImage()
548 transpix=image->colormap[index]; in ReadPALMImage()
549 (void) TransparentPaintImage(image,&transpix,(Quantum) TransparentAlpha, in ReadPALMImage()
555 if (EOFBlob(image) != MagickFalse) in ReadPALMImage()
558 image->filename); in ReadPALMImage()
565 if (image->scene >= (image_info->scene+image_info->number_scenes-1)) in ReadPALMImage()
573 if (totalOffset >= (MagickOffsetType) GetBlobSize(image)) in ReadPALMImage()
576 seekNextDepth=SeekBlob(image,totalOffset,SEEK_SET); in ReadPALMImage()
582 AcquireNextImage(image_info,image,exception); in ReadPALMImage()
583 if (GetNextImageInList(image) == (Image *) NULL) in ReadPALMImage()
588 image=SyncNextImageInList(image); in ReadPALMImage()
589 status=SetImageProgress(image,LoadImagesTag,TellBlob(image), in ReadPALMImage()
590 GetBlobSize(image)); in ReadPALMImage()
595 (void) CloseBlob(image); in ReadPALMImage()
597 return(DestroyImageList(image)); in ReadPALMImage()
598 return(GetFirstImageInList(image)); in ReadPALMImage()
689 Image *image,ExceptionInfo *exception) in WritePALMImage() argument
749 assert(image != (Image *) NULL); in WritePALMImage()
750 assert(image->signature == MagickCoreSignature); in WritePALMImage()
751 if (image->debug != MagickFalse) in WritePALMImage()
752 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); in WritePALMImage()
755 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); in WritePALMImage()
769 imageListLength=GetImageListLength(image); in WritePALMImage()
772 (void) TransformImageColorspace(image,sRGBColorspace,exception); in WritePALMImage()
773 count=GetNumberColors(image,NULL,exception); in WritePALMImage()
779 (void) TransformImageColorspace(image,image->colorspace,exception); in WritePALMImage()
782 (void) TransformImageColorspace(image,GRAYColorspace,exception); in WritePALMImage()
783 (void) SetImageType(image,PaletteType,exception); in WritePALMImage()
784 (void) SortColormapByIntensity(image,exception); in WritePALMImage()
786 if ((image->storage_class == PseudoClass) && (image->colors > 256)) in WritePALMImage()
787 (void) SetImageStorageClass(image,DirectClass,exception); in WritePALMImage()
788 if (image->storage_class == PseudoClass) in WritePALMImage()
792 (void) WriteBlobMSBShort(image,(unsigned short) image->columns); /* width */ in WritePALMImage()
793 (void) WriteBlobMSBShort(image,(unsigned short) image->rows); /* height */ in WritePALMImage()
794 bytes_per_row=((image->columns+(16/bits_per_pixel-1))/(16/ in WritePALMImage()
796 (void) WriteBlobMSBShort(image,(unsigned short) bytes_per_row); in WritePALMImage()
800 (void) WriteBlobMSBShort(image, flags); in WritePALMImage()
801 (void) WriteBlobByte(image,(unsigned char) bits_per_pixel); in WritePALMImage()
807 (void) WriteBlobByte(image,version); in WritePALMImage()
808 (void) WriteBlobMSBShort(image,0); /* nextDepthOffset */ in WritePALMImage()
809 (void) WriteBlobByte(image,(unsigned char) transparentIndex); in WritePALMImage()
811 (void) WriteBlobByte(image,PALM_COMPRESSION_RLE); in WritePALMImage()
814 (void) WriteBlobByte(image,PALM_COMPRESSION_SCANLINE); in WritePALMImage()
816 (void) WriteBlobByte(image,PALM_COMPRESSION_NONE); in WritePALMImage()
817 (void) WriteBlobMSBShort(image,0); /* reserved */ in WritePALMImage()
821 (void) WriteBlobByte(image,5); /* # of bits of red */ in WritePALMImage()
822 (void) WriteBlobByte(image,6); /* # of bits of green */ in WritePALMImage()
823 (void) WriteBlobByte(image,5); /* # of bits of blue */ in WritePALMImage()
824 (void) WriteBlobByte(image,0); /* reserved by Palm */ in WritePALMImage()
825 (void) WriteBlobMSBLong(image,0); /* no transparent color, YET */ in WritePALMImage()
832 quantize_info->dither_method=IdentifyPaletteImage(image,exception) in WritePALMImage()
834 quantize_info->number_colors=image->colors; in WritePALMImage()
835 (void) QuantizeImage(quantize_info,image,exception); in WritePALMImage()
836 (void) WriteBlobMSBShort(image,(unsigned short) image->colors); in WritePALMImage()
837 for (count = 0; count < image->colors; count++) in WritePALMImage()
839 (void) WriteBlobByte(image,(unsigned char) count); in WritePALMImage()
840 (void) WriteBlobByte(image,ScaleQuantumToChar(ClampToQuantum( in WritePALMImage()
841 image->colormap[count].red))); in WritePALMImage()
842 (void) WriteBlobByte(image,ScaleQuantumToChar(ClampToQuantum( in WritePALMImage()
843 image->colormap[count].green))); in WritePALMImage()
844 (void) WriteBlobByte(image,ScaleQuantumToChar(ClampToQuantum( in WritePALMImage()
845 image->colormap[count].blue))); in WritePALMImage()
858 (void) RemapImage(quantize_info,image,affinity_image,exception); in WritePALMImage()
859 for (y=0; y < (ssize_t) image->rows; y++) in WritePALMImage()
861 q=GetAuthenticPixels(image,0,y,image->columns,1,exception); in WritePALMImage()
864 for (x=0; x < (ssize_t) image->columns; x++) in WritePALMImage()
866 SetPixelIndex(image,(Quantum) FindColor(&image->colormap[(ssize_t) in WritePALMImage()
867 GetPixelIndex(image,q)]),q); in WritePALMImage()
868 q+=GetPixelChannels(image); in WritePALMImage()
875 (void) WriteBlobMSBShort(image,0); /* fill in size later */ in WritePALMImage()
896 for (y=0; y < (ssize_t) image->rows; y++) in WritePALMImage()
900 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WritePALMImage()
905 for (x=0; x < (ssize_t) image->columns; x++) in WritePALMImage()
907 color16=(unsigned short) ((((31*(size_t) GetPixelRed(image,p))/ in WritePALMImage()
909 GetPixelGreen(image,p))/(size_t) QuantumRange) << 5) | in WritePALMImage()
910 ((31*(size_t) GetPixelBlue(image,p))/(size_t) QuantumRange)); in WritePALMImage()
911 if (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha) in WritePALMImage()
913 transpix.red=(MagickRealType) GetPixelRed(image,p); in WritePALMImage()
914 transpix.green=(MagickRealType) GetPixelGreen(image,p); in WritePALMImage()
915 transpix.blue=(MagickRealType) GetPixelBlue(image,p); in WritePALMImage()
916 transpix.alpha=(MagickRealType) GetPixelAlpha(image,p); in WritePALMImage()
921 p+=GetPixelChannels(image); in WritePALMImage()
928 for (x=0; x < (ssize_t) image->columns; x++) in WritePALMImage()
931 color=(unsigned char) GetPixelIndex(image,p); in WritePALMImage()
933 color=(unsigned char) (GetPixelIndex(image,p)* in WritePALMImage()
934 ((one << bits_per_pixel)-1)/MagickMax(1*image->colors-1,1)); in WritePALMImage()
944 p+=GetPixelChannels(image); in WritePALMImage()
946 if ((image->columns % (8/bits_per_pixel)) != 0) in WritePALMImage()
959 (void) WriteBlobByte(image,(unsigned char) count); in WritePALMImage()
960 (void) WriteBlobByte(image,(unsigned char) byte); in WritePALMImage()
981 (void) WriteBlobByte(image, byte); in WritePALMImage()
982 (void) WriteBlob(image,tptr-tmpbuf,(unsigned char *) tmpbuf); in WritePALMImage()
987 (void) WriteBlob(image,bytes_per_row,one_row); in WritePALMImage()
991 offset=SeekBlob(image,currentOffset+6,SEEK_SET); in WritePALMImage()
992 (void) WriteBlobMSBShort(image,flags); in WritePALMImage()
993 offset=SeekBlob(image,currentOffset+12,SEEK_SET); in WritePALMImage()
994 (void) WriteBlobByte(image,(unsigned char) transparentIndex); /* trans index */ in WritePALMImage()
998 offset=SeekBlob(image,currentOffset+20,SEEK_SET); in WritePALMImage()
999 (void) WriteBlobByte(image,0); /* reserved by Palm */ in WritePALMImage()
1000 (void) WriteBlobByte(image,(unsigned char) ((31*transpix.red)/ in WritePALMImage()
1002 (void) WriteBlobByte(image,(unsigned char) ((63*transpix.green)/ in WritePALMImage()
1004 (void) WriteBlobByte(image,(unsigned char) ((31*transpix.blue)/ in WritePALMImage()
1009 offset=SeekBlob(image,currentOffset+offset,SEEK_SET); in WritePALMImage()
1010 (void) WriteBlobMSBShort(image,(unsigned short) (GetBlobSize(image)- in WritePALMImage()
1017 if (GetNextImageInList(image) == (Image *) NULL) in WritePALMImage()
1020 for (cc=(GetBlobSize(image)) % 4; cc > 0; cc--) in WritePALMImage()
1021 (void) WriteBlobByte(image,0); in WritePALMImage()
1023 offset=SeekBlob(image,currentOffset+10,SEEK_SET); in WritePALMImage()
1024 nextDepthOffset=(size_t) ((GetBlobSize(image)-currentOffset)/4); in WritePALMImage()
1025 (void) WriteBlobMSBShort(image,(unsigned short) nextDepthOffset); in WritePALMImage()
1026 currentOffset=(MagickOffsetType) GetBlobSize(image); in WritePALMImage()
1027 offset=SeekBlob(image,currentOffset,SEEK_SET); in WritePALMImage()
1028 image=SyncNextImageInList(image); in WritePALMImage()
1029 status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength); in WritePALMImage()
1034 (void) CloseBlob(image); in WritePALMImage()