core/vil1/vil1_skip_image_impl.h

Go to the documentation of this file.
00001 // This is core/vil1/vil1_skip_image_impl.h
00002 #ifndef vil1_skip_image_h_
00003 #define vil1_skip_image_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Adaptor which produces a new image by skipping rows and columns
00010 // \author fsm
00011 
00012 #include <vil1/vil1_image_impl.h>
00013 #include <vil1/vil1_image.h>
00014 #include <vcl_string.h>
00015 
00016 //: Adaptor which produces a new image by skipping rows and columns
00017 class vil1_skip_image_impl : public vil1_image_impl
00018 {
00019  public:
00020   vil1_skip_image_impl(vil1_image const &underlying, unsigned sx, unsigned sy);
00021   ~vil1_skip_image_impl() {}
00022 
00023   //: these inlines partly document the semantics of vil1_skip_image.
00024   int planes() const { return base.planes(); }
00025   int width() const { return base.width() / skipx; }
00026   int height() const { return base.height() / skipy; }
00027   int components() const { return base.components(); }
00028   int bits_per_component() const { return base.bits_per_component(); }
00029   vil1_component_format component_format() const { return base.component_format(); }
00030 
00031   vil1_image get_plane(unsigned int p) const;
00032 
00033   bool get_section(void *buf, int x0, int y0, int w, int h) const;
00034   bool put_section(void const *buf, int x0, int y0, int w, int h); // <- will fail
00035 
00036   bool get_property(char const *tag, void *property_value_out = 0) const;
00037 
00038   //: Return the name of the class
00039   virtual vcl_string is_a() const { return "vil1_skip_image_impl"; }
00040 
00041   //: Return true if the name of the class matches the argument
00042   virtual bool is_class(vcl_string const& s) const
00043   { return s==is_a() || vil1_image_impl::is_class(s); }
00044 
00045  private:
00046   vil1_image base;
00047   unsigned skipx, skipy;
00048 };
00049 
00050 #endif // vil1_skip_image_h_

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