core/vil1/vil1_block_cache_image_impl.h

Go to the documentation of this file.
00001 // This is core/vil1/vil1_block_cache_image_impl.h
00002 #ifndef vil1_block_cache_image_impl_h_
00003 #define vil1_block_cache_image_impl_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author fsm
00010 
00011 #include <vil1/vil1_image_impl.h>
00012 #include <vil1/vil1_image.h>
00013 #include <vcl_string.h>
00014 
00015 //: vil1_block_cache_image_impl - adaptor which caches the given image in blocks of given size.
00016 class vil1_block_cache_image_impl : public vil1_image_impl
00017 {
00018  public:
00019 
00020  //: Constructor with image and x and y bock-size
00021   vil1_block_cache_image_impl(vil1_image , unsigned blocksizex, unsigned blocksizey);
00022 
00023   //: Destructor
00024   ~vil1_block_cache_image_impl();
00025 
00026   //: Number of image planes
00027   int planes() const { return base.planes(); }
00028 
00029   //: Image width
00030   int width() const { return base.width(); }
00031 
00032   //: Image height
00033   int height() const { return base.height(); }
00034 
00035   //: Number of measures per pixel
00036   int components() const { return base.components(); }
00037 
00038   //: Number of bits per component
00039   int bits_per_component() const { return base.bits_per_component(); }
00040 
00041   //: Component format
00042   vil1_component_format component_format() const { return base.component_format(); }
00043 
00044   //: Access to image-plane
00045   vil1_image get_plane(unsigned int p) const;
00046 
00047   //: Write nominated section of image to buf
00048   bool get_section(void *buf, int x0, int y0, int w, int h) const;
00049 
00050   //: Write buf to nominated section of image
00051   bool put_section(void const *buf, int x0, int y0, int w, int h); // write-through
00052 
00053   //: Get info about block-characteristics
00054   bool get_property(char const *tag, void *property_value_out = 0) const;
00055 
00056   //: Return the name of the class;
00057   virtual vcl_string is_a() const;
00058 
00059   //: Return true if the name of the class matches the argument
00060   virtual bool is_class(vcl_string const&) const;
00061 
00062  private:
00063   // the underlying, uncached image.
00064   vil1_image base;
00065 
00066   // size of blocks
00067   unsigned block_size_x;
00068   unsigned block_size_y;
00069 };
00070 
00071 // Helpers-------------------------------------------------------------------
00072 
00073 #endif // vil1_block_cache_image_impl_h_

Generated on Sun Oct 12 05:08:19 2008 for core/vil1 by  doxygen 1.5.1