A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color. More...
#include <RGBAColor.h>
Public Member Functions | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
RGBAColor () | |
Default constructor of a new color. More... | |
RGBAColor (int rgba) | |
It initializes a new color with the given value. More... | |
RGBAColor (int r, int g, int b, int a) | |
It initializes a new color. More... | |
RGBAColor (const std::string &hexColor) | |
It initializes a new color from a given hex RGB-encoded string. More... | |
~RGBAColor () | |
Destructor. More... | |
Accessor methods | |
Methods used to get or set properties. | |
te::color::RGBAColor & | operator= (const RGBAColor &color) |
Assigns a copy of a color to this color, and returns a reference to it. More... | |
te::color::RGBAColor & | operator= (const int &rgba) |
Assigns a copy of a color to this color. More... | |
bool | operator== (const RGBAColor &color) const |
It compares the colors are iqual. More... | |
bool | operator!= (const RGBAColor &color) const |
It compares the colors are different. More... | |
int | getRed () const |
It returns the red component color value (a value from 0 to 255). More... | |
int | getGreen () const |
It returns the green component color value (a value from 0 to 255). More... | |
int | getBlue () const |
It returns the blue component color value (a value from 0 to 255). More... | |
int | getAlpha () const |
It returns the alpha component color value (a value from 0 to 255). More... | |
void | getRgba (int *r, int *g, int *b, int *a=0) const |
It gets the color value. More... | |
int | getRgba () const |
It returns the color value (0xAARRGGBB). More... | |
void | setColor (const std::string &hexColor) |
It sets the color using a two hexadecimal RGB-encoded color. More... | |
std::string | getColor () const |
It gets the color encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign. More... | |
void | setColor (int r, int g, int b, int a=255) |
It sets the color. More... | |
void | setColor (int rgba) |
It sets the color. More... | |
Private Attributes | |
int | m_rgba |
It returns the internal representation as a 32-bits RGBA color. More... | |
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Internally the color is represented by an integer of 32-bits as the following:
Definition at line 57 of file RGBAColor.h.
|
inline |
Default constructor of a new color.
Definition at line 243 of file RGBAColor.h.
|
inline |
It initializes a new color with the given value.
rgba | The color encoded as an integer. |
Definition at line 248 of file RGBAColor.h.
|
inline |
It initializes a new color.
r | Red component (range from 0 to 255). |
g | Green component (range from 0 to 255). |
b | Blue component (range from 0 to 255). |
a | Alpha component. A range from 0 to 255 (see the macro TE_OPAQUE and TE_TRANSPARENT for the values of totally transparent and totally opaque). |
Definition at line 253 of file RGBAColor.h.
|
inline |
It initializes a new color from a given hex RGB-encoded string.
hexColor | The color value is RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign. The hexadecimal digits between A and F may be in uppercase or lowercase. |
Definition at line 262 of file RGBAColor.h.
References setColor().
|
inline |
Destructor.
Definition at line 267 of file RGBAColor.h.
|
inline |
It returns the alpha component color value (a value from 0 to 255).
Definition at line 310 of file RGBAColor.h.
References m_rgba.
Referenced by te::layout::VariantPropertiesBrowser::changeQtVariantPropertyValue(), te::color::ColorTransform::ColorTransform(), te::qt::widgets::Config(), te::layout::ParentItem< T >::drawBackground(), te::layout::ParentItem< T >::drawBorder(), te::layout::PointItem::drawCircle(), te::layout::PointItem::drawCross(), te::layout::EllipseItem::drawEllipse(), te::layout::GridPlanarItem::drawGrid(), te::layout::GridGeodesicItem::drawGrid(), te::layout::GridMapItem::drawGrid(), te::qt::widgets::Canvas::drawImage(), te::ag::Canvas::drawImage(), te::layout::LineItem::drawLine(), te::layout::PaperItem::drawPaper(), te::ag::Canvas::drawPixel(), te::layout::PolygonItem::drawPolygon(), te::layout::RectangleItem::drawRectangle(), te::layout::NorthItem::drawRectangle(), te::layout::PointItem::drawRhombus(), te::layout::PointItem::drawSquare(), te::layout::PointItem::drawStar(), te::layout::PointItem::drawX(), te::color::ColorBar::generateColorBar(), te::se::GetColor(), te::qt::widgets::GetImage(), te::qt::widgets::ReadPixelTool::mouseReleaseEvent(), te::color::ColorBar::move(), te::layout::MenuBuilder::onShowColorDlg(), te::layout::LegendItem::paint(), te::color::ColorBar::remove(), te::ag::Canvas::setBackgroundColor(), te::ag::Canvas::setLineColor(), te::ag::Canvas::setPointColor(), te::ag::Canvas::setPointStyle(), te::ag::Canvas::setPolygonContourColor(), te::ag::Canvas::setPolygonFillColor(), te::ag::Canvas::setTextBoundaryColor(), te::qt::widgets::Canvas::setTextColor(), te::ag::Canvas::setTextColor(), te::ag::Canvas::setTextDecorationColor(), te::layout::TitleItem::updateDocument(), te::layout::MapItem::updateObserver(), te::layout::TextItem::updateTextConfig(), te::qt::widgets::BasicFillPropertyItem::updateUi(), te::qt::widgets::BasicStrokePropertyItem::updateUi(), te::qt::widgets::BasicFillWidget::updateUi(), and te::qt::widgets::BasicStrokeWidget::updateUi().
|
inline |
It returns the blue component color value (a value from 0 to 255).
Definition at line 305 of file RGBAColor.h.
References m_rgba.
Referenced by te::layout::VariantPropertiesBrowser::changeQtVariantPropertyValue(), te::color::ColorTransform::ColorTransform(), te::layout::ParentItem< T >::drawBackground(), te::layout::ParentItem< T >::drawBorder(), te::layout::PointItem::drawCircle(), te::layout::PointItem::drawCross(), te::layout::EllipseItem::drawEllipse(), te::layout::GridPlanarItem::drawGrid(), te::layout::GridGeodesicItem::drawGrid(), te::layout::GridMapItem::drawGrid(), te::qt::widgets::Canvas::drawImage(), te::ag::Canvas::drawImage(), te::layout::LineItem::drawLine(), te::layout::PaperItem::drawPaper(), te::ag::Canvas::drawPixel(), te::layout::PolygonItem::drawPolygon(), te::layout::NorthItem::drawRectangle(), te::layout::RectangleItem::drawRectangle(), te::layout::PointItem::drawRhombus(), te::layout::PointItem::drawSquare(), te::layout::PointItem::drawStar(), te::layout::PointItem::drawX(), te::qt::widgets::ColorMapItem::fetchMore(), te::color::ColorBar::generateColorBar(), te::map::RasterTransformConfigurer::getCategorizedMap(), getColor(), te::se::GetColor(), te::qt::widgets::GetImage(), te::layout::TextGridSettingsOutside::initColor(), te::layout::GridSettingsOutside::initColor(), te::qt::widgets::colorbar::ColorBar::mousePressEvent(), te::qt::widgets::ReadPixelTool::mouseReleaseEvent(), te::color::ColorBar::move(), te::layout::MenuBuilder::onShowColorDlg(), te::layout::LegendItem::paint(), te::color::ColorBar::remove(), te::ag::Canvas::setBackgroundColor(), te::map::RasterTransform::setCategorize(), te::map::RasterTransform::setInterpolate(), te::ag::Canvas::setLineColor(), te::ag::Canvas::setLineStyle(), te::ag::Canvas::setPointColor(), te::ag::Canvas::setPointStyle(), te::ag::Canvas::setPolygonContourColor(), te::ag::Canvas::setPolygonContourStyle(), te::ag::Canvas::setPolygonFillColor(), te::ag::Canvas::setPolygonFillStyle(), te::ag::Canvas::setTextBoundaryColor(), te::qt::widgets::Canvas::setTextColor(), te::ag::Canvas::setTextColor(), te::ag::Canvas::setTextDecorationColor(), te::layout::TitleItem::updateDocument(), te::layout::MapItem::updateObserver(), and te::layout::TextItem::updateTextConfig().
|
inline |
It gets the color encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign.
Definition at line 349 of file RGBAColor.h.
References getBlue(), getGreen(), and getRed().
Referenced by te::se::GenerateRandomColor(), and te::map::serialize::WriteLayerChart().
|
inline |
It returns the green component color value (a value from 0 to 255).
Definition at line 300 of file RGBAColor.h.
References m_rgba.
Referenced by te::layout::VariantPropertiesBrowser::changeQtVariantPropertyValue(), te::color::ColorTransform::ColorTransform(), te::layout::ParentItem< T >::drawBackground(), te::layout::ParentItem< T >::drawBorder(), te::layout::PointItem::drawCircle(), te::layout::PointItem::drawCross(), te::layout::EllipseItem::drawEllipse(), te::layout::GridPlanarItem::drawGrid(), te::layout::GridGeodesicItem::drawGrid(), te::layout::GridMapItem::drawGrid(), te::qt::widgets::Canvas::drawImage(), te::ag::Canvas::drawImage(), te::layout::LineItem::drawLine(), te::layout::PaperItem::drawPaper(), te::ag::Canvas::drawPixel(), te::layout::PolygonItem::drawPolygon(), te::layout::NorthItem::drawRectangle(), te::layout::RectangleItem::drawRectangle(), te::layout::PointItem::drawRhombus(), te::layout::PointItem::drawSquare(), te::layout::PointItem::drawStar(), te::layout::PointItem::drawX(), te::qt::widgets::ColorMapItem::fetchMore(), te::color::ColorBar::generateColorBar(), te::map::RasterTransformConfigurer::getCategorizedMap(), getColor(), te::se::GetColor(), te::qt::widgets::GetImage(), te::layout::TextGridSettingsOutside::initColor(), te::layout::GridSettingsOutside::initColor(), te::qt::widgets::colorbar::ColorBar::mousePressEvent(), te::qt::widgets::ReadPixelTool::mouseReleaseEvent(), te::color::ColorBar::move(), te::layout::MenuBuilder::onShowColorDlg(), te::layout::LegendItem::paint(), te::color::ColorBar::remove(), te::ag::Canvas::setBackgroundColor(), te::map::RasterTransform::setCategorize(), te::map::RasterTransform::setInterpolate(), te::ag::Canvas::setLineColor(), te::ag::Canvas::setLineStyle(), te::ag::Canvas::setPointColor(), te::ag::Canvas::setPointStyle(), te::ag::Canvas::setPolygonContourColor(), te::ag::Canvas::setPolygonContourStyle(), te::ag::Canvas::setPolygonFillColor(), te::ag::Canvas::setPolygonFillStyle(), te::ag::Canvas::setTextBoundaryColor(), te::qt::widgets::Canvas::setTextColor(), te::ag::Canvas::setTextColor(), te::ag::Canvas::setTextDecorationColor(), te::layout::TitleItem::updateDocument(), te::layout::MapItem::updateObserver(), and te::layout::TextItem::updateTextConfig().
|
inline |
It returns the red component color value (a value from 0 to 255).
Definition at line 295 of file RGBAColor.h.
References m_rgba.
Referenced by te::layout::VariantPropertiesBrowser::changeQtVariantPropertyValue(), te::color::ColorTransform::ColorTransform(), te::layout::ParentItem< T >::drawBackground(), te::layout::ParentItem< T >::drawBorder(), te::layout::PointItem::drawCircle(), te::layout::PointItem::drawCross(), te::layout::EllipseItem::drawEllipse(), te::layout::GridPlanarItem::drawGrid(), te::layout::GridGeodesicItem::drawGrid(), te::layout::GridMapItem::drawGrid(), te::qt::widgets::Canvas::drawImage(), te::ag::Canvas::drawImage(), te::layout::LineItem::drawLine(), te::layout::PaperItem::drawPaper(), te::ag::Canvas::drawPixel(), te::layout::PolygonItem::drawPolygon(), te::layout::NorthItem::drawRectangle(), te::layout::RectangleItem::drawRectangle(), te::layout::PointItem::drawRhombus(), te::layout::PointItem::drawSquare(), te::layout::PointItem::drawStar(), te::layout::PointItem::drawX(), te::qt::widgets::ColorMapItem::fetchMore(), te::color::ColorBar::generateColorBar(), te::map::RasterTransformConfigurer::getCategorizedMap(), getColor(), te::se::GetColor(), te::qt::widgets::GetImage(), te::layout::TextGridSettingsOutside::initColor(), te::layout::GridSettingsOutside::initColor(), te::qt::widgets::colorbar::ColorBar::mousePressEvent(), te::qt::widgets::ReadPixelTool::mouseReleaseEvent(), te::color::ColorBar::move(), te::layout::MenuBuilder::onShowColorDlg(), te::layout::LegendItem::paint(), te::color::ColorBar::remove(), te::ag::Canvas::setBackgroundColor(), te::map::RasterTransform::setCategorize(), te::map::RasterTransform::setInterpolate(), te::ag::Canvas::setLineColor(), te::ag::Canvas::setLineStyle(), te::ag::Canvas::setPointColor(), te::ag::Canvas::setPointStyle(), te::ag::Canvas::setPolygonContourColor(), te::ag::Canvas::setPolygonContourStyle(), te::ag::Canvas::setPolygonFillColor(), te::ag::Canvas::setPolygonFillStyle(), te::ag::Canvas::setTextBoundaryColor(), te::qt::widgets::Canvas::setTextColor(), te::ag::Canvas::setTextColor(), te::ag::Canvas::setTextDecorationColor(), te::layout::TitleItem::updateDocument(), te::layout::MapItem::updateObserver(), and te::layout::TextItem::updateTextConfig().
|
inline |
It gets the color value.
r | Red component. |
g | Green component. |
b | Blue component. |
a | Alpha component. |
Definition at line 315 of file RGBAColor.h.
References m_rgba.
Referenced by te::qt::widgets::Config(), te::qt::widgets::Convert2Qt(), te::qt::widgets::Canvas::drawImage(), te::qt::widgets::Canvas::drawPixel(), te::qt::widgets::Canvas::setBackgroundColor(), te::color::ColorTransform::setColor(), te::qt::widgets::Canvas::setLineColor(), te::qt::widgets::Canvas::setPointColor(), te::qt::widgets::Canvas::setPolygonContourColor(), te::qt::widgets::Canvas::setPolygonFillColor(), te::qt::widgets::Canvas::setTextContourColor(), te::qt::widgets::BasicFillPropertyItem::updateUi(), te::qt::widgets::BasicStrokePropertyItem::updateUi(), te::qt::widgets::BasicFillWidget::updateUi(), te::qt::widgets::BasicStrokeWidget::updateUi(), and te::qt::widgets::colorbar::ColorBar::wheelEvent().
|
inline |
It returns the color value (0xAARRGGBB).
Definition at line 324 of file RGBAColor.h.
References m_rgba.
|
inline |
It compares the colors are different.
color | The rgba color to be compared. |
Definition at line 290 of file RGBAColor.h.
References operator==().
|
inline |
Assigns a copy of a color to this color, and returns a reference to it.
color | The rgba color to be copied. |
Definition at line 271 of file RGBAColor.h.
References m_rgba.
|
inline |
Assigns a copy of a color to this color.
rgba | the 32-bit RGBA (Red-Green-Blue-Alpha channel) color to be copied. |
Definition at line 277 of file RGBAColor.h.
References m_rgba.
|
inline |
It compares the colors are iqual.
color | The rgba color to be compared. |
Definition at line 283 of file RGBAColor.h.
References m_rgba.
Referenced by operator!=().
|
inline |
It sets the color using a two hexadecimal RGB-encoded color.
hexColor | The color value is RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign. The hexadecimal digits between A and F may be in either uppercase or lowercase. |
Definition at line 329 of file RGBAColor.h.
References te::common::GetDecimalFromHexNotCS(), and TE_OPAQUE.
Referenced by te::layout::TextGridSettingsOutside::configColor(), te::layout::GridSettingsOutside::configColor(), te::qt::widgets::ColorMapItem::fetchMore(), te::color::ColorBar::generateColorBar(), te::map::RasterTransformConfigurer::getCategorizedMap(), te::se::GetColor(), te::layout::VariantPropertiesBrowser::getProperty(), te::layout::TextGridSettingsOutside::initColor(), te::layout::GridSettingsOutside::initColor(), te::layout::LegendChildModel::LegendChildModel(), te::layout::LegendModel::LegendModel(), te::qt::widgets::MixtureModelDialog::MixtureModelDialog(), te::layout::MenuBuilder::onShowColorDlg(), RGBAColor(), te::layout::TextGridModel::TextGridModel(), te::qt::widgets::TiePointsLocatorDialog::TiePointsLocatorDialog(), and te::layout::TitleModel::TitleModel().
|
inline |
It sets the color.
r | Red component (range from 0 to 255). |
g | Green component (range from 0 to 255). |
b | Blue component (range from 0 to 255). |
a | Alpha component. A range from 0 to 255 (see the macro TE_OPAQUE and TE_TRANSPARENT for the values of totally transparent and totally opaque). |
Definition at line 357 of file RGBAColor.h.
References m_rgba.
|
inline |
It sets the color.
rgba | The color represented by a number of 4 bytes, where the values ??are in the following order: alpha, red, green and blue. The alpha is the most significant byte. |
Definition at line 362 of file RGBAColor.h.
References m_rgba.
|
private |
It returns the internal representation as a 32-bits RGBA color.
Definition at line 240 of file RGBAColor.h.
Referenced by getAlpha(), getBlue(), getGreen(), getRed(), getRgba(), operator=(), operator==(), and setColor().