rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvSpecularLightingFilter Class Reference

Specular Lighting filter. More...

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

Inheritance diagram for IlvSpecularLightingFilter:
IlvLightingFilter IlvBitmapFilter

List of all members.

Public Member Functions

 IlvSpecularLightingFilter (IlFloat surfaceScale=1.0, IlFloat specularConstant=1.0, IlFloat specularExponent=1.0, IlvLightSource *light=0)
 Constructor.
 ~IlvSpecularLightingFilter ()
 Destructor.
IlvBitmapDataapply (IlUInt count=0, const IlvBitmapData **inputs=0)
IlFloat getSpecularConstant () const
 Returns the specular constant.
IlFloat getSpecularExponent () const
 Returns the specular exponent.
void setSpecularConstant (IlFloat specularConstant)
 Sets the specular constant value.
void setSpecularExponent (IlFloat specularExponent)
 Sets the specular exponent value.

Detailed Description

Specular Lighting filter.

Library: ilvbmpflt

This class allows you to light an image using a specular lighting model. The alpha channel of the source image is used as the bump map.

The resulting image is computed as follows: Sr = ks * pow(N.H, specularExponent) * Lr Sg = ks * pow(N.H, specularExponent) * Lg Sb = ks * pow(N.H, specularExponent) * Lb Sa = Max(Sr, Sg, Sb) where ks = specular lighting constant. N = surface normal unit vector, a function of x and y. H = unit vector pointing from surface to light, a function of x and y in the point and spot light cases. Lr, Lg, Lb = RGB components of the light, a function of x and y in the spot light case. N is a function of x and y and depends on the surface gradient as follows: The surface described by the input alpha image A(x, y) is: Z(x, y) = surfaceScale * Ain(x, y)

See IlvDiffuseLightingFilter for a definition of N. Unlike IlvDiffuseLightingFilter, IlvSpecularLightingFilter produces a non-opaque image.

See also:
IlvRGBBitmapData, IlvBitmapFilter, IlvLightingFilter, IlvDiffuseLightingFilter, IlvLightSource, IlvDistantLight, IlvPointLight, IlvSpotLight

Constructor & Destructor Documentation

IlvSpecularLightingFilter::IlvSpecularLightingFilter ( IlFloat  surfaceScale = 1.0,
IlFloat  specularConstant = 1.0,
IlFloat  specularExponent = 1.0,
IlvLightSource light = 0 
)

Constructor.

Initializes a new instance of the class IlvSpecularLightingFilter.

The default surface scale is 1.0. The default specular constant is 1.0. The default specular exponent is 1.0.

IlvSpecularLightingFilter::~IlvSpecularLightingFilter (  ) 

Destructor.

The destructor releases all the memory used by the instance.


Member Function Documentation

IlvBitmapData* IlvSpecularLightingFilter::apply ( IlUInt  count = 0,
const IlvBitmapData **  inputs = 0 
) [virtual]

Applies the specular lighting to the given image.

Reimplemented from IlvBitmapFilter.

IlFloat IlvSpecularLightingFilter::getSpecularConstant (  )  const

Returns the specular constant.

Returns:
The specular constant.
IlFloat IlvSpecularLightingFilter::getSpecularExponent (  )  const

Returns the specular exponent.

Returns:
The specular exponent.
void IlvSpecularLightingFilter::setSpecularConstant ( IlFloat  specularConstant  ) 

Sets the specular constant value.

Parameters:
specularConstant The new specular constant.
void IlvSpecularLightingFilter::setSpecularExponent ( IlFloat  specularExponent  ) 

Sets the specular exponent value.

Parameters:
specularExponent The new specular exponent.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, 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.