Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.52
Color.h
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
18 
19 
20 #pragma once
21 
22 #include "common.h"
23 #if GEOM_PSEUDO3D==GEOM_TRUE
24  namespace GEOM_FADE25D {
25 #elif GEOM_PSEUDO3D==GEOM_FALSE
26  namespace GEOM_FADE2D {
27 #else
28  #error GEOM_PSEUDO3D is not defined
29 #endif
30 
35 enum Colorname
36 {
37  CRED,
38  CGREEN,
39  CBLUE,
40  CBLACK,
41  CYELLOW,
42  CPINK,
43  CGRAY
44 };
45 
51 class CLASS_DECLSPEC Color
52 {
53 public:
65  Color(double r_,double g_,double b_,double width_,bool bFill_=false);
66 
75  Color(Colorname c,float width_=0.001,bool bFill_=false);
76  Color();
77 
78 
79  bool operator!=(Color& other) const;
80  bool operator==(Color& other) const;
81  float r,g,b,width;
82  bool bFill;
83  friend std::ostream &operator<<(std::ostream &stream, const Color& c);
84 };
85 
86 
87 
88 inline std::ostream &operator<<(std::ostream &stream, const Color& c)
89 {
90  stream<<"Color (r,g,b): "<<c.r<<","<<c.g<<","<<c.b<<", linewidth="<<c.width<<", fill="<<c.bFill;
91  return stream;
92 }
93 
94 
95 } // (namespace)
Color
Definition: Color.h:51
Definition: Bbox2.h:25