]> granicus.if.org Git - imagemagick/commitdiff
Renamed alpha back to opacity for various Draw methods.
authordirk <dirk@git.imagemagick.org>
Tue, 7 Apr 2015 19:32:12 +0000 (19:32 +0000)
committerdirk <dirk@git.imagemagick.org>
Tue, 7 Apr 2015 19:32:12 +0000 (19:32 +0000)
Magick++/lib/Drawable.cpp
Magick++/lib/Magick++/Drawable.h
Magick++/lib/Magick++/Include.h
MagickCore/draw.c
MagickWand/drawing-wand.c
MagickWand/drawing-wand.h

index 35aace33b83d5b5af427b80528a8c23685a549c0..aba465e3921173d4214e0c0df618eccb8e4573e3 100644 (file)
@@ -244,7 +244,6 @@ Magick::DrawableBase* Magick::DrawableAffine::copy() const
   return new DrawableAffine(*this);
 }
 
-// Change pixel matte value to transparent using PaintMethod
 Magick::DrawableAlpha::~DrawableAlpha(void)
 {
 }
@@ -624,18 +623,19 @@ Magick::DrawableBase* Magick::DrawableFillRule::copy() const
   return new DrawableFillRule(*this);
 }
 
-// Specify drawing fill alpha
-Magick::DrawableFillAlpha::~DrawableFillAlpha ( void )
+Magick::DrawableFillOpacity::~DrawableFillOpacity(void)
 {
 }
-void Magick::DrawableFillAlpha::operator()
-  ( MagickCore::DrawingWand * context_ ) const
+
+void Magick::DrawableFillOpacity::operator()
+  (MagickCore::DrawingWand *context_) const
 {
-  DrawSetFillAlpha( context_, _alpha );
+  DrawSetFillOpacity(context_,_opacity);
 }
-Magick::DrawableBase* Magick::DrawableFillAlpha::copy() const
+
+Magick::DrawableBase* Magick::DrawableFillOpacity::copy() const
 {
-  return new DrawableFillAlpha(*this);
+  return new DrawableFillOpacity(*this);
 }
 
 // Specify text font
@@ -1208,18 +1208,19 @@ Magick::DrawableBase* Magick::DrawableStrokeColor::copy() const
   return new DrawableStrokeColor(*this);
 }
 
-// Stroke alpha
-Magick::DrawableStrokeAlpha::~DrawableStrokeAlpha ( void )
+Magick::DrawableStrokeOpacity::~DrawableStrokeOpacity(void)
 {
 }
-void Magick::DrawableStrokeAlpha::operator()
-  ( MagickCore::DrawingWand * context_ ) const
+
+void Magick::DrawableStrokeOpacity::operator()
+  (MagickCore::DrawingWand * context_) const
 {
-  DrawSetStrokeAlpha( context_, _alpha );
+  DrawSetStrokeOpacity(context_,_opacity);
 }
-Magick::DrawableBase* Magick::DrawableStrokeAlpha::copy() const
+
+Magick::DrawableBase* Magick::DrawableStrokeOpacity::copy() const
 {
-  return new DrawableStrokeAlpha(*this);
+  return new DrawableStrokeOpacity(*this);
 }
 
 // Stroke width
index 4d4d76f3ba508ba1cb3d100691538571ddf8d4bc..6ae4a69b5494c4da4c0e58c7017f179e484d5f82 100644 (file)
@@ -955,33 +955,35 @@ private:
 };
 
 // Specify drawing fill alpha
-class MagickPPExport DrawableFillAlpha : public DrawableBase
+class MagickPPExport DrawableFillOpacity : public DrawableBase
 {
 public:
-  DrawableFillAlpha ( double alpha_ )
-    : _alpha(alpha_)
-    {
-    }
 
-  /*virtual*/ ~DrawableFillAlpha ( void );
+  DrawableFillOpacity(double opacity_)
+    : _opacity(opacity_)
+  {
+  }
+
+  ~DrawableFillOpacity ( void );
 
   // Operator to invoke equivalent draw API call
-  /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
+  void operator()(MagickCore::DrawingWand *context_) const;
 
   // Return polymorphic copy of object
-  /*virtual*/ DrawableBase* copy() const;
+  DrawableBase* copy() const;
 
-  void alpha( double alpha_ )
-    {
-      _alpha = alpha_;
-    }
-  double alpha( void ) const
-    {
-      return _alpha;
-    }
+  void opacity(double opacity_)
+  {
+    _opacity=opacity_;
+  }
+
+  double opacity(void) const
+  {
+    return(_opacity);
+  }
 
 private:
-  double _alpha;
+  double _opacity;
 };
 
 // Specify text font
@@ -1818,34 +1820,36 @@ private:
   Color _color;
 };
 
