📄 dp_api_command_functions.c
字号:
DP_NULL );
}
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
if ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR )
{
#else
if (( ui16CommandResult < DP_CRITICAL_ERROR_END_MARKER ) && ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR ))
{
#endif
ui16ReturnValue = ui16CommandResult;
}
#if defined DP_SIMULATION_MODE
sprintf ( &ai8DumpComment[0], "DP_SetDisplayEnabled returns %i \n", ui16ReturnValue );
printf ( ai8DumpComment );
PDumpComment( ai8DumpComment );
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_SetBackgroundColour
* Inputs : sBackgroundColour - A populated 'DP_RGBColour' structure containing the
* individual Red, Green and Blue colour elements of
* the new background colour setting.
* Outputs : None.
* Returns : DP_UINT_16 - Returns one of the defined display pipeline error
* codes, according to the success of the function and
* whether the compiler directive DP_ERROR_CHECKING
* is enabled. See API specification for more details
* on error types.
*
* Description : This function is used to specify the colour of the background plane. The
* background plane does not count as a 'plane' in the sense of the numbered
* planes to which commands can be applied. The background plane can have its
* main and border colours altered.
*
***********************************************************************************************/
DP_UINT_16 DP_SetBackgroundColour ( DP_RGBColour sBackgroundColour )
{
#if defined DP_ERROR_CHECKING
DP_UINT_16 ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16 ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif
DP_UINT_32 ui32BackgroundColour;
DP_UINT_16 ui16CommandResult;
#if defined DP_SIMULATION_MODE
sprintf ( &ai8DumpComment[0], "DP_SetBackgroundColour R = %03i G = %03i B = %03i \n", sBackgroundColour.ui8Red,
sBackgroundColour.ui8Green,
sBackgroundColour.ui8Blue );
printf ( ai8DumpComment );
PDumpComment( ai8DumpComment );
#endif
#if defined DP_ERROR_CHECKING
if ( !DP_bIsPipelineInitialised )
ui16ReturnValue = DP_ERR_NOT_INITIALISED;
/* else if.... (other tests here) */
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
ui32BackgroundColour = (sBackgroundColour.ui8Red << 16) +
(sBackgroundColour.ui8Green << 8) +
(sBackgroundColour.ui8Blue);
ui16CommandResult = DP_CommandSequence ( DP_COMMAND_SEQUENCE_OPERATIONS_SINGLE_COMMAND,
(DP_FieldTarget *) &DP_asGlobalFieldTargets [DP_GLOBAL_FIELD_BACKGROUND_COLOUR],
ui32BackgroundColour );
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
if ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR )
{
#else
if (( ui16CommandResult < DP_CRITICAL_ERROR_END_MARKER ) && ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR ))
{
#endif
ui16ReturnValue = ui16CommandResult;
}
#if defined DP_SIMULATION_MODE
sprintf ( &ai8DumpComment[0], "DP_SetBackgroundColour returns %i\n", ui16ReturnValue );
printf ( ai8DumpComment );
PDumpComment( ai8DumpComment );
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_SetBorderColour
* Inputs : sBorderColour - A populated 'DP_RGBColour' structure containing the
* individual Red, Green and Blue colour elements of
* the new background plane's border colour setting.
*
* Outputs : None.
* Returns : DP_UINT_16 - Returns one of the defined display pipeline error
* codes, according to the success of the function and
* whether the compiler directive DP_ERROR_CHECKING
* is enabled. See API specification for more details
* on error types.
*
* Description : This function is used to specify the colour of the background plane's border.
* The background plane does not count as a 'plane' in the sense of the numbered
* planes to which commands can be applied. The background plane can have its
* main and border colours altered.
*
***********************************************************************************************/
DP_UINT_16 DP_SetBorderColour ( DP_RGBColour sBorderColour )
{
#if defined DP_ERROR_CHECKING
DP_UINT_16 ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16 ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif
DP_UINT_16 ui16CommandResult;
DP_UINT_32 ui32BorderColour;
#if defined DP_SIMULATION_MODE
sprintf ( &ai8DumpComment[0], "DP_SetBorderColour R = %03i G = %03i B = %03i \n", sBorderColour.ui8Red,
sBorderColour.ui8Green,
sBorderColour.ui8Blue );
printf ( ai8DumpComment );
PDumpComment( ai8DumpComment );
#endif
#if defined DP_ERROR_CHECKING
if ( !DP_bIsPipelineInitialised )
ui16ReturnValue = DP_ERR_NOT_INITIALISED;
/* else if.... (other tests here) */
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
ui32BorderColour = (sBorderColour.ui8Red << 16) +
(sBorderColour.ui8Green << 8) +
(sBorderColour.ui8Blue);
ui16CommandResult = DP_CommandSequence ( DP_COMMAND_SEQUENCE_OPERATIONS_SINGLE_COMMAND,
(DP_FieldTarget *) &DP_asGlobalFieldTargets [DP_GLOBAL_FIELD_BORDER_COLOUR],
ui32BorderColour );
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
if ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR )
{
#else
if (( ui16CommandResult < DP_CRITICAL_ERROR_END_MARKER ) && ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR ))
{
#endif
ui16ReturnValue = ui16CommandResult;
}
#if defined DP_SIMULATION_MODE
sprintf ( &ai8DumpComment[0], "DP_SetBorderColour returns %i\n", ui16ReturnValue );
printf ( ai8DumpComment );
PDumpComment( ai8DumpComment );
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
* Function Name : DP_SetPixelColourFormat
* Inputs : ui16PlaneHandle - The handle (a sixteen bit number) by which the plane
* to be used is identified.
*
* ePixelFormat - Indicates the format according to which the source
* buffer data for the plane should be interpreted
* (i.e.: YUV, RGB, etc.)
*
* bCositedChromaSamples- In the case of the input data being a YUV format,
* this parameter indicates whether or not the chroma
* samples are offset from the luma samples, or aligned.
* Outputs :
* Returns : DP_UINT_16 - Returns one of the defined display pipeline error
* codes, according to the success of the function and
* whether the compiler directive DP_ERROR_CHECKING
* is enabled. See API specification for more details
* on error types.
*
* Description : Used to specify to the display pipeline the format of the data in the source
* frame buffer for the specified frame (i.e.: RGB, YUV, etc.)
*
***********************************************************************************************/
DP_UINT_16 DP_SetPixelColourFormat ( DP_UINT_16 ui16PlaneHandle,
DP_PixelColourFormats ePixelFormat,
DP_BOOL bCositedChromaSamples )
{
#if defined DP_ERROR_CHECKING
DP_UINT_16 ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16 ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif
DP_UINT_16 ui16CommandResult = DP_STANDARD_CODE_NO_ERROR;
DP_UINT_16 ui16TemporaryCommandResult;
#if defined DP_SIMULATION_MODE
sprintf ( &ai8DumpComment[0], "DP_SetPixelColourFormat Plane : %01i H/W val : %02i Offset chroma on / off : %01i \n",
ui16PlaneHandle,
DP_aui8ColourFormatModeVals [ ePixelFormat ],
(bCositedChromaSamples & 0x01) );
printf ( ai8DumpComment );
PDumpComment( ai8DumpComment );
#endif
#if defined DP_ERROR_CHECKING
if ( !DP_bIsPipelineInitialised )
ui16ReturnValue = DP_ERR_NOT_INITIALISED;
else if ( ui16PlaneHandle > DP_NO_OF_STREAMS )
ui16ReturnValue = DP_ERR_UNKNOWN_PLANE;
/* else if.... (other tests here) */
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
if ( ! DP_asStreamCapabilities [ ui16PlaneHandle ].abPixelModesSupported [ ePixelFormat ] )
ui16ReturnValue = DP_ERR_EXCEEDS_CAPABILITIES;
else
{
ui16CommandResult = DP_CommandSequence ( DP_COMMAND_SEQUENCE_OPERATIONS_SINGLE_COMMAND,
(DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_PIXEL_COLOUR_FORMAT ],
DP_aui8ColourFormatModeVals [ ePixelFormat ] );
#if defined DP_ERROR_CHECKING
if ( ui16CommandResult == DP_STANDARD_CODE_NO_ERROR )
{
#else
if (( ui16CommandResult > DP_CRITICAL_ERROR_END_MARKER ) || ( ui16CommandResult == DP_STANDARD_CODE_NO_ERROR ))
{
#endif
if ( !DP_asStreamCapabilities [ ui16PlaneHandle ].bIsCursor )
{
ui16TemporaryCommandResult = DP_CommandSequence ( DP_COMMAND_SEQUENCE_OPERATIONS_SINGLE_COMMAND,
(DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_COSITED_LUMA_SAMPLES ],
(DP_UINT_32) (bCositedChromaSamples & 0x01) );
/* Only bother checking the result of the offset luma parameter if the user is */
/* specifically trying to turn it on. */
if ( bCositedChromaSamples )
ui16CommandResult = ui16TemporaryCommandResult;
}
}
}
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
if ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR )
{
#else
if (( ui16CommandResult < DP_CRITICAL_ERROR_END_MARKER ) && ( ui16CommandResult != DP_STANDARD_CODE_NO_ERROR ))
{
#endif
ui16ReturnValue = ui16CommandResult;
}
#if defined DP_SIMULATION_MODE
sprintf ( &ai8DumpComment[0], "DP_SetPixelColourFormat returns %i\n", ui16ReturnValue );
printf ( ai8DumpComment );
PDumpComment( ai8DumpComment );
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_SetSourceAddress
*
* Inputs : ui16PlaneHandle - The handle (a sixteen bit number) by which the plane
* to be used is identified.
*
* eYUVStream - Certain planes can accept input data which is split
* into various components and, therefore, requires
* more than a single source buffer (for instance, non
* planar YUV requires three input buffers). This
* parameter is used to specify which source
* buffer is being controlled by this function call.
*
* pvSourceAddress - The address (as an absolute, non offset, value) of
* the source buffer being specified.
*
* ui16Stride - The stride of the image (defined as the number of
* bytes which must be read to move from a pixel to the
* pixel in the same horizontal position on the line
* below) specified in 16 BYTE words. In the case of
* planes using split source buffers, the stride is
* only read for the primary source buffer.
*
* bUVStrideHalved - Used to specify whether the stride of U and V
* planes is equal to or half that of the Y buffer.
* Only read when eYUVStream is set to 'DP_YUV_U' or
* 'DP_YUV_V'. The single flag applies to both the U
* and V buffers - setting it for either buffer sets
* it for both.
*
* eSourceDataType - Used to specify the manner in which the data in
* specified buffer should be considered by the
* display pipeline (i.e.: Progressive, Interlaced
* fields, etc.)
*
* Outputs : None.
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -