public class ImageFunction2D extends java.lang.Object implements Function2D
Modifier and Type | Field and Description |
---|---|
protected boolean |
alpha |
static int |
CLAMP |
protected int |
edgeAction |
protected int |
height |
protected int[] |
pixels |
protected int |
width |
static int |
WRAP |
static int |
ZERO |
Constructor and Description |
---|
ImageFunction2D(java.awt.image.BufferedImage image) |
ImageFunction2D(java.awt.image.BufferedImage image,
boolean alpha) |
ImageFunction2D(java.awt.image.BufferedImage image,
int edgeAction,
boolean alpha) |
ImageFunction2D(java.awt.Image image) |
ImageFunction2D(java.awt.Image image,
int edgeAction,
boolean alpha) |
ImageFunction2D(int[] pixels,
int width,
int height,
int edgeAction,
boolean alpha) |
Modifier and Type | Method and Description |
---|---|
float |
evaluate(float x,
float y)
Evaluate the pixel and the x and y values according to the edge action.
|
int |
getEdgeAction()
Get the edgeAction.
|
int |
getHeight()
Get the height.
|
int[] |
getPixels()
Get the pixels.
|
int[] |
getRGB(java.awt.image.BufferedImage image,
int x,
int y,
int width,
int height,
int[] pixels)
A convenience method for getting ARGB pixels from an image.
|
int |
getWidth()
Get the width.
|
void |
init(int[] pixels,
int width,
int height,
int edgeAction,
boolean alpha)
Initialize an image.
|
void |
setEdgeAction(int edgeAction)
Set the edgeAction.
|
public static final int ZERO
public static final int CLAMP
public static final int WRAP
protected int[] pixels
protected int width
protected int height
protected int edgeAction
protected boolean alpha
public ImageFunction2D(java.awt.image.BufferedImage image)
public ImageFunction2D(java.awt.image.BufferedImage image, boolean alpha)
public ImageFunction2D(java.awt.image.BufferedImage image, int edgeAction, boolean alpha)
public ImageFunction2D(int[] pixels, int width, int height, int edgeAction, boolean alpha)
public ImageFunction2D(java.awt.Image image)
public ImageFunction2D(java.awt.Image image, int edgeAction, boolean alpha)
public int[] getRGB(java.awt.image.BufferedImage image, int x, int y, int width, int height, int[] pixels)
image
- The imagex
- The x value of the pixel in one of the cornersy
- The y value of the pixel in one of the cornerswidth
- The width of the pixels to getheight
- The height of the pixels to getpixels
- The imagepublic void init(int[] pixels, int width, int height, int edgeAction, boolean alpha)
pixels
- The imagewidth
- The width of the pixels to getheight
- The height of the pixels to getedgeAction
- The edgeAction, one of ZERO, CLAMP or WRAP.alpha
- The alphapublic float evaluate(float x, float y)
evaluate
in interface Function2D
x
- The x valuey
- The y valuepublic void setEdgeAction(int edgeAction)
edgeAction
- one of ZERO, CLAMP or WRAP.getEdgeAction()
public int getEdgeAction()
setEdgeAction(int)
public int getWidth()
public int getHeight()
public int[] getPixels()