loading of frame cache values
The last step in implementing the segment and other object display functions is to set the color value of the frame cache. Because the scan conversion algorithm generates pixel locations at a continuous unit interval, the scan conversion algorithm can use an incremental approach to efficiently access the frame cache at each step.
as a special example, assume that the frame cache matrix is addressed in the main order of behavior, and that the pixel position is from the top left of the screen( 0,0) changes to the upper right-hand side of the screen (Xmax,yMax)(see Figure 3.14). For level two systems (1 bits per pixel), pixel position (x, y)the frame cache bit address can be computed like this:
The frame cache address at the pixel (x+l, y) can be computed based on the address offset of the location (x, y) as it moves along the scan line:
from (x, y) to the next scan line in diagonal direction, then (X+l, Y+l) the frame cache address of the equation is
where the constant xmxa+2 is only counted once for all segments. Similarly, the x and y negative sides of the screen can be obtained from the equation (3.23)calculates the increment of the unit step. This address calculation contains only one integer addition.
The method of implementing a SetPixel program that stores pixel luminance values depends on the capabilities of the particular system and the design requirements of the package. ForA system that can display a range of luminance values for each pixel, and the calculation of the frame cache address includes the pixel width (number of bits) and the pixel screen position.
Computer Graphics (ii) loading of _5_ frame cache values for output elements