com.jhlabs.image

Class GradientFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class GradientFilter
extends AbstractBufferedImageOp

A filter which draws a coloured gradient. This is largely superceded by GradientPaint in Java1.2, but does provide a few more gradient options.

Field Summary

static int
BICONICAL
static int
BILINEAR
static int
CONICAL
static int
INT_CIRCLE_DOWN
static int
INT_CIRCLE_UP
static int
INT_LINEAR
static int
INT_SMOOTH
static int
LINEAR
static int
RADIAL
static int
SQUARE

Constructor Summary

GradientFilter()
GradientFilter(Point p1, Point p2, int color1, int color2, boolean repeat, int type, int interpolation)

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
float
getAngle()
Returns the angle of the texture.
Colormap
getColormap()
Get the colormap to be used for the filter.
int
getInterpolation()
int
getPaintMode()
Point
getPoint1()
Point
getPoint2()
int
getType()
void
setAngle(float angle)
Specifies the angle of the texture.
void
setColormap(Colormap colormap)
Set the colormap to be used for the filter.
void
setInterpolation(int interpolation)
void
setPaintMode(int paintMode)
void
setPoint1(Point point1)
void
setPoint2(Point point2)
void
setType(int type)
String
toString()

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Field Details

BICONICAL

public static final int BICONICAL
Field Value:
4

BILINEAR

public static final int BILINEAR
Field Value:
1

CONICAL

public static final int CONICAL
Field Value:
3

INT_CIRCLE_DOWN

public static final int INT_CIRCLE_DOWN
Field Value:
2

INT_CIRCLE_UP

public static final int INT_CIRCLE_UP
Field Value:
1

INT_LINEAR

public static final int INT_LINEAR
Field Value:
0

INT_SMOOTH

public static final int INT_SMOOTH
Field Value:
3

LINEAR

public static final int LINEAR
Field Value:
0

RADIAL

public static final int RADIAL
Field Value:
2

SQUARE

public static final int SQUARE
Field Value:
5

Constructor Details

GradientFilter

public GradientFilter()

GradientFilter

public GradientFilter(Point p1,
                      Point p2,
                      int color1,
                      int color2,
                      boolean repeat,
                      int type,
                      int interpolation)

Method Details

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)

getAngle

public float getAngle()
Returns the angle of the texture.
Returns:
the angle of the texture.

getColormap

public Colormap getColormap()
Get the colormap to be used for the filter.
Returns:
the colormap

getInterpolation

public int getInterpolation()

getPaintMode

public int getPaintMode()

getPoint1

public Point getPoint1()

getPoint2

public Point getPoint2()

getType

public int getType()

setAngle

public void setAngle(float angle)
Specifies the angle of the texture.
Parameters:
angle - the angle of the texture.

setColormap

public void setColormap(Colormap colormap)
Set the colormap to be used for the filter.
Parameters:
colormap - the colormap
See Also:
getColormap()

setInterpolation

public void setInterpolation(int interpolation)

setPaintMode

public void setPaintMode(int paintMode)

setPoint1

public void setPoint1(Point point1)

setPoint2

public void setPoint2(Point point2)

setType

public void setType(int type)

toString

public String toString()