Lines Matching refs:image

147     *image;  in ReadHDRImage()  local
185 image=AcquireImage(image_info,exception); in ReadHDRImage()
186 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); in ReadHDRImage()
189 image=DestroyImageList(image); in ReadHDRImage()
195 image->columns=0; in ReadHDRImage()
196 image->rows=0; in ReadHDRImage()
198 c=ReadBlobByte(image); in ReadHDRImage()
201 image=DestroyImage(image); in ReadHDRImage()
204 while (isgraph(c) && (image->columns == 0) && (image->rows == 0)) in ReadHDRImage()
224 c=ReadBlobByte(image); in ReadHDRImage()
242 (void) SetImageProperty(image,"comment",comment,exception); in ReadHDRImage()
244 c=ReadBlobByte(image); in ReadHDRImage()
248 c=ReadBlobByte(image); in ReadHDRImage()
262 c=ReadBlobByte(image); in ReadHDRImage()
270 c=ReadBlobByte(image); in ReadHDRImage()
281 c=ReadBlobByte(image); in ReadHDRImage()
298 (void) SetImageProperty(image,tag,value,exception); in ReadHDRImage()
306 image->gamma=StringToDouble(value,(char **) NULL); in ReadHDRImage()
310 (void) SetImageProperty(image,tag,value,exception); in ReadHDRImage()
331 image->chromaticity.red_primary.x=chromaticity[0]; in ReadHDRImage()
332 image->chromaticity.red_primary.y=chromaticity[1]; in ReadHDRImage()
333 image->chromaticity.green_primary.x=chromaticity[2]; in ReadHDRImage()
334 image->chromaticity.green_primary.y=chromaticity[3]; in ReadHDRImage()
335 image->chromaticity.blue_primary.x=chromaticity[4]; in ReadHDRImage()
336 image->chromaticity.blue_primary.y=chromaticity[5]; in ReadHDRImage()
337 image->chromaticity.white_point.x=white_point[0], in ReadHDRImage()
338 image->chromaticity.white_point.y=white_point[1]; in ReadHDRImage()
343 (void) SetImageProperty(image,tag,value,exception); in ReadHDRImage()
360 image->columns=(size_t) width; in ReadHDRImage()
361 image->rows=(size_t) height; in ReadHDRImage()
366 (void) SetImageProperty(image,tag,value,exception); in ReadHDRImage()
372 (void) SetImageProperty(image,tag,value,exception); in ReadHDRImage()
377 if ((image->columns == 0) && (image->rows == 0)) in ReadHDRImage()
379 c=ReadBlobByte(image); in ReadHDRImage()
384 if ((image->columns == 0) || (image->rows == 0)) in ReadHDRImage()
386 (void) SetImageColorspace(image,RGBColorspace,exception); in ReadHDRImage()
388 (void) SetImageColorspace(image,XYZColorspace,exception); in ReadHDRImage()
389 image->compression=(image->columns < 8) || (image->columns > 0x7ffff) ? in ReadHDRImage()
393 (void) CloseBlob(image); in ReadHDRImage()
394 return(GetFirstImageInList(image)); in ReadHDRImage()
396 status=SetImageExtent(image,image->columns,image->rows,exception); in ReadHDRImage()
398 return(DestroyImageList(image)); in ReadHDRImage()
402 pixels=(unsigned char *) AcquireQuantumMemory(image->columns,4* in ReadHDRImage()
406 (void) memset(pixels,0,4*image->columns*sizeof(*pixels)); in ReadHDRImage()
407 for (y=0; y < (ssize_t) image->rows; y++) in ReadHDRImage()
409 if (image->compression != RLECompression) in ReadHDRImage()
411 count=ReadBlob(image,4*image->columns*sizeof(*pixels),pixels); in ReadHDRImage()
412 if (count != (ssize_t) (4*image->columns*sizeof(*pixels))) in ReadHDRImage()
417 count=ReadBlob(image,4*sizeof(*pixel),pixel); in ReadHDRImage()
420 if ((size_t) ((((size_t) pixel[2]) << 8) | pixel[3]) != image->columns) in ReadHDRImage()
423 count=ReadBlob(image,4*(image->columns-1)*sizeof(*pixels),pixels+4); in ReadHDRImage()
424 image->compression=NoCompression; in ReadHDRImage()
431 end=&pixels[(i+1)*image->columns]; in ReadHDRImage()
434 count=ReadBlob(image,2*sizeof(*pixel),pixel); in ReadHDRImage()
453 count=ReadBlob(image,(size_t) count*sizeof(*p),p); in ReadHDRImage()
463 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); in ReadHDRImage()
467 for (x=0; x < (ssize_t) image->columns; x++) in ReadHDRImage()
469 if (image->compression == RLECompression) in ReadHDRImage()
472 pixel[1]=pixels[x+image->columns]; in ReadHDRImage()
473 pixel[2]=pixels[x+2*image->columns]; in ReadHDRImage()
474 pixel[3]=pixels[x+3*image->columns]; in ReadHDRImage()
483 SetPixelRed(image,0,q); in ReadHDRImage()
484 SetPixelGreen(image,0,q); in ReadHDRImage()
485 SetPixelBlue(image,0,q); in ReadHDRImage()
489 SetPixelRed(image,ClampToQuantum(QuantumRange*gamma*pixel[0]),q); in ReadHDRImage()
490 SetPixelGreen(image,ClampToQuantum(QuantumRange*gamma*pixel[1]),q); in ReadHDRImage()
491 SetPixelBlue(image,ClampToQuantum(QuantumRange*gamma*pixel[2]),q); in ReadHDRImage()
493 q+=GetPixelChannels(image); in ReadHDRImage()
495 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadHDRImage()
497 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, in ReadHDRImage()
498 image->rows); in ReadHDRImage()
503 if (EOFBlob(image) != MagickFalse) in ReadHDRImage()
505 image->filename); in ReadHDRImage()
506 (void) CloseBlob(image); in ReadHDRImage()
507 return(GetFirstImageInList(image)); in ReadHDRImage()
595 static size_t HDRWriteRunlengthPixels(Image *image,unsigned char *pixels) in HDRWriteRunlengthPixels() argument
613 for (p=0; p < image->columns; ) in HDRWriteRunlengthPixels()
618 while ((runlength < MinimumRunlength) && (q < image->columns)) in HDRWriteRunlengthPixels()
624 ((q+runlength) < image->columns) && (runlength < 127)) in HDRWriteRunlengthPixels()
631 if (WriteBlob(image,2*sizeof(*pixel),pixel) < 1) in HDRWriteRunlengthPixels()
641 if (WriteBlob(image,sizeof(*pixel),pixel) < 1) in HDRWriteRunlengthPixels()
643 if (WriteBlob(image,(size_t) count*sizeof(*pixel),&pixels[p]) < 1) in HDRWriteRunlengthPixels()
651 if (WriteBlob(image,2*sizeof(*pixel),pixel) < 1) in HDRWriteRunlengthPixels()
659 static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, in WriteHDRImage() argument
694 assert(image != (Image *) NULL); in WriteHDRImage()
695 assert(image->signature == MagickCoreSignature); in WriteHDRImage()
696 if (image->debug != MagickFalse) in WriteHDRImage()
697 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); in WriteHDRImage()
700 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); in WriteHDRImage()
703 if (IsRGBColorspace(image->colorspace) == MagickFalse) in WriteHDRImage()
704 (void) TransformImageColorspace(image,RGBColorspace,exception); in WriteHDRImage()
710 (void) WriteBlob(image,length,(unsigned char *) header); in WriteHDRImage()
711 property=GetImageProperty(image,"comment",exception); in WriteHDRImage()
717 (void) WriteBlob(image,(size_t) count,(unsigned char *) header); in WriteHDRImage()
719 property=GetImageProperty(image,"hdr:exposure",exception); in WriteHDRImage()
724 (void) WriteBlob(image,(size_t) count,(unsigned char *) header); in WriteHDRImage()
726 if (image->gamma != 0.0) in WriteHDRImage()
729 image->gamma); in WriteHDRImage()
730 (void) WriteBlob(image,(size_t) count,(unsigned char *) header); in WriteHDRImage()
734 image->chromaticity.red_primary.x,image->chromaticity.red_primary.y, in WriteHDRImage()
735 image->chromaticity.green_primary.x,image->chromaticity.green_primary.y, in WriteHDRImage()
736 image->chromaticity.blue_primary.x,image->chromaticity.blue_primary.y, in WriteHDRImage()
737 image->chromaticity.white_point.x,image->chromaticity.white_point.y); in WriteHDRImage()
738 (void) WriteBlob(image,(size_t) count,(unsigned char *) header); in WriteHDRImage()
740 (void) WriteBlob(image,length,(unsigned char *) header); in WriteHDRImage()
742 (double) image->rows,(double) image->columns); in WriteHDRImage()
743 (void) WriteBlob(image,(size_t) count,(unsigned char *) header); in WriteHDRImage()
747 pixels=(unsigned char *) AcquireQuantumMemory(image->columns+128,4* in WriteHDRImage()
751 (void) memset(pixels,0,4*(image->columns+128)*sizeof(*pixels)); in WriteHDRImage()
752 for (y=0; y < (ssize_t) image->rows; y++) in WriteHDRImage()
754 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteHDRImage()
757 if ((image->columns >= 8) && (image->columns <= 0x7ffff)) in WriteHDRImage()
761 pixel[2]=(unsigned char) (image->columns >> 8); in WriteHDRImage()
762 pixel[3]=(unsigned char) (image->columns & 0xff); in WriteHDRImage()
763 count=WriteBlob(image,4*sizeof(*pixel),pixel); in WriteHDRImage()
768 for (x=0; x < (ssize_t) image->columns; x++) in WriteHDRImage()
777 gamma=QuantumScale*GetPixelRed(image,p); in WriteHDRImage()
778 if ((QuantumScale*GetPixelGreen(image,p)) > gamma) in WriteHDRImage()
779 gamma=QuantumScale*GetPixelGreen(image,p); in WriteHDRImage()
780 if ((QuantumScale*GetPixelBlue(image,p)) > gamma) in WriteHDRImage()
781 gamma=QuantumScale*GetPixelBlue(image,p); in WriteHDRImage()
788 pixel[0]=(unsigned char) (gamma*QuantumScale*GetPixelRed(image,p)); in WriteHDRImage()
789 pixel[1]=(unsigned char) (gamma*QuantumScale*GetPixelGreen(image,p)); in WriteHDRImage()
790 pixel[2]=(unsigned char) (gamma*QuantumScale*GetPixelBlue(image,p)); in WriteHDRImage()
793 if ((image->columns >= 8) && (image->columns <= 0x7ffff)) in WriteHDRImage()
796 pixels[x+image->columns]=pixel[1]; in WriteHDRImage()
797 pixels[x+2*image->columns]=pixel[2]; in WriteHDRImage()
798 pixels[x+3*image->columns]=pixel[3]; in WriteHDRImage()
807 p+=GetPixelChannels(image); in WriteHDRImage()
809 if ((image->columns >= 8) && (image->columns <= 0x7ffff)) in WriteHDRImage()
812 length=HDRWriteRunlengthPixels(image,&pixels[i*image->columns]); in WriteHDRImage()
816 count=WriteBlob(image,4*image->columns*sizeof(*pixels),pixels); in WriteHDRImage()
817 if (count != (ssize_t) (4*image->columns*sizeof(*pixels))) in WriteHDRImage()
820 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, in WriteHDRImage()
821 image->rows); in WriteHDRImage()
826 (void) CloseBlob(image); in WriteHDRImage()