org.jmage.filter.merge
Class ImageOverlayFilter

java.lang.Object
  extended by org.jmage.filter.ConfigurableImageFilter
      extended by org.jmage.filter.TwinResourceImageFilter
          extended by 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


Field Summary
static java.lang.String BORDEROFFSET
           
static java.lang.String DEFAULT_ORIENTATION
           
protected static org.apache.log4j.Logger log
           
protected  float opacity
           
static java.lang.String OPACITY
           
protected  double orientation
           
static java.lang.String ORIENTATION
           
static java.lang.String ORIENTATION_EAST
           
static java.lang.String ORIENTATION_NORTH
           
static java.lang.String ORIENTATION_NORTHEAST
           
static java.lang.String ORIENTATION_NORTHWEST
           
static java.lang.String ORIENTATION_SOUTH
           
static java.lang.String ORIENTATION_SOUTHEAST
           
static java.lang.String ORIENTATION_SOUTHWEST
           
static java.lang.String ORIENTATION_WEST
           
protected  java.awt.image.BufferedImage overlayImage
           
protected  java.lang.String position
           
static java.lang.String POSITION
           
static java.lang.String POSITION_BOTTOM_CENTER
           
static java.lang.String POSITION_BOTTOM_LEFT
           
static java.lang.String POSITION_BOTTOM_RIGHT
           
static java.lang.String POSITION_CENTER
           
static java.lang.String POSITION_CENTER_LEFT
           
static java.lang.String POSITION_CENTER_RIGHT
           
static java.lang.String POSITION_TOP_CENTER
           
static java.lang.String POSITION_TOP_LEFT
           
static java.lang.String POSITION_TOP_RIGHT
           
protected  java.awt.RenderingHints renderingHints
           
protected  int xyO
           
 
Fields inherited from class org.jmage.filter.TwinResourceImageFilter
CHAIN_URI, IMAGE_URI, resourceImage
 
Fields inherited from class org.jmage.filter.ConfigurableImageFilter
filterProperties, INITIALIZED, NOT_INITIALIZED
 
Constructor Summary
ImageOverlayFilter()
           
 
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 org.jmage.filter.TwinResourceImageFilter
cloneImage, filter, mapInternalRequest
 
Methods inherited from class org.jmage.filter.ConfigurableImageFilter
getFilterProperties, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

ImageOverlayFilter

public ImageOverlayFilter()
Method Detail

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.