Pattern Fill Bitblt With Transparency - Epson S1D13506 Technical Manual

Color lcd/crt/tv controller
Table of Contents

Advertisement

Epson Research and Development
Vancouver Design Center

10.2.10 Pattern Fill BitBLT with Transparency

Programming Notes and Examples
Issue Date: 02/03/21
The Pattern Fill BitBLT with Transparency fills a specified rectangular area of the display
buffer with a pattern. When a transparent color is selected, pattern pixels of the transparent
color will not get copied, allowing creation of hatched patterns. The fill pattern is an eight
by eight array of pixels stored in off-screen display buffer. The fill pattern must be loaded
to off-screen display buffer prior to the BitBLT starting.
The pattern itself must be stored in a consecutive array of pixels. As a pattern is defined to
be eight pixels square, this results in 64 consecutive bytes for 8 bpp color depths and 128
bytes for 15/16 bpp color depths. For 8 bpp color depths the pattern must begin on a 64 byte
boundary, for 15/16 bpp color depths the pattern must begin on a 128 byte boundary.
To fill an area using the Pattern Fill BitBLT with Transparency, the blit engine requires the
location of the pattern, the destination rectangle position and size, and the transparency
color. The blit engine also needs to know which pixel from the pattern is the first pixel in
the destination rectangle (the pattern start phase). This allows seamless redrawing of any
part of the screen using the pattern fill.
Example 17: Fill a 100 x 250 rectangle at the screen coordinates x = 10, y = 20 with
the pattern in off-screen memory at offset 10000h using a 640x480 dis-
play at a color depth of 8 bpp. The first pixel (upper left corner) of the
rectangle is the pattern pixel at x = 3, y = 4. Transparent color is blue (as-
sumes LUT index 1).
1. Calculate the destination address (upper left corner of destination rectangle), using the
formula:
DestinationAddress = (y × ScreenStride) + (x × BytesPerPixel)
where:
BytesPerPixel = 1 for 8 bpp
BytesPerPixel = 2 for 15/16 bpp
ScreenStride = DisplayWidthInPixels × BytesPerPixels = 640 for 8 bpp
Program the BitBLT Destination Start Address Registers. REG[10Ah] is set to 00h,
REG[109h] is set to 32h, and REG[108h] is set to 0Ah.
2. Calculate the source address. This is the address of the pixel in the pattern that is the
origin of the destination fill area. The pattern begins at offset 1M, but the first pattern
pixel is at x = 3, y = 4. Therefore, an offset within the pattern itself must be calculated.
SourceAddress
= PatternOffset + StartPatternY × 8 × BytesPerPixel + StartPatternX × BytesPerPixel
= 1M + (4 × 8 × 1) + (3 × 1)
= 1M + 35
= 1048611
= 100023h
= (20 × 640) + (10 × 1)
= 12810
= 320Ah
Page 87
S1D13506
X25B-G-003-04

Advertisement

Table of Contents
loading

Table of Contents