Powered by Pair ImageMagick logo
Image Magick
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

Magick::ColorRGB Class Reference

#include <Color.h>

Inheritance diagram for Magick::ColorRGB:

Inheritance graph
[legend]
Collaboration diagram for Magick::ColorRGB:

Collaboration graph
[legend]

Public Member Functions

 ColorRGB (double red_, double green_, double blue_)
 ColorRGB (void)
 ColorRGB (const Color &color_)
 ~ColorRGB (void)
void red (double red_)
double red (void) const
void green (double green_)
double green (void) const
void blue (double blue_)
double blue (void) const
ColorRGBoperator= (const Color &color_)
 ColorRGB (double red_, double green_, double blue_)
 ColorRGB (void)
 ColorRGB (const Color &color_)
 ~ColorRGB (void)
void red (double red_)
double red (void) const
void green (double green_)
double green (void) const
void blue (double blue_)
double blue (void) const
ColorRGBoperator= (const Color &color_)
void redQuantum (Quantum red_)
Quantum redQuantum (void) const
void redQuantum (Quantum red_)
Quantum redQuantum (void) const
void greenQuantum (Quantum green_)
Quantum greenQuantum (void) const
void greenQuantum (Quantum green_)
Quantum greenQuantum (void) const
void blueQuantum (Quantum blue_)
Quantum blueQuantum (void) const
void blueQuantum (Quantum blue_)
Quantum blueQuantum (void) const
void alphaQuantum (Quantum alpha_)
Quantum alphaQuantum (void) const
void alphaQuantum (Quantum alpha_)
Quantum alphaQuantum (void) const
void alpha (double alpha_)
double alpha (void) const
void alpha (double alpha_)
double alpha (void) const
void isValid (bool valid_)
bool isValid (void) const
void isValid (bool valid_)
bool isValid (void) const
 operator std::string () const
 operator std::string () const
 operator PixelPacket () const
 operator PixelPacket () const
double intensity (void) const
double intensity (void) const

Static Public Member Functions

Quantum scaleDoubleToQuantum (const double double_)
Quantum scaleDoubleToQuantum (const double double_)
double scaleQuantumToDouble (const Quantum quantum_)
double scaleQuantumToDouble (const double quantum_)
double scaleQuantumToDouble (const Quantum quantum_)
double scaleQuantumToDouble (const double quantum_)

Protected Types

enum  PixelType { RGBPixel, RGBAPixel, CYMKPixel }
enum  PixelType { RGBPixel, RGBAPixel, CYMKPixel }

Protected Member Functions

 ColorRGB (PixelPacket *rep_, PixelType pixelType_)
 ColorRGB (PixelPacket *rep_, PixelType pixelType_)
void pixel (PixelPacket *rep_, PixelType pixelType_)
void pixel (PixelPacket *rep_, PixelType pixelType_)

Protected Attributes

PixelPacket_pixel
PixelPacket_pixel

Member Enumeration Documentation

enum Magick::Color::PixelType [protected, inherited]
 

Enumeration values:
RGBPixel 
RGBAPixel 
CYMKPixel 

Definition at line 131 of file Color.h.

00132 { 00133 RGBPixel, 00134 RGBAPixel, 00135 CYMKPixel 00136 };

enum Magick::Color::PixelType [protected, inherited]
 

Enumeration values:
RGBPixel 
RGBAPixel 
CYMKPixel 

Definition at line 131 of file Color.h.

00132 { 00133 RGBPixel, 00134 RGBAPixel, 00135 CYMKPixel 00136 };


Constructor & Destructor Documentation

Magick::ColorRGB::ColorRGB double  red_,
double  green_,
double  blue_
 

Definition at line 558 of file Color.cpp.

References Magick::Color::alphaQuantum(), and OpaqueOpacity.

00561 : Color ( scaleDoubleToQuantum(red_), 00562 scaleDoubleToQuantum(green_), 00563 scaleDoubleToQuantum(blue_) ) 00564 { 00565 alphaQuantum ( OpaqueOpacity ); 00566 }

Here is the call graph for this function:

