00001 // Filename: fltPackedColor.h 00002 // Created by: drose (25Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef FLTPACKEDCOLOR_H 00020 #define FLTPACKEDCOLOR_H 00021 00022 #include <pandatoolbase.h> 00023 00024 #include <luse.h> 00025 #include <math.h> 00026 00027 class FltRecordReader; 00028 class FltRecordWriter; 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Class : FltPackedColor 00032 // Description : A packed color record, A, B, G, R. This appears, for 00033 // instance, within a face bead. 00034 //////////////////////////////////////////////////////////////////// 00035 class FltPackedColor { 00036 public: 00037 INLINE FltPackedColor(); 00038 00039 INLINE Colorf get_color() const; 00040 INLINE RGBColorf get_rgb() const; 00041 INLINE void set_color(const Colorf &color); 00042 INLINE void set_rgb(const RGBColorf &rgb); 00043 00044 void output(ostream &out) const; 00045 bool extract_record(FltRecordReader &reader); 00046 bool build_record(FltRecordWriter &writer) const; 00047 00048 public: 00049 int _a; 00050 int _b; 00051 int _g; 00052 int _r; 00053 }; 00054 00055 INLINE ostream &operator << (ostream &out, const FltPackedColor &color); 00056 00057 #include "fltPackedColor.I" 00058 00059 #endif 00060 00061 00062