Lines Matching refs:image

214 static inline Quantum ReadVIPSPixelNONE(Image *image,  in ReadVIPSPixelNONE()  argument
229 c=(unsigned char) ReadBlobByte(image); in ReadVIPSPixelNONE()
233 c=(unsigned char) ReadBlobShort(image); in ReadVIPSPixelNONE()
237 c=(unsigned char) ReadBlobLong(image); in ReadVIPSPixelNONE()
240 c=(unsigned char) ReadBlobFloat(image); in ReadVIPSPixelNONE()
243 c=(unsigned char) ReadBlobDouble(image); in ReadVIPSPixelNONE()
261 s=(unsigned short) ReadBlobShort(image); in ReadVIPSPixelNONE()
265 s=(unsigned short) ReadBlobLong(image); in ReadVIPSPixelNONE()
268 s=(unsigned short) ReadBlobFloat(image); in ReadVIPSPixelNONE()
271 s=(unsigned short) ReadBlobDouble(image); in ReadVIPSPixelNONE()
285 return(ScaleCharToQuantum((unsigned char) ReadBlobByte(image))); in ReadVIPSPixelNONE()
288 return(ScaleShortToQuantum(ReadBlobShort(image))); in ReadVIPSPixelNONE()
291 return(ScaleLongToQuantum(ReadBlobLong(image))); in ReadVIPSPixelNONE()
293 return((Quantum) ((float) QuantumRange*(ReadBlobFloat(image)/1.0))); in ReadVIPSPixelNONE()
296 image)/1.0))); in ReadVIPSPixelNONE()
305 static MagickBooleanType ReadVIPSPixelsNONE(Image *image, in ReadVIPSPixelsNONE() argument
321 for (y = 0; y < (ssize_t) image->rows; y++) in ReadVIPSPixelsNONE()
323 q=GetAuthenticPixels(image,0,y,image->columns,1,exception); in ReadVIPSPixelsNONE()
326 for (x=0; x < (ssize_t) image->columns; x++) in ReadVIPSPixelsNONE()
328 pixel=ReadVIPSPixelNONE(image,format,type); in ReadVIPSPixelsNONE()
329 SetPixelRed(image,pixel,q); in ReadVIPSPixelsNONE()
332 SetPixelGreen(image,pixel,q); in ReadVIPSPixelsNONE()
333 SetPixelBlue(image,pixel,q); in ReadVIPSPixelsNONE()
335 SetPixelAlpha(image,ReadVIPSPixelNONE(image,format,type),q); in ReadVIPSPixelsNONE()
339 SetPixelGreen(image,ReadVIPSPixelNONE(image,format,type),q); in ReadVIPSPixelsNONE()
340 SetPixelBlue(image,ReadVIPSPixelNONE(image,format,type),q); in ReadVIPSPixelsNONE()
343 if (image->colorspace == CMYKColorspace) in ReadVIPSPixelsNONE()
344 SetPixelIndex(image,ReadVIPSPixelNONE(image,format,type),q); in ReadVIPSPixelsNONE()
346 SetPixelAlpha(image,ReadVIPSPixelNONE(image,format,type),q); in ReadVIPSPixelsNONE()
350 SetPixelIndex(image,ReadVIPSPixelNONE(image,format,type),q); in ReadVIPSPixelsNONE()
351 SetPixelAlpha(image,ReadVIPSPixelNONE(image,format,type),q); in ReadVIPSPixelsNONE()
354 q+=GetPixelChannels(image); in ReadVIPSPixelsNONE()
356 if (SyncAuthenticPixels(image,exception) == MagickFalse) in ReadVIPSPixelsNONE()
370 *image; in ReadVIPSImage() local
399 image=AcquireImage(image_info,exception); in ReadVIPSImage()
400 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); in ReadVIPSImage()
403 image=DestroyImageList(image); in ReadVIPSImage()
406 marker=ReadBlobLSBLong(image); in ReadVIPSImage()
408 image->endian=LSBEndian; in ReadVIPSImage()
410 image->endian=MSBEndian; in ReadVIPSImage()
413 image->columns=(size_t) ReadBlobLong(image); in ReadVIPSImage()
414 image->rows=(size_t) ReadBlobLong(image); in ReadVIPSImage()
415 status=SetImageExtent(image,image->columns,image->rows,exception); in ReadVIPSImage()
417 return(DestroyImageList(image)); in ReadVIPSImage()
418 channels=ReadBlobLong(image); in ReadVIPSImage()
419 (void) ReadBlobLong(image); /* Legacy */ in ReadVIPSImage()
420 format=(VIPSBandFormat) ReadBlobLong(image); in ReadVIPSImage()
425 image->depth=8; in ReadVIPSImage()
429 image->depth=16; in ReadVIPSImage()
434 image->depth=32; in ReadVIPSImage()
437 image->depth=64; in ReadVIPSImage()
445 coding=(VIPSCoding) ReadBlobLong(image); in ReadVIPSImage()
446 type=(VIPSType) ReadBlobLong(image); in ReadVIPSImage()
450 SetImageColorspace(image,CMYKColorspace,exception); in ReadVIPSImage()
452 image->alpha_trait=BlendPixelTrait; in ReadVIPSImage()
456 SetImageColorspace(image,GRAYColorspace,exception); in ReadVIPSImage()
458 image->alpha_trait=BlendPixelTrait; in ReadVIPSImage()
462 SetImageColorspace(image,RGBColorspace,exception); in ReadVIPSImage()
464 image->alpha_trait=BlendPixelTrait; in ReadVIPSImage()
467 SetImageColorspace(image,sRGBColorspace,exception); in ReadVIPSImage()
469 image->alpha_trait=BlendPixelTrait; in ReadVIPSImage()
484 image->units=PixelsPerCentimeterResolution; in ReadVIPSImage()
485 image->resolution.x=ReadBlobFloat(image)*10; in ReadVIPSImage()
486 image->resolution.y=ReadBlobFloat(image)*10; in ReadVIPSImage()
490 (void) ReadBlobLongLong(image); in ReadVIPSImage()
491 (void) ReadBlobLongLong(image); in ReadVIPSImage()
492 (void) ReadBlobLongLong(image); in ReadVIPSImage()
494 return(image); in ReadVIPSImage()
501 status=ReadVIPSPixelsNONE(image,format,type,channels,exception); in ReadVIPSImage()
505 while ((n=ReadBlob(image,MagickPathExtent-1,(unsigned char *) buffer)) != 0) in ReadVIPSImage()
515 SetImageProperty(image,"vips:metadata",metadata,exception); in ReadVIPSImage()
518 (void) CloseBlob(image); in ReadVIPSImage()
521 return(image); in ReadVIPSImage()
609 static inline void WriteVIPSPixel(Image *image, const Quantum value) in WriteVIPSPixel() argument
611 if (image->depth == 16) in WriteVIPSPixel()
612 (void) WriteBlobShort(image,ScaleQuantumToShort(value)); in WriteVIPSPixel()
614 (void) WriteBlobByte(image,ScaleQuantumToChar(value)); in WriteVIPSPixel()
618 Image *image,ExceptionInfo *exception) in WriteVIPSImage() argument
640 assert(image != (Image *) NULL); in WriteVIPSImage()
641 assert(image->signature == MagickCoreSignature); in WriteVIPSImage()
642 if (image->debug != MagickFalse) in WriteVIPSImage()
643 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); in WriteVIPSImage()
645 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); in WriteVIPSImage()
648 if (image->endian == LSBEndian) in WriteVIPSImage()
649 (void) WriteBlobLSBLong(image,VIPS_MAGIC_LSB); in WriteVIPSImage()
651 (void) WriteBlobLSBLong(image,VIPS_MAGIC_MSB); in WriteVIPSImage()
652 (void) WriteBlobLong(image,(unsigned int) image->columns); in WriteVIPSImage()
653 (void) WriteBlobLong(image,(unsigned int) image->rows); in WriteVIPSImage()
654 (void) SetImageStorageClass(image,DirectClass,exception); in WriteVIPSImage()
655 channels=image->alpha_trait != UndefinedPixelTrait ? 4 : 3; in WriteVIPSImage()
656 if (SetImageGray(image,exception) != MagickFalse) in WriteVIPSImage()
657 channels=image->alpha_trait != UndefinedPixelTrait ? 2 : 1; in WriteVIPSImage()
658 else if (image->colorspace == CMYKColorspace) in WriteVIPSImage()
659 channels=image->alpha_trait != UndefinedPixelTrait ? 5 : 4; in WriteVIPSImage()
660 (void) WriteBlobLong(image,channels); in WriteVIPSImage()
661 (void) WriteBlobLong(image,0); in WriteVIPSImage()
662 if (image->depth == 16) in WriteVIPSImage()
663 (void) WriteBlobLong(image,(unsigned int) VIPSBandFormatUSHORT); in WriteVIPSImage()
666 image->depth=8; in WriteVIPSImage()
667 (void) WriteBlobLong(image,(unsigned int) VIPSBandFormatUCHAR); in WriteVIPSImage()
669 (void) WriteBlobLong(image,VIPSCodingNONE); in WriteVIPSImage()
670 switch(image->colorspace) in WriteVIPSImage()
673 (void) WriteBlobLong(image,VIPSTypeCMYK); in WriteVIPSImage()
676 if (image->depth == 16) in WriteVIPSImage()
677 (void) WriteBlobLong(image, VIPSTypeGREY16); in WriteVIPSImage()
679 (void) WriteBlobLong(image, VIPSTypeB_W); in WriteVIPSImage()
682 (void) WriteBlobLong(image,VIPSTypeLAB); in WriteVIPSImage()
685 (void) WriteBlobLong(image,VIPSTypeLCH); in WriteVIPSImage()
688 if (image->depth == 16) in WriteVIPSImage()
689 (void) WriteBlobLong(image, VIPSTypeRGB16); in WriteVIPSImage()
691 (void) WriteBlobLong(image, VIPSTypeRGB); in WriteVIPSImage()
694 (void) WriteBlobLong(image,VIPSTypeXYZ); in WriteVIPSImage()
698 (void) SetImageColorspace(image,sRGBColorspace,exception); in WriteVIPSImage()
699 (void) WriteBlobLong(image,VIPSTypesRGB); in WriteVIPSImage()
702 if (image->units == PixelsPerCentimeterResolution) in WriteVIPSImage()
704 (void) WriteBlobFloat(image,(image->resolution.x / 10)); in WriteVIPSImage()
705 (void) WriteBlobFloat(image,(image->resolution.y / 10)); in WriteVIPSImage()
707 else if (image->units == PixelsPerInchResolution) in WriteVIPSImage()
709 (void) WriteBlobFloat(image,(image->resolution.x / 25.4)); in WriteVIPSImage()
710 (void) WriteBlobFloat(image,(image->resolution.y / 25.4)); in WriteVIPSImage()
714 (void) WriteBlobLong(image,0); in WriteVIPSImage()
715 (void) WriteBlobLong(image,0); in WriteVIPSImage()
721 (void) WriteBlobByte(image,0); in WriteVIPSImage()
722 for (y=0; y < (ssize_t) image->rows; y++) in WriteVIPSImage()
724 p=GetVirtualPixels(image,0,y,image->columns,1,exception); in WriteVIPSImage()
727 for (x=0; x < (ssize_t) image->columns; x++) in WriteVIPSImage()
729 WriteVIPSPixel(image,GetPixelRed(image,p)); in WriteVIPSImage()
731 WriteVIPSPixel(image,GetPixelAlpha(image,p)); in WriteVIPSImage()
734 WriteVIPSPixel(image,GetPixelGreen(image,p)); in WriteVIPSImage()
735 WriteVIPSPixel(image,GetPixelBlue(image,p)); in WriteVIPSImage()
738 if (image->colorspace == CMYKColorspace) in WriteVIPSImage()
739 WriteVIPSPixel(image,GetPixelIndex(image,p)); in WriteVIPSImage()
741 WriteVIPSPixel(image,GetPixelAlpha(image,p)); in WriteVIPSImage()
745 WriteVIPSPixel(image,GetPixelIndex(image,p)); in WriteVIPSImage()
746 WriteVIPSPixel(image,GetPixelAlpha(image,p)); in WriteVIPSImage()
749 p+=GetPixelChannels(image); in WriteVIPSImage()
752 metadata=GetImageProperty(image,"vips:metadata",exception); in WriteVIPSImage()
754 WriteBlobString(image,metadata); in WriteVIPSImage()
755 (void) CloseBlob(image); in WriteVIPSImage()