00001
00002
00003
00005
00006
00011
00016
00021
00023
00024 #ifndef IMAGE_H
00025 #define IMAGE_H
00026
00027 #include "X3DImageType.h"
00028
00029 namespace X3DTK {
00030
00031 class Image
00032 {
00033 public:
00034 Image();
00035 Image(const char *fileName);
00036 ~Image();
00037
00038 bool load(const char *fileName);
00039 void resize(unsigned short width, unsigned short height);
00040 void resizeGL(float (& textureTransform)[16]);
00041
00042 inline unsigned short getWidth() const {return (_imageType != 0 ? _imageType->getWidth() : 0);};
00043 inline unsigned short getHeight() const {return (_imageType != 0 ? _imageType->getHeight() : 0);};
00044 inline int getGLType() const {return (_imageType != 0 ? _imageType->getGLType() : 0);};
00045 inline unsigned char* getData() const {return _imageType->getData();};
00046
00047 private:
00048 X3DImageType *_imageType;
00049 };
00050
00051 }
00052
00053 #endif