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 "Platform.h"
00009 
00010 #include <GL/gl.h>
00011 
00012 namespace X3DTK {
00013 
00016 
00017 class X3DImageType 
00018 {
00019 public:
00021   X3DImageType();
00023   virtual ~X3DImageType();
00024   
00026   virtual bool load(const char *fileName) = 0;  
00028   void resize(unsigned short width, unsigned short height);
00031   void resizeGL(float (& textureTransform)[16]);
00032   
00034   inline unsigned short getWidth() const {return _width;};
00036   inline unsigned short getHeight() const {return _height;};
00038   GLenum getGLType() const;
00040   inline unsigned char* getData() const {return data;};
00042   void release();
00043 
00044 protected:
00046   unsigned char *data;
00048   bool allocate(int pixelFormat, unsigned short width, unsigned short height);
00049 
00050 private:
00051   int _pixelFormat;    
00052   unsigned short _width;
00053   unsigned short _height;
00054 };
00055 
00056 }
00057 
00058 #endif

Generated on Mon Jan 19 10:32:08 2004 for X3DToolKit by doxygen1.2.18