diff --git a/hpc_index.html b/hpc_index.html index e334dd1..360f886 100644 --- a/hpc_index.html +++ b/hpc_index.html @@ -8,22 +8,16 @@ table.dashboard { border-collapse: collapse ; border: solid 1px black } - + - - - - - - - + - + @@ -41,41 +35,32 @@ table.dashboard { border-collapse: collapse ; border: solid 1px black } - + - + - - - - + - - - - + - + - - - - + - + - +
moduleTop Level DefinitionsAlternativesExpressions
%covered / total%covered / total%covered / total
  module reanimate-0.4.1.0-inplace/Paths_reanimate0%0/15
0/0 0%0/58
20%3/15
0/0 20%12/58
  module reanimate-0.4.1.0-inplace/Reanimate.Animation21%7/33
21%3/14
24%84/349
  module reanimate-0.4.1.0-inplace/Reanimate.Builtin.Documentation42%3/7
0/0 35%47/134
  module reanimate-0.4.1.0-inplace/Reanimate.Cache0%0/8
0%0/12
0%0/160
84%28/33
57%8/14
85%298/349
  module reanimate-0.4.1.0-inplace/Reanimate.Constants 37%3/8
0/0 16%3/18
  module reanimate-0.4.1.0-inplace/Reanimate.Driver8%1/12
1%1/55
3%8/246
8%1/12
1%1/55
3%9/246
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.CLI 14%5/35
0%0/63
8%31/376
0%0/16
0%0/30
0%0/634
  module reanimate-0.4.1.0-inplace/Reanimate.Ease0%0/9
0%0/8
0%0/121
77%7/9
50%4/8
70%85/121
  module reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier8%7/86
0%0/26
11%39/337
23%20/86
7%2/26
30%102/337
  module reanimate-0.4.1.0-inplace/Reanimate.Misc 0%0/7
0%0/14
0%0/162
  module reanimate-0.4.1.0-inplace/Reanimate.Parameters10%2/20
0/0 8%4/49
  module reanimate-0.4.1.0-inplace/Reanimate.Raster0%0/13
0%0/17
0%0/443
15%3/20
0/0 14%7/49
  module reanimate-0.4.1.0-inplace/Reanimate.Render 5%1/18
0%0/44
5%39/762
  module reanimate-0.4.1.0-inplace/Reanimate.Svg7%1/13
5%4/80
17%137/777
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox0%0/5
0%0/36
0%0/281
40%2/5
16%6/36
27%76/281
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors24%12/49
12%1/8
19%110/565
67%33/49
37%3/8
65%369/565
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand75%12/16
51%38/74
65%620/943
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Unuse0%0/3
0%0/14
0%0/128
75%12/16
58%43/74
69%659/943
  module reanimate-0.4.1.0-inplace/Reanimate.Transform0%0/6
0%0/12
0%0/166
83%5/6
33%4/12
45%76/166
  Program Coverage Total13%54/403
8%47/538
15%1122/7181
34%123/359
17%71/415
31%1766/5539
diff --git a/hpc_index_alt.html b/hpc_index_alt.html index 2ee58fa..2638ce1 100644 --- a/hpc_index_alt.html +++ b/hpc_index_alt.html @@ -8,40 +8,28 @@ table.dashboard { border-collapse: collapse ; border: solid 1px black } - + - + + + + - + - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + @@ -49,33 +37,30 @@ table.dashboard { border-collapse: collapse ; border: solid 1px black } - - + + - - + + - - + + - - - - - + + - + + + + - - - - - + + - +
moduleTop Level DefinitionsAlternativesExpressions
%covered / total%covered / total%covered / total
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand75%12/16
51%38/74
65%620/943
75%12/16
58%43/74
69%659/943
  module reanimate-0.4.1.0-inplace/Reanimate.Animation21%7/33
21%3/14
24%84/349
84%28/33
57%8/14
85%298/349
  module reanimate-0.4.1.0-inplace/Reanimate.Ease77%7/9
50%4/8
70%85/121
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors24%12/49
12%1/8
19%110/565
67%33/49
37%3/8
65%369/565
  module reanimate-0.4.1.0-inplace/Reanimate.Svg7%1/13
5%4/80
17%137/777
  module reanimate-0.4.1.0-inplace/Reanimate.Transform83%5/6
33%4/12
45%76/166
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox40%2/5
16%6/36
27%76/281
  module reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier23%20/86
7%2/26
30%102/337
  module reanimate-0.4.1.0-inplace/Reanimate.Driver8%1/12
1%1/55
3%8/246
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Unuse0%0/3
0%0/14
0%0/128
  module reanimate-0.4.1.0-inplace/Reanimate.Cache0%0/8
0%0/12
0%0/160
  module reanimate-0.4.1.0-inplace/Reanimate.Raster0%0/13
0%0/17
0%0/443
  module reanimate-0.4.1.0-inplace/Reanimate.Misc0%0/7
0%0/14
0%0/162
  module reanimate-0.4.1.0-inplace/Reanimate.Render5%1/18
0%0/44
5%39/762
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Compile0%0/2
0%0/4
0%0/64
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Server0%0/16
0%0/30
0%0/634
8%1/12
1%1/55
3%9/246
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.CLI 14%5/35
0%0/63
8%31/376
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Check 0%0/21
0%0/27
0%0/396
  module reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier8%7/86
0%0/26
11%39/337
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Compile0%0/2
0%0/4
0%0/64
  module reanimate-0.4.1.0-inplace/Reanimate.Transform0%0/6
0%0/12
0%0/166
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Server0%0/16
0%0/30
0%0/634
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox0%0/5
0%0/36
0%0/281
  module reanimate-0.4.1.0-inplace/Reanimate.Misc0%0/7
0%0/14
0%0/162
  module reanimate-0.4.1.0-inplace/Reanimate.Ease0%0/9
0%0/8
0%0/121
  module reanimate-0.4.1.0-inplace/Reanimate.Parameters10%2/20
0/0 8%4/49
  module reanimate-0.4.1.0-inplace/Reanimate.Render5%1/18
0%0/44
5%39/762
  module reanimate-0.4.1.0-inplace/Paths_reanimate0%0/15
0/0 0%0/58
20%3/15
0/0 20%12/58
  module reanimate-0.4.1.0-inplace/Reanimate.Constants37%3/8
0/0 16%3/18
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Magick 0%0/1
0/0 0%0/12
  module reanimate-0.4.1.0-inplace/Reanimate.Builtin.Documentation42%3/7
0/0 35%47/134
  module reanimate-0.4.1.0-inplace/Reanimate.Constants37%3/8
0/0 16%3/18
  module reanimate-0.4.1.0-inplace/Reanimate.Parameters15%3/20
0/0 14%7/49
  Program Coverage Total13%54/403
8%47/538
15%1122/7181
34%123/359
17%71/415
31%1766/5539
diff --git a/hpc_index_exp.html b/hpc_index_exp.html index e90689d..bf9de1f 100644 --- a/hpc_index_exp.html +++ b/hpc_index_exp.html @@ -7,29 +7,35 @@ table.dashboard { border-collapse: collapse ; border: solid 1px black } - - - - - - - + + + + + + + - + - - + + + + + + + + + + + - - - - + @@ -38,44 +44,23 @@ table.dashboard { border-collapse: collapse ; border: solid 1px black } - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + + - - + + + + + - +
moduleTop Level DefinitionsAlternativesExpressions
%covered / total%covered / total%covered / total
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand75%12/16
51%38/74
65%620/943
  module reanimate-0.4.1.0-inplace/Reanimate.Builtin.Documentation42%3/7
0/0 35%47/134
  module reanimate-0.4.1.0-inplace/Reanimate.Animation21%7/33
21%3/14
24%84/349
84%28/33
57%8/14
85%298/349
  module reanimate-0.4.1.0-inplace/Reanimate.Ease77%7/9
50%4/8
70%85/121
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand75%12/16
58%43/74
69%659/943
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors24%12/49
12%1/8
19%110/565
67%33/49
37%3/8
65%369/565
  module reanimate-0.4.1.0-inplace/Reanimate.Svg7%1/13
5%4/80
17%137/777
  module reanimate-0.4.1.0-inplace/Reanimate.Transform83%5/6
