include/crbn/image/image.hpp

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 // TODO: to change to be better.
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   // to create from a good old byte encoded images
00033   //
00034   Image( uint32 width, uint32 height, uint8* buffer );
00035   //
00036   // to create from a float encoded image
00037   // if is_sat is true, buffer is considered as already containing
00038   // a summed area table and copy the pointer
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__

Generated on Tue Nov 14 15:40:08 2006 for libcrbn by  doxygen 1.5.0