Listing 3: The ImagePointLut class

////////////////////////////////////////////////////////////
//    File: iplut.hpp
//    Description: ImagePoinLut - point lookup table 
//
//    Author: C Dare-Edwards
//      Copyright Conrad Dare-Edwards 1997  

typedef  ImageTList<ImagePoint> ImagePList;

class ImagePointLut : public ImageLut
{
      public:
       enum colour { RED, GREEN, BLUE };
  
    // constructors
      ImagePointLut( void );                        
      ImagePointLut( const ImagePointLut& newlut );    
      ImagePointLut( const ImagePList& newpoints  );    
  
        // histogram equalisation ( produces a lot of points )    
      void Equalise( const ImageHist& hist );     
  
     // invert the y and or the x  axis
      void Invert( BOOL xaxis = FALSE, BOOL yaxis = TRUE ); 
  
      // Minimum to Maximum routines
     void SetMinToMax( int min, int max,  colour type = RED);    
      void SetMinToMax( const ImageHist& hist, colour type =RED); 

    // optimize the mimimum and maximum 
    void OptimiseMinMax(const ImageHist& hist,int& min,int& max); 
      
    // three point optimized lookup table
    void Optimise( const ImageHist& hist, colour type =RED);    
    
    // logorithmic curve between points
      void SetLog( const ImageHist& hist );       
      void SetLog( int min, int max );      

     // exponential curve between points
      void SetExp( const ImageHist& hist );      
      void SetExp( int min, int max );    
    
    // compute new table from list
      void Update( BOOL tidy = FALSE);  

    void BuildPointList( void );

      private:
    // check and sort list
    void SortPointList( void ); 
      // tidy up list removing redundant points 
    void TidyPointList( void );        
 
    // the point list
      ImagePList m_PointList; 
};
//End of File