00001 #ifndef X3DTK_IMAGE_H 00002 #define X3DTK_IMAGE_H 00003 00004 #include "X3DImageType.h" 00005 00006 namespace X3DTK { 00007 00016 class Image 00017 { 00018 public: 00020 Image(); 00022 Image(const char *fileName); 00024 ~Image(); 00025 00027 bool load(const char *fileName); 00029 void resize(unsigned short width, unsigned short height); 00032 void resizeGL(float (& textureTransform)[16]); 00033 00035 inline unsigned short getWidth() const {return (_imageType != 0 ? _imageType->getWidth() : 0);}; 00037 inline unsigned short getHeight() const {return (_imageType != 0 ? _imageType->getHeight() : 0);}; 00039 inline int getGLType() const {return (_imageType != 0 ? _imageType->getGLType() : 0);}; 00041 inline unsigned char* getData() const {return _imageType->getData();}; 00042 00043 private: 00044 X3DImageType *_imageType; 00045 }; 00046 00047 } 00048 00049 #endif