core/vil1/vil1_pyramid.cxx

Go to the documentation of this file.
00001 // This is core/vil1/vil1_pyramid.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //:
00006 // \file
00007 // \author fsm
00008 
00009 #include "vil1_pyramid.h"
00010 #include <vcl_cassert.h>
00011 #include <vcl_iostream.h>
00012 #include <vil1/vil1_resample.h>
00013 #include <vil1/vil1_memory_image.h>
00014 
00015 vil1_pyramid::vil1_pyramid(vil1_image const &I, cache_strategy cs_)
00016 {
00017   cs = cs_;
00018   levels.push_back(I);
00019 }
00020 
00021 vil1_pyramid::~vil1_pyramid()
00022 {
00023 }
00024 
00025 vil1_image vil1_pyramid::operator[](unsigned i)
00026 {
00027   while (i >= levels.size()) {
00028     vcl_cerr << "making pyramid level " << levels.size() << vcl_endl;
00029     vil1_image I = levels.back();
00030     I = vil1_resample(I, I.width()/2, I.height()/2);
00031     switch (cs) {
00032     case none: break;
00033     case memory: I = vil1_memory_image(I /*, "silly hack"*/); break;
00034     case blocked: /* not implemented yet */
00035     default: assert(!"not implemented"); break;
00036     }
00037     levels.push_back(I);
00038   }
00039   return levels[i];
00040 }

Generated on Sat Nov 22 05:08:29 2008 for core/vil1 by  doxygen 1.5.1