From: Michael Orlitzky Date: Mon, 29 Aug 2011 23:02:31 +0000 (-0400) Subject: Modify the Values module to use ScaleFactors instead of Ints. X-Git-Tag: 0.0.1~204 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=cdea5a8631ae108b3b6520ba02642d99112806f7;p=spline3.git Modify the Values module to use ScaleFactors instead of Ints. --- diff --git a/src/Values.hs b/src/Values.hs index 3833135..dc45a3f 100644 --- a/src/Values.hs +++ b/src/Values.hs @@ -23,6 +23,9 @@ import System.FilePath () import Test.QuickCheck (Arbitrary(..), Gen) +import ScaleFactor + + type Values1D = Array DIM1 Double type Values2D = Array DIM2 Double type Values3D = Array DIM3 Double @@ -82,11 +85,11 @@ idx v3d i j k = shape = (Z :. i :. j :. k) -zoom_shape :: Int -> DIM3 -> DIM3 -zoom_shape scale_factor sh = +zoom_shape :: ScaleFactor -> DIM3 -> DIM3 +zoom_shape (sfx, sfy, sfz) sh = let (Z :. x :. y :. z) = sh - x' = x * scale_factor - y' = y * scale_factor - z' = z * scale_factor + x' = x * sfx + y' = y * sfy + z' = z * sfz in (Z :. x' :. y' :. z')