Go to the documentation of this file.00001 
00002 #ifndef vil_pyramid_image_resource_h_
00003 #define vil_pyramid_image_resource_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #include <vcl_vector.h>
00015 #include <vil/vil_image_view_base.h>
00016 #include <vil/vil_smart_ptr.h>
00017 #include <vil/vil_image_resource.h>
00018 #include <vil/vil_image_resource_sptr.h>
00019 #include <vil/vil_blocked_image_resource_sptr.h>
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 class vil_pyramid_image_resource : public vil_image_resource
00035 {
00036  public:
00037   vil_pyramid_image_resource(vcl_vector<vil_image_resource_sptr> const& images);
00038   virtual ~vil_pyramid_image_resource();
00039 
00040   
00041   
00042   
00043   
00044   virtual unsigned nplanes() const = 0;
00045 
00046   
00047   
00048   
00049   virtual unsigned ni() const = 0;
00050 
00051   
00052   
00053   
00054   virtual unsigned nj() const = 0;
00055 
00056   
00057   virtual enum vil_pixel_format pixel_format() const = 0;
00058 
00059   
00060   
00061   virtual vil_image_view_base_sptr get_copy_view(unsigned i0,
00062                                                  unsigned n_i,
00063                                                  unsigned j0,
00064                                                  unsigned n_j) const
00065     {return this->get_copy_view(i0, n_i, j0, n_j, 0);}
00066 
00067   
00068   
00069   
00070   virtual bool put_view(vil_image_view_base const& , unsigned , unsigned )
00071   { return false; }
00072 
00073   
00074   
00075   virtual char const* file_format() const = 0;
00076 
00077   
00078   virtual bool get_property(char const* tag, void* property_value = 0) const;
00079 
00080   
00081 
00082   
00083   virtual unsigned nlevels() const = 0;
00084 
00085   
00086   virtual vil_image_view_base_sptr get_copy_view(unsigned i0, unsigned n_i,
00087                                                  unsigned j0, unsigned n_j,
00088                                                  unsigned level) const = 0;
00089 
00090   
00091   
00092   virtual vil_image_view_base_sptr get_copy_view(unsigned level) const
00093   { return get_copy_view(0, ni(), 0, nj(), level); }
00094 
00095   
00096   
00097   
00098   virtual vil_image_view_base_sptr get_copy_view(unsigned i0, unsigned n_i,
00099                                                  unsigned j0, unsigned n_j,
00100                                                  const float scale,
00101                                                  float& actual_scale) const = 0;
00102 
00103   
00104   
00105   
00106   virtual vil_image_view_base_sptr get_copy_view(const float scale, float& actual_scale) const
00107   { return get_copy_view(0, ni(), 0, nj(), scale, actual_scale); }
00108 
00109   
00110   virtual bool put_resource(vil_image_resource_sptr const& resc) = 0;
00111 
00112   
00113   virtual vil_image_resource_sptr get_resource(const unsigned level) const = 0;
00114 
00115   
00116   
00117   static bool
00118     blocked_decimate(vil_blocked_image_resource_sptr const & brsc,
00119                      vil_blocked_image_resource_sptr& dec_resc);
00120 
00121   
00122   
00123   
00124   static vil_image_resource_sptr decimate(vil_image_resource_sptr const& resc,
00125                                           char const* filename,
00126                                           char const* format="tiff");
00127 
00128   
00129   virtual void print(const unsigned level) = 0;
00130 
00131  protected:
00132   
00133   friend class vil_smart_ptr<vil_pyramid_image_resource>;
00134   
00135   vil_pyramid_image_resource();
00136 };
00137 
00138 #include <vil/vil_pyramid_image_resource_sptr.h>
00139 
00140 #endif // vil_pyramid_image_resource_h_