
Page 90
Epson Research and Development
Vancouver Design Center
S1D13A05
Programming Notes and Examples
X40A-G-003-04
Issue Date: 2002/08/21
9.2.8 Transparent Move BitBLT in Positive Direction
The Transparent Move BitBLT in Positive Direction combines the capabilities of the Move
BitBLT with the ability to define a transparent color. Use this operation to copy a masked
area of display memory to another area in display memory.
The source and the destination areas of the BitBLT may be either rectangular or linear.
Performing a rectangular to rectangular Move BitBLT creates an exact copy of one portion
of video memory at the second location. Selecting a rectangular source to linear destination
would be used to compactly store an area of displayed video memory into non-displayed
video memory. Later, the area could be restored by performing a linear source to rectan-
gular destination Move BitBLT.
The transparent color is not copied during this operation, whatever pixel color existed in
the destination will be there when the BitBLT completes. This allows fast display of non-
rectangular images. For example, consider a source bitmap having a red circle on a blue
background. By selecting the blue color as the transparent color and using the Transparent
Move BitBLT on the whole rectangle, the effect is a BitBLT of the red circle only.
Note
The Transparent Move BitBLT is supported only in a positive direction.
Example 15: Copy a 9 x 101 rectangle at the screen coordinates x = 100, y = 10 to
screen coordinates X = 200, Y = 20 using a 320x240 display at a color
depth of 16 bpp. Transparent color is blue.
1. Calculate the source and destination addresses (upper left corners of the source and
destination rectangles), using the formula:
SourceAddress
= (y
× ScreenStride) + (x × BytesPerPixel)
= (10
× (320 × 2)) + (100 × 2)
= 6600
= 19C8h
DestinationAddress = (Y
× ScreenStride) + (X × BytesPerPixel)
= (20
× (320 × 2)) + (200 × 2)
= 13200
= 3390h
where:
BytesPerPixel = 2 for 16 bpp
ScreenStride = DisplayWidthInPixels
× BytesPerPixel = 640 for 16 bpp
Program the BitBLT Source Start Address Register. REG[800Ch] is set to 19C8h.
Program the BitBLT Destination Start Address Register. REG[8010h] is set to 3390h.
2. Program the BitBLT Width Register to 9 - 1. REG[8018h] is set to 08h.
3. Program the BitBLT Height Register to 101 - 1. REG[801Ch] is set to 64h (100 deci-
mal).