4 draw (0, i * u) -- (w * u, i * u);
8 draw (i * u, 0) -- (i * u, h * u);
19 drawarrow D -- A withpen pencircle scaled 4;
20 draw A -- B withpen pencircle scaled 2;
21 draw B -- C withpen pencircle scaled 2;
22 drawarrow D -- C withpen pencircle scaled 4;
25 vardef pixel_coord(expr x, y) =
27 py := h * u - u/2 - u * y;
31 def fill_pixel(expr x, y, col) =
32 fill unitsquare scaled u shifted pixel_coord(x - 0.5, y + 0.5) withcolor col
41 dotlabel.top(btex (0, 0) etex, pixel_coord(0, 0));
42 dotlabel.top(btex (w-1, h-1) etex, pixel_coord(w-1, h-1));
43 dotlabel.urt(btex (1.5, 2) etex, pixel_coord(1.5, 2));
51 fill_pixel(i, ly, (0.6, 0.6, 1));
54 dotlabel.top(btex (5, 3) etex, pixel_coord(lxs, ly));
55 dotlabel.top(btex (9, 3) etex, pixel_coord(lxe, ly));
66 dotlabel.top(btex (0, 0) etex, pixel_coord(0, 0));
70 fill_pixel(i, j, (0.6, 1, 0.6));
75 dotlabel.top(btex (2, 1) etex, pixel_coord(2, 1));
76 dotlabel.top(btex (9, 4) etex, pixel_coord(9, 4));