|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||
java.lang.Objectjava.lang.Enum
eu.hansolo.custom.Shadow
public enum Shadow extends Enum
| Enum Constant Summary | |
|---|---|
INSTANCE
|
|
| Method Summary | |
|---|---|
BufferedImage
|
createDropShadow(BufferedImage SRC_IMAGE, int DISTANCE, float ALPHA, int SOFTNESS, int ANGLE, Color SHADOW_COLOR)
|
BufferedImage
|
createDropShadow(Shape SHAPE, Paint PAINT, Color COLOR, boolean FILLED, Stroke STROKE, Color STROKE_COLOR, int DISTANCE, float ALPHA, int SOFTNESS, int ANGLE, Color SHADOW_COLOR)
|
BufferedImage
|
createImageFromShape(Shape SHAPE, Paint PAINT, Color COLOR, boolean FILLED, Stroke STROKE, Color STROKE_COLOR)
@author hansolo |
BufferedImage
|
createInnerShadow(BufferedImage SOFT_CLIP_IMAGE, Shape SHAPE, int DISTANCE, float ALPHA, Color SHADOW_COLOR, int SOFTNESS, int ANGLE)
|
BufferedImage
|
createInnerShadow(Shape SHAPE, Paint SHAPE_PAINT, Color SHAPE_COLOR, int DISTANCE, float ALPHA, Color SHADOW_COLOR, int SOFTNESS, int ANGLE)
|
BufferedImage
|
createSoftClipImage(Shape SHAPE, Paint SHAPE_PAINT, Color SHAPE_COLOR)
Method that creates a intermediate image to enable soft clipping functionality This code was taken from Chris Campbells blog http://weblogs.java.net/blog/campbell/archive/2006/07/java_2d_tricker.html |
BufferedImage
|
createSoftClipImage(Shape SHAPE, Paint SHAPE_PAINT, Color SHAPE_COLOR, int SOFTNESS, int TRANSLATE_X, int TRANSLATE_Y)
|
int[]
|
getPixels(BufferedImage IMAGE, int X, int Y, int W, int H, int[] pixels)
|
BufferedImage
|
renderDropShadow(BufferedImage IMAGE, int SOFTNESS, float ALPHA, Color SHADOW_COLOR)
|
void
|
setPixels(BufferedImage IMAGE, int X, int Y, int W, int H, int[] pixels)
|
Shadow
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
Shadow[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class Enum | |
|---|---|
| name, equals, toString, hashCode, compareTo, compareTo, valueOf, getDeclaringClass, ordinal, wait, wait, wait, getClass, notify, notifyAll |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Enum Constant Detail |
|---|
Shadow INSTANCE
| Method Detail |
|---|
public BufferedImage createDropShadow(BufferedImage SRC_IMAGE, int DISTANCE, float ALPHA, int SOFTNESS, int ANGLE, Color SHADOW_COLOR)
public BufferedImage createDropShadow(Shape SHAPE, Paint PAINT, Color COLOR, boolean FILLED, Stroke STROKE, Color STROKE_COLOR, int DISTANCE, float ALPHA, int SOFTNESS, int ANGLE, Color SHADOW_COLOR)
public BufferedImage createImageFromShape(Shape SHAPE, Paint PAINT, Color COLOR, boolean FILLED, Stroke STROKE, Color STROKE_COLOR)
public BufferedImage createInnerShadow(BufferedImage SOFT_CLIP_IMAGE, Shape SHAPE, int DISTANCE, float ALPHA, Color SHADOW_COLOR, int SOFTNESS, int ANGLE)
Method to create a inner shadow on a given shape
SOFT_CLIP_IMAGE - softclipimage create by method createSoftClipImage()SHAPE - shape that should get the inner shadowDISTANCE - distance of the shadowALPHA - alpha value of the shadowSHADOW_COLOR - color of the shadowSOFTNESS - softness/fuzzyness of the shadowANGLE - angle under which the shadow should appear
public BufferedImage createInnerShadow(Shape SHAPE, Paint SHAPE_PAINT, Color SHAPE_COLOR, int DISTANCE, float ALPHA, Color SHADOW_COLOR, int SOFTNESS, int ANGLE)
Method to create a inner shadow on a given shape
SHAPE - shape that should get the inner shadowSHAPE_PAINT - paint of the given shapeSHAPE_COLOR - color of the given shapeDISTANCE - distance of the shadowALPHA - alpha value of the shadowSHADOW_COLOR - color of the shadowSOFTNESS - softness/fuzzyness of the shadowANGLE - angle under which the shadow should appear
public BufferedImage createSoftClipImage(Shape SHAPE, Paint SHAPE_PAINT, Color SHAPE_COLOR)
public BufferedImage createSoftClipImage(Shape SHAPE, Paint SHAPE_PAINT, Color SHAPE_COLOR, int SOFTNESS, int TRANSLATE_X, int TRANSLATE_Y)
Method that creates a intermediate image to enable soft clipping functionality This code was taken from Chris Campbells blog http://weblogs.java.net/blog/campbell/archive/2006/07/java_2d_tricker.html
public int[] getPixels(BufferedImage IMAGE, int X, int Y, int W, int H, int[] pixels)
Returns an array of pixels, stored as integers, from a
BufferedImage. The pixels are grabbed from a rectangular
area defined by a location and two dimensions. Calling this method on
an image of type different from BufferedImage.TYPE_INT_ARGB
and BufferedImage.TYPE_INT_RGB will unmanage the image.
pixels is non-null and
of length < w*hIMAGE - the source imageX - the x location at which to start grabbing pixelsY - the y location at which to start grabbing pixelsW - the width of the rectangle of pixels to grabH - the height of the rectangle of pixels to grabpixels - a pre-allocated array of pixels of size w*h; can be nullpixels if non-null, a new array of integers
otherwise
public BufferedImage renderDropShadow(BufferedImage IMAGE, int SOFTNESS, float ALPHA, Color SHADOW_COLOR)
Generates the shadow for a given picture and the current properties of the renderer.
The generated image dimensions are computed as following
width = imageWidth + 2 * shadowSize height = imageHeight + 2 * shadowSize
IMAGE - the picture from which the shadow must be castimage
public void setPixels(BufferedImage IMAGE, int X, int Y, int W, int H, int[] pixels)
Writes a rectangular area of pixels in the destination
BufferedImage. Calling this method on
an image of type different from BufferedImage.TYPE_INT_ARGB
and BufferedImage.TYPE_INT_RGB will unmanage the image.
pixels is non-null and
of length < w*hIMAGE - the destination imageX - the x location at which to start storing pixelsY - the y location at which to start storing pixelsW - the width of the rectangle of pixels to storeH - the height of the rectangle of pixels to storepixels - an array of pixels, stored as integers
Shadow valueOf(String name)
Shadow[] values()
Groovy Documentation