add layer field to app type, as preparation for switching to layer tree
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
structure LayerTree =
|
||||
struct
|
||||
type square = {r: int, g: int, b: int, a: int}
|
||||
val emptyPixel = {r = 0, g = 0, b = 0, a = 0}
|
||||
|
||||
type grid = square vector vector
|
||||
|
||||
fun isBlank ({a, ...}: square) = a = 0
|
||||
|
||||
datatype tree =
|
||||
NODE of {key: int, value: grid, left: tree, right: tree}
|
||||
| LEAF
|
||||
|
||||
val emptyPixel = {r = 0, g = 0, b = 0, a = 0}
|
||||
|
||||
val emptyTree = LEAF
|
||||
|
||||
fun isBlank ({a, ...}: square) = a = 0
|
||||
|
||||
fun insert (newKey, newValue, tree) =
|
||||
case tree of
|
||||
LEAF => NODE {key = newKey, value = newValue, left = LEAF, right = LEAF}
|
||||
|
||||
Reference in New Issue
Block a user