00001 #ifndef X3DTK_X3DIMAGETYPE_H 00002 #define X3DTK_X3DIMAGETYPE_H 00003 00004 #include "Platform.h" 00005 00006 #include <GL/gl.h> 00007 00008 namespace X3DTK { 00009 00018 class X3DImageType 00019 { 00020 public: 00022 X3DImageType(); 00024 virtual ~X3DImageType(); 00025 00027 virtual bool load(const char *fileName) = 0; 00029 void resize(unsigned short width, unsigned short height); 00032 void resizeGL(float (& textureTransform)[16]); 00033 00035 inline unsigned short getWidth() const {return _width;}; 00037 inline unsigned short getHeight() const {return _height;}; 00039 GLenum getGLType() const; 00041 inline unsigned char* getData() const {return data;}; 00043 void release(); 00044 00045 protected: 00047 unsigned char *data; 00049 bool allocate(int pixelFormat, unsigned short width, unsigned short height); 00050 00051 private: 00052 int _pixelFormat; 00053 unsigned short _width; 00054 unsigned short _height; 00055 }; 00056 00057 } 00058 00059 #endif