Expand Minimize

DXGK_GDIARG_ALPHABLEND structure

The DXGK_GDIARG_ALPHABLEND structure describes the characteristics of a GDI hardware-accelerated alpha blend operation.

Syntax


typedef struct _DXGK_GDIARG_ALPHABLEND {
  RECT    SrcRect;
  RECT    DstRect;
  UINT    SrcAllocationIndex;
  UINT    DstAllocationIndex;
  UINT    NumSubRects;
  RECT    *pSubRects;
  BYTE    SourceConstantAlpha;
  BOOLEAN SourceHasAlpha;
  UINT    SrcPitch;
} DXGK_GDIARG_ALPHABLEND;

Members

SrcRect

[in] A RECT structure that defines the rectangular area to be copied. This rectangle is specified in the coordinate system of the source surface and is defined by two points: upper left and lower right. The two points that define the rectangle are always well ordered.

The source rectangle will never exceed the bounds of the source surface, so it will never overhang the source surface.

This rectangle is mapped to the destination rectangle defined by DstRect.

For more information, see the Remarks section.

DstRect

[in] A RECT structure that defines the rectangular area to be modified. This rectangle is specified in the coordinate system of the destination surface and is defined by two points: upper left and lower right. The rectangle is lower-right exclusive; that is, its lower and right edges are not a part of the bit-block transfer. The two points that define the rectangle are always well ordered.

The destination rectangle defined by DstRect can exceed the bounds of the destination surface, but sub-rectangles cannot. Additionally, all sub-rectangles are guaranteed to fit inside the destination surface. Sub-rectangles can be constrained further by a bounding rectangle that is smaller than the destination rectangle.

For more information, see the Remarks section.

SrcAllocationIndex

[in] An index of the element in the allocation list that specifies the allocation that is referenced by the SrcRect source rectangle.

DstAllocationIndex

[in] An index of the element in the allocation list that specifies the allocation that is referenced by the DstRect destination rectangle.

NumSubRects

[in] The number of sub-rectangles in the destination surface space that is bounded by the DstRect destination rectangle.

pSubRects

[in] A pointer to the sub-rectangles in the destination surface space.

SourceConstantAlpha

[in] The constant blend factor to apply to the entire source surface. This value is in the range of [0,255], where 0 is completely transparent and 255 is completely opaque.

SourceHasAlpha

[in] Defines whether the surface is assumed to have an alpha channel. If TRUE, the surface is assumed to have an alpha channel; otherwise the value is FALSE.

SrcPitch

[in] The pitch of the source surface, in bytes.

Remarks

If a stretch bit-block transfer (bitblt) operation is required, the x and y stretch ratios are computed respectively as the ratios of the x and y sizes of the DstRect and SrcRect members, and the stretch operation will proceed as if the COLORONCOLOR value in Wingdi.h is set. On a shrinking bit-block transfer, enough pixels should be ignored so that pixels do not need to be combined. On a stretching bit-block transfer, pixels should be replicated.

When sub-rectangles are transformed to the source surface space, the result is guaranteed to be within the source surface. The transformation of a sub-rectangle's coordinates in the destination surface to coordinates in the source surface is defined by the following formulas, where

  • (Xd, Yd) is a point inside the sub-rectangle
  • (Xs, Ys) is a point inside the source rectangle
float Ws = SrcRect.right – SrcRect.left;
float Wd = DstRect.right – DstRect.left;
int Xs = round((Xd – DstRect.left + 0.5) * Ws/Wd + SrcRect.left – 0.5)
OR
int Xs = truncate((Xd – DstRect.left + 0.5) * Ws/Wd + SrcRect.left)

float Hs = SrcRect.bottom – SrcRect.top;
float Hd = DstRect.bottom – DstRect.top;
int Ys = round((Yd – DstRect.top + 0.5) * Hs/Hd + SrcRect.top – 0.5)
OR
int Ys = truncate((Yd – DstRect.top + 0.5) * Hs/Hd + SrcRect.top)

Requirements

Version

Available in Windows 7 and later versions of the Windows operating systems.

Header

D3dkmddi.h (include D3dkmddi.h)

See also

RECT

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft