//
// modify hue of a photograph.
//
// Written by John A deLaubenfels, https://www.adaptune.com/steg.htm .
// Permission granted to use freely in any non-fraudulent way.
//
//
//
//
//
//
//
//

#ifndef REHUE_H
#define REHUE_H



#include "shaping.h"


#define HSLMAX  (240.0)
#define RGBMAX  (255.0)
#define UNDEFINED (HSLMAX*2./3.)




// qxReHue

class ReHue {
private:
   ShapingAnch  *m_pHueMap;
   ShapingAnch  *m_pLumGate;
   ShapingAnch  *m_pSatGate;
   enum shapeType {shapeHue=0, shapeLum, shapeSat};
public:
   ReHue();
   ReHue(const ReHue &rs);
   virtual ~ReHue();

   const ReHue& operator=(const ReHue &rs);

   double LumToFact(double luminosityIn);
   double SatToFact(double luminosityIn);

   int AssignShape(const shapeType shT, const char *fileName);
   int AssignShapes(const char *fileHue, const char *fileSat, const char *fileLum);
   static int RGBtoHSL(const double R, const double G, const double B, double &hOut, double &sOut, double &lOut);
   static int HSLtoRGB(double hue, double sat, double lum, double &Rout, double &Gout, double &Bout);
   int RemapHue(double R, double G, double B, double &Rout, double &Gout, double &Bout);


}; // end of class ReHue...






#endif // ifndef REHUE_H

