Class ImageFlavor
- java.lang.Object
-
- org.apache.xmlgraphics.image.loader.ImageFlavor
-
- Direct Known Subclasses:
RefinedImageFlavor
public class ImageFlavor extends java.lang.ObjectThe 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
Fields Modifier and Type Field Description static ImageFlavorBUFFERED_IMAGEAn image in form of a BufferedImage instancestatic ImageFlavorGRAPHICS2DAn image in form of a Graphics2DImage (can be painted on a Graphics2D interface)static ImageFlavorRAWAn image in form of a raw PNG file/streamstatic ImageFlavorRAW_CCITTFAXAn image in form of a raw CCITTFax streamstatic ImageFlavorRAW_EMFAn image in form of a raw EMF (Windows Enhanced Metafile) file/streamstatic ImageFlavorRAW_EPSAn image in form of a raw EPS (Encapsulated PostScript) file/streamstatic ImageFlavorRAW_JPEGAn image in form of a raw JPEG/JFIF file/streamstatic ImageFlavorRAW_LZWAn image in form of a raw LZW file/streamstatic ImageFlavorRAW_PNGAn image in form of a raw PNG file/streamstatic ImageFlavorRAW_TIFFAn image in form of a raw TIFF file/streamstatic ImageFlavorRENDERED_IMAGEAn image in form of a RenderedImage instancestatic ImageFlavorXML_DOMAn XML-based image in form of a W3C DOM instance
-
Constructor Summary
Constructors Constructor Description ImageFlavor(java.lang.String name)Constructs a new ImageFlavor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetMimeType()Returns the MIME type that the image flavor represents if a MIME type is available.java.lang.StringgetName()Returns the name of the ImageFlavor.java.lang.StringgetNamespace()Returns the XML namespace URI that the image flavor represents if such a namespace URI is available.inthashCode()booleanisCompatible(ImageFlavor flavor)Indicates whether a particular image flavor is compatible with this one.java.lang.StringtoString()
-
-
-
Field Detail
-
RENDERED_IMAGE
public static final ImageFlavor RENDERED_IMAGE
An image in form of a RenderedImage instance
-
BUFFERED_IMAGE
public static final ImageFlavor BUFFERED_IMAGE
An image in form of a BufferedImage instance
-
XML_DOM
public static final ImageFlavor XML_DOM
An XML-based image in form of a W3C DOM instance
-
RAW
public static final ImageFlavor RAW
An image in form of a raw PNG file/stream
-
RAW_PNG
public static final ImageFlavor RAW_PNG
An image in form of a raw PNG file/stream
-
RAW_JPEG
public static final ImageFlavor RAW_JPEG
An image in form of a raw JPEG/JFIF file/stream
-
RAW_TIFF
public static final ImageFlavor RAW_TIFF
An image in form of a raw TIFF file/stream
-
RAW_EMF
public static final ImageFlavor RAW_EMF
An image in form of a raw EMF (Windows Enhanced Metafile) file/stream
-
RAW_EPS
public static final ImageFlavor RAW_EPS
An image in form of a raw EPS (Encapsulated PostScript) file/stream
-
RAW_LZW
public static final ImageFlavor RAW_LZW
An image in form of a raw LZW file/stream
-
RAW_CCITTFAX
public static final ImageFlavor RAW_CCITTFAX
An image in form of a raw CCITTFax stream
-
GRAPHICS2D
public static final ImageFlavor GRAPHICS2D
An image in form of a Graphics2DImage (can be painted on a Graphics2D interface)
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the ImageFlavor.- Returns:
- the flavor name
-
getMimeType
public java.lang.String 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
public java.lang.String 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
public boolean isCompatible(ImageFlavor flavor)
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()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-