X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FValues.hs;h=0ef8410813e80729e09a0af3ec4a162bd7868814;hb=248880a645548e5d1910814dd9023e2af80e16ac;hp=a33bbba56d3eef9da970d845de285af4c39ac39d;hpb=2a90a63d5fbc8fb57a97e97054e139f5284bf7b0;p=spline3.git diff --git a/src/Values.hs b/src/Values.hs index a33bbba..0ef8410 100644 --- a/src/Values.hs +++ b/src/Values.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TypeSynonymInstances #-} +{-# LANGUAGE FlexibleInstances #-} module Values where @@ -79,4 +79,14 @@ idx v3d i j k = index v3d shape where shape :: DIM3 - shape = (Z :. i :. j :. k) + shape = (Z :. k :. j :. i) + + +zoom_shape :: Int -> DIM3 -> DIM3 +zoom_shape scale_factor sh = + let (Z :. x :. y :. z) = sh + x' = x * scale_factor + y' = y * scale_factor + z' = z * scale_factor + in + (Z :. x' :. y' :. z')