📄 dp_api_query_functions.c
字号:
* on error types.
*
* Description : This function is used to establish whether the specified plane is currently
* using source graphics wrapping.
*
***********************************************************************************************/
DP_UINT_16 DP_GetGraphicsWrapping ( DP_UINT_16 ui16PlaneHandle,
DP_PBOOL pbWrappingEnabled )
{
#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 ui32FieldAsRead;
#if defined DP_SIMULATION_MODE
printf ("\n DP_GetGraphicsWrapping \n");
#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
/* Read the field value */
ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_GRAPHICS_WRAPPING_ENABLED],
&ui16ReturnValue );
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
*pbWrappingEnabled = (DP_BOOL) (ui32FieldAsRead & 0x01);
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
}
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_GetSourceImageSize
* Inputs : ui16PlaneHandle - The handle (a sixteen bit number) by which the plane
* to be used is identified.
*
* pui16ImageHeight - A pointer to a 'DP_UINT_16' which the function will
* fill with the current height, in pixels, of the
* specified plane's source image.
*
* Outputs : pui16ImageWidth - See above.
*
* pui16ImageHeight - See above.
*
* 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 establish the dimensions of the specified plane's
* source image.
*
***********************************************************************************************/
DP_UINT_16 DP_GetSourceImageSize ( DP_UINT_16 ui16PlaneHandle,
DP_PUINT_16 pui16ImageWidth,
DP_PUINT_16 pui16ImageHeight )
{
#if defined DP_ERROR_CHECKING
DP_UINT_16 ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16 ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
DP_UINT_16 ui16VPanReadResult, ui16HPanReadResult;
#endif
DP_UINT_16 ui16SourceFrameWidth, ui16SourceFrameHeight;
DP_UINT_16 ui16HPanReadResult, ui16VPanReadResult, ui16NativePanningReadResult;
DP_UINT_16 ui16HeightAsRead;
#if defined DP_SIMULATION_MODE
printf ("\n DP_GetSourceImageSize \n");
#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
/* Establish the current height of the plane from the dedicated image height register */
ui16HeightAsRead = (DP_UINT_16) DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_SOURCE_IMAGE_HEIGHT],
&ui16NativePanningReadResult );
if ( ui16NativePanningReadResult != DP_STANDARD_CODE_NO_ERROR )
{
/* Could not get source height from dedicated height register - see if we can read */
/* either horizontal or vertical panning registers. If not, then we must conclude */
/* that setting source image size is not supported. */
DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_PANNING_LEFT_EDGE_PIXELS_TO_SKIP],
&ui16HPanReadResult );
DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_PANNING_TOP_EDGE_LINES_TO_SKIP],
&ui16VPanReadResult );
if (( ui16HPanReadResult != DP_STANDARD_CODE_NO_ERROR ) &&
( ui16VPanReadResult != DP_STANDARD_CODE_NO_ERROR ))
{
/* Couldn't read either of these registers, either */
ui16ReturnValue = DP_ERR_EXCEEDS_CAPABILITIES;
}
else
{
/* Establish dimensions of source frame */
DP_GetSourceFrameSize ( ui16PlaneHandle,
&ui16SourceFrameWidth,
&ui16SourceFrameHeight );
if ( ui16HPanReadResult == DP_STANDARD_CODE_NO_ERROR )
{
/* Hardware supports skipping left hand edge pixels, so source image width */
/* is a meaningful value */
*pui16ImageWidth = DP_SourceImageWidth [ ui16PlaneHandle ];
}
else
{
/* Hardware does no support skipping left hand edge pixels, so source image */
/* width is locked to source frame size. */
*pui16ImageWidth = ui16SourceFrameWidth;
}
if ( ui16VPanReadResult == DP_STANDARD_CODE_NO_ERROR )
{
/* Hardware supports skipping top edge pixels, so source image height */
/* is a meaningful value */
*pui16ImageHeight = DP_SourceImageHeight [ ui16PlaneHandle ];
}
else
{
/* Hardware does no support skipping left hand edge pixels, so source image */
/* width is locked to source frame size. */
*pui16ImageHeight = ui16SourceFrameHeight;
}
}
}
else
{
/* Using hardware native panning - a la CIS. There is only a register to define */
/* source image HEIGHT, so width is just stored locally. */
*pui16ImageHeight = (ui16HeightAsRead + DP_HARDWARE_SURFACE_HEIGHT_COMPENSATE);
*pui16ImageWidth = DP_SourceImageWidth [ ui16PlaneHandle ];
}
#if defined DP_ERROR_CHECKING
}
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_GetSourceFramePosition
* Inputs : ui16PlaneHandle - The handle (a sixteen bit number) by which the plane
* to be used is identified.
*
* pi16FrameXPos - A pointer to a 'DP_UINT_16', which the function will
* fill with the cuurent horizontal offset of the
* specified plane's source frame, in pixels, from
* the left hand edge of its source buffer.
*
* pi16FrameYPos - A pointer to a 'DP_UINT_16', which the function will
* fill with the cuurent vertical offset of the
* specified plane's source frame, in pixels, from
* the top of its source buffer.
*
* Outputs : pi16FrameXPos - See above.
*
* pi16FrameYPos - See above.
*
* 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 : This function is used to establish the current position of the specified
* plane's source frame, relative to the top left hand corner of its source
* buffer.
*
***********************************************************************************************/
DP_UINT_16 DP_GetSourceFramePosition ( DP_UINT_16 ui16PlaneHandle,
DP_PUINT_16 pui16FrameXPos,
DP_PUINT_16 pui16FrameYPos )
{
#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 ui16ReadXResult, ui16ReadYResult, ui16NativePanningReadResult;
DP_UINT_16 ui16XAsRead, ui16YAsRead;
#if defined DP_SIMULATION_MODE
printf ("\n DP_GetSourceFramePosition \n");
#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
/* Establish the current X position of the plane */
ui16XAsRead = (DP_UINT_16) DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_SOURCE_FRAME_XPOS],
&ui16NativePanningReadResult );
if ( ui16NativePanningReadResult == DP_STANDARD_CODE_NO_ERROR)
{
/* Establish the current Y position of the plane */
ui16YAsRead = (DP_UINT_16) DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_SOURCE_FRAME_YPOS],
&ui16ReturnValue );
}
else
{
/* Could not read from native source window position register, so see if it's */
/* possible to read from panning registers. */
ui16XAsRead = (DP_UINT_16) DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_PANNING_LEFT_EDGE_PIXELS_TO_SKIP],
&ui16ReadXResult );
ui16YAsRead = (DP_UINT_16) DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_PANNING_TOP_EDGE_LINES_TO_SKIP],
&ui16ReadYResult );
if (( ui16ReadXResult != DP_STANDARD_CODE_NO_ERROR ) &&
( ui16ReadYResult != DP_STANDARD_CODE_NO_ERROR ))
{
/* Could not read either panning register, either. */
ui16ReturnValue = DP_ERR_EXCEEDS_CAPABILITIES;
}
else
{
if ( ui16ReadXResult != DP_STANDARD_CODE_NO_ERROR )
ui16XAsRead = 0;
if ( ui16ReadYResult == DP_STANDARD_CODE_NO_ERROR )
{
ui16YAsRead = ui16YAsRead * DP_pCurrentScalerModifier [ui16PlaneHandle]->ui8SourceOffsetHeightDivisor;
}
}
}
}
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
*pui16FrameXPos = ui16XAsRead;
*pui16FrameYPos = ui16YAsRead;
#if defined DP_ERROR_CHECKING
}
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_GetPlaneDrawOrder
* Inputs : ui16PlaneHandle - The handle by which the plane to be used is
* identified.
*
* pui8PlaneDrawOrder - A pointer to a 'DP_UINT_8', which the function will
* fill with the current position of the specified
* plane in the draw order (where a value of zero
* represents the rearmost plane).
*
* Outputs : pui8PlaneDrawOrder - See above.
*
* 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 establish the current position in the draw order
* of the specified plane.
*
***********************************************************************************************/
DP_UINT_16 DP_GetPlaneDrawOrder ( DP_UINT_16 ui16PlaneHandle,
DP_PUINT_8 pui8PlaneDrawOrder )
{
#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 ui32FieldAsRead;
#if defined DP_SIMULATION_MODE
printf ("\n DP_GetPlaneDrawOrder \n");
#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
/* Read the field value */
ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_DRAW_ORDER_POSITION],
&ui16ReturnValue );
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
*pui8PlaneDrawOrder = (DP_UINT_8) ui32FieldAsRead;
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
}
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_GetPaletteEnable
* Inputs : ui16PlaneHandle - The handle (a sixteen bit number) by which the plane
* to be used is identified.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -