]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <mikayla-grace@urban-warrior.org>
Sat, 4 May 2019 13:05:29 +0000 (09:05 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Sat, 4 May 2019 13:05:29 +0000 (09:05 -0400)
MagickWand/magick-image.c
MagickWand/magick-image.h

index f01eee0aca69f4ba9fc923bffbf28daed1eeddc0..ff819d0d3570479e99e367e8025628049c9a3809 100644 (file)
@@ -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);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   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                 %
 %                                                                             %
 %                                                                             %
index a66e2f205dcee79b3fd7cf129c026836ef6bf6f8..3796e6d35dd2ea72f8ff5680f09ab52738a032f5 100644 (file)
@@ -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),