From a16ba9e02f080349ffba1b7aee79f8097b87ff03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Tue, 10 Dec 2019 17:37:25 +0100 Subject: [PATCH] Reuse Reanimate.Builtin.Documentation.showColorMap Former-commit-id: 66595c6d71ecda92c3fc8f55548ec9278a4863d5 --- examples/doc_cividis.hs | 10 +--------- examples/doc_greyscale.hs | 10 +--------- examples/doc_hsv.hs | 10 +--------- examples/doc_hsvMatlab.hs | 10 +--------- examples/doc_inferno.hs | 10 +--------- examples/doc_jet.hs | 10 +--------- examples/doc_magma.hs | 10 +--------- examples/doc_parula.hs | 10 +--------- examples/doc_plasma.hs | 10 +--------- examples/doc_sinebow.hs | 10 +--------- examples/doc_turbo.hs | 10 +--------- examples/doc_viridis.hs | 10 +--------- 12 files changed, 12 insertions(+), 108 deletions(-) diff --git a/examples/doc_cividis.hs b/examples/doc_cividis.hs index 53db6b6..9e2a1ad 100755 --- a/examples/doc_cividis.hs +++ b/examples/doc_cividis.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap cividis - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap cividis diff --git a/examples/doc_greyscale.hs b/examples/doc_greyscale.hs index acf34c4..eb5a693 100755 --- a/examples/doc_greyscale.hs +++ b/examples/doc_greyscale.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap greyscale - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap greyscale diff --git a/examples/doc_hsv.hs b/examples/doc_hsv.hs index b3dda43..f950a6a 100755 --- a/examples/doc_hsv.hs +++ b/examples/doc_hsv.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap hsv - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap hsv diff --git a/examples/doc_hsvMatlab.hs b/examples/doc_hsvMatlab.hs index b642c0b..43f7b09 100755 --- a/examples/doc_hsvMatlab.hs +++ b/examples/doc_hsvMatlab.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap hsvMatlab - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap hsvMatlab diff --git a/examples/doc_inferno.hs b/examples/doc_inferno.hs index 9c2bb16..b08f49b 100755 --- a/examples/doc_inferno.hs +++ b/examples/doc_inferno.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap inferno - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap inferno diff --git a/examples/doc_jet.hs b/examples/doc_jet.hs index 3ce28cc..c281f67 100755 --- a/examples/doc_jet.hs +++ b/examples/doc_jet.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap jet - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap jet diff --git a/examples/doc_magma.hs b/examples/doc_magma.hs index b6e9747..4b1a55e 100755 --- a/examples/doc_magma.hs +++ b/examples/doc_magma.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap magma - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap magma diff --git a/examples/doc_parula.hs b/examples/doc_parula.hs index 471aebc..5e45117 100755 --- a/examples/doc_parula.hs +++ b/examples/doc_parula.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap parula - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap parula diff --git a/examples/doc_plasma.hs b/examples/doc_plasma.hs index 94e691c..300952d 100755 --- a/examples/doc_plasma.hs +++ b/examples/doc_plasma.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap plasma - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap plasma diff --git a/examples/doc_sinebow.hs b/examples/doc_sinebow.hs index 9f84558..764ac42 100755 --- a/examples/doc_sinebow.hs +++ b/examples/doc_sinebow.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap sinebow - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap sinebow diff --git a/examples/doc_turbo.hs b/examples/doc_turbo.hs index 81783c8..2e92d51 100755 --- a/examples/doc_turbo.hs +++ b/examples/doc_turbo.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap turbo - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap turbo diff --git a/examples/doc_viridis.hs b/examples/doc_viridis.hs index 5154920..02fda37 100755 --- a/examples/doc_viridis.hs +++ b/examples/doc_viridis.hs @@ -7,12 +7,4 @@ import Reanimate import Reanimate.Builtin.Documentation main :: IO () -main = reanimate $ docEnv $ animate $ const $ mkColorMap viridis - -mkColorMap :: (Double -> PixelRGB8) -> SVG -mkColorMap f = center $ scaleToSize screenWidth screenHeight $ embedImage img - where - width = 256 - height = 1 - img = generateImage pixelRenderer width height - pixelRenderer x _y = f (fromIntegral x / fromIntegral (width-1)) +main = reanimate $ docEnv $ animate $ const $ showColorMap viridis