rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
List of all members | Public Member Functions
IlvLightingFilter Class Reference

Lighting filter. More...

#include <ilviews/bitmaps/filters/lighting.h>

Inheritance diagram for IlvLightingFilter:
IlvBitmapFilter IlvDiffuseLightingFilter IlvSpecularLightingFilter

Public Member Functions

 IlvLightingFilter (IlFloat surfaceScale=1.0, IlvLightSource *light=0)
 Constructor. More...
 
virtual ~IlvLightingFilter ()
 Destructor. More...
 
IlFloatcomputeBumpMap (const IlvRGBBitmapData *src, IlFloat scaleX, IlFloat scaleY)
 Computes the bump map for the given image. More...
 
IlvLightSourcegetLightSource () const
 Returns the light source. More...
 
IlFloat getSurfaceScale () const
 Returns the surface scale. More...
 
void setLightSource (IlvLightSource *light)
 
void setSurfaceScale (IlFloat scale)
 Sets the surface scale. More...
 
- Public Member Functions inherited from IlvBitmapFilter
 IlvBitmapFilter ()
 Constructor. More...
 
virtual ~IlvBitmapFilter ()
 Destructor. More...
 
virtual IlvBitmapDataapply (IlUInt count=0, const IlvBitmapData **datas=0)
 Applies the filter to the given inputs. More...
 
IlvBitmapDataapplyUnary (const IlvBitmapData *data)
 Convenience method for unary filters. More...
 
virtual const char * getClassName () const
 Returns the class name of the filter. More...
 
IlUInt getHeight () const
 Returns the height of the filter effect region. More...
 
const char *const * getInputs (IlUInt &count) const
 Returns the name of the input bitmap data. More...
 
const char * getName () const
 Returns the name of the filter. More...
 
IlUInt getRefCount () const
 Returns the reference count for this instance.
 
const char * getResult () const
 Returns the name of the result bitmap data. More...
 
IlUInt getWidth () const
 Returns the width of the filter effect region. More...
 
IlInt getX () const
 Returns the left coordinate of the filter effect region. More...
 
IlInt getY () const
 Returns the top coordinate of the filter effect region. More...
 
void lock ()
 Locks the current instance.
 
void setHeight (IlUInt height)
 Sets the height of the filter effect region. More...
 
void setInputs (IlUInt count, const char *const *name)
 Sets the input names of the filter. More...
 
void setName (const char *id)
 Sets the name of the filter. More...
 
void setResult (const char *name)
 Sets the result name of the filter. More...
 
void setWidth (IlUInt width)
 Sets the width of the filter effect region. More...
 
void setX (IlInt x)
 Sets the left coordinate of the filter effect region. More...
 
void setY (IlInt y)
 Sets the top coordinate of the filter effect region. More...
 
void unLock ()
 Unlocks the current instance. When the reference count is 0, the instance is deleted.
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvBitmapFilter
static IlvBitmapFilterCreate (const char *classname, IlBoolean forceLoad=IlTrue)
 This static method creates an instance of a bitmap filter of given classname. If the filter class is not registered and forceLoad is IlTrue, an attempt to load a dynamic module for this filter is made. More...
 
static const char ** GetRegisteredFilters (IlUInt &num)
 This static method returns an array of registered filter class names. More...
 

Detailed Description

Lighting filter.

Library: ilvbmpflt

This is the base class of lighting filters. It allows you to light an image using the alpha channel as a bump map. You can specify a light source.

See Also
IlvRGBBitmapData, IlvBitmapFilter, IlvDiffuseLightingFilter, IlvSpecularLightingFilter, IlvLightSource, IlvDistantLight, IlvPointLight, IlvSpotLight

Constructor & Destructor Documentation

IlvLightingFilter::IlvLightingFilter ( IlFloat  surfaceScale = 1.0,
IlvLightSource light = 0 
)

Constructor.

Initializes a new instance of the class IlvLightingFilter.

The default surface scale is 1.0 and there is no light.

virtual IlvLightingFilter::~IlvLightingFilter ( )
virtual

Destructor.

The destructor releases all the memory used by the instance.

Member Function Documentation

IlFloat* IlvLightingFilter::computeBumpMap ( const IlvRGBBitmapData src,
IlFloat  scaleX,
IlFloat  scaleY 
)

Computes the bump map for the given image.

The bump map is an array of floating point triplets, one for each pixel of the source image. Each triplet stores the normal vector at this point.

Parameters
srcThe source image.
scaleXThe scaling factor in the x direction.
scaleYThe scaling factor in the y direction.
Returns
An array of src->getWidth() x src->getHeight() triplets.
IlvLightSource* IlvLightingFilter::getLightSource ( ) const

Returns the light source.

Returns
The light source.
IlFloat IlvLightingFilter::getSurfaceScale ( ) const

Returns the surface scale.

Returns
The surface scale.
void IlvLightingFilter::setLightSource ( IlvLightSource light)

Sets the light source.

Parameters
lightThe new light source.
void IlvLightingFilter::setSurfaceScale ( IlFloat  scale)

Sets the surface scale.

Parameters
scaleThe new surface scale.

© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.