org.jmage.filter.merge
Class BackgroundImageFilter
java.lang.Object
org.jmage.filter.ConfigurableImageFilter
org.jmage.filter.TwinResourceImageFilter
org.jmage.filter.merge.BackgroundImageFilter
- All Implemented Interfaces:
- ImageFilter
public class BackgroundImageFilter
- extends TwinResourceImageFilter
Puts the image on a configured background image. The Resulting image will have the proportions
of the background image. Note that background images must be higher *and* wider than the
image that is supposed to overlay them. Specify the following imageProperties to change
the appearance:
IMAGE_URI: the image to put as background.
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_X: horizontal overlay position on the background
POSITION_Y: vertical overlay position on the background
Method Summary |
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
DEFAULT_OPACITY
public static final java.lang.String DEFAULT_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
DEFAULT_ORIENTATION
public static final java.lang.String DEFAULT_ORIENTATION
- See Also:
- Constant Field Values
POSITION_X
public static final java.lang.String POSITION_X
- See Also:
- Constant Field Values
POSITION_Y
public static final java.lang.String POSITION_Y
- See Also:
- Constant Field Values
DEFAULT_POSITION_X
public static final java.lang.String DEFAULT_POSITION_X
- See Also:
- Constant Field Values
DEFAULT_POSITION_Y
public static final java.lang.String DEFAULT_POSITION_Y
- See Also:
- Constant Field Values
backgroundImage
protected java.awt.image.BufferedImage backgroundImage
backgroundGraphics
protected java.awt.Graphics2D backgroundGraphics
px
protected int px
py
protected int py
renderingHints
protected java.awt.RenderingHints renderingHints
orientation
protected double orientation
opacity
protected float opacity
log
protected static org.apache.log4j.Logger log
BackgroundImageFilter
public BackgroundImageFilter()
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
Copyright © 2004-2008 Sourceforge. All Rights Reserved.