Go to the documentation of this file.00001
00002 #ifndef vil_transpose_h_
00003 #define vil_transpose_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011 #include <vil/vil_image_resource.h>
00012 #include <vil/vil_image_view.h>
00013
00014
00015
00016
00017
00018 template<class T>
00019 inline vil_image_view<T> vil_transpose(const vil_image_view<T>& v)
00020 {
00021
00022 return vil_image_view<T>(v.memory_chunk(),v.top_left_ptr(),
00023 v.nj(),v.ni(),v.nplanes(),
00024 v.jstep(),v.istep(),v.planestep());
00025 }
00026
00027
00028
00029
00030 vil_image_resource_sptr vil_transpose(const vil_image_resource_sptr &src);
00031
00032
00033
00034 class vil_transpose_image_resource : public vil_image_resource
00035 {
00036
00037 vil_image_resource_sptr src_;
00038
00039 vil_transpose_image_resource(vil_image_resource_sptr const&);
00040 friend vil_image_resource_sptr vil_transpose(const vil_image_resource_sptr &src);
00041
00042 public:
00043 inline unsigned nplanes() const { return src_->nplanes(); }
00044 inline unsigned ni() const { return src_->nj(); }
00045 inline unsigned nj() const { return src_->ni(); }
00046
00047 inline enum vil_pixel_format pixel_format() const { return src_->pixel_format(); }
00048
00049 virtual vil_image_view_base_sptr get_copy_view(unsigned i0, unsigned ni,
00050 unsigned j0, unsigned nj) const;
00051
00052 virtual vil_image_view_base_sptr get_view(unsigned i0, unsigned ni,
00053 unsigned j0, unsigned nj) const;
00054
00055
00056 virtual bool put_view(const vil_image_view_base& im, unsigned i0, unsigned j0);
00057
00058
00059 virtual bool get_property(char const* tag, void* property_value = 0) const {
00060 return src_->get_property(tag, property_value); }
00061 };
00062
00063 #endif // vil_transpose_h_