33%4/12
45%76/166
  module reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier23%20/86
7%2/26
30%102/337
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox40%2/5
16%6/36
27%76/281
  module reanimate-0.4.1.0-inplace/Paths_reanimate20%3/15
0/0 20%12/58
  module reanimate-0.4.1.0-inplace/Reanimate.Constants 37%3/8
0/0 16%3/18
  module reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier8%7/86
0%0/26
11%39/337
  module reanimate-0.4.1.0-inplace/Reanimate.Parameters10%2/20
0/0 8%4/49
15%3/20
0/0 14%7/49
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.CLI 14%5/35
0%0/63
8%31/376
5%1/18
0%0/44
5%39/762
  module reanimate-0.4.1.0-inplace/Reanimate.Driver8%1/12
1%1/55
3%8/246
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Unuse0%0/3
0%0/14
0%0/128
  module reanimate-0.4.1.0-inplace/Reanimate.Cache0%0/8
0%0/12
0%0/160
  module reanimate-0.4.1.0-inplace/Reanimate.Raster0%0/13
0%0/17
0%0/443
  module reanimate-0.4.1.0-inplace/Reanimate.Misc0%0/7
0%0/14
0%0/162
  module reanimate-0.4.1.0-inplace/Paths_reanimate0%0/15
0/0 0%0/58
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Compile0%0/2
0%0/4
0%0/64
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Server0%0/16
0%0/30
0%0/634
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Magick0%0/1
0/0 0%0/12
8%1/12
1%1/55
3%9/246
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Check 0%0/21
0%0/27
0%0/396
  module reanimate-0.4.1.0-inplace/Reanimate.Transform0%0/6
0%0/12
0%0/166
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Compile0%0/2
0%0/4
0%0/64
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox0%0/5
0%0/36
0%0/281
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Magick0%0/1
0/0 0%0/12
  module reanimate-0.4.1.0-inplace/Reanimate.Ease0%0/9
0%0/8
0%0/121
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Server0%0/16
0%0/30
0%0/634
  module reanimate-0.4.1.0-inplace/Reanimate.Misc0%0/7
0%0/14
0%0/162
  Program Coverage Total13%54/403
8%47/538
15%1122/7181
34%123/359
17%71/415
31%1766/5539
diff --git a/hpc_index_fun.html b/hpc_index_fun.html index 61699c2..02ac772 100644 --- a/hpc_index_fun.html +++ b/hpc_index_fun.html @@ -7,75 +7,60 @@ table.dashboard { border-collapse: collapse ; border: solid 1px black } - - + + - - + + + + + + + + + + + + + + - - + + - - + + + + + - - - - - - - - - - + - - - - - - - - - - - - - - + + - - - - - + + - - - - - - - - + + - +
moduleTop Level DefinitionsAlternativesExpressions
%covered / total%covered / total%covered / total
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand75%12/16
51%38/74
65%620/943
  module reanimate-0.4.1.0-inplace/Reanimate.Animation84%28/33
57%8/14
85%298/349
  module reanimate-0.4.1.0-inplace/Reanimate.Builtin.Documentation42%3/7
0/0 35%47/134
  module reanimate-0.4.1.0-inplace/Reanimate.Transform83%5/6
33%4/12
45%76/166
  module reanimate-0.4.1.0-inplace/Reanimate.Ease77%7/9
50%4/8
70%85/121
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand75%12/16
58%43/74
69%659/943
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors67%33/49
37%3/8
65%369/565
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox40%2/5
16%6/36
27%76/281
  module reanimate-0.4.1.0-inplace/Reanimate.Constants 37%3/8
0/0 16%3/18
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors24%12/49
12%1/8
19%110/565
  module reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier23%20/86
7%2/26
30%102/337
  module reanimate-0.4.1.0-inplace/Reanimate.Animation21%7/33
21%3/14
24%84/349
  module reanimate-0.4.1.0-inplace/Paths_reanimate20%3/15
0/0 20%12/58
  module reanimate-0.4.1.0-inplace/Reanimate.Parameters15%3/20
0/0 14%7/49
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.CLI 14%5/35
0%0/63
8%31/376
  module reanimate-0.4.1.0-inplace/Reanimate.Parameters10%2/20
0/0 8%4/49
  module reanimate-0.4.1.0-inplace/Reanimate.Driver8%1/12
1%1/55
3%8/246
  module reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier8%7/86
0%0/26
11%39/337
  module reanimate-0.4.1.0-inplace/Reanimate.Svg7%1/13
5%4/80
17%137/777
8%1/12
1%1/55
3%9/246
  module reanimate-0.4.1.0-inplace/Reanimate.Render 5%1/18
0%0/44
5%39/762
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.Unuse0%0/3
0%0/14
0%0/128
  module reanimate-0.4.1.0-inplace/Reanimate.Cache0%0/8
0%0/12
0%0/160
  module reanimate-0.4.1.0-inplace/Reanimate.Raster0%0/13
0%0/17
0%0/443
  module reanimate-0.4.1.0-inplace/Reanimate.Misc0%0/7
0%0/14
0%0/162
  module reanimate-0.4.1.0-inplace/Paths_reanimate0%0/15
0/0 0%0/58
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Check0%0/21
0%0/27
0%0/396
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Compile 0%0/2
0%0/4
0%0/64
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Server0%0/16
0%0/30
0%0/634
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Magick 0%0/1
0/0 0%0/12
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Check0%0/21
0%0/27
0%0/396
  module reanimate-0.4.1.0-inplace/Reanimate.Driver.Server0%0/16
0%0/30
0%0/634
  module reanimate-0.4.1.0-inplace/Reanimate.Transform0%0/6
0%0/12
0%0/166
  module reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox0%0/5
0%0/36
0%0/281
  module reanimate-0.4.1.0-inplace/Reanimate.Ease0%0/9
0%0/8
0%0/121
  module reanimate-0.4.1.0-inplace/Reanimate.Misc0%0/7
0%0/14
0%0/162
  Program Coverage Total13%54/403
