Loading...
Searching...
No Matches
colorHSV.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_DATATYPE_COLORHSV_H
#define BALL_VIEW_DATATYPE_COLORHSV_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_DATATYPE_STRING_H
# include <BALL/DATATYPE/string.h>
#endif
#ifndef BALL_VIEW_DATATYPE_COLORUNIT_H
# include <BALL/VIEW/DATATYPE/colorUnit.h>
#endif
#ifndef BALL_VIEW_DATATYPE_COLORUNITHUE_H
# include <BALL/VIEW/DATATYPE/colorUnitHue.h>
#endif
#include <iostream>
#include <cstdio>
namespace BALL
{
namespace VIEW
{
class ColorRGBA;
class BALL_VIEW_EXPORT ColorHSV
{
friend class ColorRGBA;
public:
BALL_CREATE(ColorHSV)
ColorHSV();
ColorHSV(const ColorHSV& color);
ColorHSV(const ColorRGBA& color);
ColorHSV(const char* value);
ColorHSV(const String& value);
ColorHSV
(const ColorUnitHue& hue,
const ColorUnit& saturation,
const ColorUnit& value);
virtual ~ColorHSV();
virtual void clear();
operator String () const;
void set(const ColorHSV& color);
const ColorHSV& operator = (const ColorHSV& color);
void set(const ColorRGBA& color);
const ColorHSV& operator = (const ColorRGBA& color);
void get(ColorRGBA& color) const;
void set(const char* value);
const ColorHSV& operator = (const char* value);
void get(char* value) const;
void set(const String& value);
const ColorHSV& operator = (const String& value);
void get(String& value) const;
void swap(ColorHSV& color);
void setHue(const ColorUnitHue& hue);
ColorUnitHue& getHue();
const ColorUnitHue& getHue() const;
void setSaturation(const ColorUnit& saturation);
ColorUnit& getSaturation();
const ColorUnit& getSaturation() const;
void setValue(const ColorUnit& value);
ColorUnit& getValue();
const ColorUnit& getValue() const;
void set (const ColorUnitHue& hue, const ColorUnit& saturation, const ColorUnit& value);
void get (ColorUnitHue& hue, ColorUnit& saturation, ColorUnit& value) const;
bool operator == (const ColorHSV& color) const;
bool operator != (const ColorHSV& color) const;
bool operator < (const ColorHSV& color) const;
bool operator <= (const ColorHSV& color) const;
bool operator > (const ColorHSV& color) const;
bool operator >= (const ColorHSV& color) const;
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
friend std::istream& operator >> (std::istream& s, ColorHSV& color);
friend std::ostream& operator << (std::ostream& s, const ColorHSV& color);
private:
void calculateHSV_ (const ColorUnit red, const ColorUnit green, const ColorUnit blue);
void calculateRGB_ (ColorUnit& red, ColorUnit& green, ColorUnit& blue) const;
// @throw Exception::InvalidRange
// @throw Exception::NotInHexFormat
void stringToHSV_ (const String& value);
ColorUnitHue hue_;
ColorUnit saturation_;
ColorUnit value_;
};
# ifndef BALL_NO_INLINE_FUNCTIONS
# include <BALL/VIEW/DATATYPE/colorHSV.iC>
# endif
} // namespace VIEW
} // namespace BALL
#endif // <BALL/VIEW_DATATYPE_COLORHSV_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::String
Definition string.h:57
BALL::VIEW::ColorHSV::getHue
ColorUnitHue & getHue()
BALL::VIEW::ColorHSV::setHue
void setHue(const ColorUnitHue &hue)
BALL::VIEW::ColorHSV::get
void get(ColorRGBA &color) const
BALL::VIEW::ColorHSV::ColorRGBA
friend class ColorRGBA
Definition colorHSV.h:48
BALL::VIEW::ColorHSV::swap
void swap(ColorHSV &color)
BALL::VIEW::ColorHSV::ColorHSV
ColorHSV()
BALL::VIEW::ColorHSV::getSaturation
ColorUnit & getSaturation()
BALL::VIEW::ColorHSV::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::VIEW::ColorHSV::getValue
ColorUnit & getValue()
BALL::VIEW::ColorHSV::setSaturation
void setSaturation(const ColorUnit &saturation)
BALL::VIEW::ColorHSV::clear
virtual void clear()
BALL::VIEW::ColorHSV::set
void set(const ColorHSV &color)
BALL::VIEW::ColorHSV::setValue
void setValue(const ColorUnit &value)
BALL::VIEW::ColorRGBA
Definition colorRGBA.h:32
BALL::VIEW::ColorUnitHue
Definition colorUnitHue.h:30
BALL::VIEW::ColorUnit
Definition colorUnit.h:33
colorUnitHue.h
colorUnit.h
common.h
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
std
STL namespace.
string.h