7 #if !defined (Magick_Color_header)
8 #define Magick_Color_header
40 Color(Quantum red_,Quantum green_,Quantum blue_);
43 Color(Quantum red_,Quantum green_,Quantum blue_,Quantum alpha_);
46 Color(
const char *x11color_);
52 Color(
const PixelPacket &color_);
55 Color(
const std::string &x11color_);
64 const Color& operator=(
const char *x11color);
67 const Color& operator=(
const std::string &x11color_);
70 const Color& operator=(
const PixelPacket &color_);
73 operator PixelPacket()
const;
76 operator std::string()
const;
80 void alpha(
double alpha_);
81 double alpha(
void)
const;
84 void alphaQuantum(Quantum alpha_);
85 Quantum alphaQuantum(
void)
const;
88 void blueQuantum(Quantum blue_);
89 Quantum blueQuantum (
void)
const;
92 void greenQuantum(Quantum green_);
93 Quantum greenQuantum(
void)
const;
96 void isValid(
bool valid_);
97 bool isValid(
void)
const;
100 void redQuantum(Quantum red_);
101 Quantum redQuantum (
void)
const;
110 return (0.299*(_pixel->red)+0.587*(_pixel->green)+0.114*(_pixel->blue));
116 return (static_cast<Magick::Quantum>(double_*QuantumRange));
120 #if (MAGICKCORE_QUANTUM_DEPTH < 32)
123 return (static_cast<double>(quantum_)/QuantumRange);
128 return (quantum_/QuantumRange);
157 Color(PixelPacket *rep_,PixelType pixelType_);
161 void pixel(PixelPacket *rep_,PixelType pixelType_);
202 void shade(
double shade_);
203 double shade(
void)
const;
228 ColorHSL(
double hue_,
double saturation_,
double luminosity_);
237 void hue(
double hue_);
238 double hue(
void)
const;
241 void luminosity(
double luminosity_);
242 double luminosity(
void)
const;
245 void saturation(
double saturation_);
246 double saturation(
void)
const;
279 void mono(
bool mono_);
280 bool mono(
void)
const;
302 ColorRGB(
double red_,
double green_,
double blue_);
311 void blue(
double blue_);
312 double blue(
void)
const;
315 void green(
double green_);
316 double green(
void)
const;
319 void red(
double red_);
320 double red(
void)
const;
346 ColorYUV(
double y_,
double u_,
double v_);
356 double u(
void)
const;
360 double v(
void)
const;
364 double y(
void)
const;
387 return scaleQuantumToDouble(alphaQuantum());
392 _pixel->opacity=alpha_;
398 return _pixel->opacity;
414 _pixel->green=green_;
420 return _pixel->green;
434 inline void Magick::Color::initPixel()
439 _pixel->opacity=TransparentOpacity;
442 inline Magick::Color::operator MagickCore::PixelPacket()
const
452 :
Color(rep_,pixelType_)
461 :
Color(rep_,pixelType_)
470 :
Color(rep_,pixelType_)
479 :
Color(rep_,pixelType_)
485 blueQuantum(scaleDoubleToQuantum(blue_));
490 return scaleQuantumToDouble(blueQuantum());
495 greenQuantum(scaleDoubleToQuantum(green_));
500 return scaleQuantumToDouble(greenQuantum());
505 redQuantum(scaleDoubleToQuantum(red_));
510 return scaleQuantumToDouble(redQuantum());
519 :
Color(rep_,pixelType_)
523 #endif // Magick_Color_header
class MagickPPExport Color
Quantum greenQuantum(void) const
Quantum alphaQuantum(void) const
Quantum blueQuantum(void) const
double intensity(void) const
static double scaleQuantumToDouble(const Quantum quantum_)
static double scaleQuantumToDouble(const double quantum_)
Quantum redQuantum(void) const
static Quantum scaleDoubleToQuantum(const double double_)