Go to the documentation of this file.00001
00002 #ifndef vil_blocked_image_facade_h_
00003 #define vil_blocked_image_facade_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <vil/vil_blocked_image_resource.h>
00016
00017 class vil_blocked_image_facade : public vil_blocked_image_resource
00018 {
00019 public:
00020 vil_blocked_image_facade(const vil_image_resource_sptr &src,
00021 const unsigned sbi=0, const unsigned sbj=0);
00022 virtual ~vil_blocked_image_facade() {}
00023
00024 inline virtual unsigned nplanes() const
00025 { return src_->nplanes();}
00026 inline virtual unsigned ni() const
00027 { return src_->ni();}
00028 inline virtual unsigned nj() const
00029 { return src_->nj();}
00030
00031 inline virtual unsigned size_block_i() const
00032 { return sbi_;}
00033
00034 inline virtual unsigned size_block_j() const
00035 { return sbj_;}
00036
00037 inline virtual unsigned n_block_i() const
00038 { if (sbi_>0)return (src_->ni()+sbi_-1)/sbi_; return 0; }
00039
00040 inline virtual unsigned n_block_j() const
00041 { if (sbj_>0)return (src_->nj()+sbj_-1)/sbj_; return 0; }
00042
00043 inline virtual enum vil_pixel_format pixel_format() const
00044 { return src_->pixel_format();}
00045
00046 inline virtual vil_image_view_base_sptr
00047 get_copy_view(unsigned i0, unsigned n_i, unsigned j0, unsigned n_j) const
00048 { return src_->get_copy_view(i0, n_i, j0, n_j);}
00049
00050 inline virtual bool put_view(const vil_image_view_base& im,
00051 unsigned i0, unsigned j0)
00052 { return src_->put_view(im, i0, j0);}
00053
00054
00055 virtual vil_image_view_base_sptr get_block( unsigned block_index_i,
00056 unsigned block_index_j ) const;
00057
00058
00059 virtual bool put_block(unsigned block_index_i,
00060 unsigned block_index_j,
00061 const vil_image_view_base& view);
00062
00063
00064
00065 virtual bool get_property(char const* tag, void* property_value = 0) const;
00066
00067 protected:
00068
00069 vil_image_view_base_sptr fill_block(vil_image_view_base_sptr& view) const;
00070
00071
00072 vil_image_resource_sptr src_;
00073
00074 unsigned sbi_;
00075
00076 unsigned sbj_;
00077 vil_blocked_image_facade();
00078 };
00079
00080 #endif // vil_blocked_image_facade_h_