Go to the documentation of this file.00001 #ifndef vipl_threshold_h_
00002 #define vipl_threshold_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <vipl/filter/vipl_filter_2d.h>
00042
00043
00044 template <class ImgIn,class ImgOut,class DataIn,class DataOut, VCL_DFL_TYPE_PARAM_STLDECL(PixelItr, vipl_trivial_pixeliter) >
00045 class vipl_threshold : public vipl_filter_2d<ImgIn,ImgOut,DataIn,DataOut,PixelItr>
00046 {
00047
00048 private: DataIn threshold_;
00049 public: DataIn threshold() const { return threshold_; }
00050 private: DataOut below_;
00051 public: DataOut below() const { return below_; }
00052 private: DataOut above_;
00053 public: DataOut above() const { return above_; }
00054 private: bool aboveset_;
00055 public: bool aboveset() const { return aboveset_; }
00056
00057
00058 public:
00059 inline vipl_threshold(DataIn t=128, DataOut b=1)
00060 : vipl_filter_2d<ImgIn,ImgOut,DataIn,DataOut,PixelItr>(), threshold_(t), below_(b), above_(0), aboveset_(false) {}
00061 inline vipl_threshold(DataIn t, DataOut b, DataOut a)
00062 : vipl_filter_2d<ImgIn,ImgOut,DataIn,DataOut,PixelItr>(), threshold_(t), below_(b), above_(a), aboveset_(true) {}
00063 inline vipl_threshold(vipl_threshold const& A)
00064 : vipl_filter_2d<ImgIn,ImgOut,DataIn,DataOut,PixelItr>(A), threshold_(A.threshold()), below_(A.below()),
00065 above_(A.above()), aboveset_(A.aboveset()) {}
00066 inline ~vipl_threshold() {}
00067
00068
00069 bool section_applyop();
00070 };
00071
00072 #ifdef INSTANTIATE_TEMPLATES
00073 #include "vipl_threshold.txx"
00074 #endif
00075
00076 #endif // vipl_threshold_h_