00001
00002 #ifndef __image_hpp__
00003 #define __image_hpp__
00004
00005 #include <stdio.h>
00006
00007 #include <crbn/basic/basic.h>
00008 #include <crbn/basic/vec2.hpp>
00009 #include <crbn/basic/vec3.hpp>
00010
00024
00025 class Image
00026 {
00027 public:
00028 Image() { _width = _height = 0; _data = NULL; }
00029
00030 uint32 memory() { return sizeof( Image ) + sizeof( vec3 ) * _width * _height; }
00031
00032
00033
00034 Image( uint32 width, uint32 height, uint8* buffer );
00035
00036
00037
00038
00039 Image( uint32 width, uint32 height, float* buffer, bool is_sat = false );
00040
00041
00042 void makeSAT();
00043
00044 ~Image();
00045
00046 void eval( vec3& col, vec2& uv, vec2& ab );
00047
00048 private:
00049 uint32 _width, _height;
00050 vec3* _data;
00051 };
00052
00053 #endif // __image_hpp__