reset password
Author Message
leannedavid
Posts: 14
Posted 10:09 Nov 29, 2016 |

Page 465 in the book:

9.3.5: Drawing multiple colors in XOR mode
Suppose the frame buffer supports 3 bits per pixel. Describe what color is observed when the pixel value 110 is XOR-ed with each of the possible pixel values.

 

9.3.6 Drawing twice in XOR mode equals not drawing at all
Show, for any pixel colors A and B, that drawing B twice in XOR mode leaves A unchanged. That is, show that: (A XOR B) XOR B is A itself.

 

9.3.7 Symmetric operators
Note that the OR operation is symmetric: A OR B is the same as B OR A. Which of the 16 operators ⊕ is symmetric in the sense that a ⊕ b  = b ⊕ a?

 

9.3.8 Swapping two images in place
Show that two pixmaps A and B may be interchanged by performing the following three XOR combinations. When the process is complete, A contains the pixel values originally held by B, and vice versa.

A = A XOR B
B = A XOR B
A = A XOR B

 

9.3.9 Reverse-mode drawing
Drawing a pattern in reverse mode can also be used to erase a line and restore the original pixel values. A b-bit frame buffer has N = 2b possible pixel values, ranging from 0 to 2b - 1. To draw a pixel d in reverse mode replace d with the value f(d) = N - d. Note that this drawing function is an involution: drawing twice restores the original, because f(f(d)) = N - f(d) = N - (N - d) = d. Describe how this technique operates for rubber-band drawing, and what colors are seen along the rubber-band line as it crosses pixels of various colors. Is it the same as drawing in XOR mode? For a single bit-plane, (b = 1), what is the difference between reverse mode and XOR drawing?