Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Procedural::AlphaMaskModifier Class Reference

A modifier that will use a mask image to set the alpha channels of a source image. More...

#include <alphamaskmodifier.h>

+ Inheritance diagram for Mezzanine::Graphics::Procedural::AlphaMaskModifier:
+ Collaboration diagram for Mezzanine::Graphics::Procedural::AlphaMaskModifier:

Public Member Functions

 AlphaMaskModifier ()
 Blank constructor.
 
virtual ~AlphaMaskModifier ()
 Class destructor.
 
virtual String GetName () const
 Gets the name of this modifier. More...
 
virtual void Modify (TextureBuffer &Buffer)
 Alters the generated pixels in a TextureBuffer. More...
 
AlphaMaskModifierSetColourMask (const Boole UseColour)
 Sets whether or not the colour of the mask will be used instead of the intensity. More...
 
AlphaMaskModifierSetMaskTexture (TextureBuffer *Mask)
 Sets the texture that will be used as the mask. More...
 
- Public Member Functions inherited from Mezzanine::Graphics::Procedural::TextureModifier
 TextureModifier ()
 Blank constructor.
 
virtual ~TextureModifier ()
 Class destructor.
 

Protected Attributes

Boole ColourMask
 Whether or not to use normalized colours from the mask for calculating the alpha channel, instead of the intensity. More...
 
TextureBufferMaskTexture
 A pointer to the texture to use as the Alpha Mask. More...
 

Detailed Description

A modifier that will use a mask image to set the alpha channels of a source image.

Depending on how the members are configured, an AlphaMaskModifier can operate in one of three modes:

  1. Extract alpha channel as an opaque monochrome bitmap or
  2. Multiply alpha channel with parameter image pixel intensity, or
  3. Use parameter image as color alpha mask.


Mode 1 is accomplished by leaving or setting the MaskTexture member to NULL, regardless of the ColourMask member. Mode 2 is accomplished by setting the MaskTexture member to a valid texture and leaving or setting the ColourMask member to false. Mode 3 is accomplished by setting the MaskTexture member to a valid texture and setting the ColourMask member to true.

Definition at line 85 of file alphamaskmodifier.h.

Member Function Documentation

String Mezzanine::Graphics::Procedural::AlphaMaskModifier::GetName ( ) const
virtual

Gets the name of this modifier.

Returns
Returns a string containing the name of this modifier.

Implements Mezzanine::Graphics::Procedural::TextureModifier.

Definition at line 137 of file alphamaskmodifier.cpp.

void Mezzanine::Graphics::Procedural::AlphaMaskModifier::Modify ( TextureBuffer Buffer)
virtual

Alters the generated pixels in a TextureBuffer.

Parameters
BufferThe buffer to be modified.
Exceptions
TheMaskTexture and the Buffer to be modified must be the same size. Otherwise an INVALID_STATE_EXCEPTION will be thrown.

Implements Mezzanine::Graphics::Procedural::TextureModifier.

Definition at line 92 of file alphamaskmodifier.cpp.

AlphaMaskModifier & Mezzanine::Graphics::Procedural::AlphaMaskModifier::SetColourMask ( const Boole  UseColour)

Sets whether or not the colour of the mask will be used instead of the intensity.

Parameters
UseColourWhether or not to use normalized colours from the mask for calculating the alpha channel, instead of the intensity. Initial Value: False.
Returns
Returns a reference to this.

Definition at line 146 of file alphamaskmodifier.cpp.

AlphaMaskModifier & Mezzanine::Graphics::Procedural::AlphaMaskModifier::SetMaskTexture ( TextureBuffer Mask)

Sets the texture that will be used as the mask.

Parameters
MaskA pointer to the texture to use as the Alpha Mask. Initial Value: NULL.
Returns
Returns a reference to this.

Definition at line 143 of file alphamaskmodifier.cpp.

Member Data Documentation

Boole Mezzanine::Graphics::Procedural::AlphaMaskModifier::ColourMask
protected

Whether or not to use normalized colours from the mask for calculating the alpha channel, instead of the intensity.

Definition at line 93 of file alphamaskmodifier.h.

TextureBuffer* Mezzanine::Graphics::Procedural::AlphaMaskModifier::MaskTexture
protected

A pointer to the texture to use as the Alpha Mask.

Definition at line 90 of file alphamaskmodifier.h.


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