com.mebigfatguy.pixelle
Class PixelleEval

java.lang.Object
  extended by com.mebigfatguy.pixelle.PixelleEval
Direct Known Subclasses:
PixelleEval3ByteBGR, PixelleEval4ByteABGR, PixelleEvalByteGray, PixelleEvalCustom, PixelleEvalIndexed, PixelleEvalIntARGB, PixelleEvalIntBGR, PixelleEvalIntRGB

public abstract class PixelleEval
extends java.lang.Object

an abstract class for evaluation pixels in arbitrary images by enforcing a template pattern that derived classes implement per image format.


Field Summary
protected  java.awt.image.DataBuffer buffer
           
protected  ColorOutOfBoundsOption coobOption
           
protected  int height
           
protected  IndexOutOfBoundsOption ioobOption
           
protected  PixelleImage srcImage
           
protected  int width
           
 
Constructor Summary
PixelleEval(PixelleImage image, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption)
          create an evaluator for a specific image and options
 
Method Summary
protected  double adjustColor(double value)
          adjust out of bounds colors by applying rules of ColorOutOfBoundsOption
abstract  double getBlueValue(int x, int y)
          template method to get the blue value at a specific x and y
abstract  double getGreenValue(int x, int y)
          template method to get the green value at a specific x and y
 int getHeight()
          gets the height of the source image
abstract  double getRedValue(int x, int y)
          template method to get the red value at a specific x and y
abstract  double getTransparencyValue(int x, int y)
          template method to get the transparency value at a specific x and y
 double getValue(int x, int y, char pixelSpec)
          retrieves the value at a specific index for a specific color, transparency or selection
 int getWidth()
          gets the width of the source image
protected  void setSelectionValue(int x, int y, double value)
          sets the selection value at a specific index
 void setValue(int x, int y, char pixelSpec, double value)
          sets the pixel value at the specified x, y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

srcImage

protected PixelleImage srcImage

buffer

protected java.awt.image.DataBuffer buffer

width

protected int width

height

protected int height

ioobOption

protected IndexOutOfBoundsOption ioobOption

coobOption

protected ColorOutOfBoundsOption coobOption
Constructor Detail

PixelleEval

public PixelleEval(PixelleImage image,
                   IndexOutOfBoundsOption iOption,
                   ColorOutOfBoundsOption cOption)
create an evaluator for a specific image and options

Parameters:
image - the image to evaluate
iOption - the out of bounds pixels option to use
cOption - TODO
Method Detail

getRedValue

public abstract double getRedValue(int x,
                                   int y)
template method to get the red value at a specific x and y

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the pixel red value at the given coordinate

getGreenValue

public abstract double getGreenValue(int x,
                                     int y)
template method to get the green value at a specific x and y

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the pixel green value at the given coordinate

getBlueValue

public abstract double getBlueValue(int x,
                                    int y)
template method to get the blue value at a specific x and y

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the pixel blue value at the given coordinate

getTransparencyValue

public abstract double getTransparencyValue(int x,
                                            int y)
template method to get the transparency value at a specific x and y

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the pixel transparency value at the given coordinate

getValue

public double getValue(int x,
                       int y,
                       char pixelSpec)
retrieves the value at a specific index for a specific color, transparency or selection

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the pixel value at the given coordinate for the pixel specification

setValue

public void setValue(int x,
                     int y,
                     char pixelSpec,
                     double value)
sets the pixel value at the specified x, y

Parameters:
x - the x coordinate
y - the y coordinate
pixelSpec - the component to set
value - the value to set

getWidth

public int getWidth()
gets the width of the source image

Returns:
the width of the image

getHeight

public int getHeight()
gets the height of the source image

Returns:
the height of the image

setSelectionValue

protected void setSelectionValue(int x,
                                 int y,
                                 double value)
sets the selection value at a specific index

Parameters:
x - the x coordinate
y - the y coordinate
value - the selection value to use where 0 is off

adjustColor

protected double adjustColor(double value)
adjust out of bounds colors by applying rules of ColorOutOfBoundsOption

Parameters:
value - the input color value
Returns:
the output color value


Copyright © 2008 MeBigFatGuy.com. All Rights Reserved.