// ======================================================== // Module: CAutohist.h/cpp // // Description: Auto histogram equalization // // Author(s): Chi Toung Yeung cty // // Input: Windows' bitmap 8 bpp Gray or 24 bpp RGB only // Output: // // History: // 23Mar06 start cty // 24Mar06 Construction methods cty // 24Mar06 Load(), GetStat() cty // 26Mar06 class needs testing cty // 31mar06 AdjMinMax() work but pixel orders are backward // problem is in bmp<->raw conversion cty // 13Apr06 BuiltList() for X axis data that has some // dynamic range clippings cty // ======================================================== // -------------------------------------------------------- // Constants // -------------------------------------------------------- #define QUAD 4 #define RGB 3 enum { CHAN_BLU, CHAN_GRN, CHAN_RED, CHAN_GRAY }; // -------------------------------------------------------- // Errors // -------------------------------------------------------- #define INVALID_INPUT -14000 #define MISSING_IMAGE -14001 // -------------------------------------------------------- // Class Definition // -------------------------------------------------------- class CAutoHist : public Chist { public: CAutoHist(); ~CAutoHist(); void Empty(); bool IsEmpty(); public: int Load ( CRaw *raw1 ); int GetStat (int &iMin, int &iShdw, int &iMid, int &iHgh, int &iMax, int iChannel ); public: int Equalize ( int iChannel ); int AdjMinMax ( int iChannel ); int AdjMinMax ( int iMin, int iMax, int iChannel ); int Manual ( int iMin, int iQtr, int iMid, int iThrQtr, int iMax, int iChannel ); private: int BuiltList ( double X[], double Y[], int &cnt ); public: int m_iMin[QUAD]; int m_iMax[QUAD]; int m_iQtr[QUAD]; int m_iMid[QUAD]; int m_iThrQtr[QUAD]; int m_iChan; public: CRaw *m_raw1; };