public class PipelineFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
PipelineFactory.PipelineComparator
Compares two pipelines based on their conversion penalty.
|
Modifier and Type | Field and Description |
---|---|
private DefaultEdgeDirectory |
converterEdgeDirectory
Holds the EdgeDirectory for all image conversions
|
private int |
converterEdgeDirectoryVersion |
protected static org.apache.commons.logging.Log |
log
logger
|
private ImageManager |
manager |
Constructor and Description |
---|
PipelineFactory(ImageManager manager)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
ImageProviderPipeline[] |
determineCandidatePipelines(Image sourceImage,
ImageFlavor[] flavors)
Finds and returns an array of
ImageProviderPipeline instances which can handle
the convert the given Image and return one of the given ImageFlavor s. |
ImageProviderPipeline[] |
determineCandidatePipelines(ImageInfo imageInfo,
ImageFlavor targetFlavor)
Determines all possible pipelines for the given image that can produce the requested
target flavor.
|
ImageProviderPipeline[] |
determineCandidatePipelines(ImageInfo imageInfo,
ImageFlavor[] flavors)
Finds and returns an array of
ImageProviderPipeline instances which can handle
the given MIME type and return one of the given ImageFlavor s. |
private ImageProviderPipeline |
findPipeline(DefaultEdgeDirectory dir,
ImageFlavor originFlavor,
ImageRepresentation destination) |
private DefaultEdgeDirectory |
getEdgeDirectory() |
ImageProviderPipeline |
newImageConverterPipeline(Image originalImage,
ImageFlavor targetFlavor)
Creates and returns an
ImageProviderPipeline that allows to load an image of the
given MIME type and present it in the requested image flavor. |
ImageProviderPipeline |
newImageConverterPipeline(ImageInfo imageInfo,
ImageFlavor targetFlavor)
Creates and returns an
ImageProviderPipeline that allows to load an image of the
given MIME type and present it in the requested image flavor. |
protected static final org.apache.commons.logging.Log log
private ImageManager manager
private int converterEdgeDirectoryVersion
private DefaultEdgeDirectory converterEdgeDirectory
public PipelineFactory(ImageManager manager)
manager
- the ImageManager instanceprivate DefaultEdgeDirectory getEdgeDirectory()
public ImageProviderPipeline newImageConverterPipeline(Image originalImage, ImageFlavor targetFlavor)
ImageProviderPipeline
that allows to load an image of the
given MIME type and present it in the requested image flavor.originalImage
- the original image that serves as the origin point of the conversiontargetFlavor
- the requested image flavorImageProviderPipeline
or null if no suitable pipeline could be assembledpublic ImageProviderPipeline newImageConverterPipeline(ImageInfo imageInfo, ImageFlavor targetFlavor)
ImageProviderPipeline
that allows to load an image of the
given MIME type and present it in the requested image flavor.imageInfo
- the image info object of the original imagetargetFlavor
- the requested image flavorImageProviderPipeline
or null if no suitable pipeline could be assembledpublic ImageProviderPipeline[] determineCandidatePipelines(ImageInfo imageInfo, ImageFlavor targetFlavor)
imageInfo
- the image informationtargetFlavor
- the target flavorprivate ImageProviderPipeline findPipeline(DefaultEdgeDirectory dir, ImageFlavor originFlavor, ImageRepresentation destination)
public ImageProviderPipeline[] determineCandidatePipelines(ImageInfo imageInfo, ImageFlavor[] flavors)
ImageProviderPipeline
instances which can handle
the given MIME type and return one of the given ImageFlavor
s.imageInfo
- the image info objectflavors
- the possible target flavorspublic ImageProviderPipeline[] determineCandidatePipelines(Image sourceImage, ImageFlavor[] flavors)
ImageProviderPipeline
instances which can handle
the convert the given Image
and return one of the given ImageFlavor
s.sourceImage
- the image to be convertedflavors
- the possible target flavors