00001
00002
00003 #ifndef __TEXTURE_2D_H
00004 #define __TEXTURE_2D_H
00005
00006 #include <esg/texture/Texture.h>
00007 #include <vecmath/Color3f.h>
00008
00009 namespace esg {
00010
00011 class Texture2D : public Texture {
00012 protected:
00013 Color3f** _texture;
00014 unsigned _width;
00015 unsigned _height;
00016
00017 protected:
00018 void _delete_texture (void);
00019 void _allocate_texture (unsigned w, unsigned h);
00020
00021 public:
00022 Texture2D (void)
00023 : Texture(UV_MAPPING), _texture(NULL), _width(0), _height(0) {}
00024
00025 virtual ~Texture2D () { _delete_texture(); }
00026
00027 virtual bool value (unsigned row, unsigned col, Color3f& c) const;
00028 virtual bool mapUV (float u, float v, Color3f& c) const;
00029 virtual bool mapXYZ (float x, float y, float z, Color3f& c) const;
00030 };
00031
00032 };
00033
00034 #endif // __TEXTURE_2D_H