// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
-// Copyright Dirk Lemstra 2013-2015
+// Copyright Dirk Lemstra 2013-2018
//
// Color Implementation
//
{
initPixel();
- quantumAlpha(TransparentAlpha);
+ setAlpha(TransparentAlpha);
}
Magick::Color::Color(const Magick::Quantum red_,const Magick::Quantum green_,
void Magick::Color::quantumAlpha(const Magick::Quantum alpha_)
{
- _pixel->alpha=alpha_;
- if (alpha_ == QuantumRange)
- {
- _pixel->alpha_trait=UndefinedPixelTrait;
- if (_pixelType == RGBAPixel)
- _pixelType=RGBPixel;
- else if (_pixelType == CMYKAPixel)
- _pixelType=CMYKPixel;
- }
- else
- {
- _pixel->alpha_trait=BlendPixelTrait;
- if (_pixelType == RGBPixel)
- _pixelType=RGBAPixel;
- else if (_pixelType == CMYKPixel)
- _pixelType=CMYKAPixel;
- }
+ setAlpha(alpha_);
_isValid=true;
}
_pixel->colorspace=CMYKColorspace;
}
+void Magick::Color::setAlpha(const Magick::Quantum alpha_)
+{
+ _pixel->alpha=alpha_;
+ if (alpha_ == QuantumRange)
+ {
+ _pixel->alpha_trait=UndefinedPixelTrait;
+ if (_pixelType == RGBAPixel)
+ _pixelType=RGBPixel;
+ else if (_pixelType == CMYKAPixel)
+ _pixelType=CMYKPixel;
+ }
+ else
+ {
+ _pixel->alpha_trait=BlendPixelTrait;
+ if (_pixelType == RGBPixel)
+ _pixelType=RGBAPixel;
+ else if (_pixelType == CMYKPixel)
+ _pixelType=CMYKAPixel;
+ }
+}
+
void Magick::Color::setPixelType(const PixelInfo &color_)
{
if (color_.colorspace == CMYKColorspace)
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003, 2008
-// Copyright Dirk Lemstra 2013-2014
+// Copyright Dirk Lemstra 2013-2018
//
// Color Implementation
//
// Common initializer for PixelInfo representation
void initPixel();
+ void setAlpha(const Magick::Quantum alpha_);
+
// Sets the pixel type using the specified PixelInfo.
void setPixelType(const PixelInfo &color_);
};