com.jhlabs.image
Class ShadowFilter
- BufferedImageOp, Cloneable
public class ShadowFilter
A filter which draws a drop shadow based on the alpha channel of the image.
ShadowFilter() - Construct a ShadowFilter.
|
ShadowFilter(float radius, float xOffset, float yOffset, float opacity) - Construct a ShadowFilter.
|
BufferedImage | filter(BufferedImage src, BufferedImage dst)
|
boolean | getAddMargins() - Get whether to increase the size of the output image to accomodate the shadow.
|
float | getAngle() - Returns the angle of the shadow.
|
Rectangle2D | getBounds2D(BufferedImage src)
|
float | getDistance() - Get the distance of the shadow.
|
float | getOpacity() - Get the opacity of the shadow.
|
Point2D | getPoint2D(Point2D srcPt, Point2D dstPt)
|
float | getRadius() - Get the radius of the kernel.
|
int | getShadowColor() - Get the color of the shadow.
|
boolean | getShadowOnly() - Get whether to only draw the shadow without the original image.
|
void | setAddMargins(boolean addMargins) - Set whether to increase the size of the output image to accomodate the shadow.
|
void | setAngle(float angle) - Specifies the angle of the shadow.
|
void | setDistance(float distance) - Set the distance of the shadow.
|
void | setOpacity(float opacity) - Set the opacity of the shadow.
|
void | setRadius(float radius) - Set the radius of the kernel, and hence the amount of blur.
|
void | setShadowColor(int shadowColor) - Set the color of the shadow.
|
void | setShadowOnly(boolean shadowOnly) - Set whether to only draw the shadow without the original image.
|
String | toString()
|
ShadowFilter
public ShadowFilter()
Construct a ShadowFilter.
ShadowFilter
public ShadowFilter(float radius,
float xOffset,
float yOffset,
float opacity)
Construct a ShadowFilter.
radius
- the radius of the shadowxOffset
- the X offset of the shadowyOffset
- the Y offset of the shadowopacity
- the opacity of the shadow
filter
public BufferedImage filter(BufferedImage src,
BufferedImage dst)
getAddMargins
public boolean getAddMargins()
Get whether to increase the size of the output image to accomodate the shadow.
getAngle
public float getAngle()
Returns the angle of the shadow.
getDistance
public float getDistance()
Get the distance of the shadow.
getOpacity
public float getOpacity()
Get the opacity of the shadow.
getRadius
public float getRadius()
Get the radius of the kernel.
getShadowColor
public int getShadowColor()
Get the color of the shadow.
getShadowOnly
public boolean getShadowOnly()
Get whether to only draw the shadow without the original image.
- true to only draw the shadow.
setAddMargins
public void setAddMargins(boolean addMargins)
Set whether to increase the size of the output image to accomodate the shadow.
addMargins
- true to add margins.
setAngle
public void setAngle(float angle)
Specifies the angle of the shadow.
angle
- the angle of the shadow.
setDistance
public void setDistance(float distance)
Set the distance of the shadow.
setOpacity
public void setOpacity(float opacity)
Set the opacity of the shadow.
setRadius
public void setRadius(float radius)
Set the radius of the kernel, and hence the amount of blur. The bigger the radius, the longer this filter will take.
radius
- the radius of the blur in pixels.
setShadowColor
public void setShadowColor(int shadowColor)
Set the color of the shadow.
setShadowOnly
public void setShadowOnly(boolean shadowOnly)
Set whether to only draw the shadow without the original image.
shadowOnly
- true to only draw the shadow.
toString
public String toString()