Listing 1: The ImageLut class

////////////////////////////////////////////////////////
//    File: ilut.hpp
//    Description: ImageLut - lookup table definition
//
//    Author: C Dare-Edwards
//      Copyright Conrad Dare-Edwards 1997  

typedef unsigned char BYTE;
#define BYTE_SIZE  256

class ImageLut
{
    public:
    //  constructors
    ImageLut( void );          
    ImageLut( const ImageLut& lut );    

    // conversion routines
         void Lookup( BYTE* buffer, int length ) const;         

    const BYTE& operator[] ( BYTE nIndex ) const; 
                BYTE& operator[] ( BYTE nIndex ); 
    
    int getRange( void ) const;    // return BYTE_SIZE
    ImageLut& operator=( const ImageLut& copy );
    
    BOOL  ScaleTo( const ImagePoint& from, const ImagePoint& to);
    void Clear( void ); 
                
        private:
        BYTE m_luttable[BYTE_SIZE];
};
//End of File