com.flagstone.transform.filter
Class GradientGlowFilter

java.lang.Object
  extended by com.flagstone.transform.filter.GradientGlowFilter
All Implemented Interfaces:
SWFEncodeable, Filter

public final class GradientGlowFilter
extends Object
implements Filter

GlowFilter is used to create a glow effect using a gradient colour around an object on the display list.


Nested Class Summary
static class GradientGlowFilter.Builder
          Builder for creating GradientGlowFilter objects.
 
Constructor Summary
GradientGlowFilter(GradientGlowFilter.Builder builder)
          Create a GradientGlowFilter and initialize it wit the values defined in the Builder.
GradientGlowFilter(SWFDecoder coder, Context context)
          Creates and initialises a GradientGlowFilter object using values encoded in the Flash binary format.
 
Method Summary
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 boolean equals(Object object)
           
 float getAngle()
          Get the angle of the glow.
 float getBlurX()
          Get the blur amount in the x-direction.
 float getBlurY()
          Get the blur amount in the y-direction.
 float getDistance()
          Get the distance of the glow from the object.
 List<Gradient> getGradients()
          Get the list of gradients used to create the glow colour.
 FilterMode getMode()
          Get the compositing mode.
 int getPasses()
          Get the number of passes for generating the blur.
 float getStrength()
          Get the strength of the glow.
 int hashCode()
           
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GradientGlowFilter

public GradientGlowFilter(GradientGlowFilter.Builder builder)
Create a GradientGlowFilter and initialize it wit the values defined in the Builder.

Parameters:
builder - a Builder object.

GradientGlowFilter

public GradientGlowFilter(SWFDecoder coder,
                          Context context)
                   throws IOException
Creates and initialises a GradientGlowFilter object using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
context - a Context object used to manage the decoders for different type of object and to pass information on how objects are decoded.
Throws:
IOException - if an error occurs while decoding the data.
Method Detail

getGradients

public List<Gradient> getGradients()
Get the list of gradients used to create the glow colour.

Returns:
the list of Gradient objects.

getBlurX

public float getBlurX()
Get the blur amount in the x-direction.

Returns:
the horizontal blur amount.

getBlurY

public float getBlurY()
Get the blur amount in the y-direction.

Returns:
the vertical blur amount.

getAngle

public float getAngle()
Get the angle of the glow.

Returns:
the angle of the glow in radians.

getDistance

public float getDistance()
Get the distance of the glow from the object.

Returns:
the width of the glow.

getStrength

public float getStrength()
Get the strength of the glow.

Returns:
the glow strength.

getMode

public FilterMode getMode()
Get the compositing mode.

Returns:
the mode used for compositing, either TOP, INNER or KNOCKOUT.

getPasses

public int getPasses()
Get the number of passes for generating the blur.

Returns:
the number of blur passes.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

prepareToEncode

public int prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. This method also used to initialise variables, such as offsets and flags that will be used when the object is encoded. Generally the method returns the size in bytes, however when called on objects that use bit fields such as shapes the methods will return the size in bits.

Specified by:
prepareToEncode in interface SWFEncodeable
Parameters:
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Returns:
the size of the object when it is encoded.

encode

public void encode(SWFEncoder coder,
                   Context context)
            throws IOException
Encode an object to the Flash binary format.

Specified by:
encode in interface SWFEncodeable
Parameters:
coder - an SWFEncoder object.
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Throws:
IOException - if an error occurs while encoding the object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.