]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Volumetric.hs
src/Volumetric.hs: add type annotations to avoid monomorphism warnings.
[spline3.git] / src / Volumetric.hs
index 5b24760a256b0cbc2477ff71f12009497a79deec..2f2819cf502fcfbeac9f84cb568670b62b300afb 100644 (file)
@@ -70,7 +70,7 @@ bracket :: Double -> Double -> Double -> Word16
 bracket lower_threshold upper_threshold x
         | x < lower_threshold      = 0
         | x > upper_threshold      = 255
-        | otherwise                    = truncate (r * 255)
+        | otherwise                = truncate (r * 255)
             where
               numerator = x - lower_threshold
               denominator = upper_threshold - lower_threshold
@@ -138,9 +138,9 @@ values_to_colors arr =
     truncate_rgb (r, g, b) =
       (r', g', b')
       where
-        r' = truncate (r * 255)
-        g' = truncate (g * 255)
-        b' = truncate (b * 255)
+        r' = truncate (r * 255) :: Word8
+        g' = truncate (g * 255) :: Word8
+        b' = truncate (b * 255) :: Word8
 
 
 write_values_to_bmp :: FilePath -> Values2D -> IO ()