Enum Class Bitmap.SaveFormat

java.lang.Object
java.lang.Enum<Bitmap.SaveFormat>
icyllis.modernui.graphics.Bitmap.SaveFormat
All Implemented Interfaces:
Serializable, Comparable<Bitmap.SaveFormat>, Constable
Enclosing class:
Bitmap

public static enum Bitmap.SaveFormat extends Enum<Bitmap.SaveFormat>
List of supported formats a bitmap can be saved as (encoding or compressing).
  • Enum Constant Details

    • PNG

      public static final Bitmap.SaveFormat PNG
      Save as the PNG format. PNG is lossless and compressed, and quality is ignored.

      Only supports 8-bit per channel images (Bitmap.Format.isChannelU8() is true).

    • TGA

      public static final Bitmap.SaveFormat TGA
      Save as the TGA format. TGA is lossless and compressed (by default), and quality is ignored.

      Only supports 8-bit per channel images (Bitmap.Format.isChannelU8() is true).

    • BMP

      public static final Bitmap.SaveFormat BMP
      Save as the BMP format. BMP is lossless but almost uncompressed, so it takes up a lot of space, and quality is ignored as well.

      Only supports 8-bit per channel images (Bitmap.Format.isChannelU8() is true).

    • JPEG

      public static final Bitmap.SaveFormat JPEG
      Save as the JPEG baseline format. quality of 1 means compress for the smallest size. 100 means compress for max visual quality. The file extension can be .jpg.

      Only supports 8-bit per channel images (Bitmap.Format.isChannelU8() is true).

    • HDR

      public static final Bitmap.SaveFormat HDR
      Save as the Radiance RGBE format. RGBE allows pixels to have the dynamic range and precision of floating-point values, and quality is ignored.

      Only supports 32-bit per channel images (Bitmap.Format.isChannelHDR() is true).

    • RAW

      public static final Bitmap.SaveFormat RAW
      Save as the raw binary data, this is simply a memory dump. The byte order is determined by host endianness ByteOrder.nativeOrder().
  • Method Details

    • values

      public static Bitmap.SaveFormat[] 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

      public static Bitmap.SaveFormat valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • write

      public boolean write(@NonNull org.lwjgl.stb.STBIWriteCallbackI func, int width, int height, @NonNull Bitmap.Format format, long data, int quality) throws IOException
      Throws:
      IOException
    • getAllFilters

      @NonNull public static org.lwjgl.PointerBuffer getAllFilters(@NonNull org.lwjgl.system.MemoryStack stack)
    • getAllDescription

      @NonNull public static String getAllDescription()
      Reads: "Image Files (*.png;*.jpg;*.bmp)"
    • getAllDescription

      @NonNull public static String getAllDescription(@NonNull String header)
      Reads: "[header] (*.png;*.jpg;*.bmp)"
    • getFilters

      @NonNull public org.lwjgl.PointerBuffer getFilters(@NonNull org.lwjgl.system.MemoryStack stack)
    • getDescription

      @NonNull public String getDescription()
    • getDefaultExtension

      @NonNull public String getDefaultExtension()
    • getFileName

      @NonNull public static String getFileName(@Nullable Bitmap.SaveFormat format, @Nullable String name)