Magick::ColorRGB::ColorRGB void   ) 
 

Definition at line 568 of file Color.cpp.

00569 : Color () 00570 { 00571 }

Magick::ColorRGB::ColorRGB const Color color_  ) 
 

Definition at line 573 of file Color.cpp.

00574 : Color( color_ ) 00575 { 00576 }

Magick::ColorRGB::~ColorRGB void   ) 
 

Definition at line 578 of file Color.cpp.

00579 { 00580 // Nothing to do 00581 }

Magick::ColorRGB::ColorRGB PixelPacket rep_,
PixelType  pixelType_
[protected]
 

Magick::ColorRGB::ColorRGB double  red_,
double  green_,
double  blue_
 

Magick::ColorRGB::ColorRGB void   ) 
 

Magick::ColorRGB::ColorRGB const Color color_  ) 
 

Magick::ColorRGB::~ColorRGB void   ) 
 

Magick::ColorRGB::ColorRGB PixelPacket rep_,
PixelType  pixelType_
[protected]
 


Member Function Documentation

double Magick::Color::alpha void   )  const [inherited]
 

void Magick::Color::alpha double  alpha_  )  [inherited]
 

double Magick::Color::alpha void   )  const [inline, inherited]
 

Definition at line 375 of file Color.h.

References Magick::Color::alphaQuantum(), and Magick::Color::scaleQuantumToDouble().

00376 { 00377 return scaleQuantumToDouble( alphaQuantum() ); 00378 }

Here is the call graph for this function:

void Magick::Color::alpha double  alpha_  )  [inline, inherited]
 

Definition at line 371 of file Color.h.

References Magick::Color::alphaQuantum(), and Magick::Color::scaleDoubleToQuantum().

00372 { 00373 alphaQuantum( scaleDoubleToQuantum(alpha_) ); 00374 }

Here is the call graph for this function:

Quantum Magick::Color::alphaQuantum void   )  const [inherited]
 

void Magick::Color::alphaQuantum Quantum  alpha_  )  [inherited]
 

Magick::Quantum Magick::Color::alphaQuantum void   )  const [inline, inherited]
 

Definition at line 359 of file Color.h.

References Magick::Color::_pixel, and _PixelPacket::opacity.

Referenced by Magick::Color::alpha(), Magick::Color::Color(), Magick::ColorGray::ColorGray(), Magick::ColorHSL::ColorHSL(), Magick::ColorMono::ColorMono(), ColorRGB(), Magick::ColorYUV::ColorYUV(), and Magick::Color::operator=().

00360 { 00361 return _pixel->opacity; 00362 }

void Magick::Color::alphaQuantum Quantum  alpha_  )  [inline, inherited]
 

Definition at line 354 of file Color.h.

References Magick::Color::_pixel, and _PixelPacket::opacity.

00355 { 00356 _pixel->opacity = alpha_; 00357 }

double Magick::ColorRGB::blue void   )  const
 

void Magick::ColorRGB::blue double  blue_  ) 
 

double Magick::ColorRGB::blue void   )  const [inline]
 

Definition at line 441 of file Color.h.

References Magick::Color::blueQuantum().

00442 { 00443 return scaleQuantumToDouble( blueQuantum() ); 00444 }

Here is the call graph for this function:

void Magick::ColorRGB::blue double  blue_  )  [inline]
 

Definition at line 436 of file Color.h.

References Magick::Color::blueQuantum().

00437 { 00438 blueQuantum( scaleDoubleToQuantum(blue_) ); 00439 }

Here is the call graph for this function:

Quantum Magick::Color::blueQuantum void   )  const [inherited]
 

void Magick::Color::blueQuantum Quantum  blue_  )  [inherited]
 

Magick::Quantum Magick::Color::blueQuantum void   )  const [inline, inherited]
 

Definition at line 349 of file Color.h.

References Magick::Color::_pixel, and _PixelPacket::blue.

