summaryrefslogtreecommitdiffstats
path: root/libdimensionxx/dimensionxx/color.hpp
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-04-12 19:06:50 +0000
committerTavian Barnes <tavianator@gmail.com>2009-04-12 19:06:50 +0000
commitb9e19e076662ae5743b9c81eb238fe11204f6dbd (patch)
tree2a29279adf20a2b8291f56f341695db07e861e98 /libdimensionxx/dimensionxx/color.hpp
parent8a4f9e902cf64f97ee2f15fa3940a7cf183a27b7 (diff)
downloaddimension-b9e19e076662ae5743b9c81eb238fe11204f6dbd.tar.xz
Add some comments.
Diffstat (limited to 'libdimensionxx/dimensionxx/color.hpp')
-rw-r--r--libdimensionxx/dimensionxx/color.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libdimensionxx/dimensionxx/color.hpp b/libdimensionxx/dimensionxx/color.hpp
index afd7ea5..a7087a7 100644
--- a/libdimensionxx/dimensionxx/color.hpp
+++ b/libdimensionxx/dimensionxx/color.hpp
@@ -21,16 +21,21 @@
#ifndef DIMENSIONXX_COLOR_HPP
#define DIMENSIONXX_COLOR_HPP
+// Wrappers for libdimension colors.
+
namespace Dimension
{
+ // Forward declarations
class CIE_XYZ;
class CIE_xyY;
class CIE_Lab;
class CIE_Luv;
class sRGB;
+ // Default whitepoint (D50)
extern const CIE_XYZ whitepoint;
+ // Wrapper for dmnsn_color
class Color
{
public:
@@ -44,6 +49,7 @@ namespace Dimension
// Color(const Color& c);
// ~Color();
+ // Get and set filtered and unfiltered transparancy
double filter() const { return m_color.filter; }
double trans() const { return m_color.trans; }
@@ -51,15 +57,20 @@ namespace Dimension
double trans(double t) { m_color.trans = t; }
// Color& operator=(const Color& c);
+
+ // Add a color to this one in a perceptually correct manner
Color& operator+=(const Color& c)
{ m_color = dmnsn_color_add(m_color, c.m_color); return *this; }
+ // Access the wrapped color
dmnsn_color dmnsn() const { return m_color; }
private:
dmnsn_color m_color;
};
+ // Wrappers for all libdimension color types
+
class CIE_XYZ
{
public:
@@ -206,6 +217,7 @@ namespace Dimension
// Color operators
+ // Perceptually correct color combination
inline Color
operator+(const Color& lhs, const Color& rhs)
{
@@ -214,6 +226,7 @@ namespace Dimension
return temp;
}
+ // Perceptual color difference
inline double
operator-(const Color& lhs, const Color& rhs)
{