- All Implemented Interfaces:
Serializable
,Comparable<ImageFormat>
,Constable
Enumeration of supported image formats (PDF, EPS, SVG, PNG, BMP, JPG).
Each format has a unique integer ID which can be used for efficient storage in a file or
database. The IDs are small positive integers (1-6) that can be safely cast to byte if needed.
See getID()
and valueOf(int id)
.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionint
getID()
Returns the integer ID associated with this image format.boolean
Checks whether this image format is a raster format.boolean
Checks whether this image format supports CMYK color model.boolean
Checks whether this image format supports transparent backgrounds.static ImageFormat
valueOf
(int id) Returns the enum constant of this class associated with the specified integer ID.static ImageFormat
Returns the enum constant of this class with the specified name.static ImageFormat[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PDF
Portable Document Format (PDF) -
EPS
Encapsulated PostScript (EPS) -
SVG
Scalable Vector Graphics (SVG) -
PNG
Portable Network Graphics (PNG) -
BMP
Bitmap (BMP) -
JPG
JPEG/JPG
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
valueOf
Returns the enum constant of this class associated with the specified integer ID.- Parameters:
id
- the ID of the enum constant to be returned- Returns:
- the enum constant associated with the specified ID
- Throws:
IllegalArgumentException
- if this enum class has no constant associated with the specified ID
-
getID
public int getID()Returns the integer ID associated with this image format.- Returns:
- the integer ID associated with this image format
- See Also:
-
isRasterFormat
public boolean isRasterFormat()Checks whether this image format is a raster format.- Returns:
true
if this format is a raster format (PNG, BMP, or JPG),false
if it is a vector format (PDF, EPS, or SVG)
-
supportsTransparency
public boolean supportsTransparency()Checks whether this image format supports transparent backgrounds.- Returns:
true
if this format supports transparent backgrounds (PDF, EPS, SVG, or PNG),false
otherwise (BMP or JPG)
-
supportsCMYK
public boolean supportsCMYK()Checks whether this image format supports CMYK color model.Note: RGB color model is supported by all included formats.
- Returns:
true
if this format supports CMYK (PDF or EPS),false
otherwise (SVG, PNG, BMP, or JPG)
-