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

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants 
    Enum ConstantDescription
    BMP 
    GIF 
    JPG 
    PNG 
    UNSUPPORTED 
  • Method Summary

    Modifier and TypeMethodDescription
    static ImageFormatget​(java.lang.String imageFormat)
    Gets the ImageFormat of the specified format string.
    static java.lang.String[]getAllExtensions() 
    static booleanisSupported​(java.io.File file)
    Determines whether the extension of the specified file is supported by the engine.
    static booleanisSupported​(java.lang.String fileName)
    Determines whether the extension of the specified file is supported by the engine.
    java.lang.StringtoFileExtension()
    Converts this format instance to a file format string that can be used as an extension (e.g.
    java.lang.StringtoString() 
    static ImageFormatvalueOf​(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.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

  • Method Details

    • values

      public static ImageFormat[] 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

      public static ImageFormat valueOf​(java.lang.String name)
      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 name
      java.lang.NullPointerException - if the argument is null
    • get

      public static ImageFormat get​(java.lang.String imageFormat)
      Gets the ImageFormat 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 class java.lang.Enum<ImageFormat>