Package com.jhlabs.math
Class ImageFunction2D
java.lang.Object
com.jhlabs.math.ImageFunction2D
- All Implemented Interfaces:
Function2D
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionImageFunction2D(int[] pixels, int width, int height, int edgeAction, boolean alpha) ImageFunction2D(Image image) ImageFunction2D(BufferedImage image) ImageFunction2D(BufferedImage image, boolean alpha) ImageFunction2D(BufferedImage image, int edgeAction, boolean alpha) ImageFunction2D(Image image, int edgeAction, boolean alpha) -
Method Summary
Modifier and TypeMethodDescriptionfloatevaluate(float x, float y) intintint[]int[]getRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels) A convenience method for getting ARGB pixels from an image.intgetWidth()voidinit(int[] pixels, int width, int height, int edgeAction, boolean alpha) voidsetEdgeAction(int edgeAction)
-
Field Details
-
ZERO
public static final int ZERO- See Also:
-
CLAMP
public static final int CLAMP- See Also:
-
WRAP
public static final int WRAP- See Also:
-
pixels
protected int[] pixels -
width
protected int width -
height
protected int height -
edgeAction
protected int edgeAction -
alpha
protected boolean alpha
-
-
Constructor Details
-
ImageFunction2D
-
ImageFunction2D
-
ImageFunction2D
-
ImageFunction2D
public ImageFunction2D(int[] pixels, int width, int height, int edgeAction, boolean alpha) -
ImageFunction2D
-
ImageFunction2D
-
-
Method Details
-
getRGB
A convenience method for getting ARGB pixels from an image. This tries to avoid the performance penalty of BufferedImage.getRGB unmanaging the image.- Parameters:
image- a BufferedImage objectx- the left edge of the pixel blocky- the right edge of the pixel blockwidth- the width of the pixel arryheight- the height of the pixel arrypixels- the array to hold the returned pixels. May be null.- Returns:
- the pixels
- See Also:
-
#setRGB
-
init
public void init(int[] pixels, int width, int height, int edgeAction, boolean alpha) -
evaluate
public float evaluate(float x, float y) - Specified by:
evaluatein interfaceFunction2D
-
setEdgeAction
public void setEdgeAction(int edgeAction) -
getEdgeAction
public int getEdgeAction() -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getPixels
public int[] getPixels()
-