com.flagstone.transform.filter
Class ConvolutionFilter.Builder

java.lang.Object
  extended by com.flagstone.transform.filter.ConvolutionFilter.Builder
Enclosing class:
ConvolutionFilter

public static final class ConvolutionFilter.Builder
extends Object

Builder for creating ConvolutionFilter objects.


Constructor Summary
ConvolutionFilter.Builder()
           
 
Method Summary
 ConvolutionFilter build()
          Generate an instance of ConvolutionFilter using the parameters set in the Builder.
 ConvolutionFilter.Builder setAlpha(boolean preserve)
          Indicate whether the alpha value of the pixels should be preserved.
 ConvolutionFilter.Builder setBias(float value)
          Set the bias for the convolution.
 ConvolutionFilter.Builder setClamp(boolean nearest)
          Indicate whether the pixels outside the image will be clamped to the nearest pixel value (true) or to the default colour (false).
 ConvolutionFilter.Builder setColor(Color aColor)
          Set the default colour applied to the pixels outside of the image.
 ConvolutionFilter.Builder setDivisor(float value)
          Set the divisor for the convolution.
 ConvolutionFilter.Builder setMatrix(float[][] aMatrix)
          Set the matrix used for the convolution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvolutionFilter.Builder

public ConvolutionFilter.Builder()
Method Detail

setMatrix

public ConvolutionFilter.Builder setMatrix(float[][] aMatrix)
Set the matrix used for the convolution.

Parameters:
aMatrix - a 2D matrix.
Returns:
this Builder.

setDivisor

public ConvolutionFilter.Builder setDivisor(float value)
Set the divisor for the convolution.

Parameters:
value - the divisor
Returns:
this Builder.

setBias

public ConvolutionFilter.Builder setBias(float value)
Set the bias for the convolution.

Parameters:
value - the bias
Returns:
this Builder.

setColor

public ConvolutionFilter.Builder setColor(Color aColor)
Set the default colour applied to the pixels outside of the image.

Parameters:
aColor - the default colour.
Returns:
this Builder.

setClamp

public ConvolutionFilter.Builder setClamp(boolean nearest)
Indicate whether the pixels outside the image will be clamped to the nearest pixel value (true) or to the default colour (false).

Parameters:
nearest - if true clamp to the nearest pixel, false use the default colour.
Returns:
this Builder.

setAlpha

public ConvolutionFilter.Builder setAlpha(boolean preserve)
Indicate whether the alpha value of the pixels should be preserved.

Parameters:
preserve - if true preserve the alpha values.
Returns:
this Builder.

build

public ConvolutionFilter build()
Generate an instance of ConvolutionFilter using the parameters set in the Builder.

Returns:
a ConvolutionFilter object.


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