Loading...
Searching...
No Matches
colorRGBA.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
#define BALL_VIEW_DATATYPE_COLORRGBA_H
#ifndef BALL_VIEW_DATATYPE_COLORUNIT_H
# include <BALL/VIEW/DATATYPE/colorUnit.h>
#endif
#ifndef BALL_CONCEPT_TIMESTAMP_H
#include <BALL/CONCEPT/timeStamp.h>
#endif
class QColor;
namespace BALL
{
namespace VIEW
{
// forward declarations
class ColorHSV;
class BALL_VIEW_EXPORT ColorRGBA
{
friend class ColorHSV;
public:
// BALL_CREATE(ColorRGBA)
ColorRGBA();
ColorRGBA(const ColorRGBA& color);
ColorRGBA(const ColorHSV& color);
ColorRGBA(const char* value);
ColorRGBA(const String& value);
ColorRGBA
(const ColorUnit& red_value, const ColorUnit& green_value,
const ColorUnit& blue_value, const ColorUnit& alpha_value = (float)1);
ColorRGBA(const QColor& color);
ColorRGBA(const QColor& color, const ColorUnit& alpha);
~ColorRGBA();
void clear();
operator String() const;
void set(const ColorRGBA& color);
const ColorRGBA& operator = (const ColorRGBA& color);
void set(const ColorHSV& color);
const ColorRGBA& operator = (const ColorHSV& color);
void get(ColorHSV& color) const;
void set(const char* value);
const ColorRGBA& operator = (const char* value);
void get(char* value) const;
void set(const String& value);
const ColorRGBA& operator = (const String& value);
void get(String& value) const;
void get(QColor& color) const;
bool set(const QColor& color);
QColor getQColor() const;
void swap(ColorRGBA& color);
void setRed(const ColorUnit& red_value);
ColorUnit& getRed();
const ColorUnit& getRed() const;
void setGreen(const ColorUnit& green_value);
ColorUnit& getGreen();
const ColorUnit& getGreen() const;
void setBlue(const ColorUnit& blue_value);
ColorUnit& getBlue();
const ColorUnit& getBlue() const;
void setAlpha(const ColorUnit& alpha_value);
ColorUnit& getAlpha();
const ColorUnit& getAlpha() const;
void set
(const ColorUnit& red_value, const ColorUnit& green_value,
const ColorUnit& blue_value, const ColorUnit& alpha_value = (float)1);
void get(ColorUnit& red_value, ColorUnit& green_value,
ColorUnit& blue_value, ColorUnit& alpha_value) const;
void get(ColorUnit& red_value,
ColorUnit& green_value,
ColorUnit& blue_value) const;
ColorRGBA getInverseColor() const;
bool operator == (const ColorRGBA& color) const;
bool operator != (const ColorRGBA& color) const;
bool operator < (const ColorRGBA& color) const;
bool operator <= (const ColorRGBA& color) const;
bool operator > (const ColorRGBA& color) const;
bool operator >= (const ColorRGBA& color) const;
void dump(std::ostream& s = std::cout, Size depth = 0) const;
friend BALL_VIEW_EXPORT std::istream& operator >> (std::istream& s, ColorRGBA& color);
friend BALL_VIEW_EXPORT std::ostream& operator << (std::ostream& s, const ColorRGBA& color);
private:
ColorUnit red_;
ColorUnit green_;
ColorUnit blue_;
ColorUnit alpha_;
// @throw Exception::InvalidRange
// @throw Exception::NotInHexFormat
void stringToRGBA_(const String& s);
};
extern ColorRGBA BALL_SELECTED_COLOR;
extern PreciseTime BALL_SELECTED_COLOR_CHANGE_TIME;
#ifdef BALL_COMPILER_MSVC
#include <vector>
template class BALL_VIEW_EXPORT std::vector<ColorRGBA>;
#endif
# ifndef BALL_NO_INLINE_FUNCTIONS
# include <BALL/VIEW/DATATYPE/colorRGBA.iC>
# endif
} // namespace VIEW
} // namespace BALL
#endif // <BALL/VIEW_DATATYPE_COLORRGBA_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::PreciseTime
Definition timeStamp.h:38
BALL::String
Definition string.h:57
BALL::VIEW::ColorHSV
Definition colorHSV.h:43
BALL::VIEW::ColorRGBA
Definition colorRGBA.h:32
BALL::VIEW::ColorRGBA::ColorRGBA
ColorRGBA(const char *value)
BALL::VIEW::ColorRGBA::ColorRGBA
ColorRGBA()
BALL::VIEW::ColorRGBA::getGreen
ColorUnit & getGreen()
BALL::VIEW::ColorRGBA::getQColor
QColor getQColor() const
Get a QColor representing this color.
BALL::VIEW::ColorRGBA::getGreen
const ColorUnit & getGreen() const
BALL::VIEW::ColorRGBA::~ColorRGBA
~ColorRGBA()
BALL::VIEW::ColorRGBA::getRed
const ColorUnit & getRed() const
BALL::VIEW::ColorRGBA::get
void get(char *value) const
BALL::VIEW::ColorRGBA::clear
void clear()
BALL::VIEW::ColorRGBA::setGreen
void setGreen(const ColorUnit &green_value)
BALL::VIEW::ColorRGBA::ColorRGBA
ColorRGBA(const String &value)
BALL::VIEW::ColorRGBA::set
void set(const ColorUnit &red_value, const ColorUnit &green_value, const ColorUnit &blue_value, const ColorUnit &alpha_value=(float) 1)
BALL::VIEW::ColorRGBA::setBlue
void setBlue(const ColorUnit &blue_value)
BALL::VIEW::ColorRGBA::swap
void swap(ColorRGBA &color)
BALL::VIEW::ColorRGBA::get
void get(String &value) const
BALL::VIEW::ColorRGBA::ColorHSV
friend class ColorHSV
Definition colorRGBA.h:36
BALL::VIEW::ColorRGBA::setRed
void setRed(const ColorUnit &red_value)
BALL::VIEW::ColorRGBA::set
void set(const ColorHSV &color)
BALL::VIEW::ColorRGBA::getRed
ColorUnit & getRed()
BALL::VIEW::ColorRGBA::getAlpha
const ColorUnit & getAlpha() const
BALL::VIEW::ColorRGBA::getBlue
const ColorUnit & getBlue() const
BALL::VIEW::ColorRGBA::getAlpha
ColorUnit & getAlpha()
BALL::VIEW::ColorRGBA::getInverseColor
ColorRGBA getInverseColor() const
BALL::VIEW::ColorRGBA::get
void get(QColor &color) const
Assign to a QT QColor.
BALL::VIEW::ColorRGBA::ColorRGBA
ColorRGBA(const ColorUnit &red_value, const ColorUnit &green_value, const ColorUnit &blue_value, const ColorUnit &alpha_value=(float) 1)
BALL::VIEW::ColorRGBA::ColorRGBA
ColorRGBA(const QColor &color, const ColorUnit &alpha)
Assignment from a QT QColor.
BALL::VIEW::ColorRGBA::ColorRGBA
ColorRGBA(const ColorHSV &color)
BALL::VIEW::ColorRGBA::dump
void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::VIEW::ColorRGBA::getBlue
ColorUnit & getBlue()
BALL::VIEW::ColorRGBA::set
void set(const ColorRGBA &color)
BALL::VIEW::ColorRGBA::ColorRGBA
ColorRGBA(const ColorRGBA &color)
BALL::VIEW::ColorRGBA::get
void get(ColorUnit &red_value, ColorUnit &green_value, ColorUnit &blue_value, ColorUnit &alpha_value) const
BALL::VIEW::ColorRGBA::get
void get(ColorUnit &red_value, ColorUnit &green_value, ColorUnit &blue_value) const
BALL::VIEW::ColorRGBA::set
bool set(const QColor &color)
BALL::VIEW::ColorRGBA::set
void set(const String &value)
BALL::VIEW::ColorRGBA::get
void get(ColorHSV &color) const
BALL::VIEW::ColorRGBA::set
void set(const char *value)
BALL::VIEW::ColorRGBA::setAlpha
void setAlpha(const ColorUnit &alpha_value)
BALL::VIEW::ColorRGBA::ColorRGBA
ColorRGBA(const QColor &color)
Assignment from a QT QColor.
BALL::VIEW::ColorUnit
Definition colorUnit.h:33
colorUnit.h
BALL::VIEW
Definition constraints.h:35
BALL::VIEW::BALL_SELECTED_COLOR
ColorRGBA BALL_SELECTED_COLOR
BALL::VIEW::BALL_SELECTED_COLOR_CHANGE_TIME
PreciseTime BALL_SELECTED_COLOR_CHANGE_TIME
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
timeStamp.h