Panda3D
fltPackedColor.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file fltPackedColor.h
10  * @author drose
11  * @date 2000-08-25
12  */
13 
14 #ifndef FLTPACKEDCOLOR_H
15 #define FLTPACKEDCOLOR_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "luse.h"
20 #include <math.h>
21 
22 class FltRecordReader;
23 class FltRecordWriter;
24 
25 /**
26  * A packed color record, A, B, G, R. This appears, for instance, within a
27  * face bead.
28  */
30 public:
31  INLINE FltPackedColor();
32 
33  INLINE LColor get_color() const;
34  INLINE LRGBColor get_rgb() const;
35  INLINE void set_color(const LColor &color);
36  INLINE void set_rgb(const LRGBColor &rgb);
37 
38  void output(std::ostream &out) const;
39  bool extract_record(FltRecordReader &reader);
40  bool build_record(FltRecordWriter &writer) const;
41 
42 public:
43  int _a;
44  int _b;
45  int _g;
46  int _r;
47 };
48 
49 INLINE std::ostream &operator << (std::ostream &out, const FltPackedColor &color);
50 
51 #include "fltPackedColor.I"
52 
53 #endif
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
LColor get_color() const
Returns the four-component color as a LColor, where each component is in the range [0,...