CartoType API
Public Member Functions
CartoType::CPerspectiveGraphicsContext Class Reference

#include <cartotype_perspective.h>

Inheritance diagram for CartoType::CPerspectiveGraphicsContext:
CartoType::CGraphicsContext

List of all members.

Public Member Functions

CT_IMPORT CPerspectiveGraphicsContext (CGraphicsContext &aGc)
void Sync ()
TResult DrawBitmap (const TBitmap &aBitmap, const TPoint &aTopLeft)
TResult DrawRect (const TRect &aRect)
TResult DrawShape (const MPath &aOutline, uint32 aFlags)
void Clear ()
bool TransformsPoints ()
TResult Transform (TPoint &aPoint, int32 aFractionalBits)
void InverseTransform (TPoint &aPoint, int32 aFractionalBits)
bool EnableTransform (bool aEnable)
void OnViewResize (int32 aWidth, int32 aHeight)
TBitmapBitmap ()
TBitmapPushBitmap (TResult &aError)
TResult PopBitmap (TBitmap *aBitmap)

Detailed Description

A graphics context that applies a perspective transformation to all lines and shapes - but not text or bitmaps - and forwards the output to another graphics context.


Member Function Documentation

TBitmap * CPerspectiveGraphicsContext::Bitmap ( ) [virtual]

Return the bitmap drawn to by the graphics context, if any. If the graphics context does not draw to a bitmap return NULL. The default implementation returns null.

Reimplemented from CartoType::CGraphicsContext.

void CPerspectiveGraphicsContext::Clear ( ) [virtual]

Clear the drawing area to transparent black. If colors are not stored set all pixels to zero intensity. If transparency levels are not stored set all pixels to black.

Implements CartoType::CGraphicsContext.

TResult CPerspectiveGraphicsContext::DrawBitmap ( const TBitmap aBitmap,
const TPoint aTopLeft 
) [virtual]

Draw a bitmap. If the bitmap has no color information use the current color. Combine any alpha information from the bitmap with the current alpha level. The coordinates are whole pixels.

Implements CartoType::CGraphicsContext.

TResult CPerspectiveGraphicsContext::DrawRect ( const TRect aRect) [virtual]

Draw a filled rectangle in the current color. The coordinates are whole pixels.

Reimplemented from CartoType::CGraphicsContext.

TResult CPerspectiveGraphicsContext::DrawShape ( const MPath aPath,
uint32  aFlags 
) [virtual]

Draw a filled shape in the current color.

Implements CartoType::CGraphicsContext.

bool CPerspectiveGraphicsContext::EnableTransform ( bool  aEnable) [virtual]

Enable or disable any transformation applied by the graphics context. Return the previous state. The base implementation does nothing and returns false.

Reimplemented from CartoType::CGraphicsContext.

void CPerspectiveGraphicsContext::InverseTransform ( TPoint aPoint,
int32  aFractionalBits 
) [virtual]

Apply the inverse of the graphics context's current transformation to a point. See CGraphicsContext::Transform function for details.

Reimplemented from CartoType::CGraphicsContext.

void CPerspectiveGraphicsContext::OnViewResize ( int32  aWidth,
int32  aHeight 
) [virtual]

Do anything that is needed when the output view size is initially set or changed. For instance, the OpenGL graphics context needs to change its viewport and projection. The base implementation does nothing.

Reimplemented from CartoType::CGraphicsContext.

TResult CPerspectiveGraphicsContext::PopBitmap ( TBitmap aBitmap) [virtual]

Draw the current bitmap on top of aBitmap before deleting it and restoring aBitmap as the current bitmap. The base implementation does nothing.

Reimplemented from CartoType::CGraphicsContext.

TBitmap * CPerspectiveGraphicsContext::PushBitmap ( TResult aError) [virtual]

Replace the current bitmap with a new one of the same type and size, returning the original one. The base implementation does nothing.

Reimplemented from CartoType::CGraphicsContext.

void CPerspectiveGraphicsContext::Sync ( ) [virtual]

Synchronize the private graphics state to take account of any changes in iChangeFlags.

Implements CartoType::CGraphicsContext.

TResult CPerspectiveGraphicsContext::Transform ( TPoint aPoint,
int32  aFractionalBits 
) [virtual]

Apply the graphics context's current transformation to a point. Graphics contexts that provide a non-identity overriding implementation of this function must also override TransformsPoints to return true. The base implementation is identity and thus does nothing. Although the transform does not change the points' representation, the number of fractional bits must be supplied so that the transform can use actual pixels consistently, as in a perpective transform.

Reimplemented from CartoType::CGraphicsContext.

bool CPerspectiveGraphicsContext::TransformsPoints ( ) [virtual]

Return true if the GC applies a further transformation to points before drawing them, as for example the perspective transformation. The base implementation returns false.

Reimplemented from CartoType::CGraphicsContext.


The documentation for this class was generated from the following files: