Class PipelineFactory
java.lang.Object
org.apache.xmlgraphics.image.loader.pipeline.PipelineFactory
Factory class for image processing pipelines.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Compares two pipelines based on their conversion penalty. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DefaultEdgeDirectory
Holds the EdgeDirectory for all image conversionsprivate int
protected static final org.apache.commons.logging.Log
loggerprivate ImageManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondetermineCandidatePipelines
(ImageInfo imageInfo, ImageFlavor targetFlavor) Determines all possible pipelines for the given image that can produce the requested target flavor.determineCandidatePipelines
(ImageInfo imageInfo, ImageFlavor[] flavors) Finds and returns an array ofImageProviderPipeline
instances which can handle the given MIME type and return one of the givenImageFlavor
s.determineCandidatePipelines
(Image sourceImage, ImageFlavor[] flavors) Finds and returns an array ofImageProviderPipeline
instances which can handle the convert the givenImage
and return one of the givenImageFlavor
s.private ImageProviderPipeline
findPipeline
(DefaultEdgeDirectory dir, ImageFlavor originFlavor, ImageRepresentation destination) private DefaultEdgeDirectory
newImageConverterPipeline
(ImageInfo imageInfo, ImageFlavor targetFlavor) Creates and returns anImageProviderPipeline
that allows to load an image of the given MIME type and present it in the requested image flavor.newImageConverterPipeline
(Image originalImage, ImageFlavor targetFlavor) Creates and returns anImageProviderPipeline
that allows to load an image of the given MIME type and present it in the requested image flavor.
-
Field Details
-
log
protected static final org.apache.commons.logging.Log loglogger -
manager
-
converterEdgeDirectoryVersion
private int converterEdgeDirectoryVersion -
converterEdgeDirectory
Holds the EdgeDirectory for all image conversions
-
-
Constructor Details
-
PipelineFactory
Main constructor.- Parameters:
manager
- the ImageManager instance
-
-
Method Details
-
getEdgeDirectory
-
newImageConverterPipeline
public ImageProviderPipeline newImageConverterPipeline(Image originalImage, ImageFlavor targetFlavor) Creates and returns anImageProviderPipeline
that allows to load an image of the given MIME type and present it in the requested image flavor.- Parameters:
originalImage
- the original image that serves as the origin point of the conversiontargetFlavor
- the requested image flavor- Returns:
- an
ImageProviderPipeline
or null if no suitable pipeline could be assembled
-
newImageConverterPipeline
public ImageProviderPipeline newImageConverterPipeline(ImageInfo imageInfo, ImageFlavor targetFlavor) Creates and returns anImageProviderPipeline
that allows to load an image of the given MIME type and present it in the requested image flavor.- Parameters:
imageInfo
- the image info object of the original imagetargetFlavor
- the requested image flavor- Returns:
- an
ImageProviderPipeline
or null if no suitable pipeline could be assembled
-
determineCandidatePipelines
public ImageProviderPipeline[] determineCandidatePipelines(ImageInfo imageInfo, ImageFlavor targetFlavor) Determines all possible pipelines for the given image that can produce the requested target flavor.- Parameters:
imageInfo
- the image informationtargetFlavor
- the target flavor- Returns:
- the candidate pipelines
-
findPipeline
private ImageProviderPipeline findPipeline(DefaultEdgeDirectory dir, ImageFlavor originFlavor, ImageRepresentation destination) -
determineCandidatePipelines
public ImageProviderPipeline[] determineCandidatePipelines(ImageInfo imageInfo, ImageFlavor[] flavors) Finds and returns an array ofImageProviderPipeline
instances which can handle the given MIME type and return one of the givenImageFlavor
s.- Parameters:
imageInfo
- the image info objectflavors
- the possible target flavors- Returns:
- an array of pipelines
-
determineCandidatePipelines
public ImageProviderPipeline[] determineCandidatePipelines(Image sourceImage, ImageFlavor[] flavors) Finds and returns an array ofImageProviderPipeline
instances which can handle the convert the givenImage
and return one of the givenImageFlavor
s.- Parameters:
sourceImage
- the image to be convertedflavors
- the possible target flavors- Returns:
- an array of pipelines
-