org.jmage.filter.merge
Class ImageOverlayFilter
java.lang.Object
org.jmage.filter.ConfigurableImageFilter
org.jmage.filter.TwinResourceImageFilter
org.jmage.filter.merge.ImageOverlayFilter
- All Implemented Interfaces:
- ImageFilter
public class ImageOverlayFilter
- extends TwinResourceImageFilter
Overlays the image with another image. Specify the following imageProperties to change
the appearance:
IMAGE_URI: the image resource to overlay the filtered image with.
OPACITY: [0-100] opacity percentage, where 0 is transparent and 100 is opaque.
ORIENTATION: [0-360] where values are in degrees. For convenience, use the constants defined, i.e "ORIENTATION_NORTH" (the default)
POSITION: [1-9] aligns the text following a keypad layout. Default is [9] POSITION_BOTTOM_RIGHT
BORDEROFFSET: a numeric value indicating how many pixels to offset the text from it's nearest border
Method Summary |
protected int[] |
alignOverlayFor(javax.media.jai.PlanarImage image,
java.awt.Graphics2D graphics)
calculates the coordinates to overlay the image at |
javax.media.jai.PlanarImage |
filter(javax.media.jai.PlanarImage image)
Overlay image with another image |
void |
initialize(java.util.Properties filterProperties)
Initialize the ImageFilter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OPACITY
public static final java.lang.String OPACITY
- See Also:
- Constant Field Values
ORIENTATION
public static final java.lang.String ORIENTATION
- See Also:
- Constant Field Values
ORIENTATION_NORTH
public static final java.lang.String ORIENTATION_NORTH
- See Also:
- Constant Field Values
ORIENTATION_NORTHEAST
public static final java.lang.String ORIENTATION_NORTHEAST
- See Also:
- Constant Field Values
ORIENTATION_EAST
public static final java.lang.String ORIENTATION_EAST
- See Also:
- Constant Field Values
ORIENTATION_SOUTHEAST
public static final java.lang.String ORIENTATION_SOUTHEAST
- See Also:
- Constant Field Values
ORIENTATION_SOUTH
public static final java.lang.String ORIENTATION_SOUTH
- See Also:
- Constant Field Values
ORIENTATION_SOUTHWEST
public static final java.lang.String ORIENTATION_SOUTHWEST
- See Also:
- Constant Field Values
ORIENTATION_WEST
public static final java.lang.String ORIENTATION_WEST
- See Also:
- Constant Field Values
ORIENTATION_NORTHWEST
public static final java.lang.String ORIENTATION_NORTHWEST
- See Also:
- Constant Field Values
POSITION
public static final java.lang.String POSITION
- See Also:
- Constant Field Values
POSITION_TOP_LEFT
public static final java.lang.String POSITION_TOP_LEFT
- See Also:
- Constant Field Values
POSITION_TOP_CENTER
public static final java.lang.String POSITION_TOP_CENTER
- See Also:
- Constant Field Values
POSITION_TOP_RIGHT
public static final java.lang.String POSITION_TOP_RIGHT
- See Also:
- Constant Field Values
POSITION_CENTER_LEFT
public static final java.lang.String POSITION_CENTER_LEFT
- See Also:
- Constant Field Values
POSITION_CENTER
public static final java.lang.String POSITION_CENTER
- See Also:
- Constant Field Values
POSITION_CENTER_RIGHT
public static final java.lang.String POSITION_CENTER_RIGHT
- See Also:
- Constant Field Values
POSITION_BOTTOM_LEFT
public static final java.lang.String POSITION_BOTTOM_LEFT
- See Also:
- Constant Field Values
POSITION_BOTTOM_CENTER
public static final java.lang.String POSITION_BOTTOM_CENTER
- See Also:
- Constant Field Values
POSITION_BOTTOM_RIGHT
public static final java.lang.String POSITION_BOTTOM_RIGHT
- See Also:
- Constant Field Values
BORDEROFFSET
public static final java.lang.String BORDEROFFSET
- See Also:
- Constant Field Values
DEFAULT_ORIENTATION
public static final java.lang.String DEFAULT_ORIENTATION
- See Also:
- Constant Field Values
overlayImage
protected java.awt.image.BufferedImage overlayImage
position
protected java.lang.String position
xyO
protected int xyO
renderingHints
protected java.awt.RenderingHints renderingHints
orientation
protected double orientation
opacity
protected float opacity
log
protected static org.apache.log4j.Logger log
ImageOverlayFilter
public ImageOverlayFilter()
initialize
public void initialize(java.util.Properties filterProperties)
throws FilterException
- Initialize the ImageFilter
- Overrides:
initialize
in class TwinResourceImageFilter
- Throws:
FilterException
- if the filter can't handle the properties.
filter
public javax.media.jai.PlanarImage filter(javax.media.jai.PlanarImage image)
throws FilterException
- Overlay image with another image
- Specified by:
filter
in interface ImageFilter
- Overrides:
filter
in class TwinResourceImageFilter
- Parameters:
image
- the image
- Returns:
- the filtered image
- Throws:
FilterException
- if an error occurs during filtering
alignOverlayFor
protected int[] alignOverlayFor(javax.media.jai.PlanarImage image,
java.awt.Graphics2D graphics)
- calculates the coordinates to overlay the image at
- Parameters:
image
- the image
- Returns:
- an integer array with the x/y coordinates
Copyright © 2004-2008 Sourceforge. All Rights Reserved.