core/vil1/vil1_clamp_image_impl.h

Go to the documentation of this file.
00001 // This is core/vil1/vil1_clamp_image_impl.h
00002 #ifndef vil1_clamp_image_impl_h_
00003 #define vil1_clamp_image_impl_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 
00010 #include <vil1/vil1_image_impl.h>
00011 #include <vil1/vil1_image.h>
00012 #include <vcl_string.h>
00013 
00014 //: View of image clamped to a given range
00015 class vil1_clamp_image_impl : public vil1_image_impl
00016 {
00017  public:
00018   vil1_clamp_image_impl(vil1_image const& src, double low, double high)
00019     : base(src), low_(low), high_(high) {}
00020 
00021   int planes() const { return base.planes(); }
00022   int width() const { return base.width(); }
00023   int height() const { return base.height(); }
00024   int components() const { return base.components(); }
00025   int bits_per_component() const { return base.bits_per_component(); }
00026   vil1_component_format component_format() const { return base.component_format(); }
00027 
00028   vil1_image get_plane(unsigned int p) const;
00029 
00030   bool get_section(void *buf, int x0, int y0, int w, int h) const;
00031   bool put_section(void const *buf, int x0, int y0, int w, int h);
00032 
00033   //: Return the name of the class;
00034   virtual vcl_string is_a() const { return "vil1_clamp_image_impl"; }
00035 
00036   //: Return true if the name of the class matches the argument
00037   virtual bool is_class(vcl_string const& s) const
00038   { return s==is_a() || vil1_image_impl::is_class(s); }
00039 
00040  private:
00041   vil1_image base;
00042   double low_;
00043   double high_;
00044 };
00045 
00046 #endif // vil1_clamp_image_impl_h_

Generated on Mon Mar 8 05:09:32 2010 for core/vil1 by  doxygen 1.5.1