13.07.2015 Views

Advanced Micro Devices - FTP

Advanced Micro Devices - FTP

Advanced Micro Devices - FTP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 6Software6.2.4 TransparencyTI has defined a logical operation called transparency.This involves executing copy block only for pixels wherethe source is not zero. This buys two things:I. You can build up your destination in layers with the mostrecent information on top, providing a type of visualpriority. (Using a straight Copy Block obscures the oldlayers).II. No new colors are created which might distort thereadability or change the intended meaning of colorcoded information. (Observe that using logical operationsto merge information does just that. So does controllingthe activity bits to write only selected planes).The String instruction can do exactly what is called forhere. If you use an SOAXZ field of 101 (Graphical Set)and a single plane font, then the character will be writteninto all planes wherever there is a one in the font. Anyplace there is a zero in the font, the pixel will not bewritten, allowing the data that is underneath to comethrough.The drawing instructions (Line, Point, etc) also do thisverywell. Using aSOAXZfieldof 1 01 (Graphical Set), thedrawing colorwill be written into all bit planes everywherethe object exists. This also works properly for singleplane PELs.For Copy Block, the Situation may be slightly morecomplex. If the source is a single plane, the Graphical Setdoes exactly the correct thing: everywhere the source isa one, all the planes of the destination will be written withthe current drawing color.It is more interesting if the source image contains severalcolors and the application wants to copy all of them to thedestination without overlaying anything where the sourceis all zeroes. In this case, we cannot use a single planesource because of the multiple color situation. Onemethod is:1. Make a copy of the source (if it needs to be preserved).2. Copy the destination to the source matching on afield of all zeroes.3. Copy the source to the destination.A third example involves the case where all pixels of asingle color are to be copied from the source block, but noothers. The solution involves the self-canceling effect ofexclusive OR.1. Copy the source to a temporary region.2. Copy the source to temporary with logical XOR,matching on the desired color.3. Copy the source to temporary with logical XOR.This leaves all pixels, except those of the desiredcolor, at zero.4. Choose a plane whose color bit for the desiredcolor is a one and execute a single plane copyfrom temporary to the destination. Use GraphicalSet with drawing color set to the desired color.6-8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!