Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

X3DImageType.h

Go to the documentation of this file.
00001 
00002 //                            X3DImageType.h                                  //
00004 
00005 #ifndef X3DIMAGETYPE_H
00006 #define X3DIMAGETYPE_H
00007 
00008 #include <GL/gl.h>
00009 
00010 namespace X3DTK {
00011 
00014 
00015 class X3DImageType
00016 {
00017 public:
00019   X3DImageType();
00021   virtual ~X3DImageType();
00022   
00024   virtual bool load(const char *fileName) = 0;  
00026   void resize(unsigned short width, unsigned short height);
00029   void resizeGL(float (& textureTransform)[16]);
00030   
00032   inline unsigned short getWidth() const {return _width;};
00034   inline unsigned short getHeight() const {return _height;};
00036   GLenum getGLType() const;
00038   inline unsigned char* getData() const {return data;};
00040   void release();
00041 
00042 protected:
00044   unsigned char *data;
00046   bool allocate(int pixelFormat, unsigned short width, unsigned short height);
00047 
00048 private:
00049   int _pixelFormat;    
00050   unsigned short _width;
00051   unsigned short _height;
00052 };
00053 
00054 }
00055 
00056 #endif

Generated on Thu Oct 9 13:50:55 2003 for X3DToolKit by doxygen1.2.18