Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

imageBuffer.h

Go to the documentation of this file.
00001 // Filename: imageBuffer.h
00002 // Created by:  mike (09Jan97)
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 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 //       Class : ImageBuffer
00035 // Description :
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   // These are set by (and read by) the derived Texture class.
00080 
00081   // The number of channels of the primary file we use.  1, 2, 3, or 4.
00082   int _primary_file_num_channels;
00083 
00084   // If we have a separate alpha file, this designates which channel
00085   // in the alpha file provides the alpha channel.  0 indicates the
00086   // combined grayscale value of rgb; otherwise, 1, 2, 3, or 4 are
00087   // valid.
00088   int _alpha_file_channel;
00089 
00090 public:
00091   // Abstract class, so no factory methods for Reading and Writing
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 

Generated on Fri Apr 18 00:06:47 2003 for Panda by doxygen1.3