Semantics For Pictures COS 441 Princeton University Fall 2004
A Simple Picture Language Provide rigorous denotational semantics –Resolution and device independent specification Not about how to draw a picture but about what a picture is Start with informal concepts then dive into semantics
Concepts Point – A location on R 2 Shape – A set of points Color – red, blue, green, etc… Texture – An assignment of color to every point on the plane Layer – A partial assignment of colors to points on the plane
Concepts (cont.) Picture – An order collection of layers Image – A total assignment of colors to every point on the plane. e.g. A picture with a default background
Picture Syntax
Points (1,1) (0,0)
Shapes: Everything
Shapes: Nothing
Shapes: Ellipse (0,0) 2 1 ellipse((0,0),1,2)
Shapes: Half Planes (1,1) (0,0) halfplane((0,0),(1,1))
Shapes: Half Plane (1,1) (0,0) halfplane((1,1),(0,0))
Composite Shapes (0,0) 1 1 (0,1) intersect(ellipse((0,0),1,1),halfplane((0,0),(0,1))
Polygon as Shapes intersect(halfplane((0,0),(0,1), intersect(halfplane((0,1),(1,1), halfplane((1,1),(0,0)))
Red Texture
Layer (0,0) 1 1 layer(ellipse((0,0),1,1),red)
Picture 1 layer(ellipse((0,0),1,1),red) B layer(ellipse((1,0),1,1),green)
Miscellaneous Operators Set operators on shapes –Intersection, Union, Difference Scaling and Translation on shape coordiates
Formal Semantics
Formal Semantics (cont.)
A Simple Theorem
More Theorems
Scaling and Translation Thms.
Optimizations We can systematically remove every scaling and translation operation to obtain an equivalent picture Removing scaling and translation can speed up rasterizing of image by removing unneeded computations