-// Stroke alpha
-class MagickPPExport DrawableStrokeAlpha : public DrawableBase
+// Stroke opacity
+class MagickPPExport DrawableStrokeOpacity : public DrawableBase
 {
 public:
-  DrawableStrokeAlpha ( double alpha_ )
-    : _alpha(alpha_)
-    {
-    }
 
-  /*virtual*/ ~DrawableStrokeAlpha ( void );
+  DrawableStrokeOpacity(double opacity_)
+    : _opacity(opacity_)
+  {
+  }
+
+  ~DrawableStrokeOpacity(void);
 
   // Operator to invoke equivalent draw API call
-  /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
+  void operator()(MagickCore::DrawingWand *context_) const;
 
   // Return polymorphic copy of object
-  /*virtual*/ DrawableBase* copy() const;
+  DrawableBase* copy() const;
 
-  void alpha( double alpha_ )
-    {
-      _alpha = alpha_;
-    }
-  double alpha( void ) const
-    {
-      return _alpha;
-    }
+  void opacity(double opacity_)
+  {
+    _opacity=opacity_;
+  }
+
+  double opacity(void) const
+  {
+    return(_opacity);
+  }
 
 private:
-  double _alpha;
+  double _opacity;
 };
 
 // Stroke width
index d78f8c2b0009f3e95febb5b6ebe64207418e2eae..792c251dbb3186f1ef74683f61f916792008c371 100644 (file)
@@ -1206,7 +1206,7 @@ namespace Magick
   using MagickCore::DrawSetClipRule;
   using MagickCore::DrawSetClipUnits;
   using MagickCore::DrawSetFillColor;
-  using MagickCore::DrawSetFillAlpha;
+  using MagickCore::DrawSetFillOpacity;
   using MagickCore::DrawSetFillPatternURL;
   using MagickCore::DrawSetFillRule;
   using MagickCore::DrawSetFont;
@@ -1223,7 +1223,7 @@ namespace Magick
   using MagickCore::DrawSetStrokeLineCap;
   using MagickCore::DrawSetStrokeLineJoin;
   using MagickCore::DrawSetStrokeMiterLimit;
-  using MagickCore::DrawSetStrokeAlpha;
+  using MagickCore::DrawSetStrokeOpacity;
   using MagickCore::DrawSetStrokePatternURL;
   using MagickCore::DrawSetStrokeWidth;
   using MagickCore::DrawSetTextAntialias;
index 8c3f5dc6f1cb4d2993248084df3d40ca3706dbdf..deeb8c09d382ee5c464594f8869349da8b7070f8 100644 (file)
@@ -2010,7 +2010,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
               }
             break;
           }
-        if (LocaleCompare("fill-alpha",keyword) == 0)
+        if (LocaleCompare("fill-opacity",keyword) == 0)
           {
             GetMagickToken(q,&q,token);
             factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
@@ -2179,16 +2179,6 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
           status=MagickFalse;
         break;
       }
