public class ImageProviderPipeline
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
logger
|
Constructor and Description |
---|
ImageProviderPipeline()
Default constructor without caching and without an ImageLoader (or the ImageLoader may
be set later).
|
ImageProviderPipeline(ImageCache cache,
ImageLoader loader)
Main constructor.
|
ImageProviderPipeline(ImageLoader loader)
Constructor for operation without caching.
|
Modifier and Type | Method and Description |
---|---|
void |
addConverter(ImageConverter converter)
Adds an additional ImageConverter to the end of the pipeline.
|
Image |
execute(ImageInfo info,
Image originalImage,
java.util.Map hints,
ImageSessionContext context)
Executes the image converter pipeline.
|
Image |
execute(ImageInfo info,
java.util.Map hints,
ImageSessionContext context)
Executes the image converter pipeline.
|
protected Image |
forceCaching(Image img)
In some cases the provided Image is not cacheable, nor is any of the intermediate Image
instances (for example, when loading a raw JPEG file).
|
int |
getConversionPenalty()
Returns the overall conversion penalty for the pipeline.
|
Penalty |
getConversionPenalty(ImageImplRegistry registry)
Returns the overall conversion penalty for the pipeline.
|
ImageFlavor |
getTargetFlavor()
Returns the target flavor generated by this pipeline.
|
void |
setImageLoader(ImageLoader imageLoader)
Sets the ImageLoader that is used at the beginning of the pipeline if the image is not
loaded, yet.
|
java.lang.String |
toString() |
public ImageProviderPipeline(ImageCache cache, ImageLoader loader)
cache
- the image cache (may be null if no caching is desired)loader
- the image loader to drive the pipeline withpublic ImageProviderPipeline(ImageLoader loader)
loader
- the image loader to drive the pipeline withpublic ImageProviderPipeline()
public Image execute(ImageInfo info, java.util.Map hints, ImageSessionContext context) throws ImageException, java.io.IOException
info
- the image info object indicating the image to loadhints
- a Map of image conversion hintscontext
- the session contextImageException
- if an error occurs while loader or converting the imagejava.io.IOException
- if an I/O error occurspublic Image execute(ImageInfo info, Image originalImage, java.util.Map hints, ImageSessionContext context) throws ImageException, java.io.IOException
info
- the image info object indicating the image to loadoriginalImage
- the original image to start the pipeline off or null if an ImageLoader
is usedhints
- a Map of image conversion hintscontext
- the session contextImageException
- if an error occurs while loader or converting the imagejava.io.IOException
- if an I/O error occursprotected Image forceCaching(Image img) throws java.io.IOException
img
- the Image to investigatejava.io.IOException
- if an I/O error occurspublic void setImageLoader(ImageLoader imageLoader)
imageLoader
- the image loader implementationpublic void addConverter(ImageConverter converter)
converter
- the ImageConverter instancepublic java.lang.String toString()
toString
in class java.lang.Object
public int getConversionPenalty()
public Penalty getConversionPenalty(ImageImplRegistry registry)
registry
- the image implementation registrypublic ImageFlavor getTargetFlavor()
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.