diff --git a/src/output.rs b/src/output.rs index e2ca138..cc81994 100644 --- a/src/output.rs +++ b/src/output.rs @@ -578,7 +578,12 @@ pub fn output( out_scale, )?) } else { - Box::new(ImageWriter::new(path, images, &surface)?) + Box::new(ImageWriter::new( + path, + images, + &surface, + out_scale.2.signum(), + )?) }; let mesh = Mesh::create(surface, interpolation, progress_listener)?; @@ -1049,6 +1054,7 @@ struct ImageWriter { output_map: DMatrix>, point_projections: Vec>, path: String, + scale: f64, img1_width: u32, img1_height: u32, } @@ -1058,6 +1064,7 @@ impl ImageWriter { path: &str, images: Vec, surface: &triangulation::Surface, + scale: f64, ) -> Result { let point_projections = surface .iter_tracks() @@ -1074,6 +1081,7 @@ impl ImageWriter { output_map, point_projections, path: path.to_owned(), + scale, img1_width: img1.width(), img1_height: img1.height(), }) @@ -1158,7 +1166,7 @@ impl MeshWriter for ImageWriter { } let value = if let Some(value) = self.barycentric_interpolation(polygon, (row, col)) { - value + value * self.scale } else { continue; };