-      case 'm':
-      case 'M':
-      {
-        if (LocaleCompare("matte",keyword) == 0)
-          {
-            primitive_type=AlphaPrimitive;
-            break;
-          }
-        break;
-      }
       case 'o':
       case 'O':
       {
index 003e60e4c30e080eadee5dfb9827dc111729b132..9e0c45c769db2ccef1a4e047fb53e79fd2256368 100644 (file)
@@ -1426,19 +1426,19 @@ WandExport void DrawGetFillColor(const DrawingWand *wand,PixelWand *fill_color)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  DrawGetFillAlpha() returns the alpha used when drawing using the fill
+%  DrawGetFillOpacity() returns the alpha used when drawing using the fill
 %  color or fill texture.  Fully opaque is 1.0.
 %
-%  The format of the DrawGetFillAlpha method is:
+%  The format of the DrawGetFillOpacity method is:
 %
-%      double DrawGetFillAlpha(const DrawingWand *wand)
+%      double DrawGetFillOpacity(const DrawingWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the drawing wand.
 %
 */
-WandExport double DrawGetFillAlpha(const DrawingWand *wand)
+WandExport double DrawGetFillOpacity(const DrawingWand *wand)
 {
   double
     alpha;
@@ -1771,19 +1771,19 @@ WandExport GravityType DrawGetGravity(const DrawingWand *wand)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  DrawGetAlpha() returns the alpha used when drawing with the fill
+%  DrawGetOpacity() returns the alpha used when drawing with the fill
 %  or stroke color or texture.  Fully opaque is 1.0.
 %
-%  The format of the DrawGetAlpha method is:
+%  The format of the DrawGetOpacity method is:
 %
-%      double DrawGetAlpha(const DrawingWand *wand)
+%      double DrawGetOpacity(const DrawingWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the drawing wand.
 %
 */
-WandExport double DrawGetAlpha(const DrawingWand *wand)
+WandExport double DrawGetOpacity(const DrawingWand *wand)
 {
   double
     alpha;
@@ -2081,18 +2081,18 @@ WandExport size_t DrawGetStrokeMiterLimit(const DrawingWand *wand)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  DrawGetStrokeAlpha() returns the alpha of stroked object outlines.
+%  DrawGetStrokeOpacity() returns the alpha of stroked object outlines.
 %
-%  The format of the DrawGetStrokeAlpha method is:
+%  The format of the DrawGetStrokeOpacity method is:
 %
-%      double DrawGetStrokeAlpha(const DrawingWand *wand)
+%      double DrawGetStrokeOpacity(const DrawingWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the drawing wand.
 %
 */
-WandExport double DrawGetStrokeAlpha(const DrawingWand *wand)
+WandExport double DrawGetStrokeOpacity(const DrawingWand *wand)
 {
   double
     alpha;
@@ -2475,7 +2475,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
-  child=AddChildToXMLTree(xml_info,"fill-alpha",0);
+  child=AddChildToXMLTree(xml_info,"fill-opacity",0);
   if (child != (XMLTreeInfo *) NULL)
     {
       (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
@@ -2596,7 +2596,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
         CurrentContext->miterlimit);
       (void) SetXMLTreeContent(child,value);
     }
-  child=AddChildToXMLTree(xml_info,"stroke-alpha",0);
+  child=AddChildToXMLTree(xml_info,"stroke-opacity",0);
   if (child != (XMLTreeInfo *) NULL)
     {
       (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
@@ -4666,21 +4666,21 @@ WandExport void DrawSetFillColor(DrawingWand *wand,const PixelWand *fill_wand)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  DrawSetFillAlpha() sets the alpha to use when drawing using the fill
+%  DrawSetFillOpacity() sets the alpha to use when drawing using the fill
 %  color or fill texture.  Fully opaque is 1.0.
 %
-%  The format of the DrawSetFillAlpha method is:
+%  The format of the DrawSetFillOpacity method is:
 %
-%      void DrawSetFillAlpha(DrawingWand *wand,const double fill_alpha)
+%      void DrawSetFillOpacity(DrawingWand *wand,const double fill_alpha)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the drawing wand.
 %
-%    o fill_alpha: fill alpha
+%    o fill_opacity: fill opacity
 %
 */
-WandExport void DrawSetFillAlpha(DrawingWand *wand,const double fill_alpha)
+WandExport void DrawSetFillOpacity(DrawingWand *wand,const double fill_opacity)
 {
   double
     alpha;
@@ -4689,12 +4689,12 @@ WandExport void DrawSetFillAlpha(DrawingWand *wand,const double fill_alpha)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  alpha=(double) ClampToQuantum(QuantumRange*(1.0-fill_alpha));
+  alpha=(double) ClampToQuantum(QuantumRange*fill_opacity);
   if ((wand->filter_off != MagickFalse) ||
       (CurrentContext->fill.alpha != alpha))
     {
       CurrentContext->fill.alpha=alpha;
-      (void) MvgPrintf(wand,"fill-alpha %.20g\n",fill_alpha);
+      (void) MvgPrintf(wand,"fill-opacity %.20g\n",fill_opacity);
     }
 }
 \f
@@ -4763,10 +4763,10 @@ WandExport MagickBooleanType DrawSetFontResolution(DrawingWand *wand,
 %
 %    o wand: the drawing wand.
 %
-%    o alpha: fill alpha
+%    o opacity: fill and stroke opacity.  The value 1.0 is opaque.
 %
 */
-WandExport void DrawSetOpacity(DrawingWand *wand,const double alpha)
+WandExport void DrawSetOpacity(DrawingWand *wand,const double opacity)
 {
   Quantum
     quantum_alpha;
@@ -4775,12 +4775,12 @@ WandExport void DrawSetOpacity(DrawingWand *wand,const double alpha)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  quantum_alpha=ClampToQuantum(QuantumRange*(1.0-alpha));
+  quantum_alpha=ClampToQuantum(QuantumRange*opacity);
   if ((wand->filter_off != MagickFalse) ||
       (CurrentContext->alpha != quantum_alpha))
     {
-      CurrentContext->alpha=(Quantum) alpha;
-      (void) MvgPrintf(wand,"opacity %.20g\n",alpha);
+      CurrentContext->alpha=(Quantum) opacity;
+      (void) MvgPrintf(wand,"opacity %.20g\n",opacity);
     }
 }
 \f
@@ -5639,22 +5639,22 @@ WandExport void DrawSetStrokeMiterLimit(DrawingWand *wand,
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  DrawSetStrokeAlpha() specifies the alpha of stroked object outlines.
+%  DrawSetStrokeOpacity() specifies the alpha of stroked object outlines.
 %
-%  The format of the DrawSetStrokeAlpha method is:
+%  The format of the DrawSetStrokeOpacity method is:
 %
-%      void DrawSetStrokeAlpha(DrawingWand *wand,
+%      void DrawSetStrokeOpacity(DrawingWand *wand,
 %        const double stroke_alpha)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the drawing wand.
 %
-%    o stroke_alpha: stroke alpha.  The value 1.0 is opaque.
+%    o opacity: stroke opacity.  The value 1.0 is opaque.
 %
 */
-WandExport void DrawSetStrokeAlpha(DrawingWand *wand,
-  const double stroke_alpha)
+WandExport void DrawSetStrokeOpacity(DrawingWand *wand,
+  const double opacity)
 {
   double
     alpha;
@@ -5663,12 +5663,12 @@ WandExport void DrawSetStrokeAlpha(DrawingWand *wand,
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  alpha=(double) ClampToQuantum(QuantumRange*(1.0-stroke_alpha));
+  alpha=(double) ClampToQuantum(QuantumRange*opacity);
   if ((wand->filter_off != MagickFalse) ||
       (CurrentContext->stroke.alpha != alpha))
     {
       CurrentContext->stroke.alpha=alpha;
-      (void) MvgPrintf(wand,"stroke-alpha %.20g\n",stroke_alpha);
+      (void) MvgPrintf(wand,"stroke-opacity %.20g\n",opacity);
     }
 }
 \f
@@ -6189,7 +6189,7 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand,
         (void) QueryColorCompliance(value,AllCompliance,&CurrentContext->fill,
           wand->exception);
     }
-  child=GetXMLTreeChild(xml_info,"fill-alpha");
+  child=GetXMLTreeChild(xml_info,"fill-opacity");
   if (child != (XMLTreeInfo *) NULL)
     {
       value=GetXMLTreeContent(child);
@@ -6353,7 +6353,7 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand,
       if (value != (const char *) NULL)
         CurrentContext->miterlimit=StringToUnsignedLong(value);
     }
-  child=GetXMLTreeChild(xml_info,"stroke-alpha");
+  child=GetXMLTreeChild(xml_info,"stroke-opacity");
   if (child != (XMLTreeInfo *) NULL)
     {
       value=GetXMLTreeContent(child);
index dff15317c1c3f4bad25b3681eb6b8321110fe5bb..c4183ad25de13bd7e4330861f3c5e5d622a78913 100644 (file)
@@ -48,12 +48,12 @@ extern WandExport DirectionType
   DrawGetTextDirection(const DrawingWand *);
 
 extern WandExport double
-  DrawGetFillAlpha(const DrawingWand *),
+  DrawGetFillOpacity(const DrawingWand *),
   DrawGetFontSize(const DrawingWand *),
-  DrawGetAlpha(const DrawingWand *),
+  DrawGetOpacity(const DrawingWand *),
   *DrawGetStrokeDashArray(const DrawingWand *,size_t *),
   DrawGetStrokeDashOffset(const DrawingWand *),
-  DrawGetStrokeAlpha(const DrawingWand *),
+  DrawGetStrokeOpacty(const DrawingWand *),
   DrawGetStrokeWidth(const DrawingWand *),
   DrawGetTextKerning(DrawingWand *),
   DrawGetTextInterlineSpacing(DrawingWand *),
@@ -191,7 +191,7 @@ extern WandExport void
   DrawSetClipRule(DrawingWand *,const FillRule),
   DrawSetClipUnits(DrawingWand *,const ClipPathUnits),
   DrawSetFillColor(DrawingWand *,const PixelWand *),
-  DrawSetFillAlpha(DrawingWand *,const double),
+  DrawSetFillOpacity(DrawingWand *,const double),
   DrawSetFillRule(DrawingWand *,const FillRule),
   DrawSetFontSize(DrawingWand *,const double),
   DrawSetFontStretch(DrawingWand *,const StretchType),
@@ -205,7 +205,7 @@ extern WandExport void
   DrawSetStrokeLineCap(DrawingWand *,const LineCap),
   DrawSetStrokeLineJoin(DrawingWand *,const LineJoin),
   DrawSetStrokeMiterLimit(DrawingWand *,const size_t),
-  DrawSetStrokeAlpha(DrawingWand *, const double),
+  DrawSetStrokeOpacity(DrawingWand *, const double),
   DrawSetStrokeWidth(DrawingWand *,const double),
   DrawSetTextAlignment(DrawingWand *,const AlignType),
   DrawSetTextAntialias(DrawingWand *,const MagickBooleanType),