00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef _CIL_CONTROLHISTOGRAMCTRL_H
00016 #define _CIL_CONTROLHISTOGRAMCTRL_H
00017
00018 #if _MSC_VER > 1000
00019 #pragma once
00020 #endif // _MSC_VER > 1000
00021
00022 #include <cfl/ScanBaseBuffer.h>
00023 #include <cil/ImageHistogramCalculator.h>
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 DECLARE_CLASS( CHistogramCtrl );
00038
00039
00040
00041
00042 class CHistogramCtrl : public CStatic
00043 {
00044 DECLARE_DYNAMIC( CHistogramCtrl )
00045
00046
00047
00048
00049 typedef CHistogramCtrl Self;
00050
00051 public:
00052
00053
00054
00055 typedef double ValueType;
00056
00057
00058
00059
00060 typedef cil::ImageHistogramCalculator< ValueType > HistogramType;
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 ~CHistogramCtrl();
00071
00072
00073
00074
00075 CHistogramCtrl();
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 int GetNumberOfBins() const;
00093
00094
00095
00096
00097 int GetMaximumCount() const;
00098
00099
00100
00101
00102
00103
00104
00105
00106 void SetHistogram( const HistogramType& histogram );
00107
00108
00109
00110
00111 void SetAutoscale( bool autoscale );
00112
00113
00114
00115
00116 void SetFullscale( bool fullscale );
00117
00118
00119
00120
00121 void EnableHorizontalCursor( bool enable );
00122
00123
00124
00125
00126 void SetHorizontalCursor( int percentage );
00127
00128
00129
00130
00131 void EnableVerticalCursor( bool enable );
00132
00133
00134
00135
00136 void SetVerticalCursor1( int percentage );
00137
00138
00139
00140
00141 void SetVerticalCursor2( int percentage );
00142
00143
00144
00145
00146 void SetCursorColor( COLORREF color );
00147
00148
00149
00150
00151 void SetBinColor( COLORREF color );
00152
00153
00154
00155
00156 void SetBgColor( COLORREF bgcolor );
00157
00158
00159
00160
00161
00162 public:
00163 virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00164 protected:
00165 virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00166 virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
00167 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00168
00169
00170 protected:
00171
00172
00173
00174
00175 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00176 afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
00177 afx_msg void OnPaint();
00178
00179 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00180 afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
00181
00182
00183 DECLARE_MESSAGE_MAP()
00184
00185 protected:
00186
00187
00188
00189 CHistogramCtrl( const Self& rhs );
00190
00191
00192
00193
00194 Self& operator= ( const Self& rhs );
00195
00196 protected:
00197
00198
00199
00200 HistogramType m_histogram;
00201
00202
00203
00204
00205 bool m_autoscale;
00206
00207
00208
00209
00210 double m_fullscale;
00211
00212
00213
00214
00215 bool m_horCursorOn;
00216
00217
00218
00219
00220 bool m_verCursorOn;
00221
00222
00223
00224
00225 int m_horCursor;
00226
00227
00228
00229
00230 int m_verCursor1;
00231
00232
00233
00234
00235 int m_verCursor2;
00236
00237
00238
00239
00240 COLORREF m_cursorColor;
00241
00242
00243
00244
00245 COLORREF m_binColor;
00246
00247
00248
00249
00250 COLORREF m_bgColor;
00251 };
00252
00253
00254
00255
00256
00257
00258 #endif // _CIL_CONTROLHISTOGRAMCTRL_H
00259
00260
00261
00262