Texture.h

Go to the documentation of this file.
00001 
00007 #ifndef TEXTURE_H
00008 #define TEXTURE_H TEXTURE_H
00009 
00010 #include "Image.h"
00011 
00016 class Texture
00017 {
00018 public:
00023     enum Mode{
00025         CLAMP = 0,
00026 
00028         REPEAT = 1
00029     };
00030 
00035     enum InterpolationMode
00036     {
00038         NEAREST = 0,
00039 
00041         LINEAR = 1
00042     };
00043 
00048     Texture() : mMode(CLAMP), mInterpolationMode(NEAREST)
00049     {
00050     };
00051         
00053     virtual ~Texture()
00054     {
00055     }
00056 
00062     Mode getWrapMode() const { return mMode; }
00063 
00069     void setWrapMode(Mode mode) { mMode = mode; }
00070 
00076     InterpolationMode getInterpolationMode() const { return mInterpolationMode; }
00077 
00083     void setInterpolationMode(InterpolationMode mode) { mInterpolationMode = mode; }
00084 
00089     virtual ColorRGBA GetTexel(float u, float v) = 0;
00090     inline  ColorRGBA GetTexel(const PAIR& uv) { return GetTexel(uv.first, uv.second); }
00091 
00092 protected:
00093 
00098     Mode mMode;
00099 
00104     InterpolationMode mInterpolationMode;
00105 };
00106 
00107 #endif

Generated on Thu Jan 31 21:48:49 2008 for RayTracer by  doxygen 1.5.4