GF4J 0.9.4 Beta

gameframe.graphics
Class ColorReplacementEffect

java.lang.Object
  |
  +--gameframe.graphics.BitmapEffect
        |
        +--gameframe.graphics.ColorReplacementEffect

public class ColorReplacementEffect
extends BitmapEffect

Replaces the colors with other colours given as colour mappings.

Since:
GameFrame for Java 0.9.3
Version:
GameFrame for Java 0.9.4

Field Summary
protected  java.util.Vector m_colorReplacements
          The color replacements to be applied.
 
Constructor Summary
ColorReplacementEffect()
           
 
Method Summary
 void addColourMapping(ColorMapping colourMapping)
          Adds a colour mapping to the list of colour mappings to be applied.
 void addColourMapping(int replacedColour, int replacementColour)
          Adds a colour to be replaced by another colour.
 BitmapData processData(BitmapData data)
          Maps the colours with the given colour maps.
 void reset()
          Resets the effect settings to default values (no colour mappings are applied).
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_colorReplacements

protected java.util.Vector m_colorReplacements
The color replacements to be applied.
Constructor Detail

ColorReplacementEffect

public ColorReplacementEffect()
Method Detail

addColourMapping

public void addColourMapping(int replacedColour,
                             int replacementColour)
Adds a colour to be replaced by another colour.
Parameters:
replacedColour - The colour to be replaced.
replacementColour - The colour that will replace the colour.

addColourMapping

public void addColourMapping(ColorMapping colourMapping)
Adds a colour mapping to the list of colour mappings to be applied.
Parameters:
colourMapping - The colour mapping to be applied.

reset

public void reset()
Resets the effect settings to default values (no colour mappings are applied).
Overrides:
reset in class BitmapEffect

processData

public BitmapData processData(BitmapData data)
Maps the colours with the given colour maps.
Overrides:
processData in class BitmapEffect
Parameters:
data - The raw bitmap data that is to be processed.
Returns:
The processed bitmap.

GF4J 0.9.4 Beta