Graphics Reference
In-Depth Information
ately and then cycling through the areas by changing the origin registers
appropriately.
Comparing the second and third methods, we see that the second has full reso-
lution but allows a limited number of colors whereas the third has low resolution but
offers full use of colors.
Some graphics systems supported small fixed-size rectangular pixel blocks that
are maintained separately from the frame buffer but can be superimposed on it by
the hardware. These are called sprites and were common in the hardware for video
games. Using sprites it is very fast to move small images around on the screen without
disturbing the background simply by changing some registers that specify the address
in the frame buffer at which to show the sprite. Some simple video games consisted
entirely of sprites moving over a fixed background. Collisions can be checked very
easily. Sprites can also be implemented in software using bitBlt operations, although
this will obviously not be as fast.
Finally, to get a smooth animation sequence, one needs to generate a minimum
of 10-15 frames per second but this depends on the complexity of the scene and one
probably wants more like 24-30 frames per second. Aside from the fact that writing
large blocks of data takes time and would slow down any animation, there is an addi-
tional problem for CRTs that we have mentioned before. One has to be very careful
about when and what one writes to the frame buffer if one wants to avoid flicker. It
might be much better to create a complete image in an auxiliary buffer and then copy
it to the frame buffer in one fell swoop. The only problem is that the copy operation
would involve so much memory that it would not be fast enough and there would still
be flicker. To avoid this copying most graphics systems on PCs now support what is
called double buffering , that is, the auxiliary buffer one wants to write to is actually
part of the graphics system (not part of main memory) and rather than copying it to
the frame buffer, the hardware allows one to switch the scanning of the electron beam
between it and the initial frame buffer. The changeover becomes almost instantaneous
and the flicker will be gone. Of course, if it takes too long to compute each image,
then the animation would be jerky.
Graphics systems nowadays have lots of memory on board and support all kinds
of extra buffers. We shall have some more to say about this later in Chapter 9.
2.12
E XERCISES
Section 2.2
Find the various integers k so that there are k-neighbors in Z 4 .
2.2.1
Prove that every 8-component of a subset of Z 2 is the union of 4-components.
2.2.2
Section 2.5.1
2.5.1.1
Determine the points generated by the simple and symmetric DDA for the line segment
from (2,6) to (-1,1). Make a table and also plot these points (both the real and integer
ones).
Search WWH ::




Custom Search