All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::BlendMode Class Reference

This class defines a blending mode used during rendering. More...

#include <Luminous/BlendMode.hpp>

Public Types

enum  Equation {
  ADD = GL_FUNC_ADD, SUBTRACT = GL_FUNC_SUBTRACT, REVERSE_SUBTRACT = GL_FUNC_REVERSE_SUBTRACT, MIN = GL_MIN,
  MAX = GL_MAX
}
 The blending equation. More...
 
enum  Function {
  ZERO = GL_ZERO, ONE = GL_ONE, SOURCE_COLOR = GL_SRC_COLOR, SOURCE_ALPHA = GL_SRC_ALPHA,
  ONE_MINUS_SOURCE_COLOR = GL_ONE_MINUS_SRC_COLOR, ONE_MINUS_SOURCE_ALPHA = GL_ONE_MINUS_SRC_ALPHA, DESTINATION_COLOR = GL_DST_COLOR, DESTINATION_ALPHA = GL_DST_ALPHA,
  ONE_MINUS_DESTINATION_COLOR = GL_ONE_MINUS_DST_COLOR, ONE_MINUS_DESTINATION_ALPHA = GL_ONE_MINUS_DST_ALPHA, CONSTANT_COLOR = GL_CONSTANT_COLOR, CONSTANT_ALPHA = GL_CONSTANT_ALPHA,
  ONE_MINUS_CONSTANT_COLOR = GL_ONE_MINUS_CONSTANT_COLOR, ONE_MINUS_CONSTANT_ALPHA = GL_ONE_MINUS_CONSTANT_ALPHA, ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE
}
 Defines the pixel arithmetic used during blending. More...
 

Public Member Functions

LUMINOUS_API BlendMode ()
 Constructs new blend mode object.
 
const Radiant::ColorconstantColor () const
 Returns blending color. More...
 
Function destFunction () const
 Sets function to use when blending destination. More...
 
Equation equation () const
 Returns blending equation. More...
 
void setConstantColor (const Radiant::Color &color)
 Set constant blending color. More...
 
void setDestFunction (Function func)
 Sets function to use when blending destination. More...
 
void setEquation (Equation eq)
 Set blending equation. More...
 
void setSourceFunction (Function func)
 Sets function to use when blending source. More...
 
Function sourceFunction () const
 Returns the function to use when blending source. More...
 

Static Public Member Functions

static LUMINOUS_API BlendMode Additive ()
 Returns additive blending mode. More...
 
static BlendMode Default ()
 Returns default blend mode. More...
 
static LUMINOUS_API BlendMode Subtractive ()
 Returns subtractive blending mode. More...
 

Detailed Description

This class defines a blending mode used during rendering.

Member Enumeration Documentation

The blending equation.

See http://www.opengl.org/sdk/docs/man3/xhtml/glBlendEquation.xml for details.

Enumerator
ADD 

Add colors.

SUBTRACT 

Subtract colors.

REVERSE_SUBTRACT 

Subtract colors reversily.

MIN 

Minimum of colors.

MAX 

Maximum of colors.

Defines the pixel arithmetic used during blending.

See http://www.opengl.org/sdk/docs/man3/xhtml/glBlendFunc.xml for details.

Enumerator
ZERO 

Ignore the color.

ONE 

Do not scale color in any way.

SOURCE_COLOR 

Scale according to source color.

SOURCE_ALPHA 

Scale according to source alpha.

ONE_MINUS_SOURCE_COLOR 

Scale according to inverse of source color factors.

ONE_MINUS_SOURCE_ALPHA 

Scale according to inverse of source color alpha.

DESTINATION_COLOR 

Scale according to destination color.

DESTINATION_ALPHA 

Scale according to destionation alpha.

ONE_MINUS_DESTINATION_COLOR 

Scale according to inverse of destination color factors.

ONE_MINUS_DESTINATION_ALPHA 

Scale according to inverse of destination color alpha.

CONSTANT_COLOR 

Use blend color set by setConstantColor.

CONSTANT_ALPHA 

Use blend alpha set by setConstantColor.

ONE_MINUS_CONSTANT_COLOR 

Use inverse of blend color set by setConstantColor.

ONE_MINUS_CONSTANT_ALPHA 

Use inverse of blend alpha set by setConstantColor.

ALPHA_SATURATE 

Saturate alpha.

Member Function Documentation

static LUMINOUS_API BlendMode Luminous::BlendMode::Additive ( )
static

Returns additive blending mode.

Returns
BlendMode having additive blending
const Radiant::Color& Luminous::BlendMode::constantColor ( ) const
inline

Returns blending color.

Returns
Constant blending color
static BlendMode Luminous::BlendMode::Default ( )
inlinestatic

Returns default blend mode.

Returns
BlendMode having default values
Function Luminous::BlendMode::destFunction ( ) const
inline

Sets function to use when blending destination.

Returns
Function to use for blending destination
Equation Luminous::BlendMode::equation ( ) const
inline

Returns blending equation.

Returns
Equation to use for blending
void Luminous::BlendMode::setConstantColor ( const Radiant::Color color)
inline

Set constant blending color.

Parameters
colorColor for constant blending color.
void Luminous::BlendMode::setDestFunction ( Function  func)
inline

Sets function to use when blending destination.

Parameters
funcFunction to use for blending destination
void Luminous::BlendMode::setEquation ( Equation  eq)
inline

Set blending equation.

Parameters
eqEquation to use for blending
void Luminous::BlendMode::setSourceFunction ( Function  func)
inline

Sets function to use when blending source.

Parameters
funcFunction to use for blending source
Function Luminous::BlendMode::sourceFunction ( ) const
inline

Returns the function to use when blending source.

Returns
Function to use for blending source
static LUMINOUS_API BlendMode Luminous::BlendMode::Subtractive ( )
static

Returns subtractive blending mode.

Returns
BlendMode having subtractive blending