00001
00002
00004
00005 #ifndef IMAGE_H
00006 #define IMAGE_H
00007
00008 #include "X3DImageType.h"
00009
00010 namespace X3DTK {
00011
00012 class Image
00013 {
00014 public:
00015 Image();
00016 Image(const char *fileName);
00017 ~Image();
00018
00019 bool load(const char *fileName);
00020 void resize(unsigned short width, unsigned short height);
00021 void resizeGL(float (& textureTransform)[16]);
00022
00023 inline unsigned short getWidth() const {return (_imageType != 0 ? _imageType->getWidth() : 0);};
00024 inline unsigned short getHeight() const {return (_imageType != 0 ? _imageType->getHeight() : 0);};
00025 inline int getGLType() const {return (_imageType != 0 ? _imageType->getGLType() : 0);};
00026 inline unsigned char* getData() const {return _imageType->getData();};
00027
00028 private:
00029 X3DImageType *_imageType;
00030 };
00031
00032 }
00033
00034 #endif