TLinearDDA Class Reference

class TLinearDDA

Linear digital differential analyser.

This is used to calculate the pixels which most closely approximate a specified straight line, or when scaling a bitmap. Note that a line is infinitely thin, and can only be approximated by pixels with real width and height.

Functions are provided for: pixel line traversing; jumping to a rectangle or co-ordinate

Public Member Functions
TLinearDDA()
TLinearDDA(const TLinearDDA &)
IMPORT_C voidConstruct(const TPoint &, const TPoint &, TLineMode)
IMPORT_C voidJumpToRect(const TRect &)
IMPORT_C voidJumpToXCoord(const TInt, TInt &)
IMPORT_C voidJumpToXCoord2(TInt, TInt &)
IMPORT_C voidJumpToYCoord(TInt &, const TInt)
IMPORT_C voidJumpToYCoord2(TInt &, TInt)
IMPORT_C TBoolNextStep(TPoint &)
IMPORT_C TBoolSingleScanline(TPoint &, TPoint &)
IMPORT_C TBoolSingleStep(TPoint &)
Private Member Functions
voidUpdatePosition()
Public Member Enumerations
enumTLineMode { ECenter, ELeft }
Private Member Enumerations
enumTLineStatus { EInitialised, ECurrent, EComplete }
Private Attributes
TRect iBoundingRect
TBool iBoundingRectSet
TInt iCount
TSize iDifference
TPoint iFinish
TInt iGradient
TPoint iInc
TInt16 iInsideX
TInt16 iInsideY
TPoint iPos
TPoint iStart
TLineStatus iStatus

Constructor & Destructor Documentation

TLinearDDA()

IMPORT_CTLinearDDA()

TLinearDDA(const TLinearDDA &)

IMPORT_CTLinearDDA(const TLinearDDA &aLine)

Parameters

const TLinearDDA & aLine

Member Functions Documentation

Construct(const TPoint &, const TPoint &, TLineMode)

IMPORT_C voidConstruct(const TPoint &aStart,
const TPoint &aFinish,
TLineModeaMode = ECenter
)

Parameters

const TPoint & aStart
const TPoint & aFinish
TLineMode aMode = ECenter

JumpToRect(const TRect &)

IMPORT_C voidJumpToRect(const TRect &aRect)

Parameters

const TRect & aRect

JumpToXCoord(const TInt, TInt &)

IMPORT_C voidJumpToXCoord(const TIntaXCoord,
TInt &aYCoord
)

Parameters

const TInt aXCoord
TInt & aYCoord

JumpToXCoord2(TInt, TInt &)

IMPORT_C voidJumpToXCoord2(TIntaXCoord,
TInt &aYCoord
)

Parameters

TInt aXCoord
TInt & aYCoord

JumpToYCoord(TInt &, const TInt)

IMPORT_C voidJumpToYCoord(TInt &aXCoord,
const TIntaYCoord
)

Parameters

TInt & aXCoord
const TInt aYCoord

JumpToYCoord2(TInt &, TInt)

IMPORT_C voidJumpToYCoord2(TInt &aXCoord,
TIntaYCoord
)

Parameters

TInt & aXCoord
TInt aYCoord

NextStep(TPoint &)

IMPORT_C TBoolNextStep(TPoint &aPosition)

Parameters

TPoint & aPosition

SingleScanline(TPoint &, TPoint &)

IMPORT_C TBoolSingleScanline(TPoint &aStartPosition,
TPoint &aEndPosition
)

Parameters

TPoint & aStartPosition
TPoint & aEndPosition

SingleStep(TPoint &)

IMPORT_C TBoolSingleStep(TPoint &aPosition)

Parameters

TPoint & aPosition

UpdatePosition()

voidUpdatePosition()[private]

Member Enumerations Documentation

Enum TLineMode

LDDA Line mode.

Enumerators

ECenter

Centres scan-lines in the pixel line

ELeft

Starts at the beginning of a complete scan line. Used for bitmap scaling.

Enum TLineStatus

Enumerators

EInitialised
ECurrent
EComplete

Member Data Documentation

TRect iBoundingRect

TRect iBoundingRect[private]

TBool iBoundingRectSet

TBool iBoundingRectSet[private]

TInt iCount

TInt iCount[private]

TSize iDifference

TSize iDifference[private]

TPoint iFinish

TPoint iFinish[private]

TInt iGradient

TInt iGradient[private]

TPoint iInc

TPoint iInc[private]

TInt16 iInsideX

TInt16 iInsideX[private]

TInt16 iInsideY

TInt16 iInsideY[private]

TPoint iPos

TPoint iPos[private]

TPoint iStart

TPoint iStart[private]

TLineStatus iStatus

TLineStatus iStatus[private]