Go to the documentation of this file.00001 #ifndef vil_structuring_element_h_
00002 #define vil_structuring_element_h_
00003
00004
00005
00006
00007
00008 #include <vcl_vector.h>
00009 #include <vcl_iosfwd.h>
00010 #include <vcl_cstddef.h>
00011
00012
00013
00014
00015 class vil_structuring_element
00016 {
00017
00018 vcl_vector<int> p_i_;
00019
00020 vcl_vector<int> p_j_;
00021
00022 int min_i_;
00023
00024 int max_i_;
00025
00026 int min_j_;
00027
00028 int max_j_;
00029
00030 public:
00031 vil_structuring_element() : min_i_(0),max_i_(-1),min_j_(0),max_j_(-1) {}
00032
00033
00034 vil_structuring_element(const vcl_vector<int>& v_p_i,const vcl_vector<int>& v_p_j)
00035 { set(v_p_i,v_p_j); }
00036
00037
00038 void set(const vcl_vector<int>& v_p_i,const vcl_vector<int>& v_p_j);
00039
00040
00041
00042 void set_to_disk(double r);
00043
00044
00045 void set_to_line_i(int ilo, int ihi);
00046
00047
00048 void set_to_line_j(int jlo, int jhi);
00049
00050
00051 const vcl_vector<int>& p_i() const { return p_i_; }
00052
00053 const vcl_vector<int>& p_j() const { return p_j_; }
00054
00055
00056 int min_i() const { return min_i_; }
00057
00058 int max_i() const { return max_i_; }
00059
00060 int min_j() const { return min_j_; }
00061
00062 int max_j() const { return max_j_; }
00063 };
00064
00065
00066 vcl_ostream& operator<<(vcl_ostream&, const vil_structuring_element& element);
00067
00068
00069
00070
00071 void vil_compute_offsets(vcl_vector<vcl_ptrdiff_t>& offset,
00072 const vil_structuring_element& element,
00073 vcl_ptrdiff_t istep, vcl_ptrdiff_t jstep);
00074
00075 #endif // vil_structuring_element_h_