ID3D11VideoContext::VideoProcessorSetStreamAlpha method (d3d11.h)

Sets the planar alpha for an input stream on the video processor.

Syntax

void VideoProcessorSetStreamAlpha(
  ID3D11VideoProcessor *pVideoProcessor,
  UINT                 StreamIndex,
  BOOL                 Enable,
  FLOAT                Alpha
);

Parameters

pVideoProcessor

A pointer to the ID3D11VideoProcessor interface. To get this pointer, call ID3D11VideoDevice::CreateVideoProcessor.

StreamIndex

The zero-based index of the input stream. To get the maximum number of streams, call ID3D11VideoProcessorEnumerator::GetVideoProcessorCaps and check the MaxStreamStates structure member.

Enable

Specifies whether alpha blending is enabled.

Alpha

The planar alpha value. The value can range from 0.0 (transparent) to 1.0 (opaque). If Enable is FALSE, this parameter is ignored.

Return value

None

Remarks

To use this feature, the driver must support stereo video, indicated by the D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALHPA_STREAM capability flag. To query for this capability, call ID3D11VideoProcessorEnumerator::GetVideoProcessorCaps.

Alpha blending is disabled by default.

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

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

where:

  • Cd = The color value of the destination pixel
  • Cs = The color value of the source pixel
  • As = The per-pixel source alpha
  • Ap = The planar alpha value
  • Ae = The 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 D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_PALETTE capability. Otherwise, this factor equals 1.0.
 
The destination alpha value is computed according to the alpha fill mode. For more information, see ID3D11VideoContext::VideoProcessorSetOutputAlphaFillMode.

Requirements

   
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header d3d11.h

See also

ID3D11VideoContext