Go to the documentation of this file.00001
00002 #ifndef vimt_image_2d_of_h_
00003 #define vimt_image_2d_of_h_
00004
00005
00006
00007
00008
00009 #include <vimt/vimt_image_2d.h>
00010 #include <vil/vil_image_view.h>
00011 #include <vcl_iosfwd.h>
00012
00013
00014
00015
00016 template<class T>
00017 class vimt_image_2d_of : public vimt_image_2d
00018 {
00019 vil_image_view<T> image_;
00020
00021
00022
00023 bool equals(const vimt_image &) const;
00024
00025 public:
00026
00027
00028
00029 vimt_image_2d_of() {}
00030
00031
00032
00033 vimt_image_2d_of(unsigned ni, unsigned nj, unsigned np=1,
00034 const vimt_transform_2d& w2i=vimt_transform_2d())
00035 : vimt_image_2d(w2i), image_(ni, nj, np) {}
00036
00037
00038
00039 explicit vimt_image_2d_of(const vil_image_view<T>& view,
00040 const vimt_transform_2d& w2i=vimt_transform_2d())
00041 : vimt_image_2d(w2i), image_(view) {}
00042
00043
00044
00045 virtual ~vimt_image_2d_of() {}
00046
00047
00048 virtual const vil_image_view_base& image_base() const { return image_; }
00049
00050
00051 vil_image_view<T>& image() { return image_; }
00052
00053
00054 const vil_image_view<T>& image() const { return image_; }
00055
00056
00057
00058
00059
00060 bool operator==(const vimt_image_2d_of<T> &) const;
00061
00062
00063
00064
00065
00066
00067 void set_valid_region(int x0, unsigned nx, int y0, unsigned ny);
00068
00069
00070 unsigned n_planes() const {return image_.nplanes();}
00071
00072
00073 void deep_copy(const vimt_image_2d_of& image);
00074
00075
00076 short version_no() const;
00077
00078
00079 virtual vcl_string is_a() const;
00080
00081
00082 virtual bool is_class(vcl_string const& s) const;
00083
00084
00085
00086 virtual vimt_image* clone() const { return new vimt_image_2d_of(*this); }
00087
00088
00089
00090 virtual vimt_image* deep_clone() const;
00091
00092
00093 virtual void print_summary(vcl_ostream& os) const;
00094
00095
00096 virtual void print_all(vcl_ostream& os) const;
00097
00098
00099 virtual void b_write(vsl_b_ostream& bfs) const;
00100
00101
00102 virtual void b_read(vsl_b_istream& bfs);
00103 };
00104
00105 #endif // vimt_image_2d_of_h_