Referenced by blue(), Magick::Color::Color(), Magick::ColorHSL::ColorHSL(), Magick::ColorHSL::hue(), Magick::ColorHSL::luminosity(), Magick::ColorMono::mono(), Magick::Color::operator=(), Magick::ColorHSL::saturation(), Magick::ColorGray::shade(), Magick::ColorYUV::u(), Magick::ColorYUV::v(), and Magick::ColorYUV::y().

00350 { 00351 return _pixel->blue; 00352 }

void Magick::Color::blueQuantum Quantum  blue_  )  [inline, inherited]
 

Definition at line 344 of file Color.h.

References Magick::Color::_pixel, and _PixelPacket::blue.

Referenced by Magick::Image::backgroundColor(), Magick::Image::borderColor(), Magick::Image::matteColor(), Magick::operator<(), and Magick::operator==().

00345 { 00346 _pixel->blue = blue_; 00347 }

double Magick::ColorRGB::green void   )  const
 

void Magick::ColorRGB::green double  green_  ) 
 

double Magick::ColorRGB::green void   )  const [inline]
 

Definition at line 431 of file Color.h.

References Magick::Color::greenQuantum().

00432 { 00433 return scaleQuantumToDouble( greenQuantum() ); 00434 }

Here is the call graph for this function:

void Magick::ColorRGB::green double  green_  )  [inline]
 

Definition at line 426 of file Color.h.

References Magick::Color::greenQuantum().

00427 { 00428 greenQuantum( scaleDoubleToQuantum(green_) ); 00429 }

Here is the call graph for this function:

Quantum Magick::Color::greenQuantum void   )  const [inherited]
 

void Magick::Color::greenQuantum Quantum  green_  )  [inherited]
 

Magick::Quantum Magick::Color::greenQuantum void   )  const [inline, inherited]
 

Definition at line 339 of file Color.h.

References Magick::Color::_pixel, and _PixelPacket::green.

Referenced by Magick::Color::Color(), Magick::ColorHSL::ColorHSL(), green(), Magick::ColorHSL::hue(), Magick::ColorHSL::luminosity(), Magick::ColorMono::mono(), Magick::Color::operator=(), Magick::ColorHSL::saturation(), Magick::ColorGray::shade(), Magick::ColorYUV::u(), Magick::ColorYUV::v(), and Magick::ColorYUV::y().

00340 { 00341 return _pixel->green; 00342 }

void Magick::Color::greenQuantum Quantum  green_  )  [inline, inherited]
 

Definition at line 334 of file Color.h.

References Magick::Color::_pixel, and _PixelPacket::green.

Referenced by Magick::Image::backgroundColor(), Magick::Image::borderColor(), Magick::Image::matteColor(), Magick::operator<(), and Magick::operator==().

00335 { 00336 _pixel->green = green_; 00337 }

double Magick::Color::intensity void   )  const [inline, inherited]
 

Definition at line 92 of file Color.h.

00093 { 00094 return (0.299*(_pixel->red)+0.587*(_pixel->green)+0.114*(_pixel->blue)); 00095 }

double Magick::Color::intensity void   )  const [inline, inherited]
 

Definition at line 92 of file Color.h.

Referenced by Magick::operator<().

00093 { 00094 return (0.299*(_pixel->red)+0.587*(_pixel->green)+0.114*(_pixel->blue)); 00095 }

bool Magick::Color::isValid void   )  const [inherited]
 

void Magick::Color::isValid bool  valid_  )  [inherited]
 

bool Magick::Color::isValid void   )  const [inherited]
 

Definition at line 269 of file Color.cpp.

References Magick::Color::_pixel, _PixelPacket::blue, _PixelPacket::green, _PixelPacket::opacity, _PixelPacket::red, and TransparentOpacity.

Referenced by Magick::Color::isValid(), and Magick::Color::operator std::string().

00270 { 00271 return( _pixel->opacity != TransparentOpacity || 00272 _pixel->red != 0 || 00273 _pixel->green != 0 || 00274 _pixel->blue != 0 ); 00275 }

void Magick::Color::isValid bool  valid_  )  [inherited]
 

Definition at line 276 of file Color.cpp.

