public class ImageProviderPipeline extends 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,
Map hints,
ImageSessionContext context)
Executes the image converter pipeline.
|
Image |
execute(ImageInfo info,
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.
|
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, Map hints, ImageSessionContext context) throws ImageException, 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 imageIOException
- if an I/O error occurspublic Image execute(ImageInfo info, Image originalImage, Map hints, ImageSessionContext context) throws ImageException, 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 imageIOException
- if an I/O error occursprotected Image forceCaching(Image img) throws IOException
img
- the Image to investigateIOException
- if an I/O error occurspublic void setImageLoader(ImageLoader imageLoader)
imageLoader
- the image loader implementationpublic void addConverter(ImageConverter converter)
converter
- the ImageConverter instancepublic int getConversionPenalty()
public Penalty getConversionPenalty(ImageImplRegistry registry)
registry
- the image implementation registrypublic ImageFlavor getTargetFlavor()
Copyright © 2022 Apache Software Foundation. All rights reserved.