![background image](http://html.mh-extra.com/html/texas-instruments/tvp4020-permedia-2/tvp4020-permedia-2_reference-manual_1097169066.webp)
TVP4020
Programmers Reference Manual
Graphics Programming
57
Since the downloaded bitmask data will be ANDed with masks
generated by the Rasterizer without any re-alignment being performed, it
is up to the host software to ensure that the masks match up. This can
be achieved in two ways. First, the host software can align the bits that it
downloads to match the alignment of the Rasterizer. A faster way is to
use the User Scissor. This is the recommended method. Note that this is
a general algorithm. In the special case where the data to be
downloaded is already aligned to 32 bits on both the left and right edges
then the scissor need not be used.
For example, suppose that we want to download data to fill a rectangle
with left edge at 10 and right edge at 200. And further, assume that the
host bitmap data is to be loaded from an offset of 35 within the bitmap.
Our goal is to match the bit at offset 35 with the pixel at offset 10.
Since we want to do the least amount of work on the host by avoiding
shifting the data, we will actually download the host bitmap data at the
previous 32-bit boundary. This means that we must set P
ERMEDIA
up to
discard the first 3 bits of data. We achieve this by rasterizing a rectangle
whose left edge is 3 pixels less than that required, in this case we would
rasterize the left edge to start at pixel 7. This causes the source bitmap
data to be correctly aligned with the mask data produced by the
Rasterizer. But, in order to protect the 3 pixels that we would otherwise
overwrite, we use the scissor clip and set its bounds to be those of the
original rectangle.
When using a block write operation like this, the Rasterizer will wait for
new bitmask data to be downloaded at the start of each scanline. So we
do not have to perform the alignment operation on the right hand edge.
A similar algorithm can be used to implement fast text rendering. For
example, for fonts where each line fits into 32 bits, each line of a glyph
can be downloaded as a mask.
Block writes can be used in combination with bitmasks with
InvertBitMask and/or MirrorBitMask options but not BitMaskOffset or
BitMaskPacking.
5.3.10
Copy/Upload/Download
P
ERMEDIA
supports three "pixel rectangle" operations: copy, upload and
download. These can apply to all buffer types.
Typically, a P
ERMEDIA
copy moves
raw blocks of data around buffers. To
zoom or re-format data, either external software must upload the data,
process it and then download it again, or the texture part of the
Texture/Fog/Blend unit should be used.
To copy a rectangular area, the Rasterizer would be configured to
render the destination rectangle, thus generating fragments for the area
Summary of Contents for TVP4020 PERMEDIA 2
Page 1: ...Texas Instruments TVP4020 PERMEDIA 2 Programmer s Reference Manual Issue 4 ...
Page 284: ...TVP4020 Programmers Reference Manual A Gouraud Shaded Triangle 275 ...
Page 292: ...TVP4020 Programmers Reference Manual Register Tables 283 ...
Page 314: ...TVP4020 Programmers Reference Manual Index 305 ...
Page 315: ...Index TVP4020 Programmers Reference Manual 306 Index ...
Page 323: ...Index TVP4020 Programmers Reference Manual 314 ...