References Magick::Color::_pixel, Magick::Color::_pixelOwn, Magick::Color::initPixel(), and Magick::Color::isValid().

Referenced by Magick::Image::backgroundColor(), Magick::Image::borderColor(), Magick::Image::colorize(), Magick::Image::colorMap(), Magick::Image::matteColor(), Magick::Image::opaque(), Magick::floodFillTextureImage::operator()(), Magick::floodFillColorImage::operator()(), Magick::operator==(), Magick::Image::pixelColor(), and Magick::Image::transparent().

00277 { 00278 if ( (valid_ && isValid()) || (!valid_ && !isValid()) ) 00279 return; 00280 00281 if ( !_pixelOwn ) 00282 { 00283 _pixel = new PixelPacket; 00284 _pixelOwn = true; 00285 } 00286 00287 initPixel(); 00288 }

Here is the call graph for this function:

Magick::Color::operator PixelPacket  )  const [inherited]
 

Magick::Color::operator PixelPacket  )  const [inherited]
 

Magick::Color::operator std::string  )  const [inherited]
 

Magick::Color::operator std::string  )  const [inherited]
 

Definition at line 224 of file Color.cpp.

References Magick::Color::_pixel, Magick::Color::_pixelType, _PixelPacket::blue, _MagickPixelPacket::blue, _MagickPixelPacket::colorspace, _MagickPixelPacket::depth, GetColorTuple(), _PixelPacket::green, _MagickPixelPacket::green, Magick::Color::isValid(), MagickFalse, MagickPixelPacket, MagickTrue, _MagickPixelPacket::matte, MaxTextExtent, _PixelPacket::opacity, _MagickPixelPacket::opacity, Magick::Color::pixel(), QuantumDepth, _PixelPacket::red, _MagickPixelPacket::red, Magick::Color::RGBAPixel, and RGBColorspace.

00225 { 00226 if ( !isValid() ) 00227 return std::string("none"); 00228 00229 char colorbuf[MaxTextExtent]; 00230 00231 MagickPixelPacket 00232 pixel; 00233 00234 pixel.colorspace=RGBColorspace; 00235 pixel.matte=_pixelType == RGBAPixel ? MagickTrue : MagickFalse; 00236 pixel.depth=QuantumDepth; 00237 pixel.red=_pixel->red; 00238 pixel.green=_pixel->green; 00239 pixel.blue=_pixel->blue; 00240 pixel.opacity=_pixel->opacity; 00241 GetColorTuple( &pixel, MagickTrue, colorbuf ); 00242 00243 return std::string(colorbuf); 00244 }

Here is the call graph for this function:

ColorRGB& Magick::ColorRGB::operator= const Color color_  ) 
 

Reimplemented from Magick::Color.

Magick::ColorRGB & Magick::ColorRGB::operator= const Color color_  ) 
 

Reimplemented from Magick::Color.

Definition at line 584 of file Color.cpp.

00585 { 00586 *static_cast<Magick::Color*>(this) = color_; 00587 return *this; 00588 }

void Magick::Color::pixel PixelPacket rep_,
PixelType  pixelType_
[protected, inherited]
 

void Magick::Color::pixel PixelPacket rep_,
PixelType  pixelType_
[protected, inherited]
 

Definition at line 259 of file Color.cpp.

References Magick::Color::_pixel, Magick::Color::_pixelOwn, Magick::Color::_pixelType, and Magick::Color::pixel().

Referenced by Magick::Color::operator std::string(), and Magick::Color::pixel().

00260 { 00261 if ( _pixelOwn ) 00262 delete _pixel; 00263 _pixel = rep_; 00264 _pixelOwn = false; 00265 _pixelType = pixelType_; 00266 }

Here is the call graph for this function:

double Magick::ColorRGB::red void   )  const
 

void Magick::ColorRGB::red double  red_  ) 
 

double Magick::ColorRGB::red void   )  const [inline]
 

Definition at line 421 of file Color.h.

References Magick::Color::redQuantum().

00422 { 00423 return scaleQuantumToDouble( redQuantum() ); 00424 }

Here is the call graph for this function:

