
Advanced Topics
Quadro SDI Output PG-03776-001_v06 | 55
Code Listing 42: Configuring Desktop Video Output
// Open the SDI device for desktop output
if (NvAPI_VIO_Open(hVIO, NVVIOCLASS_SDI, NVVIOOWNERTYPE_DESKTOP)
!= NVAPI_OK) {
return E_FAIL;
}
// Configure video output parameters
NVVIOCONFIG l_vioConfig;
memset(&l_vioConfig, 0, sizeof(l_vioConfig));
l_vioConfig.version = NVVIOCONFIG_VER;
l_vioConfig.fields = NVVIOCONFIG_SIGNALFORMAT |
NVVIOCONFIG_DATAFORMAT |
NVVIOCONFIG_OUTPUTREGION;
// Video output signal format
l_vioConfig.vioConfig.outConfig.signalFormat =
NVVIOSIGNALFORMAT_720P_5994_SMPTE274;
// Video output data format
l_vioConfig.vioConfig.outConfig.dataFormat =
NVVIODATAFORMAT_R8G8B8_TO_YCRCB422;
// Desktop region to output
NVVIOOUTPUTREGION l_vioOutputRegion;
l_vioOutputRegion.x = gX;
l_vioOutputRegion.y = gY;
l_vioOutputRegion.width = 1280;
l_vioOutputRegion.height = 720;
// Set configuration
if (NvAPI_VIO_SetConfig(hVIO, &l_vioConfig) != NVAPI_OK) {
return E_FAIL;
}
10.3 COLOR SPACE CONVERSION
The Quadro SDI automatically performs ITU Rec. 601 or 709 color space conversion
from RGB to YCrCb when required by the specified data format. This color space
conversion is performed according to the following formula:
Y = offset
Y + scaleY * (ry*R + gy*G + by*B)
Cb = offset
cb + scalecb * (rcb*R + gcb*G + bcb *B)
Cr = offset
cr + scalecr * (rcr*R + gcr*G + bcr*B)
where scale controls the magnitude of the resulting output range and offset controls the
position of the result within that range. These values should be within -1.0 and 1.0.
Kommentare zu diesen Handbüchern