Package com.twelvemonkeys.servlet.image
Class RotateFilter
- java.lang.Object
-
- com.twelvemonkeys.servlet.GenericFilter
-
- com.twelvemonkeys.servlet.image.ImageFilter
-
- com.twelvemonkeys.servlet.image.RotateFilter
-
- All Implemented Interfaces:
java.io.Serializable,javax.servlet.Filter,javax.servlet.FilterConfig
public class RotateFilter extends ImageFilter
This Servlet is able to render a cropped part of an image.
Parameters:
cropX- integer, the new left edge of the image.
cropY- integer, the new top of the image.
cropWidth- integer, the new width of the image.
cropHeight- integer, the new height of the image.
Examples:
JPEG: <IMG src="/scale/test.jpg?image=http://www.iconmedialab.com/images/random/home_image_12.jpg&width=500&uniform=true">
PNG: <IMG src="/scale/test.png?cache=false&image=http://www.iconmedialab.com/images/random/home_image_12.jpg&width=50&units=PERCENT">- Version:
- $Id: RotateFilter.java#1 $
- Author:
- Harald Kuhr, last modified by $Author: haku $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringPARAM_ANGLEangleprotected static java.lang.StringPARAM_ANGLE_UNITSangleUnits (RADIANS|DEGREES)protected static java.lang.StringPARAM_BGCOLORbgcolorprotected static java.lang.StringPARAM_CROPcrop-
Fields inherited from class com.twelvemonkeys.servlet.image.ImageFilter
triggerParams
-
Fields inherited from class com.twelvemonkeys.servlet.GenericFilter
oncePerRequest
-
-
Constructor Summary
Constructors Constructor Description RotateFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.image.RenderedImagedoFilter(java.awt.image.BufferedImage pImage, javax.servlet.ServletRequest pRequest, ImageServletResponse pResponse)Reads the image from the requested URL, rotates it, and returns it in the Servlet stream.-
Methods inherited from class com.twelvemonkeys.servlet.image.ImageFilter
doFilterImpl, setTriggerParams, trigger
-
Methods inherited from class com.twelvemonkeys.servlet.GenericFilter
destroy, doFilter, getFilterConfig, getFilterName, getInitParameter, getInitParameterNames, getServletContext, init, init, log, log, setFilterConfig, setOncePerRequest
-
-
-
-
Field Detail
-
PARAM_ANGLE
protected static final java.lang.String PARAM_ANGLE
angle- See Also:
- Constant Field Values
-
PARAM_ANGLE_UNITS
protected static final java.lang.String PARAM_ANGLE_UNITS
angleUnits (RADIANS|DEGREES)- See Also:
- Constant Field Values
-
PARAM_CROP
protected static final java.lang.String PARAM_CROP
crop- See Also:
- Constant Field Values
-
PARAM_BGCOLOR
protected static final java.lang.String PARAM_BGCOLOR
bgcolor- See Also:
- Constant Field Values
-
-
Method Detail
-
doFilter
protected java.awt.image.RenderedImage doFilter(java.awt.image.BufferedImage pImage, javax.servlet.ServletRequest pRequest, ImageServletResponse pResponse)Reads the image from the requested URL, rotates it, and returns it in the Servlet stream. See above for details on parameters.- Specified by:
doFilterin classImageFilter- Parameters:
pImage- the image to filterpRequest- the servlet requestpResponse- the servlet response- Returns:
- the filtered image
-
-