DXGK_GDIARG_ALPHABLEND structure (d3dkmddi.h)

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

Syntax

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

Members

[in] SrcRect

A RECT structure that defines the rectangular area to be copied. This source 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. This 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. See Remarks for more information.

[in] DstRect

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.

[in] SrcAllocationIndex

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

[in] DstAllocationIndex

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

[in] NumSubRects

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

[in] pSubRects

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

[in] SourceConstantAlpha

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.

[in] SourceHasAlpha

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.

[in] SrcPitch

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)</code></pre>

Requirements

Requirement Value
Minimum supported client Windows 7
Header d3dkmddi.h (include D3dkmddi.h)

See also

RECT