Panda3D
|
00001 // Filename: fltPackedColor.h 00002 // Created by: drose (25Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef FLTPACKEDCOLOR_H 00016 #define FLTPACKEDCOLOR_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "luse.h" 00021 #include <math.h> 00022 00023 class FltRecordReader; 00024 class FltRecordWriter; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : FltPackedColor 00028 // Description : A packed color record, A, B, G, R. This appears, for 00029 // instance, within a face bead. 00030 //////////////////////////////////////////////////////////////////// 00031 class FltPackedColor { 00032 public: 00033 INLINE FltPackedColor(); 00034 00035 INLINE LColor get_color() const; 00036 INLINE LRGBColor get_rgb() const; 00037 INLINE void set_color(const LColor &color); 00038 INLINE void set_rgb(const LRGBColor &rgb); 00039 00040 void output(ostream &out) const; 00041 bool extract_record(FltRecordReader &reader); 00042 bool build_record(FltRecordWriter &writer) const; 00043 00044 public: 00045 int _a; 00046 int _b; 00047 int _g; 00048 int _r; 00049 }; 00050 00051 INLINE ostream &operator << (ostream &out, const FltPackedColor &color); 00052 00053 #include "fltPackedColor.I" 00054 00055 #endif 00056 00057 00058