core/vil1/vil1_resample_image_impl.h

Go to the documentation of this file.
00001 // This is core/vil1/vil1_resample_image_impl.h
00002 #ifndef vil1_resample_image_impl_h_
00003 #define vil1_resample_image_impl_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author fsm
00010 // This class is best accessed through the external function vil1_resample().
00011 
00012 #include <vil1/vil1_image_impl.h>
00013 #include <vil1/vil1_image.h>
00014 #include <vcl_string.h>
00015 
00016 //: Adaptor which produces an image by resampling.
00017 // Note that the actual subsampling only takes place at the moment when the
00018 // get_section() method is called.
00019 class vil1_resample_image_impl : public vil1_image_impl
00020 {
00021  public:
00022   vil1_resample_image_impl(vil1_image const &underlying, unsigned nw, unsigned nh);
00023   ~vil1_resample_image_impl() {}
00024 
00025   //: these inlines partly document the semantics of vil1_resample_image.
00026   int planes() const { return base.planes(); }
00027   int width() const { return new_width; }
00028   int height() const { return new_height; }
00029   int components() const { return base.components(); }
00030   int bits_per_component() const { return base.bits_per_component(); }
00031   vil1_component_format component_format() const { return base.component_format(); }
00032 
00033   vil1_image get_plane(unsigned int p) const;
00034 
00035   bool get_section(void *buf, int x0, int y0, int w, int h) const;
00036   bool put_section(void const *buf, int x0, int y0, int w, int h); // <- will fail
00037 
00038   bool get_property(char const *tag, void *property_value_out = 0) const;
00039 
00040   //: Return the name of the class
00041   virtual vcl_string is_a() const { return "vil1_resample_image_impl"; }
00042 
00043   //: Return true if the name of the class matches the argument
00044   virtual bool is_class(vcl_string const& s) const
00045   { return s==is_a() || vil1_image_impl::is_class(s); }
00046 
00047  private:
00048   vil1_image base;
00049   unsigned new_width, new_height;
00050 };
00051 
00052 #endif // vil1_resample_image_impl_h_

Generated on Sat Nov 22 05:08:29 2008 for core/vil1 by  doxygen 1.5.1