00001
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
00009
00010
00011
00012
00013 #include <vil1/vil1_image_impl.h>
00014 #include <vil1/vil1_image.h>
00015 #include <vcl_string.h>
00016
00017
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
00039
00040
00041 virtual vcl_string is_a() const;
00042
00043
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_