ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
cGCLProcessor

Graphics command language processing class. More...

Inheritance diagram for cGCLProcessor:
[legend]

Public Member Functions

 cGCLProcessor ()
 Constructor.
 
virtual ~cGCLProcessor ()
 Destructor.
 
tResult Create ()
 Create GCLProcessor. More...
 
tResult Release ()
 Release GCLProcessor. More...
 
tResult Process (ICanvas *pCanvas, tVoid *pCommandBlock, tInt nBlockSize, tUInt nOrigWidth, tUInt nOrigHeight, cRect sTargetRect, tBool bFlipRGB=tFalse)
 Process command block on canvas. More...
 
tResult Process (tHandle hCanvas, tVoid *pCommandBlock, tInt nBlockSize, tUInt nOrigWidth, tUInt nOrigHeight, cRect sTargetRect, tBool bFlipRGB=tFalse)
 Process command block on canvas. More...
 
tResult SetFonts (IFont *pSmallFont, IFont *pNormalFont, IFont *pHugeFont)
 Sets small, normal and huge font for the GCL_CMD_Text Command. More...
 

Protected Member Functions

tResult ProcessBlock (tVoid *pCommandBlock, tInt nBlockSize, tUInt nOrigWidth, tUInt nOrigHeight, cRect sTargetRect)
 Process command block. More...
 
tResult ProcessCommand (tGCLCommandDescriptor *pCmd, tUInt32 *pParams, tInt &nJump, cRect sTargetRect)
 Process command. More...
 
tResult CalcScale (tUInt nOrigWidth, tUInt nOrigHeight, const cRect &sTargetRect)
 Calculate the current scaling factor and sets the members m_fScaleX and m_fScaleY. More...
 
tResult GetCoords (const tUInt32 *pParam, const cRect &sTargetRect, tInt &x, tInt &y) const
 Takes the first two parameters from the array (pParam) converts them depending on the m_bFormatFloat flag, scales and translates them and writes the result back to x, y. More...
 

Protected Attributes

ICanvasm_pCanvas
 Canvas for output.
 
tHandle m_hCanvas
 Windows canvas handle for output.
 
tBool m_bInitialized
 Is GCLProcessor initialized?
 
tInt m_nCurrentX
 Current x coordinate (integer)
 
tInt m_nCurrentY
 Current y coordinate (integer)
 
tBool m_bFormatFloat
 Use integer (false) or floating-point (true) coordinates.
 
tFloat32 m_fScaleX
 Current scaling factor.
 
tFloat32 m_fScaleY
 Current scaling factor.
 
tBool m_bFlipRGB
 Flag for legacy issues.
 
IFontm_pSmallFont
 Small font for GCL_CMD_Text Command.
 
IFontm_pNormalFont
 Normal font for GCL_CMD_Text Command.
 
IFontm_pHugeFont
 Huge font for GCL_CMD_Text Command.
 

Private Member Functions

 A_UTILS_D (cGCLProcessor)
 D-Pointer implementation.
 

Detailed Description

Graphics command language processing class.

Definition at line 63 of file gcl.h.

Member Function Documentation

◆ CalcScale()

tResult CalcScale ( tUInt  nOrigWidth,
tUInt  nOrigHeight,
const cRect sTargetRect 
)
protected

Calculate the current scaling factor and sets the members m_fScaleX and m_fScaleY.

Parameters
nOrigWidth[in] Original width.
nOrigHeight[in] Original height.
sTargetRect[in] Target rectangle.
Returns
Standard result code

◆ Create()

tResult Create ( )

Create GCLProcessor.

Returns
Standard result code

◆ GetCoords()

tResult GetCoords ( const tUInt32 *  pParam,
const cRect sTargetRect,
tInt &  x,
tInt &  y 
) const
protected

Takes the first two parameters from the array (pParam) converts them depending on the m_bFormatFloat flag, scales and translates them and writes the result back to x, y.

Parameters
pParam[in] Array with parameters where the first two of them are to be calculated
sTargetRect[in] Target rectangle.(used for translation
x[out] converted value from pParam[0]
y[out] converted value from pParam[1]
Returns
always NO_ERROR

◆ Process() [1/2]

tResult Process ( ICanvas pCanvas,
tVoid *  pCommandBlock,
tInt  nBlockSize,
tUInt  nOrigWidth,
tUInt  nOrigHeight,
cRect  sTargetRect,
tBool  bFlipRGB = tFalse 
)

Process command block on canvas.

Parameters
pCanvas[in] Canvas to paint on.
pCommandBlock[in] Block with GCL commands.
nBlockSize[in] Size of block.
nOrigWidth[in] Original width.
nOrigHeight[in] Original height.
sTargetRect[in] Target rectangle.
bFlipRGB[in] Flip on process.
Returns
Standard result code

◆ Process() [2/2]

tResult Process ( tHandle  hCanvas,
tVoid *  pCommandBlock,
tInt  nBlockSize,
tUInt  nOrigWidth,
tUInt  nOrigHeight,
cRect  sTargetRect,
tBool  bFlipRGB = tFalse 
)

Process command block on canvas.

Parameters
hCanvas[in] Canvas to paint on.
pCommandBlock[in] Block with GCL commands.
nBlockSize[in] Size of block.
nOrigWidth[in] Original width.
nOrigHeight[in] Original height.
sTargetRect[in] Target rectangle.
bFlipRGB[in] Flip on process.
Returns
Standard result code

◆ ProcessBlock()

tResult ProcessBlock ( tVoid *  pCommandBlock,
tInt  nBlockSize,
tUInt  nOrigWidth,
tUInt  nOrigHeight,
cRect  sTargetRect 
)
protected

Process command block.

Parameters
pCommandBlock[in] Block with GCL commands.
nBlockSize[in] Size of block.
nOrigWidth[in] Original width.
nOrigHeight[in] Original height.
sTargetRect[in] Target rectangle.
Returns
Standard result code

◆ ProcessCommand()

tResult ProcessCommand ( tGCLCommandDescriptor pCmd,
tUInt32 *  pParams,
tInt &  nJump,
cRect  sTargetRect 
)
protected

Process command.

Parameters
pCmd[in] GCL command.
pParams[in] Command parameters.
nJump[inout] Internally used to navigate inside the command blocks.
sTargetRect[in] Target rectangle.
Returns
Standard result code

◆ Release()

tResult Release ( )

Release GCLProcessor.

Returns
Standard result code

◆ SetFonts()

tResult SetFonts ( IFont pSmallFont,
IFont pNormalFont,
IFont pHugeFont 
)

Sets small, normal and huge font for the GCL_CMD_Text Command.

Parameters
pSmallFont[in] small font
pNormalFont[in] normal font
pHugeFont[in] huge font
Returns
ERR_POINTER, if one of the inputs equals NULL, otherwise NO_ERROR