void Magick::ColorRGB::red double  red_  )  [inline]
 

Definition at line 416 of file Color.h.

References Magick::Color::redQuantum().

00417 { 00418 redQuantum( scaleDoubleToQuantum(red_) ); 00419 }

Here is the call graph for this function:

Quantum Magick::Color::redQuantum void   )  const [inherited]
 

void Magick::Color::redQuantum Quantum  red_  )  [inherited]
 

Magick::Quantum Magick::Color::redQuantum void   )  const [inline, inherited]
 

Definition at line 329 of file Color.h.

References Magick::Color::_pixel, and _PixelPacket::red.

Referenced by Magick::Color::Color(), Magick::ColorHSL::ColorHSL(), Magick::ColorHSL::hue(), Magick::ColorHSL::luminosity(), Magick::ColorMono::mono(), Magick::Color::operator=(), red(), Magick::ColorHSL::saturation(), Magick::ColorGray::shade(), Magick::ColorYUV::u(), Magick::ColorYUV::v(), and Magick::ColorYUV::y().

00330 { 00331 return _pixel->red; 00332 }

void Magick::Color::redQuantum Quantum  red_  )  [inline, inherited]
 

Definition at line 324 of file Color.h.

References Magick::Color::_pixel, and _PixelPacket::red.

Referenced by Magick::Image::backgroundColor(), Magick::Image::borderColor(), Magick::Image::matteColor(), Magick::operator<(), and Magick::operator==().

00325 { 00326 _pixel->red = red_; 00327 }

Quantum Magick::Color::scaleDoubleToQuantum const double  double_  )  [inline, static, inherited]
 

Definition at line 98 of file Color.h.

References MaxRGB, and Quantum.

00099 { 00100 return (static_cast<Magick::Quantum>(double_*MaxRGB)); 00101 }

Quantum Magick::Color::scaleDoubleToQuantum const double  double_  )  [inline, static, inherited]
 

Definition at line 98 of file Color.h.

References MaxRGB, and Quantum.

Referenced by Magick::Color::alpha().

00099 { 00100 return (static_cast<Magick::Quantum>(double_*MaxRGB)); 00101 }

double Magick::Color::scaleQuantumToDouble const double  quantum_  )  [inline, static, inherited]
 

Definition at line 108 of file Color.h.

References MaxRGB.

00109 { 00110 return (quantum_/MaxRGB); 00111 }

double Magick::Color::scaleQuantumToDouble const Quantum  quantum_  )  [inline, static, inherited]
 

Definition at line 104 of file Color.h.

References MaxRGB.

00105 { 00106 return (static_cast<double>(quantum_)/MaxRGB); 00107 }

double Magick::Color::scaleQuantumToDouble const double  quantum_  )  [inline, static, inherited]
 

Definition at line 108 of file Color.h.

References MaxRGB.

00109 { 00110 return (quantum_/MaxRGB); 00111 }

double Magick::Color::scaleQuantumToDouble const Quantum  quantum_  )  [inline, static, inherited]
 

Definition at line 104 of file Color.h.

References MaxRGB.

Referenced by Magick::Color::alpha().

00105 { 00106 return (static_cast<double>(quantum_)/MaxRGB); 00107 }


Field Documentation

PixelPacket* Magick::Color::_pixel [protected, inherited]
 

Definition at line 152 of file Color.h.

PixelPacket* Magick::Color::_pixel [protected, inherited]
 

Definition at line 152 of file Color.h.

Referenced by Magick::Color::alphaQuantum(), Magick::Color::blueQuantum(), Magick::Color::Color(), Magick::Color::greenQuantum(), Magick::Color::initPixel(), Magick::Color::isValid(), Magick::Color::operator std::string(), Magick::Color::operator=(), Magick::Color::pixel(), Magick::Color::redQuantum(), and Magick::Color::~Color().


The documentation for this class was generated from the following files:
Generated on Mon Oct 25 13:47:28 2004 for ImageMagick by doxygen 1.3.7
ImageMagick Copyright © 2004, ImageMagick Studio LLC