00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef IMAGEBUFFER_H
00020 #define IMAGEBUFFER_H
00021
00022 #include "pandabase.h"
00023
00024 #include "drawable.h"
00025 #include "pointerToArray.h"
00026 #include "typedef.h"
00027 #include "filename.h"
00028 #include "namable.h"
00029
00030 class RenderBuffer;
00031 class DisplayRegion;
00032
00033
00034
00035
00036
00037 class EXPCL_PANDA ImageBuffer : public ReferenceCount,
00038 public WritableConfigurable, public Namable {
00039 PUBLISHED:
00040 ImageBuffer();
00041 virtual ~ImageBuffer();
00042
00043 public:
00044 virtual void config( void ) { WritableConfigurable::config(); }
00045
00046 virtual void copy(GraphicsStateGuardianBase *, const DisplayRegion *)=0;
00047 virtual void copy(GraphicsStateGuardianBase *, const DisplayRegion *,
00048 const RenderBuffer &rb)=0;
00049
00050 PUBLISHED:
00051 INLINE bool has_filename() const;
00052 INLINE const Filename &get_filename() const;
00053 INLINE bool has_alpha_filename() const;
00054 INLINE const Filename &get_alpha_filename() const;
00055
00056 INLINE bool has_fullpath() const;
00057 INLINE const Filename &get_fullpath() const;
00058 INLINE bool has_alpha_fullpath() const;
00059 INLINE const Filename &get_alpha_fullpath() const;
00060
00061 public:
00062 INLINE void set_filename(const Filename &filename);
00063 INLINE void clear_filename();
00064 INLINE void set_alpha_filename(const Filename &alpha_filename);
00065 INLINE void clear_alpha_filename();
00066
00067 INLINE void set_fullpath(const Filename &fullpath);
00068 INLINE void clear_fullpath();
00069 INLINE void set_alpha_fullpath(const Filename &alpha_fullpath);
00070 INLINE void clear_alpha_fullpath();
00071
00072 private:
00073 Filename _filename;
00074 Filename _alpha_filename;
00075 Filename _fullpath;
00076 Filename _alpha_fullpath;
00077
00078 protected:
00079
00080
00081
00082 int _primary_file_num_channels;
00083
00084
00085
00086
00087
00088 int _alpha_file_channel;
00089
00090 public:
00091
00092 virtual void write_datagram(BamWriter *manager, Datagram &me);
00093
00094 protected:
00095 void fillin(DatagramIterator &scan, BamReader *manager);
00096
00097 public:
00098
00099 static TypeHandle get_class_type() {
00100 return _type_handle;
00101 }
00102 static void init_type() {
00103 ReferenceCount::init_type();
00104 WritableConfigurable::init_type();
00105 Namable::init_type();
00106 register_type(_type_handle, "ImageBuffer",
00107 ReferenceCount::get_class_type(),
00108 WritableConfigurable::get_class_type(),
00109 Namable::get_class_type());
00110 }
00111 virtual TypeHandle get_type() const {
00112 return get_class_type();
00113 }
00114 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00115
00116 private:
00117
00118 static TypeHandle _type_handle;
00119 };
00120
00121 #include "imageBuffer.I"
00122
00123 #endif
00124
00125