
Video Compositing
Quadro SDI Output PG-03776-001_v06 | 43
In configuration of the SDI device, alpha compositing is enabled as follows:
l_vioConfig.fields = 0;
l_vioConfig.fields = NVVIOCONFIG_COMPOSITE;
l_vioConfig.vioConfig.outConfig.enableComposite = TRUE;
l_vioConfig.fields = NVVIOCONFIG_ALPHAKEYCOMPOSITE;
l_vioConfig.vioConfig.outConfig.enableAlphaKeyComposite |= TRUE;
if (NvAPI_VIO_SetConfig(m_vioHandle, &l_vioConfig)!= NVAPI_OK) {
return E_FAIL;
}
OpenGL must be configured to provide an alpha channel to the SDI device. In the case
of sending pbuffer data with
WGL/GLX_send_video this is done by specifying
VIDEO_OUT_COLOR_AND_ALPHA to the bind command as follows:
// Bind pbuffer to video device.
if (!wglBindVideoImageNV(ghpDevList[0], gPBuffer.getHandle(),
WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV)) {
// Handle error.
}
In the case of the GL_present_video extension, the format of the buffer object or texture
must contain an alpha channel. Typical formats to create such a buffer object or texture
would be either
GL_RGBA8 or GL_RGBA16F_ARB.
7.2 CHROMA-KEYING
To perform chroma keying, the application can specify up to two (Cr,Cb) pairs that
represent the starting and ending chroma values for replacement within the video
stream. Chroma keying is enabled with the ranges specified using the control API as
follows.
// Cr composite ranges
l_vioConfig.fields = 0; // reset fields
l_vioConfig.fields = NVVIOCONFIG_COMPOSITE |
NVVIOCONFIG_COMPOSITE_CR;
l_vioConfig.vioConfig.outConfig.enableComposite = TRUE;
l_vioConfig.vioConfig.outConfig.compRange.uEnabled = TRUE;
l_vioConfig.vioConfig.outConfig.compRange.uRange = 0;
l_vioConfig.vioConfig.outConfig.compRange.uMin = crCompRange[0];
l_vioConfig.vioConfig.outConfig.compRange.uMax = crCompRange[1];
if (NvAPI_VIO_SetConfig(m_vioHandle, &l_vioConfig)!= NVAPI_OK) {
return E_FAIL;
}
l_vioConfig.vioConfig.outConfig.compRange.uRange = 1;
Comentários a estes Manuais