VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
color.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1999 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: gdbColor.h,v $ $Revision: 1.9 $ $State: Exp $
7 *********************************************************************/
8 #ifndef color_H_
9 #define color_H_
10 
11 // \file gdbColor.h
12 // \brief Contains the DtColor class declaration.
13 
15 #include <stdio.h>
16 #include <iostream>
17 #include <vlutil/vlString.h>
18 #include <vlutil/vlMachineTypes.h>
19 #include <vlutil/vlUtil.h>
20 
21 
22 //
23 // DtColor represents a color assigned to a polygon, or
24 // pixel element.
26 {
27 public:
28  // default constructor
29  DtColor();
30 
31  // additional constructor
32  DtColor(DtU8 red, DtU8 green, DtU8 blue, DtU8 alpha);
33 
34  // destructor
35  virtual ~DtColor();
36 
37  // copy constructor
38  DtColor(const DtColor& orig);
39 
40  // assignment operator
41  DtColor& operator=(const DtColor& orig);
42 
43  // set specified colors -- mutator function
44  virtual void setColors(DtU8 red, DtU8 green, DtU8 blue, DtU8 alpha);
45 
46  // accessor functions
47  virtual DtU8 red() const;
48  virtual DtU8 green() const;
49  virtual DtU8 blue() const;
50  virtual DtU8 alpha() const;
51 
52  // comparison function
53  virtual int operator==(const DtColor& other)const;
54 
55  // help function for debugging
56  virtual void dump() const;
57 
58  // input/output functions
59  virtual bool readFrom(FILE* fp);
60  virtual bool writeTo(FILE* fp);
61 
62 #ifndef NO_VRLINK
63  virtual DtString string() const;
64 #endif
65 
66 protected:
67 
68  DtU8 myRed;
69  DtU8 myGreen;
70  DtU8 myBlue;
71  DtU8 myAlpha;
72 
73 };
74 
75 inline DtU8 DtColor::red() const
76 {
77  return myRed;
78 }
79 
80 inline DtU8 DtColor::green() const
81 {
82  return myGreen;
83 }
84 
85 inline DtU8 DtColor::blue() const
86 {
87  return myBlue;
88 }
89 
90 inline DtU8 DtColor::alpha() const
91 {
92  return myAlpha;
93 }
94 
95 DT_DLL_geometry std::ostream& operator<<(std::ostream& os, const DtColor& color);
96 DT_DLL_geometry std::istream& operator>>(std::istream& is, DtColor& color);
97 
98 #endif
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
DT_DLL_features std::ostream & operator<<(std::ostream &, const DtFeatureTransform &)
std::ostream output.
Definition: color.h:25
#define DT_DLL_geometry
Definition: geometryDefines.h:23
DtU8 myAlpha
Definition: color.h:71
virtual DtU8 alpha() const
Definition: color.h:90
DtU8 myGreen
Definition: color.h:69
virtual DtU8 red() const
Definition: color.h:75
DtU8 myRed
Definition: color.h:68
virtual DtU8 blue() const
Definition: color.h:85
DT_DLL_features std::istream & operator>>(std::istream &, DtQuery &)
iostream input iteration
DtU8 myBlue
Definition: color.h:70
virtual DtU8 green() const
Definition: color.h:80

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)