core/vil1/vil1_crop_image_impl.h

Go to the documentation of this file.
00001 // This is core/vil1/vil1_crop_image_impl.h
00002 #ifndef vil1_crop_image_h_
00003 #define vil1_crop_image_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief A generic_image adaptor that behaves like a cropped version of its input
00010 // \author awf@robots.ox.ac.uk
00011 // \date 16 Feb 00
00012 
00013 #include <vil1/vil1_image_impl.h>
00014 #include <vil1/vil1_image.h>
00015 #include <vcl_string.h>
00016 
00017 //: A generic_image adaptor that behaves like a cropped version of its input
00018 class vil1_crop_image_impl : public vil1_image_impl
00019 {
00020  public:
00021   vil1_crop_image_impl(vil1_image const&, int x0, int y0, int w, int h);
00022   ~vil1_crop_image_impl();
00023 
00024   int planes() const { return gi_.planes(); }
00025   int width() const { return width_; }
00026   int height() const { return height_; }
00027   int components() const { return gi_.components(); }
00028 
00029   int bits_per_component() const { return gi_.bits_per_component(); }
00030   enum vil1_component_format component_format() const { return gi_.component_format(); }
00031 
00032   bool get_section(void* buf, int x0, int y0, int width, int height) const {
00033     return gi_.get_section(buf, x0 + x0_, y0 + y0_, width, height);
00034   }
00035   bool put_section(void const* buf, int x0, int y0, int width, int height) {
00036     return gi_.put_section(buf, x0 + x0_, y0 + y0_, width, height);
00037   }
00038   //  vil1_image get_plane(unsigned int p) const;
00039 
00040   //: Return the name of the class;
00041   virtual vcl_string is_a() const;
00042 
00043   //: Return true if the name of the class matches the argument
00044   virtual bool is_class(vcl_string const&) const;
00045 
00046  protected:
00047   vil1_image gi_;
00048   int x0_;
00049   int y0_;
00050   int width_;
00051   int height_;
00052 };
00053 
00054 #endif // vil1_crop_image_h_

Generated on Sun Sep 7 05:08:27 2008 for core/vil1 by  doxygen 1.5.1