This repository has been archived by the owner on Jun 14, 2021. It is now read-only.
forked from damelang/gezira
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
89 lines (74 loc) · 3.94 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
- get SVG arc math (appox. using beziers) to Bert
- Make linear gradient API simpler
- General Gaussian blur
- Decimation filter
- cubic >> quadratic bezier kernel
- ExpandSpans looks funny (the second 'if' should be nested
in the first?) Under what conditions will 'c'overage be 0 (or neg?)
- stroke
- what about multiple stroke paths in the same stream? This would
allow for stroke-of-stroke-of-a...
- dashed lines (input path -> output several paths to stroker)
- rasterizer
- why is it so much slower for zoomed in snowflakes? Where is
the time spent? (horizontal line optimization below helps some)
- sortby is getting a reverse sorted stream (for x and/or y fields).
we could change decomposebeziers to recurse in increasing x/y
order (input prefixing)
- optimization: skip horizontal lines during decomposition:
if ¬(A.y = M.y ∧ M.y = C.y)
<< (M, B ~ C, C) << (A, A ~ B, M)
or, add extra stage before decomposebeziers to check for
horizontal lines
- (see sortby optimization proposal in nile repo, which makes
the shift copy happen as a group)
- optimization: coerce edgecontributions (with the same x and y)
into one, so that sortby can operate on fewer elements.
We only need to look at pairs in a stream. How much
difference does this make?
Try this in decomposebezier and also as a separate process
- optimization: how often do we get tiny beziers with
endpoints on opposite sides of the pixel square? We currently split
these, but could try not doing it (with effects on visual quality)
- optimization: the createspans could avoid sending down spans of
zero length or zero coverage (how much difference does this make?)
- compositing
- CompositeInverse might need to unpremultiply the colors first,
right now it only works on fully opaque images. The fact that
it ignores the SOURCE pixels might mean that it shouldn't be
compositor.
- consider issue with compositors clamping color channels
to 1 instead of clamping to the opacity (for Porter-Duff ops,
this is not a problem). Maybe define a color operator that
clamps alpha first, then uses that to clamp the other channels
(like a ^ operator for color)
- do any operators expect us to multiply the alpha in at the end?
- add a "premultiply" and "unpremultiply" operator?
- calculate bounds should have something like this at the end
for perfectly vertical, no-area shapes (coming out of clipping):
if min.x = max.x
>> (99999:Point, -99999:Point)
else
>> (min, max)
...or we just tell the user that the bounds are empty if:
min.x >= max.x \or min.y >= max.y
- Fix usage of '='. In bezier we want pairwise '=', in other
places we want a scalar result. Use '==' for the scalar result?
- more image effects
- CrazyOver (a : Real) : Color >> Color
∀ A
AA = A / A.a
{- B = (1, 3 × AA.g / 4, (2 × AA.b + 1) / 4, (3 × AA.r + 1 ) / 4) : Color -}
B = (1, 3 × AA.g / 4, 3 × AA.b / 4, (3 × AA.r + 1 ) / 4) : Color
{- B = (1, AA.g, AA.b, AA.r) : Color -}
{- B = (1, 2 × AA.r / 3, (2 × AA.g + 1) / 3, (2 - AA.b) / 3) : Color -}
{- B = (1, |AA.r - 0.5|, |AA.g - 0.5|, 1 - |AA.b - 0.5|) : Color -}
{- B = (1, |AA.r - 0.5|, 1 - |AA.g - 0.5|, 1 - AA.b) : Color -}
{- B = (1, 1 - |AA.r - 0.5| - 0.16, |AA.g - 0.5| + 0.16, 1 - AA.b) : Color -}
{- B = (1, | (| 2 × AA.r - 0.5 |) - 1 |, | 2 × AA.g - 1 |, 1 - | 2 × AA.b - 1 |) : Color -}
{- B = (1, (|2 × AA.r - 1| + 1) / 4, (|2 × AA.g - 1| + 1) / 4, (3 - |2 × AA.b - 1|) / 4) : Color -}
{- B = (1, (AA.g + 1) / 4, (AA.b + 1) / 4, (3 - AA.r) / 4) : Color -}
{- B = (1, AA.b / 2, AA.r / 2, 1 - AA.g / 2) : Color -}
{- B = (1, AA.r / 2, AA.g / 2, 1 - AA.b) : Color -}
C = a × B + (1 - a) × AA
>> (A.a, A.a × C.r, A.a × C.g, A.a × C.b)