Class ImageFlavor
java.lang.Object
org.apache.xmlgraphics.image.loader.ImageFlavor
- Direct Known Subclasses:
RefinedImageFlavor
The flavor of an image indicates in which form it is available. A bitmap image loaded into
memory might be represented as a BufferedImage (indicated by ImageFlavor.BUFFERED_IMAGE).
It is mostly used by consuming code to indicate what kind of flavors can be processed so a
processing pipeline can do the necessary loading operations and conversions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImageFlavor
An image in form of a BufferedImage instancestatic final ImageFlavor
An image in form of a Graphics2DImage (can be painted on a Graphics2D interface)static final ImageFlavor
An image in form of a raw PNG file/streamstatic final ImageFlavor
An image in form of a raw CCITTFax streamstatic final ImageFlavor
An image in form of a raw EMF (Windows Enhanced Metafile) file/streamstatic final ImageFlavor
An image in form of a raw EPS (Encapsulated PostScript) file/streamstatic final ImageFlavor
An image in form of a raw JPEG/JFIF file/streamstatic final ImageFlavor
An image in form of a raw LZW file/streamstatic final ImageFlavor
static final ImageFlavor
An image in form of a raw PNG file/streamstatic final ImageFlavor
An image in form of a raw TIFF file/streamstatic final ImageFlavor
An image in form of a RenderedImage instancestatic final ImageFlavor
An XML-based image in form of a W3C DOM instance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the MIME type that the image flavor represents if a MIME type is available.getName()
Returns the name of the ImageFlavor.Returns the XML namespace URI that the image flavor represents if such a namespace URI is available.int
hashCode()
boolean
isCompatible
(ImageFlavor flavor) Indicates whether a particular image flavor is compatible with this one.toString()
-
Field Details
-
RENDERED_IMAGE
An image in form of a RenderedImage instance -
BUFFERED_IMAGE
An image in form of a BufferedImage instance -
XML_DOM
An XML-based image in form of a W3C DOM instance -
RAW
An image in form of a raw PNG file/stream -
RAW_PNG
An image in form of a raw PNG file/stream -
RAW_JPEG
An image in form of a raw JPEG/JFIF file/stream -
RAW_TIFF
An image in form of a raw TIFF file/stream -
RAW_EMF
An image in form of a raw EMF (Windows Enhanced Metafile) file/stream -
RAW_EPS
An image in form of a raw EPS (Encapsulated PostScript) file/stream -
RAW_PDF
-
RAW_LZW
An image in form of a raw LZW file/stream -
RAW_CCITTFAX
An image in form of a raw CCITTFax stream -
GRAPHICS2D
An image in form of a Graphics2DImage (can be painted on a Graphics2D interface)
-
-
Constructor Details
-
ImageFlavor
Constructs a new ImageFlavor. Please reuse existing constants wherever possible!- Parameters:
name
- the name of the flavor (must be unique)
-
-
Method Details
-
getName
Returns the name of the ImageFlavor.- Returns:
- the flavor name
-
getMimeType
Returns the MIME type that the image flavor represents if a MIME type is available. This is only applicable to images which can also exist as files. For images flavors like decoded in-memory images (Rendered/BufferedImage), this method will return null.- Returns:
- the MIME type or null if no MIME type can be provided (like for in-memory images)
-
getNamespace
Returns the XML namespace URI that the image flavor represents if such a namespace URI is available. This is only applicable to images in XML form. Other image types will return null.- Returns:
- the XML or null if no MIME type can be provided (like for in-memory images)
-
isCompatible
Indicates whether a particular image flavor is compatible with this one.- Parameters:
flavor
- the other image flavor- Returns:
- true if the two are compatible
-
hashCode
public int hashCode() -
equals
-
toString
-