From: Cristy Date: Sat, 4 May 2019 13:05:29 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-45~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=888ac4eb044b193640429b20b541b18bb353b0f8;p=imagemagick ... --- diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index f01eee0ac..ff819d0d3 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -5526,7 +5526,7 @@ WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% MagickGetImagePixelColor() returns the color of the specified pixel. +% MagickGetImagePixelColor() gets the color of the specified pixel. % % The format of the MagickGetImagePixelColor method is: % @@ -10799,6 +10799,60 @@ WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand, % % % % % % +% M a g i c k S e t I m a g e P i x e l C o l o r % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickSetImagePixelColor() sets the color of the specified pixel. +% +% The format of the MagickSetImagePixelColor method is: +% +% MagickBooleanType MagickSetImagePixelColor(MagickWand *wand, +% const ssize_t x,const ssize_t y,const PixelWand *color) +% +% A description of each parameter follows: +% +% o wand: the magick wand. +% +% o x,y: the pixel offset into the image. +% +% o color: Return the colormap color in this wand. +% +*/ +WandExport MagickBooleanType MagickSetImagePixelColor(MagickWand *wand, + const ssize_t x,const ssize_t y,const PixelWand *color) +{ + register Quantum + *q; + + CacheView + *image_view; + + assert(wand != (MagickWand *) NULL); + assert(wand->signature == MagickWandSignature); + if (wand->debug != MagickFalse) + (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) + ThrowWandException(WandError,"ContainsNoImages",wand->name); + image_view=AcquireAuthenticCacheView(wand->images,wand->exception); + q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,wand->exception); + if (q == (Quantum *) NULL) + { + image_view=DestroyCacheView(image_view); + return(MagickFalse); + } + PixelGetQuantumPixel(wand->images,color,q); + image_view=DestroyCacheView(image_view); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % M a g i c k S e t I m a g e P r o g r e s s M o n i t o r % % % % % diff --git a/MagickWand/magick-image.h b/MagickWand/magick-image.h index a66e2f205..3796e6d35 100644 --- a/MagickWand/magick-image.h +++ b/MagickWand/magick-image.h @@ -289,6 +289,8 @@ extern WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *,const OrientationType), MagickSetImagePage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), + MagickSetImagePixelColor(MagickWand *,const ssize_t,const ssize_t, + const PixelWand *), MagickSetImageRedPrimary(MagickWand *,const double,const double, const double), MagickSetImageRenderingIntent(MagickWand *,const RenderingIntent),