ADTF Display Toolbox
Loading...
Searching...
No Matches
cGCLProcessor

Graphics command language processing class. More...

#include <gcl.h>

Inheritance diagram for cGCLProcessor:
[legend]

Public Member Functions

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

Protected Member Functions

tResult ProcessBlock (tVoid *pCommandBlock, tInt nBlockSize, tUInt nOrigWidth, tUInt nOrigHeight, cRect sTargetRect)
 Process command block.
 
tResult ProcessCommand (const tGCLCommandDescriptor *pCmd, tUInt32 *pParam, tInt &nJump, cRect sTargetRect)
 Process command.
 
tResult CalcScale (tUInt nOrigWidth, tUInt nOrigHeight, const cRect &sTargetRect)
 Calculate the current scaling factor and sets the members m_fScaleX and m_fScaleY.
 
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.
 

Protected Attributes

ICanvas * m_pCanvas
 D-Pointer implementation.
 
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.
 
IFont * m_pSmallFont
 Small font for GCL_CMD_Text Command.
 
IFont * m_pNormalFont
 Normal font for GCL_CMD_Text Command.
 
IFont * m_pHugeFont
 Huge font for GCL_CMD_Text Command.
 

Detailed Description

Graphics command language processing class.

Definition at line 101 of file gcl.h.

Constructor & Destructor Documentation

◆ cGCLProcessor()

◆ ~cGCLProcessor()

virtual ~cGCLProcessor ( )
inlinevirtual

Destructor.

Definition at line 153 of file gcl.h.

Member Function Documentation

◆ CalcScale()

tResult CalcScale ( tUInt nOrigWidth,
tUInt nOrigHeight,
const cRect & sTargetRect )
inlineprotected

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

Definition at line 670 of file gcl.h.

References m_bFormatFloat, m_fScaleX, m_fScaleY, cRect::m_nBottom, cRect::m_nLeft, cRect::m_nRight, and cRect::m_nTop.

Referenced by ProcessBlock().

◆ Create()

tResult Create ( )
inline

Create GCLProcessor.

Returns
Standard result code

Definition at line 163 of file gcl.h.

◆ GetCoords()

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

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

Definition at line 708 of file gcl.h.

References m_bFormatFloat, m_fScaleX, m_fScaleY, cRect::m_nLeft, and cRect::m_nTop.

Referenced by ProcessCommand().

◆ Process() [1/2]

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

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

Definition at line 193 of file gcl.h.

References m_bFlipRGB, m_pCanvas, and ProcessBlock().

◆ Process() [2/2]

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

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

Definition at line 222 of file gcl.h.

References m_bFlipRGB, m_bInitialized, m_hCanvas, and ProcessBlock().

◆ ProcessBlock()

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

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

Definition at line 297 of file gcl.h.

References CalcScale(), m_bFormatFloat, m_pCanvas, tGCLCommandDescriptor::nSize, and ProcessCommand().

Referenced by Process(), and Process().

◆ ProcessCommand()

◆ Release()

tResult Release ( )
inline

Release GCLProcessor.

Returns
Standard result code

Definition at line 174 of file gcl.h.

References m_bInitialized.

◆ SetFonts()

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

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

Definition at line 273 of file gcl.h.

References m_pHugeFont, m_pNormalFont, and m_pSmallFont.

Member Data Documentation

◆ m_bFlipRGB

tBool m_bFlipRGB
protected

Flag for legacy issues.

Definition at line 120 of file gcl.h.

Referenced by cGCLProcessor(), Process(), Process(), and ProcessCommand().

◆ m_bFormatFloat

tBool m_bFormatFloat
protected

Use integer (false) or floating-point (true) coordinates.

Definition at line 115 of file gcl.h.

Referenced by cGCLProcessor(), CalcScale(), GetCoords(), ProcessBlock(), and ProcessCommand().

◆ m_bInitialized

tBool m_bInitialized
protected

Is GCLProcessor initialized?

Definition at line 111 of file gcl.h.

Referenced by cGCLProcessor(), Process(), and Release().

◆ m_fScaleX

tFloat32 m_fScaleX
protected

Current scaling factor.

Definition at line 117 of file gcl.h.

Referenced by cGCLProcessor(), CalcScale(), GetCoords(), and ProcessCommand().

◆ m_fScaleY

tFloat32 m_fScaleY
protected

Current scaling factor.

Definition at line 118 of file gcl.h.

Referenced by cGCLProcessor(), CalcScale(), and GetCoords().

◆ m_hCanvas

tHandle m_hCanvas
protected

Windows canvas handle for output.

Definition at line 110 of file gcl.h.

Referenced by cGCLProcessor(), and Process().

◆ m_nCurrentX

tInt m_nCurrentX
protected

Current x coordinate (integer)

Definition at line 113 of file gcl.h.

Referenced by cGCLProcessor(), and ProcessCommand().

◆ m_nCurrentY

tInt m_nCurrentY
protected

Current y coordinate (integer)

Definition at line 114 of file gcl.h.

Referenced by cGCLProcessor(), and ProcessCommand().

◆ m_pCanvas

ICanvas* m_pCanvas
protected

D-Pointer implementation.

Canvas for output

Definition at line 109 of file gcl.h.

Referenced by cGCLProcessor(), Process(), ProcessBlock(), and ProcessCommand().

◆ m_pHugeFont

IFont* m_pHugeFont
protected

Huge font for GCL_CMD_Text Command.

Definition at line 124 of file gcl.h.

Referenced by cGCLProcessor(), ProcessCommand(), and SetFonts().

◆ m_pNormalFont

IFont* m_pNormalFont
protected

Normal font for GCL_CMD_Text Command.

Definition at line 123 of file gcl.h.

Referenced by cGCLProcessor(), ProcessCommand(), and SetFonts().

◆ m_pSmallFont

IFont* m_pSmallFont
protected

Small font for GCL_CMD_Text Command.

Definition at line 122 of file gcl.h.

Referenced by cGCLProcessor(), ProcessCommand(), and SetFonts().