00001
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005
00006
00007
00008
00009 #include "vil1_block_cache_image_impl.h"
00010 #include <vcl_cstring.h>
00011 #include <vcl_cassert.h>
00012
00013
00014
00015
00016
00017
00018 vil1_block_cache_image_impl::vil1_block_cache_image_impl(vil1_image i_, unsigned bx, unsigned by)
00019 : base(i_),block_size_x(bx),block_size_y(by)
00020 {
00021 }
00022
00023 vil1_block_cache_image_impl::~vil1_block_cache_image_impl() {
00024 }
00025
00026 vil1_image vil1_block_cache_image_impl::get_plane(unsigned int p) const {
00027 assert((int)p < base.planes());
00028 return base.get_plane(p);
00029 }
00030
00031 bool vil1_block_cache_image_impl::get_section(void *buf, int x0, int y0, int w, int h) const {
00032
00033 return base.get_section(buf, x0, y0, w, h);
00034 }
00035
00036 bool vil1_block_cache_image_impl::put_section(void const *buf, int x0, int y0, int w, int h) {
00037 return base.put_section(buf, x0, y0, w, h);
00038 }
00039
00040
00041
00042 bool vil1_block_cache_image_impl::get_property(char const *tag,
00043 void *out) const
00044 {
00045 if (vcl_strcmp(tag, "is_blocked") == 0)
00046 return true;
00047
00048 if (vcl_strcmp(tag, "block_size_x") == 0) {
00049 if (out) *(unsigned *)out = block_size_x;
00050 return true;
00051 }
00052
00053 if (vcl_strcmp(tag, "block_size_y") == 0) {
00054 if (out) *(unsigned *)out = block_size_y;
00055 return true;
00056 }
00057
00058 return false;
00059 }
00060
00061
00062
00063 vcl_string vil1_block_cache_image_impl::is_a() const
00064 {
00065 static const vcl_string class_name_="vil1_block_cache_image_impl";
00066 return class_name_;
00067 }
00068
00069
00070 bool vil1_block_cache_image_impl::is_class(vcl_string const& s) const
00071 {
00072 return s==vil1_block_cache_image_impl::is_a() || vil1_image_impl::is_class(s);
00073 }