Title: Semantics For Pictures
1Semantics For Pictures
- COS 441
- Princeton University
- Fall 2004
2A 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
3Concepts
- Point A location on R2
- 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
4Concepts (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
5Picture Syntax
6Points
(1,1)
(0,0)
7Shapes Everything
8Shapes Nothing
9 Shapes Ellipse
1
2
(0,0)
ellipse((0,0),1,2)
10Shapes Half Planes
(1,1)
(0,0)
halfplane((0,0),(1,1))
11Shapes Half Plane
(1,1)
(0,0)
halfplane((1,1),(0,0))
12Composite Shapes
1
1
(0,0)
(0,1)
intersect(ellipse((0,0),1,1),halfplane((0,0),(0,1)
)
13Polygon as Shapes
intersect(halfplane((0,0),(0,1),
intersect(halfplane((0,1),(1,1),
halfplane((1,1),(0,0)))
14Red Texture
15Layer
1
1
(0,0)
layer(ellipse((0,0),1,1),red)
16Picture
1
layer(ellipse((0,0),1,1),red) B
layer(ellipse((1,0),1,1),green)
17Miscellaneous Operators
- Set operators on shapes
- Intersection, Union, Difference
- Scaling and Translation on shape coordiates
18Formal Semantics
19Formal Semantics (cont.)
20A Simple Theorem
21More Theorems
22(No Transcript)
23 Scaling and Translation Thms.
24 Scaling and Translation Thms.
25Optimizations
- 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