CartoType API
Public Member Functions | Static Public Member Functions
CartoType::CDiffuseLighting Class Reference

#include <cartotype_diffuse_lighting.h>

Inheritance diagram for CartoType::CDiffuseLighting:
CartoType::CPaintServer CartoType::MPaintServer

List of all members.

Public Member Functions

CT_IMPORT TColor Color (int32 aX, int32 aY)

Static Public Member Functions

static CT_IMPORT CDiffuseLightingNew (TResult &aError, TColor aLightColor, TFixed aLightAzimuth, TFixed aLightElevation, const TBitmap &aHeightMap, TFixed aSurfaceScale, int32 aUnitLength)

Detailed Description

A diffuse lighting filter implemented as a paint server. It supplies light levels determined by a light source at infinity and an 8bpp source bitmap acting as a height map. See http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feDiffuseLighting for an explanation of the algorithm.


Member Function Documentation

CT_EXPORT TColor CDiffuseLighting::Color ( int32  aX,
int32  aY 
) [virtual]

Supply a color for the pixel at (aX,aY) in premultiplied RGBA format.

Implements CartoType::MPaintServer.

CT_EXPORT CDiffuseLighting * CDiffuseLighting::New ( TResult aError,
TColor  aLightColor,
TFixed  aLightAzimuth,
TFixed  aLightElevation,
const TBitmap aHeightMap,
TFixed  aSurfaceScale,
int32  aUnitLength 
) [static]

Create a diffuse lighting filter. aLightColor is the color of the light, in non-premultiplied-alpha format. The azimuth and elevation of the light source (the 'sun') are supplied in radians. aSurfaceScale is the scale used to multiply heights: a scale of 1 means that 1 horizontal pixel = 255 height units. aUnitLength is the number of pixels between sample points when estimating the gradient.


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