BOOL EngBitBlt(
IN SURFOBJ *psoDst, | |
IN SURFOBJ *psoSrc, | |
IN SURFOBJ *psoMask, | |
IN CLIPOBJ *pco, | |
IN XLATEOBJ *pxlo, | |
IN RECTL *prclDst, | |
IN POINTL *pptlSrc, | |
IN POINTL *pptlMask, | |
IN BRUSHOBJ *pbo, | |
IN POINTL *pptlBrush, | |
IN ROP4 rop4 | |
); |
EngBitBlt provides general bit-block transfer capabilities either between device-managed surfaces, or between a device-managed surface and a GDI-managed standard format bitmap.
The mask is large enough to cover the destination rectangle.
If the value of this parameter is null and a mask is required by the rop4,
then the implicit mask in the brush is used. If a mask is required, then psoMask
overrides the implicit mask in the brush.
EngBitBlt is never called with an empty destination rectangle. The two
points that define the rectangle are always well ordered.
This is a quaternary raster operation, which is a natural extension of the usual ternary Rop3 operation. A Rop4 has 16 relevant bits, which are similar to the 8 defining bits of a Rop3. (The other, redundant bits of the Rop3 are ignored.) The simplest way to implement a Rop4 is to consider its 2 bytes separately. The lower byte specifies a Rop3 that should be computed wherever the mask is 1. The high byte specifies a Rop3 that can be computed and applied wherever the mask is 0.
The return value is TRUE if the function is successful. Otherwise, it is FALSE, and an error code is logged.
If a device’s surface is organized as a standard-format bitmap, the driver can request that GDI perform the bit-block transfer by calling EngBitBlt. A driver might do this if it has special hardware to handle simple transfers quickly, but doesn’t want to handle calls with complicated transfers.
GDI services reduce clipping to a series of clip rectangles. A translation vector assists in color index translation for palettes.
If the source surface is palette-managed, its colors are represented by indices into an array of RGB colors. The XLATEOBJ can be queried for a translate vector that allows the driver to quickly translate any source index into a color index for the destination.
The situation is more complicated when, for example, the source is RGB, but the destination is palette-managed. In this case, the closest match for each source RGB value must be found in the destination palette. The XLATEOBJ contains the address of a service routine to perform this operation.
Optionally, the driver can match colors when the target palette is the default device palette.
See the Win32 SDK for more information on raster operations.
BRUSHOBJ, BRUSHOBJ_pvGetRbrush, CLIPOBJ, DrvBitBlt, EngAssociateSurface, SURFOBJ, XLATEOBJ