|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaitools.media.jai.kernel.KernelFactory
public class KernelFactory
A factory class with static methods to create a variety of KernelJAI objects with specified geometries
| Nested Class Summary | |
|---|---|
static class |
KernelFactory.ValueType
Meaning of the kernel values |
| Constructor Summary | |
|---|---|
KernelFactory()
|
|
| Method Summary | |
|---|---|
static javax.media.jai.KernelJAI |
createAnnulus(int outerRadius,
int innerRadius,
KernelFactory.ValueType type,
float centreValue)
Creates a new KernelJAI object with an annular configuration (like a doughnut). |
static javax.media.jai.KernelJAI |
createCircle(int radius)
Create a new KernelJAI object with a circular configuration. |
static javax.media.jai.KernelJAI |
createCircle(int radius,
KernelFactory.ValueType type,
float centreValue)
Creates a new KernelJAI object with a circular configuration. |
static javax.media.jai.KernelJAI |
createFromShape(Shape shape,
AffineTransform transform,
KernelFactory.ValueType type,
int keyX,
int keyY,
float keyValue)
Create a new KernelJAI object by rasterizing a shape. |
static javax.media.jai.KernelJAI |
createRectangle(int width,
int height)
Creates a new KernelJAI object with a rectangular configuraton. |
static javax.media.jai.KernelJAI |
createRectangle(int width,
int height,
KernelFactory.ValueType type,
int keyX,
int keyY,
float keyValue)
Creates a new KernelJAI object with a rectangular configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KernelFactory()
| Method Detail |
|---|
public static javax.media.jai.KernelJAI createCircle(int radius)
This is equivalent to, but faster than, calling...
createCircle(radius, Kernel.ValueType.BINARY, 1.0f)
radius - radius of the circle
public static javax.media.jai.KernelJAI createCircle(int radius,
KernelFactory.ValueType type,
float centreValue)
radius - the radius of the circle expressed in pixelstype - one of
KernelFactory.ValueType.BINARY,
KernelFactory.ValueType.DISTANCE or
KernelFactory.ValueType.INVERSE_DISTANCEcentreValue - the value to assign to the kernel centre (key element)
public static javax.media.jai.KernelJAI createAnnulus(int outerRadius,
int innerRadius,
KernelFactory.ValueType type,
float centreValue)
An IllegalArgumentException will be thrown if:
outerRadius - the radius of the circle expressed in pixelsinnerRadius - the radius of the 'hole' of the annulustype - one of
KernelFactory.ValueType.BINARY,
KernelFactory.ValueType.DISTANCE or
KernelFactory.ValueType.INVERSE_DISTANCEcentreValue - the value to assign to the kernel centre (key element)
public static javax.media.jai.KernelJAI createRectangle(int width,
int height)
This is equivalent to calling...
createRectangle(width, height, Kernel.ValueType.BINARY, width/2, height/2, 1.0f)
width - rectangle widthheight - rectangle height
public static javax.media.jai.KernelJAI createRectangle(int width,
int height,
KernelFactory.ValueType type,
int keyX,
int keyY,
float keyValue)
An IllegalArgumentException will be thrown if:
width - rectangle widthheight - rectangle heighttype - one of
KernelFactory.ValueType.BINARY,
KernelFactory.ValueType.DISTANCE or
KernelFactory.ValueType.INVERSE_DISTANCEkeyX - x position of the key elementkeyY - y position of the key element (y coords increase downwards)keyValue - value of the key element
public static javax.media.jai.KernelJAI createFromShape(Shape shape,
AffineTransform transform,
KernelFactory.ValueType type,
int keyX,
int keyY,
float keyValue)
This method can cope with arbitrary shape bounds, ie. there is no need to set the bounding rectangle to have origin x=0, y=0. The values of keyX and keyY, which specify the position of the kernel's key element, must be within the bounds of the shape as passed to this method, but do not need to be inside the shape itself.
shape - an object representing a closed polygontransform - an optional AffineTransform to relate shape coordinates to
kernel element coordinates. May be null. This is useful to scale and/or rotate
the shape.type - one of
KernelFactory.ValueType.BINARY,
KernelFactory.ValueType.DISTANCE or
KernelFactory.ValueType.INVERSE_DISTANCEkeyX - the x coord of the key elementkeyY - the y coord of the key elementkeyValue - the value of the key element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||