TuttleOFX  1
AbstractLut.hpp
Go to the documentation of this file.
00001 #ifndef _LUTENGINE_ABSTRACTLUT_HPP_
00002 #define _LUTENGINE_ABSTRACTLUT_HPP_
00003 
00004 #include "LutReader.hpp"
00005 #include "Color.hpp"
00006 
00007 namespace tuttle {
00008 
00009 class Interpolator;
00010 class TrilinInterpolator;
00011 
00012 class AbstractLut
00013 {
00014 protected:
00015         size_t _dimSize;
00016         double* _data;
00017         bool _shared;
00018         Interpolator* _interpolator;
00019 
00020 public:
00021         AbstractLut();
00022         AbstractLut( Interpolator* interpolator, size_t dimSize, double* data = NULL );
00023         AbstractLut( Interpolator* interpolator, LutReader& reader );
00024         virtual ~AbstractLut();
00025 
00026         void reset( Interpolator* interpolator, LutReader& reader );
00027         void reset( LutReader& reader );
00028         void reset( size_t dimSize, double* data = NULL );
00029 
00030         inline const size_t& dimSize() const { return _dimSize; }
00031         double*              getData()       { return _data; }
00032         virtual const size_t totalSize() const = 0;
00033 
00034         virtual Color getIndexedColor( int _x, int _y, int _z ) const                             = 0;
00035         virtual Color getColor( Color const& color ) const                                        = 0;
00036         virtual Color getColor( double _r, double _g, double _b ) const                           = 0;
00037         virtual void  setIndexedColor( int _x, int _y, int _z, Color _color )                     = 0;
00038         virtual void  setIndexedValues( int _x, int _y, int _z, double _r, double _g, double _b ) = 0;
00039 };
00040 
00041 }
00042 
00043 #endif