Enum ImageFormat
java.lang.Object
java.lang.Enum<ImageFormat>
de.gurkenlabs.litiengine.resources.ImageFormat
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ImageFormat>
,java.lang.constant.Constable
public enum ImageFormat
extends java.lang.Enum<ImageFormat>
Contains all known image file-formats supported by the engine.
- See Also:
SoundFormat
Nested Class Summary
Enum Constant Summary
Enum Constants Enum Constant Description BMP
GIF
JPG
PNG
UNSUPPORTED
Method Summary
Modifier and Type Method Description static ImageFormat
get(java.lang.String imageFormat)
Gets theImageFormat
of the specified format string.static java.lang.String[]
getAllExtensions()
static boolean
isSupported(java.io.File file)
Determines whether the extension of the specified file is supported by the engine.static boolean
isSupported(java.lang.String fileName)
Determines whether the extension of the specified file is supported by the engine.java.lang.String
toFileExtension()
Converts this format instance to a file format string that can be used as an extension (e.g.java.lang.String
toString()
static ImageFormat
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ImageFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Enum Constant Details
Method Details
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
get
Gets theImageFormat
of the specified format string.- Parameters:
imageFormat
- The format string from which to extract the format.- Returns:
- The format of the specified string or
UNDEFINED
if not supported.
isSupported
public static boolean isSupported(java.io.File file)Determines whether the extension of the specified file is supported by the engine.- Parameters:
file
- The file to check for.- Returns:
- True if the extension is part of this enum; otherwise false.
isSupported
public static boolean isSupported(java.lang.String fileName)Determines whether the extension of the specified file is supported by the engine.- Parameters:
fileName
- The name of the file to check for.- Returns:
- True if the extension is part of this enum; otherwise false.
getAllExtensions
public static java.lang.String[] getAllExtensions()toFileExtension
public java.lang.String toFileExtension()Converts this format instance to a file format string that can be used as an extension (e.g. .png).
It adds a leading '.' to the lower-case string representation of this instance.- Returns:
- The file extension string for this instance.
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Enum<ImageFormat>