Filter Library | Camera | Interface Physics |
00001 /* 00002 * ScanFilterClad.h - clad filter. 00003 * 00004 * This file is part of the Camera Filter Library. 00005 * Computer Aided Measurement Environment for Realtime Atomic imaging (Camera) 00006 * 00007 * Copyright (C) 2004-2005, Leiden Probe Microscopy. 00008 * Copyright (C) 2004-2005, Universiteit Leiden. 00009 * 00010 * Authors: M. Seynen (original), Martin J. Moene 00011 * 00012 * $Id: ScanFilterClad.h 236 2005-06-27 09:03:17Z moene $ 00013 */ 00014 00015 #ifndef CFL_SCANFILTERCLAD_H 00016 #define CFL_SCANFILTERCLAD_H 00017 00018 #if _MSC_VER > 1000 00019 #pragma once 00020 #endif // _MSC_VER > 1000 00021 00022 #include <cfl/ScanFilter.h> // for base class 00023 #include <cfl/ScanBaseBuffer.h> // for ValueType 00024 00025 /** 00026 * \addtogroup cfl_filterclad Clad Filter 00027 * \brief clad filter. 00028 * 00029 00030 <h3>Purpose</h3> 00031 00032 Enlarge the image's area. 00033 00034 <h3>Description</h3> 00035 00036 The clad filter enables you to enlarge the area of an image. 00037 00038 <h3>Algorithm</h3> 00039 00040 \f[ 00041 \textrm{B} = \textrm{A} 00042 \f] 00043 00044 <h3>Examples</h3> 00045 Try to find some interesting pictures for most filters. 00046 00047 <h3>Contact</h3> 00048 Dipl.phys. M.J. Rost<br> 00049 Huygens Laboratorium<br> 00050 Universiteit Leiden<br> 00051 Niels Bohrweg 2<br> 00052 2333 CA Leiden, The Netherlands<br> 00053 <br> 00054 Tel: +31 71 5275600<br> 00055 Fax: +31 71 5275404<br> 00056 <br> 00057 E-mail: rost@physics.LeidenUniv.nl<br> 00058 Web: http://www.geocities.com/marcel_rost/<br> 00059 00060 * 00061 * @{ 00062 */ 00063 00064 DECLARE_CLASS( CScanFilterClad ); // create various types 00065 00066 /** 00067 * \brief clad filter. 00068 * 00069 */ 00070 class CScanFilterClad : public CScanFilter 00071 { 00072 /** 00073 * its dialog class. 00074 */ 00075 friend class CFilterDlg_Clad; 00076 00077 public: 00078 /** 00079 * the value type. 00080 */ 00081 typedef CScanBaseBuffer::ValueType ValueType; 00082 00083 /** 00084 * the size type. 00085 */ 00086 typedef CSize SizeType; 00087 00088 /** 00089 * the size element type. 00090 */ 00091 typedef DWORD SizeElementType; 00092 00093 /// 00094 /// \name Construction 00095 /// @{ 00096 00097 /** 00098 * default constructor. 00099 */ 00100 CScanFilterClad(); 00101 00102 /** 00103 * destructor. 00104 */ 00105 ~CScanFilterClad(); 00106 00107 /// @} 00108 /// \name Camera--Filter Interface 00109 /// @{ 00110 00111 /** 00112 * \brief configure filter with settings as provided by the application on the 00113 * filterlist window (e.g. via registry); see also CScanFilterNull::ReadFilterSettings(). 00114 */ 00115 virtual void ReadFilterSettings( ); 00116 00117 /** 00118 * \brief save filter settings e.g. for use with the filterlist window (e.g. via registry); 00119 * see also ReadFilterSettings(). 00120 */ 00121 virtual void WriteFilterSettings( ) const; 00122 00123 /** 00124 * provide current filter parameter(s) for filter-scripting capture 00125 * in the main application; 00126 * see also CScanFilterNull::GetParameters(). 00127 */ 00128 virtual LPCTSTR GetParameters() const; 00129 00130 /** 00131 * set parameters for filter-script execution of filter; 00132 * see also CScanFilterNull::SetParameters(). 00133 */ 00134 virtual BOOL SetParameters(LPCTSTR lpParameters); 00135 00136 /** 00137 * start filter dialog to edit parameters; no filter operations; 00138 * see also CScanFilterNull::EditModeless(). 00139 */ 00140 // virtual BOOL EditModeless( CWnd *pParentWnd ); 00141 00142 /** 00143 * create filter dialog and pre Apply() filter to view result; 00144 * see also CScanFilterNull::RunModeless(). 00145 */ 00146 virtual BOOL RunModeless( CWnd *pParentWnd, CDocument *pDoc ); 00147 00148 /** 00149 * check parameters, take care of a properly sized output buffer, 00150 * set its name and copy filter parameters and process; 00151 * see also CScanFilterNull::ApplyCore(). 00152 */ 00153 virtual BOOL Apply(); 00154 00155 /** 00156 * the supported dragmethod(s). 00157 */ 00158 DragSupportType SupportDragInput() const; 00159 00160 /** 00161 * apply the filter to the selected area. 00162 */ 00163 void SetDragInput( BOOL bL2R, CRect rcIn ); 00164 00165 /// @} 00166 /// \name Predicates 00167 /// @{ 00168 00169 /// @} 00170 /// \name Accessors 00171 /// @{ 00172 00173 /** 00174 * the current size. 00175 */ 00176 SizeType GetSize() const; 00177 00178 /** 00179 * the current width. 00180 */ 00181 SizeElementType GetWidth() const; 00182 00183 /** 00184 * the current height. 00185 */ 00186 SizeElementType GetHeight() const; 00187 00188 /// @} 00189 /// \name Mutators 00190 /// @{ 00191 00192 /** 00193 * set the width. 00194 */ 00195 void SetWidth( SizeElementType size ); 00196 00197 /** 00198 * set the height. 00199 */ 00200 void SetHeight( SizeElementType size ); 00201 00202 /// @} 00203 00204 protected: 00205 /** 00206 * store or retrieve the object's settings. 00207 */ 00208 virtual void Serialize( CArchive& ar ); 00209 DECLARE_SERIAL(CScanFilterClad) 00210 00211 /** 00212 * process the given frame part (L2R, R2L frame part). 00213 */ 00214 void Clad( BOOL bDoR2L ); 00215 00216 public: 00217 /** 00218 * the filter name. 00219 */ 00220 static LPCTSTR m_lpcsFilterName; 00221 00222 /** 00223 * the class short filtername. 00224 */ 00225 static LPCTSTR m_lpcsShortFilterName; 00226 00227 /** 00228 * the default new X-size. 00229 */ 00230 static const SizeElementType def_nWidth; 00231 00232 /** 00233 * the default new Y-size. 00234 */ 00235 static const SizeElementType def_nHeight; 00236 00237 protected: 00238 /** 00239 * the new size. 00240 */ 00241 CSize m_cSize; 00242 }; 00243 00244 /// @} cfl_filterclad 00245 00246 /** 00247 * the current width. 00248 */ 00249 inline CScanFilterClad::SizeType CScanFilterClad::GetSize() const 00250 { 00251 return m_cSize; 00252 } 00253 00254 /** 00255 * the current width. 00256 */ 00257 inline CScanFilterClad::SizeElementType CScanFilterClad::GetWidth() const 00258 { 00259 return m_cSize.cx; 00260 } 00261 00262 /** 00263 * the current height. 00264 */ 00265 inline CScanFilterClad::SizeElementType CScanFilterClad::GetHeight() const 00266 { 00267 return m_cSize.cy; 00268 } 00269 00270 /** 00271 * set the width. 00272 */ 00273 inline void CScanFilterClad::SetWidth( SizeElementType size ) 00274 { 00275 m_cSize.cx = size; 00276 } 00277 00278 /** 00279 * set the height. 00280 */ 00281 inline void CScanFilterClad::SetHeight( SizeElementType size ) 00282 { 00283 m_cSize.cy = size; 00284 } 00285 00286 #endif // CFL_SCANFILTERCLAD_H 00287 00288 /* 00289 * end of file 00290 */ 00291