]> gitweb.michael.orlitzky.com - spline3.git/commitdiff
Flip bytes again before outputting the 3D data.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 22 Aug 2012 20:51:56 +0000 (16:51 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 22 Aug 2012 20:51:56 +0000 (16:51 -0400)
src/Main.hs

index 5e10d6cfdc16146d7d8844de335558253c6ef5b2..6848ff86264c3fc461e554cc2067cd6f312db2d4 100644 (file)
@@ -89,8 +89,11 @@ main3d Args{..} shape = do
   let arr_shaped  = R.reshape shape arr_swapped
   dbl_data <- R.computeUnboxedP $ R.map fromIntegral arr_shaped
   raw_output <- zoom dbl_data zoom_factor
-  word16_output <- R.computeUnboxedP $ round_array raw_output
-  write_word16s output word16_output
+  let word16_output = round_array raw_output
+  -- Switch the bytes order back to what it was. This lets us use the
+  -- same program to view the input/output data.
+  swapped_output <- R.computeUnboxedP $ swap_bytes word16_output
+  write_word16s output swapped_output
 
 
 main2d :: Args -> R.DIM3 -> IO ()