Go to the documentation of this file.00001
00002 #ifndef vil_blocked_image_resource_h_
00003 #define vil_blocked_image_resource_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011 #include <vcl_vector.h>
00012 #include <vil/vil_image_resource.h>
00013 #include <vil/vil_blocked_image_resource_sptr.h>
00014
00015
00016 vil_blocked_image_resource_sptr
00017 blocked_image_resource(const vil_image_resource_sptr& ir);
00018
00019 class vil_blocked_image_resource : public vil_image_resource
00020 {
00021
00022 public:
00023
00024 vil_blocked_image_resource();
00025 virtual ~vil_blocked_image_resource();
00026
00027 virtual unsigned nplanes() const =0;
00028 virtual unsigned ni() const = 0;
00029 virtual unsigned nj() const = 0;
00030
00031
00032 virtual unsigned size_block_i() const = 0;
00033
00034
00035 virtual unsigned size_block_j() const = 0;
00036
00037
00038 virtual unsigned n_block_i() const;
00039
00040
00041 virtual unsigned n_block_j() const;
00042
00043
00044 virtual enum vil_pixel_format pixel_format() const = 0;
00045
00046 virtual vil_image_view_base_sptr
00047 get_copy_view(unsigned i0, unsigned n_i, unsigned j0, unsigned n_j) const;
00048
00049 virtual bool put_view(const vil_image_view_base& im, unsigned i0, unsigned j0) = 0;
00050
00051
00052 virtual vil_image_view_base_sptr get_block( unsigned block_index_i,
00053 unsigned block_index_j ) const = 0;
00054
00055
00056
00057 virtual bool get_blocks( unsigned start_block_i, unsigned end_block_i,
00058 unsigned start_block_j, unsigned end_block_j,
00059 vcl_vector< vcl_vector< vil_image_view_base_sptr > >& blocks ) const;
00060
00061
00062 virtual bool put_block(unsigned block_index_i,
00063 unsigned block_index_j,
00064 const vil_image_view_base& view) = 0;
00065
00066
00067
00068 virtual bool put_blocks( unsigned start_block_i, unsigned end_block_i,
00069 unsigned start_block_j, unsigned end_block_j,
00070 vcl_vector< vcl_vector< vil_image_view_base_sptr > > const& blocks );
00071
00072
00073 virtual bool get_property(char const* tag, void* property_value = 0) const = 0;
00074
00075 protected:
00076
00077 vil_image_view_base_sptr fill_block(unsigned i0, unsigned icrop,
00078 unsigned j0, unsigned jcrop,
00079 vil_image_view_base_sptr& view) const;
00080
00081
00082 bool block_i_offset(unsigned block_i, unsigned i,
00083 unsigned& i_offset) const;
00084
00085
00086 bool block_j_offset(unsigned block_j, unsigned j,
00087 unsigned& j_offset) const;
00088
00089 bool trim_border_blocks(unsigned i0, unsigned ni,
00090 unsigned j0, unsigned nj,
00091 unsigned start_block_i,
00092 unsigned start_block_j,
00093 vcl_vector< vcl_vector< vil_image_view_base_sptr > >& blocks) const;
00094
00095 vil_image_view_base_sptr
00096 glue_blocks_together(const vcl_vector< vcl_vector< vil_image_view_base_sptr > >& blocks) const;
00097
00098 protected:
00099 friend class vil_smart_ptr<vil_blocked_image_resource>;
00100 };
00101
00102 #endif // vil_blocked_image_resource_h_