DXVAHD_STREAM_STATE_ALPHA_DATA structure (dxvahd.h)

Specifies the planar alpha value for an input stream, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

Syntax

typedef struct _DXVAHD_STREAM_STATE_ALPHA_DATA {
  BOOL  Enable;
  FLOAT Alpha;
} DXVAHD_STREAM_STATE_ALPHA_DATA;

Members

Enable

If TRUE, alpha blending is enabled. Otherwise, alpha blending is disabled. The default state value is FALSE.

Alpha

Specifies the planar alpha value as a floating-point number from 0.0 (transparent) to 1.0 (opaque).

If the Enable member is FALSE, this member is ignored.

Remarks

For each pixel, the destination color value is computed as follows:

Cd = Cs * (As * Ap * Ae) + Cd * (1.0 - As * Ap * Ae)

where

  • Cd = Color value of the destination pixel.
  • Cs = Color value of source pixel.
  • As = Per-pixel source alpha.
  • Ap = Planar alpha value.
  • Ae = Palette-entry alpha value, or 1.0 (see Note).
Note  Palette-entry alpha values apply only to palettized color formats, and only when the device supports the DXVAHD_FEATURE_CAPS_ALPHA_PALETTE capability. Otherwise, this factor equals 1.0.
 
The destination alpha value is computed according to the DXVAHD_BLT_STATE_ALPHA_FILL state. For more information, see DXVAHD_BLT_STATE_ALPHA_FILL_DATA.

To get the device capabilities, call IDXVAHD_Device::GetVideoProcessorDeviceCaps and check the FeatureCaps member of the DXVAHD_VPDEVCAPS structure.

Examples

HRESULT DXVAHD_SetPlanarAlpha(
    IDXVAHD_VideoProcessor *pVP,
    UINT stream,
    BOOL bEnable,
    float fAlpha
    )
{
    DXVAHD_STREAM_STATE_ALPHA_DATA alpha = { bEnable, fAlpha };

    HRESULT hr = pVP->SetVideoProcessStreamState(
        stream,
        DXVAHD_STREAM_STATE_ALPHA,
        sizeof(alpha),
        &alpha
        );

    return hr;
}

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Header dxvahd.h

See also

DXVA-HD

DXVAHD_STREAM_STATE

Direct3D Video Structures

IDXVAHD_VideoProcessor::SetVideoProcessStreamState

Media Foundation Structures