Filter Library | Camera | Interface Physics |
00001 /* 00002 * // FIXME: filename and text 00003 * ScanFilterNull.h - a null filter to 00004 * (1) document general ascpects of filters, (2) act as a filter template. 00005 * 00006 * This file is part of the Camera Filter Library. 00007 * Computer Aided Measurement Environment for Realtime Atomic imaging (Camera) 00008 * 00009 * Copyright (C) 2004, Leiden Probe Microscopy. 00010 * Copyright (C) 2004, Universiteit Leiden. 00011 * 00012 * Authors: Martin J. Moene (original) 00013 * 00014 * $Id: ScanFilterNull.h 236 2005-06-27 09:03:17Z moene $ 00015 */ 00016 00017 #ifndef CFL_SCANFILTERNULL_H // FIXME: filename 00018 #define CFL_SCANFILTERNULL_H // FIXME: filename 00019 00020 #if _MSC_VER > 1000 00021 #pragma once 00022 #endif // _MSC_VER > 1000 00023 00024 #include <cfl/ScanFilter.h> // for base class 00025 #include <cfl/ScanBaseBuffer.h> // for ValueType 00026 00027 /** 00028 * \addtogroup cfl_filternull Null Filter 00029 * \brief almost no-op filter to document general aspects of filters. 00030 * 00031 00032 <h3>Purpose</h3> 00033 00034 This filter serves two purposes: 00035 -# it documents the features common to all filters 00036 -# it is a template to create new filters from (see \ref cfl_develop_filter_class) 00037 00038 <h3>Description</h3> 00039 Tell more about the filter. 00040 00041 <h3>Algorithm</h3> 00042 00043 The algorithm used: \f$y_{ij} = a \times x_{ij} + b\f$. 00044 00045 As display: 00046 \f[ 00047 y_{ij} = a \times x_{ij} + b 00048 \f] 00049 00050 <h3>Examples</h3> 00051 Try to find some interesting pictures for most filters. This one is not so interesting. 00052 00053 <h3>Contact</h3> 00054 00055 Ing. M.J. Moene<br> 00056 Huygens Laboratorium<br> 00057 Universiteit Leiden<br> 00058 Niels Bohrweg 2<br> 00059 2333 CA Leiden, The Netherlands<br> 00060 00061 Tel: +31 71 5275960<br> 00062 Fax: +31 71 5275819<br> 00063 00064 E-mail: m.j.moene@eld.physics.LeidenUniv.nl<br> 00065 Web: http://www.eld.physics.leidenuniv.nl/~moene/<br> 00066 00067 * 00068 * @{ 00069 */ 00070 00071 DECLARE_CLASS( CScanFilterNull ); // create various types 00072 00073 /** 00074 * \brief null scanfilter. 00075 * 00076 * This is the class for the Null Filter. Its purpose is twofold: 00077 * -# document the features common to all filters 00078 * -# be a template to create new filters from (see \ref cfl_develop_filter_class) 00079 * 00080 * As a filter, class CScanFilterNull simply copies its input buffer to its 00081 * ouput buffer using STL std::transform(), while applying the formula: 00082 * \f$y_{ij} = factor \times x_{ij} + offset\f$. 00083 * 00084 * \todo change "stdafx.h" in .cpp to <cfl/stdafx.h> when all filters have been adapted. 00085 * "stdafx.h" is used to determine the contents of the precompiled headers; 00086 * see prj settings C/C++, precompiled headers, through header "stdafx.h") 00087 * 00088 * \author Martin J. Moene 00089 */ 00090 00091 class CScanFilterNull : public CScanFilter 00092 { 00093 public: 00094 /// 00095 /// \name Types 00096 /// @{ 00097 00098 /** 00099 * specify the scan base buffer datatype; having ValueType we omit the type 00100 * specification from the variablename: \p pStart in stead of \p pwStart; 00101 * see for example Process(). 00102 */ 00103 00104 typedef CScanBaseBuffer::ValueType ValueType; 00105 00106 /** 00107 * the pointer type. 00108 */ 00109 typedef ValueType* Pointer; 00110 00111 /** 00112 * the const pointer type. 00113 */ 00114 typedef const ValueType* ConstPointer; 00115 00116 /// @} 00117 /// \name Construction 00118 /// @{ 00119 00120 CScanFilterNull(); 00121 virtual ~CScanFilterNull(); 00122 00123 /// @} 00124 /// \name Camera--Filter Interface 00125 /// @{ 00126 00127 // virtual BOOL CanDoPartialData() const; 00128 // virtual BOOL CanDoDialogEntry() const; 00129 00130 virtual void ReadFilterSettings( ); 00131 virtual void WriteFilterSettings( ) const; 00132 00133 virtual LPCTSTR GetParameters( ) const; 00134 virtual BOOL SetParameters( LPCTSTR lpParameters ); 00135 00136 virtual BOOL RunModeless( CWnd *pParentWnd, CDocument *pDoc ); 00137 00138 virtual BOOL Apply(); 00139 virtual BOOL ApplyCore(); 00140 virtual void Process( ConstPointer pStartIn, Pointer pStartOut, DWORD dwSize ); 00141 00142 virtual SPerformanceTestResult 00143 GetPerformanceTestResult(); 00144 00145 /// @} 00146 /// \name Predicates 00147 /// @{ 00148 00149 /// @} 00150 /// \name Accessors 00151 /// @{ 00152 00153 double GetFactor(); 00154 double GetOffset(); 00155 00156 /// @} 00157 /// \name Mutators 00158 /// @{ 00159 00160 void SetFactor( double aFactor ); 00161 void SetOffset( double aOffset ); 00162 00163 /// @} 00164 00165 protected: 00166 virtual void Serialize( CArchive& ar ); 00167 00168 DECLARE_SERIAL( CScanFilterNull ) 00169 00170 public: 00171 static LPCTSTR m_lpcsFilterName; ///< filter name 00172 00173 /** 00174 * the class short filtername. 00175 */ 00176 static LPCTSTR m_lpcsShortFilterName; 00177 00178 static const double def_dFactor; ///< default factor 00179 static const double def_dOffset; ///< default offset 00180 00181 private: 00182 double m_dFactor; ///< current factor value 00183 double m_dOffset; ///< current offset value 00184 }; 00185 00186 /// @} group cfl_filternul 00187 00188 /** 00189 * the factor. 00190 */ 00191 00192 inline double CScanFilterNull::GetFactor() 00193 { 00194 return m_dFactor; 00195 } 00196 00197 /** 00198 * the offset. 00199 */ 00200 00201 inline double CScanFilterNull::GetOffset() 00202 { 00203 return m_dOffset; 00204 } 00205 00206 /** 00207 * set the factor. 00208 */ 00209 00210 inline void CScanFilterNull::SetFactor( double aFactor ) 00211 { 00212 m_dFactor = aFactor; 00213 } 00214 00215 /** 00216 * set the offset. 00217 */ 00218 00219 inline void CScanFilterNull::SetOffset( double aOffset ) 00220 { 00221 m_dOffset = aOffset; 00222 } 00223 00224 00225 #endif // #ifndef CFL_SCANFILTERNULL_H 00226 00227 /* 00228 * end of file 00229 */