public class CropFilter extends ScaleFilter
cropX
cropY
cropWidth
cropHeight
cropUniform
true
.
cropUnits
PIXELS
, PERCENT
.
PIXELS
is default.
image
scaleX
scaleY
scaleUniform
true
.
scaleUnits
PIXELS
, PERCENT
.
PIXELS
is default.
scaleQuality
SCALE_SMOOTH
, SCALE_FAST
,
SCALE_REPLICATE
, SCALE_AREA_AVERAGING
.
SCALE_DEFAULT
is default.
Modifier and Type | Field and Description |
---|---|
protected static String |
PARAM_CROP_HEIGHT
cropHeight |
protected static String |
PARAM_CROP_UNIFORM
cropUniform |
protected static String |
PARAM_CROP_UNITS
cropUnits |
protected static String |
PARAM_CROP_WIDTH
cropWidth |
protected static String |
PARAM_CROP_X
cropX |
protected static String |
PARAM_CROP_Y
cropY |
defaultScaleQuality, PARAM_IMAGE, PARAM_SCALE_QUALITY, PARAM_SCALE_UNIFORM, PARAM_SCALE_UNITS, PARAM_SCALE_X, PARAM_SCALE_Y, UNITS_PERCENT, UNITS_PIXELS, UNITS_UNKNOWN
triggerParams
oncePerRequest
Constructor and Description |
---|
CropFilter() |
Modifier and Type | Method and Description |
---|---|
protected RenderedImage |
doFilter(BufferedImage pImage,
javax.servlet.ServletRequest pRequest,
ImageServletResponse pResponse)
Reads the image from the requested URL, scales it, crops it, and returns
it in the
Servlet stream.
|
protected Rectangle |
getBounds(int pX,
int pY,
int pWidth,
int pHeight,
int pUnits,
boolean pUniform,
BufferedImage pImg) |
getDimensions, getQuality, getUnits, setDefaultScaleQuality
doFilterImpl, setTriggerParams, trigger
destroy, doFilter, getFilterConfig, getFilterName, getInitParameter, getInitParameterNames, getServletContext, init, init, log, log, setFilterConfig, setOncePerRequest
protected static final String PARAM_CROP_X
cropX
protected static final String PARAM_CROP_Y
cropY
protected static final String PARAM_CROP_WIDTH
cropWidth
protected static final String PARAM_CROP_HEIGHT
cropHeight
protected static final String PARAM_CROP_UNIFORM
cropUniform
protected static final String PARAM_CROP_UNITS
cropUnits
protected RenderedImage doFilter(BufferedImage pImage, javax.servlet.ServletRequest pRequest, ImageServletResponse pResponse)
doFilter
in class ScaleFilter
pImage
- the image to filterpRequest
- the servlet requestpResponse
- the servlet responseprotected Rectangle getBounds(int pX, int pY, int pWidth, int pHeight, int pUnits, boolean pUniform, BufferedImage pImg)
Copyright © 2017. All rights reserved.