From 88c82234cd8a03997bf3248e631a220aee074e78 Mon Sep 17 00:00:00 2001 From: David Hilvert Date: Sun, 10 May 2009 03:25:30 +0000 Subject: [PATCH] image_rw, ui/input: Proposed new sequence logic and input processor cache logic. --- d2/image_rw.cc | 1 - d2/image_rw.h | 10 ---------- ui/input.h | 8 ++++---- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/d2/image_rw.cc b/d2/image_rw.cc index 32585a8..5a886ab 100644 --- a/d2/image_rw.cc +++ b/d2/image_rw.cc @@ -38,7 +38,6 @@ int *image_rw::files_open; int image_rw::latest_close_num = -1; double image_rw::cache_size = 0; -double image_rw::cache_size_max = 256; unsigned int image_rw::cache_count = 0; double image_rw::nn_defined_radius = 0; diff --git a/d2/image_rw.h b/d2/image_rw.h index 6c11e9e..6e73e67 100644 --- a/d2/image_rw.h +++ b/d2/image_rw.h @@ -96,12 +96,6 @@ class image_rw { static int latest_close_num; /* - * Maximum cache size, in megabytes (2^20 * bytes), for images not most - * recently closed. - */ - static double cache_size_max; - - /* * Actual cache size. */ static double cache_size; @@ -318,10 +312,6 @@ public: mcv = 255; } - static void set_cache(double size) { - cache_size_max = size; - } - static void destroy() { assert (file_count > 0); destroy_image(); diff --git a/ui/input.h b/ui/input.h index 2f8126f..359d7f1 100644 --- a/ui/input.h +++ b/ui/input.h @@ -1418,6 +1418,7 @@ public: d2::pixel exp_mult = d2::pixel(1, 1, 1); std::map d3_output_pt; std::map d3_depth_pt; + double cache = 256; /* MB */ /* * dchain is ochain[0]. @@ -2129,10 +2130,7 @@ public: } else if (!strcmp(option_name, "ip")) { unsupported::discontinued("--ip ", "--lpsf box= --ips "); } else if (!strcmp(option_name, "cache")) { - double cache = env->get_double_arg(i->first, 1); - - d2::image_rw::set_cache(cache); - + cache = env->get_double_arg(i->first, 1); } else if (!strcmp(option_name, "resident")) { double resident = env->get_double_arg(i->first, 1); @@ -2629,6 +2627,8 @@ public: d2::image_rw::init(input_file_count, input_files, files[files.size() - 1].first, input_exposure, output_exposure); + ale_image_seq image_seq = ale_new_image_seq(open_file_by_number, NULL, cache); + ochain_names[0] = files[files.size() - 1].first; /* -- 2.11.4.GIT