Panda3D
fltPackedColor.h
1 // Filename: fltPackedColor.h
2 // Created by: drose (25Aug00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef FLTPACKEDCOLOR_H
16 #define FLTPACKEDCOLOR_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "luse.h"
21 #include <math.h>
22 
23 class FltRecordReader;
24 class FltRecordWriter;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : FltPackedColor
28 // Description : A packed color record, A, B, G, R. This appears, for
29 // instance, within a face bead.
30 ////////////////////////////////////////////////////////////////////
32 public:
33  INLINE FltPackedColor();
34 
35  INLINE LColor get_color() const;
36  INLINE LRGBColor get_rgb() const;
37  INLINE void set_color(const LColor &color);
38  INLINE void set_rgb(const LRGBColor &rgb);
39 
40  void output(ostream &out) const;
41  bool extract_record(FltRecordReader &reader);
42  bool build_record(FltRecordWriter &writer) const;
43 
44 public:
45  int _a;
46  int _b;
47  int _g;
48  int _r;
49 };
50 
51 INLINE ostream &operator << (ostream &out, const FltPackedColor &color);
52 
53 #include "fltPackedColor.I"
54 
55 #endif
56 
57 
58 
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
void set_rgb(const LRGBColor &rgb)
Sets the color according to the indicated three-component LRGBColor value, and set the alpha to 1...
LRGBColor get_rgb() const
Returns the three-component color as an LRGBColor (ignoring the alpha component), where each componen...
void set_color(const LColor &color)
Sets the color according to the indicated four-component LColor value (including alpha).
A packed color record, A, B, G, R.
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
LColor get_color() const
Returns the four-component color as a LColor, where each component is in the range [0...