X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=coders%2Fnull.c;h=34ebe4f85ad0c5d0b487a6138f8f36b864cfad38;hb=8418c7e51974060a1c724e25d700d72fb437174b;hp=3492c698f2cc093b5e6c39a9f2f5655763c5f4d6;hpb=dcfc1ad7e0ad199ccd86e9508e9c5775e4c4bbdb;p=imagemagick diff --git a/coders/null.c b/coders/null.c index 3492c698f..34ebe4f85 100644 --- a/coders/null.c +++ b/coders/null.c @@ -13,11 +13,11 @@ % Read/Write Image Of Uniform Color. % % % % Software Design % -% John Cristy % +% Cristy % % July 1992 % % % % % -% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization % +% Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -63,7 +63,7 @@ Forward declarations. */ static MagickBooleanType - WriteNULLImage(const ImageInfo *,Image *); + WriteNULLImage(const ImageInfo *,Image *,ExceptionInfo *); /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -121,25 +121,25 @@ static Image *ReadNULLImage(const ImageInfo *image_info, image_info->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); - image=AcquireImage(image_info); + image=AcquireImage(image_info,exception); if (image->columns == 0) image->columns=1; if (image->rows == 0) image->rows=1; - image->matte=MagickTrue; + image->alpha_trait=BlendPixelTrait; GetPixelInfo(image,&background); - background.alpha=(MagickRealType) TransparentAlpha; + background.alpha=(double) TransparentAlpha; if (image->colorspace == CMYKColorspace) ConvertRGBToCMYK(&background); for (y=0; y < (ssize_t) image->rows; y++) { q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (const Quantum *) NULL) + if (q == (Quantum *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { - SetPixelPixelInfo(image,&background,q); - q+=GetPixelComponents(image); + SetPixelInfoPixel(image,&background,q); + q+=GetPixelChannels(image); } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; @@ -227,7 +227,7 @@ ModuleExport void UnregisterNULLImage(void) % The format of the WriteNULLImage method is: % % MagickBooleanType WriteNULLImage(const ImageInfo *image_info, -% Image *image) +% Image *image,ExceptionInfo *exception) % % A description of each parameter follows. % @@ -235,14 +235,17 @@ ModuleExport void UnregisterNULLImage(void) % % o image: The image. % +% o exception: return any errors or warnings in this structure. +% */ static MagickBooleanType WriteNULLImage(const ImageInfo *image_info, - Image *image) + Image *image,ExceptionInfo *exception) { assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); assert(image != (Image *) NULL); assert(image->signature == MagickSignature); + assert(exception != (ExceptionInfo *) NULL); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); return(MagickTrue);