00001 // This is tbl/vipl/filter/vipl_filter_2d.h 00002 #ifndef vipl_filter_2d_h_ 00003 #define vipl_filter_2d_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 00010 #include <vipl/filter/vipl_filter.h> 00011 00012 template < class ImgIn, class ImgOut, class DataIn, class DataOut, VCL_DFL_TYPE_PARAM_STLDECL(PixelItr, vipl_trivial_pixeliter) > 00013 class vipl_filter_2d : public vipl_filter< ImgIn, ImgOut, DataIn, DataOut, 2, PixelItr > 00014 { 00015 public: 00016 00017 //: Main constructor for this abstract class. 00018 // If dst_image 00019 // (by default) the output will be generated automatically when 00020 // filtering is about to proceed. (Either way, the filter 00021 // decrements the refcount of the output when it is destroyed.) 00022 // Some filters support multiple inputs, if ninputs is >1 then 00023 // this constructor expects src_img to be the first element 00024 // pointer to the input (i.e. src_img+1 is the location of input 00025 // image2). Note that the filter keeps pointers to the input 00026 // (properly refcounted). Actually the main filter constructor 00027 // does all the work 00028 00029 vipl_filter_2d( 00030 const ImgIn* src_img, 00031 ImgOut* dst_img=NULL, 00032 int ninputs=1, 00033 int img_border=0 , 00034 DataOut fill_val=0); 00035 00036 //: Secondary constructor for this class. 00037 // If dst_img 00038 // is null (by default), the output will be generated 00039 // automatically when filtering is about to proceed. The filter 00040 // decrements the refcount of the output when it is 00041 // destroyed. Some filters support multiple inputs, if ninputs is 00042 // >1 then this constructor uses non_consecutive input images (with 00043 // their address in a c_vector, i.e. *(src_img+1) is the location 00044 // of input image2). Note that the filter keeps pointers to the 00045 // input (properly refcounted). Actually the main filter 00046 // constructor does all the work 00047 00048 vipl_filter_2d( 00049 const ImgIn** src_img, 00050 ImgOut* dst_img=NULL, 00051 int ninputs=1, 00052 int img_border=0 , 00053 DataOut fill_val=0) ; 00054 00055 vipl_filter_2d() {} // argless ctor 00056 ~vipl_filter_2d() {} // (virtual) destructor 00057 00058 //: User accessed low_level c++ copy constructor. 00059 // note this does NOT copy input/output image pointers. 00060 vipl_filter_2d(const vipl_filter_2d< ImgIn, ImgOut, DataIn, DataOut, PixelItr > &); 00061 00062 protected: 00063 00064 //: This walks over the sections calling section_applyop. 00065 // Now that we know the dim we can write the 00066 // loop. 00067 virtual bool applyop(); 00068 //: The main filtering method, derived class must supply it. 00069 virtual bool section_applyop() = 0; 00070 }; 00071 00072 #ifdef INSTANTIATE_TEMPLATES 00073 #include "vipl_filter_2d.txx" 00074 #endif 00075 00076 #endif // vipl_filter_2d_h_