8%47/538
15%1122/7181
34%123/359
17%71/415
31%1766/5539
diff --git a/reanimate-0.4.1.0-inplace/Paths_reanimate.hs.html b/reanimate-0.4.1.0-inplace/Paths_reanimate.hs.html index 143708b..1cdf16b 100644 --- a/reanimate-0.4.1.0-inplace/Paths_reanimate.hs.html +++ b/reanimate-0.4.1.0-inplace/Paths_reanimate.hs.html @@ -42,7 +42,7 @@ span.spaces { background: white } 23 #else 24 catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a 25 #endif - 26 catchIO = Exception.catch + 26 catchIO = Exception.catch 27 28 version :: Version 29 version = Version [0,4,1,0] [] @@ -59,14 +59,14 @@ span.spaces { background: white } 40 getBinDir = catchIO (getEnv "reanimate_bindir") (\_ -> return bindir) 41 getLibDir = catchIO (getEnv "reanimate_libdir") (\_ -> return libdir) 42 getDynLibDir = catchIO (getEnv "reanimate_dynlibdir") (\_ -> return dynlibdir) - 43 getDataDir = catchIO (getEnv "reanimate_datadir") (\_ -> return datadir) + 43 getDataDir = catchIO (getEnv "reanimate_datadir") (\_ -> return datadir) 44 getLibexecDir = catchIO (getEnv "reanimate_libexecdir") (\_ -> return libexecdir) 45 getSysconfDir = catchIO (getEnv "reanimate_sysconfdir") (\_ -> return sysconfdir) 46 47 getDataFileName :: FilePath -> IO FilePath - 48 getDataFileName name = do - 49 dir <- getDataDir - 50 return (dir ++ "/" ++ name) + 48 getDataFileName name = do + 49 dir <- getDataDir + 50 return (dir ++ "/" ++ name) diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Animation.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Animation.hs.html index 85083ea..dc3cb9b 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Animation.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Animation.hs.html @@ -89,11 +89,11 @@ span.spaces { background: white } 70 71 -- | Construct an animation with a duration of @1@. 72 animate :: (Time -> SVG) -> Animation - 73 animate = Animation 1 + 73 animate = Animation 1 74 75 -- | Create an animation with provided @duration@, which consists of stationary frame displayed for its entire duration. 76 staticFrame :: Duration -> SVG -> Animation - 77 staticFrame d svg = Animation d (const svg) + 77 staticFrame d svg = Animation d (const svg) 78 79 -- | Query the duration of an animation. 80 duration :: Animation -> Duration @@ -125,15 +125,15 @@ span.spaces { background: white } 106 -- 107 -- <<docs/gifs/doc_parA.gif>> 108 parA :: Animation -> Animation -> Animation - 109 parA (Animation d1 f1) (Animation d2 f2) = - 110 Animation (max d1 d2) $ \t -> - 111 let t1 = t * totalD/d1 - 112 t2 = t * totalD/d2 in - 113 mkGroup - 114 [ f1 (min 1 t1) - 115 , f2 (min 1 t2) ] - 116 where - 117 totalD = max d1 d2 + 109 parA (Animation d1 f1) (Animation d2 f2) = + 110 Animation (max d1 d2) $ \t -> + 111 let t1 = t * totalD/d1 + 112 t2 = t * totalD/d2 in + 113 mkGroup + 114 [ f1 (min 1 t1) + 115 , f2 (min 1 t2) ] + 116 where + 117 totalD = max d1 d2 118 119 -- | Play two animation concurrently. Shortest animation loops. 120 -- New animation duration is '@max (duration lhs) (duration rhs)@'. @@ -144,15 +144,15 @@ span.spaces { background: white } 125 -- 126 -- <<docs/gifs/doc_parLoopA.gif>> 127 parLoopA :: Animation -> Animation -> Animation - 128 parLoopA (Animation d1 f1) (Animation d2 f2) = - 129 Animation totalD $ \t -> - 130 let t1 = t * totalD/d1 - 131 t2 = t * totalD/d2 in - 132 mkGroup - 133 [ f1 (t1 `mod'` 1) - 134 , f2 (t2 `mod'` 1) ] - 135 where - 136 totalD = max d1 d2 + 128 parLoopA (Animation d1 f1) (Animation d2 f2) = + 129 Animation totalD $ \t -> + 130 let t1 = t * totalD/d1 + 131 t2 = t * totalD/d2 in + 132 mkGroup + 133 [ f1 (t1 `mod'` 1) + 134 , f2 (t2 `mod'` 1) ] + 135 where + 136 totalD = max d1 d2 137 138 -- | Play two animation concurrently. Animations disappear after playing once. 139 -- New animation duration is '@max (duration lhs) (duration rhs)@'. @@ -163,15 +163,15 @@ span.spaces { background: white } 144 -- 145 -- <<docs/gifs/doc_parDropA.gif>> 146 parDropA :: Animation -> Animation -> Animation - 147 parDropA (Animation d1 f1) (Animation d2 f2) = - 148 Animation totalD $ \t -> - 149 let t1 = t * totalD/d1 - 150 t2 = t * totalD/d2 in - 151 mkGroup - 152 [ if t1>1 then None else f1 t1 - 153 , if t2>1 then None else f2 t2 ] - 154 where - 155 totalD = max d1 d2 + 147 parDropA (Animation d1 f1) (Animation d2 f2) = + 148 Animation totalD $ \t -> + 149 let t1 = t * totalD/d1 + 150 t2 = t * totalD/d2 in + 151 mkGroup + 152 [ if t1>1 then None else f1 t1 + 153 , if t2>1 then None else f2 t2 ] + 154 where + 155 totalD = max d1 d2 156 157 -- | Empty animation (no SVG output) with a fixed duration. 158 -- @@ -181,7 +181,7 @@ span.spaces { background: white } 162 -- 163 -- <<docs/gifs/doc_pause.gif>> 164 pause :: Duration -> Animation - 165 pause d = Animation d (const None) + 165 pause d = Animation d (const None) 166 167 -- | Play left animation and freeze on the last frame, then play the right 168 -- animation. New duration is '@duration lhs + duration rhs@'. @@ -192,7 +192,7 @@ span.spaces { background: white } 173 -- 174 -- <<docs/gifs/doc_andThen.gif>> 175 andThen :: Animation -> Animation -> Animation - 176 andThen a b = a `parA` (pause (duration a) `seqA` b) + 176 andThen a b = a `parA` (pause (duration a) `seqA` b) 177 178 -- | Calculate the frame that would be displayed at given point in @time@ of running @animation@. 179 -- @@ -243,7 +243,7 @@ span.spaces { background: white } 224 -- 225 -- <<docs/gifs/doc_pauseAtEnd.gif>> 226 pauseAtEnd :: Duration -> Animation -> Animation - 227 pauseAtEnd t a = a `andThen` pause t + 227 pauseAtEnd t a = a `andThen` pause t 228 229 -- | Freeze the first frame for @t@ seconds at the beginning of the animation. 230 -- @@ -253,8 +253,8 @@ span.spaces { background: white } 234 -- 235 -- <<docs/gifs/doc_pauseAtBeginning.gif>> 236 pauseAtBeginning :: Duration -> Animation -> Animation - 237 pauseAtBeginning t a = - 238 Animation t (freezeFrame 0 a) `seqA` a + 237 pauseAtBeginning t a = + 238 Animation t (freezeFrame 0 a) `seqA` a 239 240 -- | Freeze the first and the last frame of the animation for a specified duration. 241 -- @@ -264,7 +264,7 @@ span.spaces { background: white } 245 -- 246 -- <<docs/gifs/doc_pauseAround.gif>> 247 pauseAround :: Duration -> Duration -> Animation -> Animation - 248 pauseAround start end = pauseAtEnd end . pauseAtBeginning start + 248 pauseAround start end = pauseAtEnd end . pauseAtBeginning start 249 250 -- XXX: Rename to 'setDurationFreeze'. Add 'setDurationDrop' and 251 -- 'setDurationLoop'. @@ -273,13 +273,13 @@ span.spaces { background: white } 254 255 -- Freeze frame at time @t@. 256 freezeFrame :: Time -> Animation -> (Time -> SVG) - 257 freezeFrame t (Animation d f) = const $ f (t/d) + 257 freezeFrame t (Animation d f) = const $ f (t/d) 258 259 -- | Change the duration of an animation. Animates are stretched or squished 260 -- (rather than truncated) to fit the new duration. 261 adjustDuration :: (Duration -> Duration) -> Animation -> Animation - 262 adjustDuration fn (Animation d gen) = - 263 Animation (fn d) gen + 262 adjustDuration fn (Animation d gen) = + 263 Animation (fn d) gen 264 265 -- | Set the duration of an animation by adjusting its playback rate. The 266 -- animation is still played from start to finish without being cropped. @@ -295,7 +295,7 @@ span.spaces { background: white } 276 -- 277 -- <<docs/gifs/doc_reverseA.gif>> 278 reverseA :: Animation -> Animation - 279 reverseA = signalA reverseS + 279 reverseA = signalA reverseS 280 281 -- | Play animation before playing it again in reverse. Duration is twice 282 -- the duration of the input. @@ -306,7 +306,7 @@ span.spaces { background: white } 287 -- 288 -- <<docs/gifs/doc_playThenReverseA.gif>> 289 playThenReverseA :: Animation -> Animation - 290 playThenReverseA a = a `seqA` reverseA a + 290 playThenReverseA a = a `seqA` reverseA a 291 292 -- | Loop animation @n@ number of times. This number may be fractional and it 293 -- may be less than 1. It must be greater than or equal to 0, though. @@ -318,8 +318,8 @@ span.spaces { background: white } 299 -- 300 -- <<docs/gifs/doc_repeatA.gif>> 301 repeatA :: Double -> Animation -> Animation - 302 repeatA n (Animation d f) = Animation (d*n) $ \t -> - 303 f ((t*n) `mod'` 1) + 302 repeatA n (Animation d f) = Animation (d*n) $ \t -> + 303 f ((t*n) `mod'` 1) 304 305 306 -- | @freezeAtPercentage time animation@ creates an animation consisting of stationary frame, @@ -339,7 +339,7 @@ span.spaces { background: white } 320 -- 321 -- <<docs/gifs/doc_addStatic.gif>> 322 addStatic :: SVG -> Animation -> Animation - 323 addStatic static = mapA (\frame -> mkGroup [static, frame]) + 323 addStatic static = mapA (\frame -> mkGroup [static, frame]) 324 325 -- | Modify the time component of an animation. Animation duration is unchanged. 326 -- @@ -349,7 +349,7 @@ span.spaces { background: white } 330 -- 331 -- <<docs/gifs/doc_signalA.gif>> 332 signalA :: Signal -> Animation -> Animation - 333 signalA fn (Animation d gen) = Animation d $ gen . fn + 333 signalA fn (Animation d gen) = Animation d $ gen . fn 334 335 -- | @takeA duration animation@ creates a new animation consisting of initial segment of 336 -- @animation@ of given @duration@, played at the same rate as the original animation. @@ -357,10 +357,10 @@ span.spaces { background: white } 338 -- The @duration@ parameter is clamped to be between 0 and @animation@'s duration. 339 -- New animation duration is equal to (eventually clamped) @duration@. 340 takeA :: Duration -> Animation -> Animation - 341 takeA len (Animation d gen) = Animation len' $ \t -> - 342 gen (t * len'/d) - 343 where - 344 len' = clamp 0 d len + 341 takeA len (Animation d gen) = Animation len' $ \t -> + 342 gen (t * len'/d) + 343 where + 344 len' = clamp 0 d len 345 346 -- | @dropA duration animation@ creates a new animation by dropping initial segment 347 -- of length @duration@ from the provided @animation@, played at the same rate as the original animation. @@ -368,13 +368,13 @@ span.spaces { background: white } 349 -- The @duration@ parameter is clamped to be between 0 and @animation@'s duration. 350 -- The duration of the resulting animation is duration of provided @animation@ minus (eventually clamped) @duration@. 351 dropA :: Duration -> Animation -> Animation - 352 dropA len (Animation d gen) = Animation len' $ \t -> - 353 gen (t * len'/d + len/d) - 354 where - 355 len' = d - clamp 0 d len + 352 dropA len (Animation d gen) = Animation len' $ \t -> + 353 gen (t * len'/d + len/d) + 354 where + 355 len' = d - clamp 0 d len 356 357 lastA :: Duration -> Animation -> Animation - 358 lastA len a = dropA (duration a - len) a + 358 lastA len a = dropA (duration a - len) a 359 360 clamp :: Double -> Double -> Double -> Double 361 clamp a b number @@ -385,14 +385,14 @@ span.spaces { background: white } 366 o # f = f o 367 368 getAnimationFrame :: Sync -> Animation -> Time -> Duration -> SVG - 369 getAnimationFrame sync (Animation aDur aGen) t d = - 370 case sync of - 371 SyncStretch -> aGen (t/d) - 372 SyncLoop -> aGen (takeFrac $ t/aDur) - 373 SyncDrop -> if t > aDur then None else aGen (t/aDur) - 374 SyncFreeze -> aGen (min 1 $ t/aDur) - 375 where - 376 takeFrac f = snd (properFraction f :: (Int, Double)) + 369 getAnimationFrame sync (Animation aDur aGen) t d = + 370 case sync of + 371 SyncStretch -> aGen (t/d) + 372 SyncLoop -> aGen (takeFrac $ t/aDur) + 373 SyncDrop -> if t > aDur then None else aGen (t/aDur) + 374 SyncFreeze -> aGen (min 1 $ t/aDur) + 375 where + 376 takeFrac f = snd (properFraction f :: (Int, Double)) 377 378 data Sync 379 = SyncStretch diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Driver.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Driver.hs.html index b870c32..49042aa 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Driver.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Driver.hs.html @@ -132,7 +132,7 @@ span.spaces { background: white } 113 setFPS 60 114 renderSvgs rawOutputFolder rawFrameOffset rawPrettyPrint animation 115 Test -> do - 116 setNoExternals True + 116 setNoExternals True 117 -- hSetBinaryMode stdout True 118 renderSnippets animation 119 Check -> checkEnvironment diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Ease.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Ease.hs.html index f0f27de..8ff1fca 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Ease.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Ease.hs.html @@ -51,7 +51,7 @@ span.spaces { background: white } 32 -- 33 -- <<docs/gifs/doc_constantS.gif>> 34 constantS :: Double -> Signal - 35 constantS = const + 35 constantS = const 36 37 -- | Signal with new starting and end values. 38 -- @@ -61,7 +61,7 @@ span.spaces { background: white } 42 -- 43 -- <<docs/gifs/doc_fromToS.gif>> 44 fromToS :: Double -> Double -> Signal - 45 fromToS from to t = from + (to-from)*t + 45 fromToS from to t = from + (to-from)*t 46 47 -- | Reverse signal order. 48 -- @@ -71,7 +71,7 @@ span.spaces { background: white } 52 -- 53 -- <<docs/gifs/doc_reverseS.gif>> 54 reverseS :: Signal - 55 reverseS t = 1-t + 55 reverseS t = 1-t 56 57 -- | S-curve signal. Takes a steepness parameter. 2 is a good default. 58 -- @@ -81,10 +81,10 @@ span.spaces { background: white } 62 -- 63 -- <<docs/gifs/doc_curveS.gif>> 64 curveS :: Double -> Signal - 65 curveS steepness s = - 66 if s < 0.5 - 67 then 0.5 * (2*s)**steepness - 68 else 1-0.5 * (2 - 2*s)**steepness + 65 curveS steepness s = + 66 if s < 0.5 + 67 then 0.5 * (2*s)**steepness + 68 else 1-0.5 * (2 - 2*s)**steepness 69 70 powerS :: Double -> Signal 71 powerS steepness s = s**steepness @@ -97,10 +97,10 @@ span.spaces { background: white } 78 -- 79 -- <<docs/gifs/doc_oscillateS.gif>> 80 oscillateS :: Signal - 81 oscillateS t = - 82 if t < 1/2 - 83 then t*2 - 84 else 2-t*2 + 81 oscillateS t = + 82 if t < 1/2 + 83 then t*2 + 84 else 2-t*2 85 86 -- | Bell-curve signal. Takes a steepness parameter. 2 is a good default. 87 -- @@ -110,7 +110,7 @@ span.spaces { background: white } 91 -- 92 -- <<docs/gifs/doc_bellS.gif>> 93 bellS :: Double -> Signal - 94 bellS steepness = curveS steepness . oscillateS + 94 bellS steepness = curveS steepness . oscillateS 95 96 -- | Cubic Bezier signal. Gives you a fair amount of control over how the 97 -- signal will 'curve'. @@ -121,9 +121,9 @@ span.spaces { background: white } 102 -- 103 -- <<docs/gifs/doc_cubicBezierS.gif>> 104 cubicBezierS :: (Double, Double, Double, Double) -> Signal - 105 cubicBezierS (x1, x2, x3, x4) s = - 106 let ms = 1-s - 107 in x1*ms^(3::Int) + 3*x2*ms^(2::Int)*s + 3*x3*ms*s^(2::Int) + x4*s^(3::Int) + 105 cubicBezierS (x1, x2, x3, x4) s = + 106 let ms = 1-s + 107 in x1*ms^(3::Int) + 3*x2*ms^(2::Int)*s + 3*x3*ms*s^(2::Int) + x4*s^(3::Int) diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier.hs.html index 21485d4..bdfa554 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Internal.CubicBezier.hs.html @@ -116,7 +116,7 @@ span.spaces { background: white } 97 -- Methods 98 99 quadToCubic :: Fractional a => QuadBezier a -> CubicBezier a - 100 quadToCubic = upCast . C.quadToCubic . downCast + 100 quadToCubic = upCast . C.quadToCubic . downCast 101 102 arcLength :: CubicBezier Double -> Double -> Double -> Double 103 arcLength bezier t tol = C.arcLength (downCast bezier) t tol @@ -125,10 +125,10 @@ span.spaces { background: white } 106 arcLengthParam bezier t tol = C.arcLengthParam (downCast bezier) t tol 107 108 colinear :: CubicBezier Double -> Double -> Bool - 109 colinear bezier tol = C.colinear (downCast bezier) tol + 109 colinear bezier tol = C.colinear (downCast bezier) tol 110 111 evalBezier :: (C.GenericBezier b, V.Unbox a, Fractional a) => b a -> a -> V2 a - 112 evalBezier c p = upCast $ C.evalBezier c p + 112 evalBezier c p = upCast $ C.evalBezier c p 113 114 evalBezierDeriv :: (V.Unbox a, Fractional a,C.GenericBezier b) => b a -> a -> (V2 a, V2 a) 115 evalBezierDeriv c p = upCast $ C.evalBezierDeriv c p @@ -155,7 +155,7 @@ span.spaces { background: white } 136 closest c p t = C.closest (downCast c) (downCast p) t 137 138 closedPathCurves :: Fractional a => ClosedPath a -> [CubicBezier a] - 139 closedPathCurves = upCast . C.closedPathCurves . downCast + 139 closedPathCurves = upCast . C.closedPathCurves . downCast 140 141 openPathCurves :: Fractional a => OpenPath a -> [CubicBezier a] 142 openPathCurves = upCast . C.openPathCurves . downCast @@ -180,13 +180,13 @@ span.spaces { background: white } 161 162 instance C.GenericBezier QuadBezier where 163 degree = C.degree . downCast - 164 toVector = C.toVector . downCast + 164 toVector = C.toVector . downCast 165 unsafeFromVector = upCast . C.unsafeFromVector 166 167 instance C.GenericBezier CubicBezier where 168 degree = C.degree . downCast - 169 toVector = C.toVector . downCast - 170 unsafeFromVector = upCast . C.unsafeFromVector + 169 toVector = C.toVector . downCast + 170 unsafeFromVector = upCast . C.unsafeFromVector 171 172 instance C.GenericBezier AnyBezier where 173 degree = C.degree . downCast @@ -202,7 +202,7 @@ span.spaces { background: white } 183 184 instance Cast a b => Cast [a] [b] where 185 downCast = map downCast - 186 upCast = map upCast + 186 upCast = map upCast 187 188 instance (Cast a a', Cast b b') => Cast (a,b) (a',b') where 189 downCast (a, b) = (downCast a, downCast b) @@ -210,17 +210,17 @@ span.spaces { background: white } 191 192 instance Cast (V2 a) (C.Point a) where 193 downCast (V2 a b) = C.Point a b - 194 upCast (C.Point a b) = V2 a b + 194 upCast (C.Point a b) = V2 a b 195 196 instance Cast (CubicBezier a) (C.CubicBezier a) where 197 downCast (CubicBezier a b c d) = C.CubicBezier 198 (downCast a) (downCast b) (downCast c) (downCast d) - 199 upCast (C.CubicBezier a b c d) = CubicBezier - 200 (upCast a) (upCast b) (upCast c) (upCast d) + 199 upCast (C.CubicBezier a b c d) = CubicBezier + 200 (upCast a) (upCast b) (upCast c) (upCast d) 201 202 instance Cast (QuadBezier a) (C.QuadBezier a) where - 203 downCast (QuadBezier a b c) = C.QuadBezier - 204 (downCast a) (downCast b) (downCast c) + 203 downCast (QuadBezier a b c) = C.QuadBezier + 204 (downCast a) (downCast b) (downCast c) 205 upCast (C.QuadBezier a b c)= QuadBezier 206 (upCast a) (upCast b) (upCast c) 207 @@ -245,8 +245,8 @@ span.spaces { background: white } 226 upCast (C.Controls p1 p2) = Controls (upCast p1) (upCast p2) 227 228 instance Cast (PathJoin a) (C.PathJoin a) where - 229 downCast JoinLine = C.JoinLine - 230 downCast (JoinCurve a b) = C.JoinCurve (downCast a) (downCast b) + 229 downCast JoinLine = C.JoinLine + 230 downCast (JoinCurve a b) = C.JoinCurve (downCast a) (downCast b) 231 upCast C.JoinLine = JoinLine 232 upCast (C.JoinCurve a b) = JoinCurve (upCast a) (upCast b) 233 @@ -275,9 +275,9 @@ span.spaces { background: white } 256 | (p, j) <- lst ] (upCast end) 257 258 instance Cast (ClosedPath a) (C.ClosedPath a) where - 259 downCast (ClosedPath lst) = C.ClosedPath - 260 [ (downCast p, downCast j) - 261 | (p, j) <- lst ] + 259 downCast (ClosedPath lst) = C.ClosedPath + 260 [ (downCast p, downCast j) + 261 | (p, j) <- lst ] 262 upCast (C.ClosedPath lst) = ClosedPath 263 [ (upCast p, upCast j) 264 | (p, j) <- lst ] diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Parameters.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Parameters.hs.html index 1073182..7e04797 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Parameters.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Parameters.hs.html @@ -102,7 +102,7 @@ span.spaces { background: white } 83 84 {-# NOINLINE pNoExternals #-} 85 pNoExternals :: Bool - 86 pNoExternals = unsafePerformIO (readIORef pNoExternalsRef) + 86 pNoExternals = unsafePerformIO (readIORef pNoExternalsRef) 87 88 setNoExternals :: Bool -> IO () 89 setNoExternals = writeIORef pNoExternalsRef diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox.hs.html index 35f45ef..29e05e8 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Svg.BoundingBox.hs.html @@ -39,15 +39,15 @@ span.spaces { background: white } 20 -- in all cases. The only supported SVG nodes are: path, circle, polyline, 21 -- ellipse, line, rectangle, image. All other nodes return (0,0,0,0). 22 boundingBox :: Tree -> (Double, Double, Double, Double) - 23 boundingBox t = - 24 case svgBoundingPoints t of - 25 [] -> (0,0,0,0) - 26 (V2 x y:rest) -> - 27 let (minx, miny, maxx, maxy) = foldl' worker (x, y, x, y) rest - 28 in (minx, miny, maxx-minx, maxy-miny) - 29 where - 30 worker (minx, miny, maxx, maxy) (V2 x y) = - 31 (min minx x, min miny y, max maxx x, max maxy y) + 23 boundingBox t = + 24 case svgBoundingPoints t of + 25 [] -> (0,0,0,0) + 26 (V2 x y:rest) -> + 27 let (minx, miny, maxx, maxy) = foldl' worker (x, y, x, y) rest + 28 in (minx, miny, maxx-minx, maxy-miny) + 29 where + 30 worker (minx, miny, maxx, maxy) (V2 x y) = + 31 (min minx x, min miny y, max maxx x, max maxy y) 32 33 svgHeight :: Tree -> Double 34 svgHeight t = h @@ -76,60 +76,60 @@ span.spaces { background: white } 57 chunks = 10 58 59 svgBoundingPoints :: Tree -> [RPoint] - 60 svgBoundingPoints t = map (Transform.transformPoint m) $ - 61 case t of - 62 None -> [] - 63 UseTree{} -> [] - 64 GroupTree g -> concatMap svgBoundingPoints (g^.groupChildren) - 65 SymbolTree (Symbol g) -> concatMap svgBoundingPoints (g^.groupChildren) - 66 FilterTree{} -> [] - 67 DefinitionTree{} -> [] - 68 PathTree p -> linePoints $ toLineCommands (p^.pathDefinition) - 69 CircleTree c -> circleBoundingPoints c - 70 PolyLineTree pl -> pl ^. polyLinePoints - 71 EllipseTree e -> ellipseBoundingPoints e - 72 LineTree line -> map pointToRPoint [line^.linePoint1, line^.linePoint2] - 73 RectangleTree rect -> - 74 case pointToRPoint (rect^.rectUpperLeftCorner) of - 75 V2 x y -> V2 x y : - 76 case mapTuple (fmap $ toUserUnit defaultDPI) (rect^.rectWidth, rect^.rectHeight) of - 77 (Just (Num w), Just (Num h)) -> [V2 (x+w) (y+h)] - 78 _ -> [] - 79 TextTree{} -> [] - 80 ImageTree img -> - 81 case (img^.imageCornerUpperLeft, img^.imageWidth, img^.imageHeight) of - 82 ((Num x, Num y), Num w, Num h) -> - 83 [V2 x y, V2 (x+w) (y+h)] - 84 _ -> [] - 85 MeshGradientTree{} -> [] - 86 _ -> [] - 87 where - 88 m = Transform.mkMatrix (t^.transform) - 89 mapTuple f = f *** f - 90 pointToRPoint p = - 91 case mapTuple (toUserUnit defaultDPI) p of - 92 (Num x, Num y) -> V2 x y - 93 _ -> error "Reanimate.Svg.svgBoundingPoints: Unrecognized number format." - 94 - 95 circleBoundingPoints circ = - 96 let (xnum, ynum) = circ ^. circleCenter - 97 rnum = circ ^. circleRadius - 98 in case mapMaybe unpackNumber [xnum, ynum, rnum] of - 99 [x, y, r] -> [ V2 (x + r * cos angle) (y + r * sin angle) | angle <- [0, pi/10 .. 2 * pi]] - 100 _ -> [] - 101 - 102 ellipseBoundingPoints e = - 103 let (xnum,ynum) = e ^. ellipseCenter - 104 xrnum = e ^. ellipseXRadius - 105 yrnum = e ^. ellipseYRadius - 106 in case mapMaybe unpackNumber [xnum, ynum, xrnum, yrnum] of - 107 [x,y,xr,yr] -> [V2 (x + xr * cos angle) (y + yr * sin angle) | angle <- [0, pi/10 .. 2 * pi]] - 108 _ -> [] - 109 - 110 unpackNumber n = - 111 case toUserUnit defaultDPI n of - 112 Num d -> Just d - 113 _ -> Nothing + 60 svgBoundingPoints t = map (Transform.transformPoint m) $ + 61 case t of + 62 None -> [] + 63 UseTree{} -> [] + 64 GroupTree g -> concatMap svgBoundingPoints (g^.groupChildren) + 65 SymbolTree (Symbol g) -> concatMap svgBoundingPoints (g^.groupChildren) + 66 FilterTree{} -> [] + 67 DefinitionTree{} -> [] + 68 PathTree p -> linePoints $ toLineCommands (p^.pathDefinition) + 69 CircleTree c -> circleBoundingPoints c + 70 PolyLineTree pl -> pl ^. polyLinePoints + 71 EllipseTree e -> ellipseBoundingPoints e + 72 LineTree line -> map pointToRPoint [line^.linePoint1, line^.linePoint2] + 73 RectangleTree rect -> + 74 case pointToRPoint (rect^.rectUpperLeftCorner) of + 75 V2 x y -> V2 x y : + 76 case mapTuple (fmap $ toUserUnit defaultDPI) (rect^.rectWidth, rect^.rectHeight) of + 77 (Just (Num w), Just (Num h)) -> [V2 (x+w) (y+h)] + 78 _ -> [] + 79 TextTree{} -> [] + 80 ImageTree img -> + 81 case (img^.imageCornerUpperLeft, img^.imageWidth, img^.imageHeight) of + 82 ((Num x, Num y), Num w, Num h) -> + 83 [V2 x y, V2 (x+w) (y+h)] + 84 _ -> [] + 85 MeshGradientTree{} -> [] + 86 _ -> [] + 87 where + 88 m = Transform.mkMatrix (t^.transform) + 89 mapTuple f = f *** f + 90 pointToRPoint p = + 91 case mapTuple (toUserUnit defaultDPI) p of + 92 (Num x, Num y) -> V2 x y + 93 _ -> error "Reanimate.Svg.svgBoundingPoints: Unrecognized number format." + 94 + 95 circleBoundingPoints circ = + 96 let (xnum, ynum) = circ ^. circleCenter + 97 rnum = circ ^. circleRadius + 98 in case mapMaybe unpackNumber [xnum, ynum, rnum] of + 99 [x, y, r] -> [ V2 (x + r * cos angle) (y + r * sin angle) | angle <- [0, pi/10 .. 2 * pi]] + 100 _ -> [] + 101 + 102 ellipseBoundingPoints e = + 103 let (xnum,ynum) = e ^. ellipseCenter + 104 xrnum = e ^. ellipseXRadius + 105 yrnum = e ^. ellipseYRadius + 106 in case mapMaybe unpackNumber [xnum, ynum, xrnum, yrnum] of + 107 [x,y,xr,yr] -> [V2 (x + xr * cos angle) (y + yr * sin angle) | angle <- [0, pi/10 .. 2 * pi]] + 108 _ -> [] + 109 + 110 unpackNumber n = + 111 case toUserUnit defaultDPI n of + 112 Num d -> Just d + 113 _ -> Nothing diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors.hs.html index 32dbbf8..c2377f2 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Svg.Constructors.hs.html @@ -101,7 +101,7 @@ span.spaces { background: white } 82 -- | @rotate angle image@ rotates the @image@ around origin @(0,0)@ counterclockwise by @angle@ 83 -- given in degrees. 84 rotate :: Double -> Tree -> Tree - 85 rotate a = withTransformations [Rotate a Nothing] + 85 rotate a = withTransformations [Rotate a Nothing] 86 87 -- | @rotate angle point image@ rotates the @image@ around given @point@ counterclockwise by 88 -- @angle@ given in degrees. @@ -146,23 +146,23 @@ span.spaces { background: white } 127 -- half the original size. Negative values are also allowed, and lead to flipping the image along 128 -- both X and Y axes. 129 scale :: Double -> Tree -> Tree - 130 scale a = withTransformations [Scale a Nothing] + 130 scale a = withTransformations [Scale a Nothing] 131 132 -- | @scaleToSize width height@ resizes the image so that its bounding box has corresponding @width@ 133 -- and @height@. 134 scaleToSize :: Double -> Double -> Tree -> Tree - 135 scaleToSize w h t = - 136 scaleXY (w/w') (h/h') t - 137 where - 138 (_x, _y, w', h') = boundingBox t + 135 scaleToSize w h t = + 136 scaleXY (w/w') (h/h') t + 137 where + 138 (_x, _y, w', h') = boundingBox t 139 140 -- | @scaleToWidth width@ scales the image so that the width of its bounding box ends up having 141 -- given @width@. 142 scaleToWidth :: Double -> Tree -> Tree - 143 scaleToWidth w t = - 144 scale (w/w') t - 145 where - 146 (_x, _y, w', _h') = boundingBox t + 143 scaleToWidth w t = + 144 scale (w/w') t + 145 where + 146 (_x, _y, w', _h') = boundingBox t 147 148 -- | @scaleToHeight height@ scales the image so that the height of its bounding box ends up having 149 -- given @height@. @@ -180,17 +180,17 @@ span.spaces { background: white } 161 -- | Flip the image along vertical axis so that what was on the right will end up on left and vice 162 -- versa. 163 flipXAxis :: Tree -> Tree - 164 flipXAxis = scaleXY (-1) 1 + 164 flipXAxis = scaleXY (-1) 1 165 166 -- | Flip the image along horizontal so that what was on the top will end up in the bottom and vice 167 -- versa. 168 flipYAxis :: Tree -> Tree - 169 flipYAxis = scaleXY 1 (-1) + 169 flipYAxis = scaleXY 1 (-1) 170 171 -- | Translate given image so that the center of its bouding box coincides with coordinates 172 -- @(0, 0)@. 173 center :: Tree -> Tree - 174 center t = centerUsing t t + 174 center t = centerUsing t t 175 176 -- | Translate given image so that the X-coordinate of the center of its bouding box is 0. 177 centerX :: Tree -> Tree @@ -205,9 +205,9 @@ span.spaces { background: white } 186 (_x, y, _w, h) = boundingBox t 187 188 centerUsing :: Tree -> Tree -> Tree - 189 centerUsing a = translate (-x-w/2) (-y-h/2) - 190 where - 191 (x, y, w, h) = boundingBox a + 189 centerUsing a = translate (-x-w/2) (-y-h/2) + 190 where + 191 (x, y, w, h) = boundingBox a 192 193 -- | Create 'Texture' based on SVG color name. 194 -- See <https://en.wikipedia.org/wiki/Web_colors#X11_color_names> for the list of available names. @@ -223,7 +223,7 @@ span.spaces { background: white } 204 withStrokeColor color = strokeColor .~ pure (mkColor color) 205 206 withStrokeColorPixel :: PixelRGBA8 -> Tree -> Tree - 207 withStrokeColorPixel color = strokeColor .~ pure (ColorRef color) + 207 withStrokeColorPixel color = strokeColor .~ pure (ColorRef color) 208 209 withStrokeDashArray :: [Double] -> Tree -> Tree 210 withStrokeDashArray arr = strokeDashArray .~ pure (map Num arr) @@ -237,14 +237,14 @@ span.spaces { background: white } 218 withFillColor color = fillColor .~ pure (mkColor color) 219 220 withFillColorPixel :: PixelRGBA8 -> Tree -> Tree - 221 withFillColorPixel color = fillColor .~ pure (ColorRef color) + 221 withFillColorPixel color = fillColor .~ pure (ColorRef color) 222 223 -- | See <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-opacity> 224 withFillOpacity :: Double -> Tree -> Tree 225 withFillOpacity opacity = fillOpacity ?~ realToFrac opacity 226 227 withGroupOpacity :: Double -> Tree -> Tree - 228 withGroupOpacity opacity = groupOpacity ?~ realToFrac opacity + 228 withGroupOpacity opacity = groupOpacity ?~ realToFrac opacity 229 230 -- | See <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width> 231 withStrokeWidth :: Double -> Tree -> Tree @@ -278,17 +278,17 @@ span.spaces { background: white } 259 -- | Create an ellipse given X-axis radius, and Y-axis radius, with center at @(0, 0)@. 260 -- See <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse> 261 mkEllipse :: Double -> Double -> Tree - 262 mkEllipse rx ry = EllipseTree $ defaultSvg - 263 & ellipseCenter .~ (Num 0, Num 0) - 264 & ellipseXRadius .~ Num rx - 265 & ellipseYRadius .~ Num ry + 262 mkEllipse rx ry = EllipseTree $ defaultSvg + 263 & ellipseCenter .~ (Num 0, Num 0) + 264 & ellipseXRadius .~ Num rx + 265 & ellipseYRadius .~ Num ry 266 267 -- | Create a line segment between two points given by their @(x, y)@ coordinates. 268 -- See <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/line> 269 mkLine :: (Double,Double) -> (Double, Double) -> Tree - 270 mkLine (x1,y1) (x2,y2) = LineTree $ defaultSvg - 271 & linePoint1 .~ (Num x1, Num y1) - 272 & linePoint2 .~ (Num x2, Num y2) + 270 mkLine (x1,y1) (x2,y2) = LineTree $ defaultSvg + 271 & linePoint1 .~ (Num x1, Num y1) + 272 & linePoint2 .~ (Num x2, Num y2) 273 274 -- | Merges multiple images into one. 275 -- See <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g> @@ -321,20 +321,20 @@ span.spaces { background: white } 302 -- | Create a path from the list of path commands. 303 -- See <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#Path_commands> 304 mkPath :: [PathCommand] -> Tree - 305 mkPath cmds = PathTree $ defaultSvg & pathDefinition .~ cmds + 305 mkPath cmds = PathTree $ defaultSvg & pathDefinition .~ cmds 306 307 -- | Similar to 'mkPathText', but taking SVG path command as a String. 308 mkPathString :: String -> Tree - 309 mkPathString = mkPathText . T.pack + 309 mkPathString = mkPathText . T.pack 310 311 -- | Create path from textual representation of SVG path command. 312 -- If the text doesn't represent valid path command, this function fails with 'Prelude.error'. 313 -- Use 'mkPath' for type safe way of creating paths. 314 mkPathText :: T.Text -> Tree - 315 mkPathText str = - 316 case parseOnly pathParser str of - 317 Left err -> error err - 318 Right cmds -> mkPath cmds + 315 mkPathText str = + 316 case parseOnly pathParser str of + 317 Left err -> error err + 318 Right cmds -> mkPath cmds 319 320 -- | Create a path from a list of @(x, y)@ coordinates of points along the path. 321 mkLinePath :: [(Double, Double)] -> Tree @@ -347,13 +347,13 @@ span.spaces { background: white } 328 329 -- | Create a path from a list of @(x, y)@ coordinates of points along the path. 330 mkLinePathClosed :: [(Double, Double)] -> Tree - 331 mkLinePathClosed [] = mkGroup [] - 332 mkLinePathClosed ((startX, startY):rest) = - 333 PathTree $ defaultSvg & pathDefinition .~ cmds - 334 where - 335 cmds = [ MoveTo OriginAbsolute [V2 startX startY] - 336 , LineTo OriginAbsolute [ V2 x y | (x, y) <- rest ] - 337 , EndPath ] + 331 mkLinePathClosed [] = mkGroup [] + 332 mkLinePathClosed ((startX, startY):rest) = + 333 PathTree $ defaultSvg & pathDefinition .~ cmds + 334 where + 335 cmds = [ MoveTo OriginAbsolute [V2 startX startY] + 336 , LineTo OriginAbsolute [ V2 x y | (x, y) <- rest ] + 337 , EndPath ] 338 339 -- | Rectangle with a uniform color and the same size as the screen. 340 -- @@ -367,9 +367,9 @@ span.spaces { background: white } 348 withFillColor color $ mkRect screenWidth screenHeight 349 350 mkBackgroundPixel :: PixelRGBA8 -> Tree - 351 mkBackgroundPixel pixel = - 352 withFillOpacity 1 $ withStrokeWidth 0 $ - 353 withFillColorPixel pixel $ mkRect screenWidth screenHeight + 351 mkBackgroundPixel pixel = + 352 withFillOpacity 1 $ withStrokeWidth 0 $ + 353 withFillColorPixel pixel $ mkRect screenWidth screenHeight 354 355 -- | Take list of rows, where each row consists of number of images and display them in regular 356 -- grid structure. @@ -377,17 +377,17 @@ span.spaces { background: white } 358 -- The images within each row will get equal amount of horizontal space, independent of the other 359 -- rows. Each row can contain different number of cells. 360 gridLayout :: [[Tree]] -> Tree - 361 gridLayout rows = mkGroup - 362 [ translate (-screenWidth/2+colSep*nCol + colSep*0.5) - 363 (screenHeight/2-rowSep*nRow - rowSep*0.5) - 364 elt - 365 | (nRow, row) <- zip [0..] rows - 366 , let nCols = length row - 367 colSep = screenWidth / fromIntegral nCols - 368 , (nCol, elt) <- zip [0..] row ] - 369 where - 370 rowSep = screenHeight / fromIntegral nRows - 371 nRows = length rows + 361 gridLayout rows = mkGroup + 362 [ translate (-screenWidth/2+colSep*nCol + colSep*0.5) + 363 (screenHeight/2-rowSep*nRow - rowSep*0.5) + 364 elt + 365 | (nRow, row) <- zip [0..] rows + 366 , let nCols = length row + 367 colSep = screenWidth / fromIntegral nCols + 368 , (nCol, elt) <- zip [0..] row ] + 369 where + 370 rowSep = screenHeight / fromIntegral nRows + 371 nRows = length rows 372 373 -- | Insert a native text object anchored at the middle. 374 -- @@ -397,16 +397,16 @@ span.spaces { background: white } 378 -- 379 -- <<docs/gifs/doc_mkText.gif>> 380 mkText :: T.Text -> Tree - 381 mkText str = - 382 flipYAxis - 383 (TextTree Nothing $ defaultSvg - 384 & textRoot .~ span_ - 385 & fontSize .~ pure (Num 2)) - 386 & textAnchor .~ pure TextAnchorMiddle - 387 -- Note: TextAnchorMiddle is placed on the 'flipYAxis' group such that it can easily - 388 -- be overwritten by the user. - 389 where - 390 span_ = defaultSvg & spanContent .~ [SpanText str] + 381 mkText str = + 382 flipYAxis + 383 (TextTree Nothing $ defaultSvg + 384 & textRoot .~ span_ + 385 & fontSize .~ pure (Num 2)) + 386 & textAnchor .~ pure TextAnchorMiddle + 387 -- Note: TextAnchorMiddle is placed on the 'flipYAxis' group such that it can easily + 388 -- be overwritten by the user. + 389 where + 390 span_ = defaultSvg & spanContent .~ [SpanText str] 391 392 -- | Switch from the default viewbox to a custom viewbox. Nesting custom viewboxes is 393 -- unlikely to give good results. If you need nested custom viewboxes, you will have @@ -420,16 +420,16 @@ span.spaces { background: white } 401 -- 402 -- <<docs/gifs/doc_withViewBox.gif>> 403 withViewBox :: (Double, Double, Double, Double) -> Tree -> Tree - 404 withViewBox vbox child = translate (-screenWidth/2) (-screenHeight/2) $ - 405 SvgTree $ Document - 406 { _viewBox = Just vbox - 407 , _width = Just (Num screenWidth) - 408 , _height = Just (Num screenHeight) - 409 , _elements = [child] - 410 , _description = "" - 411 , _documentLocation = "" - 412 , _documentAspectRatio = PreserveAspectRatio False AlignNone Nothing - 413 } + 404 withViewBox vbox child = translate (-screenWidth/2) (-screenHeight/2) $ + 405 SvgTree $ Document + 406 { _viewBox = Just vbox + 407 , _width = Just (Num screenWidth) + 408 , _height = Just (Num screenHeight) + 409 , _elements = [child] + 410 , _description = "" + 411 , _documentLocation = "" + 412 , _documentAspectRatio = PreserveAspectRatio False AlignNone Nothing + 413 } diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand.hs.html index 4c1f00d..827b14c 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Svg.LineCommand.hs.html @@ -45,10 +45,10 @@ span.spaces { background: white } 26 worker (LineMove p) = MoveTo OriginAbsolute [p] 27 -- worker (LineDraw p) = LineTo OriginAbsolute [p] 28 worker (LineBezier [a,b,c]) = CurveTo OriginAbsolute [(a,b,c)] - 29 worker (LineBezier [a,b]) = QuadraticBezier OriginAbsolute [(a,b)] + 29 worker (LineBezier [a,b]) = QuadraticBezier OriginAbsolute [(a,b)] 30 worker (LineBezier [a]) = LineTo OriginAbsolute [a] 31 worker LineBezier{} = error "Reanimate.Svg.lineToPath: invalid bezier curve" - 32 worker LineEnd{} = EndPath + 32 worker LineEnd{} = EndPath 33 34 lineToPoints :: Int -> [LineCommand] -> [RPoint] 35 lineToPoints nPoints cmds = @@ -129,7 +129,7 @@ span.spaces { background: white } 110 MoveTo OriginAbsolute [] -> pure [] 111 MoveTo OriginAbsolute lst -> put (last lst) *> gets (pure.LineMove) 112 MoveTo OriginRelative lst -> modify (+ sum lst) *> gets (pure.LineMove) - 113 LineTo OriginAbsolute lst -> forM lst (\to -> put to $> mkStraightLine to) + 113 LineTo OriginAbsolute lst -> forM lst (\to -> put to $> mkStraightLine to) 114 LineTo OriginRelative lst -> forM lst (\to -> modify (+to) *> gets mkStraightLine) 115 HorizontalTo OriginAbsolute lst -> 116 forM lst $ \x -> modify (_x .~ x) *> gets mkStraightLine @@ -152,11 +152,11 @@ span.spaces { background: white } 133 let c1 = maybe (makeAbsolute o from c2) (mirrorPoint from) mbControl 134 pure $ LineBezier [c1,makeAbsolute o from c2,makeAbsolute o from to] 135 QuadraticBezier OriginAbsolute pairs -> - 136 forM pairs $ \(a,b) -> put b $> LineBezier [a,b] + 136 forM pairs $ \(a,b) -> put b $> LineBezier [a,b] 137 QuadraticBezier OriginRelative pairs -> - 138 forM pairs $ \(a,b) -> do - 139 from <- get <* modify (+b) - 140 pure $ LineBezier $ map (+from) [a,b] + 138 forM pairs $ \(a,b) -> do + 139 from <- get <* modify (+b) + 140 pure $ LineBezier $ map (+from) [a,b] 141 SmoothQuadraticBezierCurveTo o lst -> mfix $ \result -> do 142 let ctrl = mbPrevControlPt : map cmdToControlPoint result 143 forM (zip lst ctrl) $ \(to, mbControl) -> do diff --git a/reanimate-0.4.1.0-inplace/Reanimate.Transform.hs.html b/reanimate-0.4.1.0-inplace/Reanimate.Transform.hs.html index 9c24b36..c9a8505 100644 --- a/reanimate-0.4.1.0-inplace/Reanimate.Transform.hs.html +++ b/reanimate-0.4.1.0-inplace/Reanimate.Transform.hs.html @@ -37,42 +37,42 @@ span.spaces { background: white } 18 type TMatrix = Matrix Coord 19 20 identity :: TMatrix - 21 identity = M.identity 3 + 21 identity = M.identity 3 22 23 fromList :: [Coord] -> TMatrix - 24 fromList [a,b,c,d,e,f] = M.fromList 3 3 [a,c,e,b,d,f,0,0,1] - 25 fromList _ = error "Reanimate.Transform.fromList: bad input" + 24 fromList [a,b,c,d,e,f] = M.fromList 3 3 [a,c,e,b,d,f,0,0,1] + 25 fromList _ = error "Reanimate.Transform.fromList: bad input" 26 27 transformPoint :: TMatrix -> RPoint -> RPoint - 28 transformPoint m (V2 x y) = V2 (a*x +c*y + e) (b*x + d*y +f) - 29 where - 30 !a = M.unsafeGet 1 1 m - 31 !c = M.unsafeGet 1 2 m - 32 !e = M.unsafeGet 1 3 m - 33 !b = M.unsafeGet 2 1 m - 34 !d = M.unsafeGet 2 2 m - 35 !f = M.unsafeGet 2 3 m + 28 transformPoint m (V2 x y) = V2 (a*x +c*y + e) (b*x + d*y +f) + 29 where + 30 !a = M.unsafeGet 1 1 m + 31 !c = M.unsafeGet 1 2 m + 32 !e = M.unsafeGet 1 3 m + 33 !b = M.unsafeGet 2 1 m + 34 !d = M.unsafeGet 2 2 m + 35 !f = M.unsafeGet 2 3 m 36 -- (a:c:e:b:d:f:_) = M.toList m 37 38 mkMatrix :: Maybe [Transformation] -> TMatrix - 39 mkMatrix Nothing = identity - 40 mkMatrix (Just ts) = foldl' (*) identity (map transformationMatrix ts) + 39 mkMatrix Nothing = identity + 40 mkMatrix (Just ts) = foldl' (*) identity (map transformationMatrix ts) 41 42 transformationMatrix :: Transformation -> TMatrix - 43 transformationMatrix transformation = - 44 case transformation of - 45 TransformMatrix a b c d e f -> fromList [a,b,c,d,e,f] - 46 Translate x y -> translate x y - 47 Scale sx mbSy -> fromList [sx,0,0,fromMaybe sx mbSy,0,0] - 48 Rotate a Nothing -> rotate a - 49 Rotate a (Just (x,y)) -> translate x y * rotate a * translate (-x) (-y) - 50 SkewX a -> fromList [1,0,tan (a*pi/180),1,0,0] - 51 SkewY a -> fromList [1,tan (a*pi/180),0,1,0,0] - 52 TransformUnknown -> identity - 53 where - 54 translate x y = fromList [1,0,0,1,x,y] - 55 rotate a = fromList [cos r,sin r,-sin r,cos r,0,0] - 56 where r = a * pi / 180 + 43 transformationMatrix transformation = + 44 case transformation of + 45 TransformMatrix a b c d e f -> fromList [a,b,c,d,e,f] + 46 Translate x y -> translate x y + 47 Scale sx mbSy -> fromList [sx,0,0,fromMaybe sx mbSy,0,0] + 48 Rotate a Nothing -> rotate a + 49 Rotate a (Just (x,y)) -> translate x y * rotate a * translate (-x) (-y) + 50 SkewX a -> fromList [1,0,tan (a*pi/180),1,0,0] + 51 SkewY a -> fromList [1,tan (a*pi/180),0,1,0,0] + 52 TransformUnknown -> identity + 53 where + 54 translate x y = fromList [1,0,0,1,x,y] + 55 rotate a = fromList [cos r,sin r,-sin r,cos r,0,0] + 56 where r = a * pi / 180 57 58 toTransformation :: TMatrix -> Transformation 59 toTransformation m = TransformMatrix a b c d e f