fix offset discrepency, and allow reuse of loaded images

This commit is contained in:
David Rose 2001-07-26 16:48:40 +00:00
parent 8bac9c27fa
commit f78a17389d
2 changed files with 7 additions and 4 deletions

View File

@ -83,7 +83,7 @@ StitchImage(const string &name, const string &filename,
_mm_to_uv =
LMatrix3d::translate_mat(-_film_offset_mm) *
LMatrix3d::scale_mat(1.0 / mm_per_uv[0], 1.0 / mm_per_uv[1]) *
LMatrix3d::translate_mat(LVector2d(0.5, 0.5) + _film_offset_mm);
LMatrix3d::translate_mat(LVector2d(0.5, 0.5));
setup_pixel_scales();
@ -147,8 +147,8 @@ set_fade_filename(const Filename &filename) {
bool StitchImage::
read_file() {
if (_data != NULL) {
delete _data;
_data = NULL;
// The data is already available; no need to re-read it.
return true;
}
if (!has_filename()) {
return false;

View File

@ -313,7 +313,10 @@ draw_image(StitchImage *output, StitchImage *input) {
output->pick_up_singularity(rast, input);
output->close_layer(rast._read_input);
input->clear_file();
// We don't necessarily want to clear the input file now. Although
// that would reduce memory consumption, maybe we've got plenty of
// memory and we're more concerned with reducing load time.
// input->clear_file();
}