Package icyllis.modernui.graphics
Enum Class Bitmap.SaveFormat
- All Implemented Interfaces:
Serializable
,Comparable<Bitmap.SaveFormat>
,Constable
- Enclosing class:
Bitmap
List of supported formats a bitmap can be saved as (encoding or compressing).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Reads: "Image Files (*.png;*.jpg;*.bmp)"static String
getAllDescription
(String header) Reads: "[header] (*.png;*.jpg;*.bmp)"static org.lwjgl.PointerBuffer
getAllFilters
(org.lwjgl.system.MemoryStack stack) static String
getFileName
(Bitmap.SaveFormat format, String name) org.lwjgl.PointerBuffer
getFilters
(org.lwjgl.system.MemoryStack stack) static Bitmap.SaveFormat
Returns the enum constant of this class with the specified name.static Bitmap.SaveFormat[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.boolean
write
(org.lwjgl.stb.STBIWriteCallbackI func, int width, int height, Bitmap.Format format, long data, int quality)
-
Enum Constant Details
-
PNG
Save as the PNG format. PNG is lossless and compressed, andquality
is ignored.Only supports 8-bit per channel images (
Bitmap.Format.isChannelU8()
is true). -
TGA
Save as the TGA format. TGA is lossless and compressed (by default), andquality
is ignored.Only supports 8-bit per channel images (
Bitmap.Format.isChannelU8()
is true). -
BMP
Save as the BMP format. BMP is lossless but almost uncompressed, so it takes up a lot of space, andquality
is ignored as well.Only supports 8-bit per channel images (
Bitmap.Format.isChannelU8()
is true). -
JPEG
Save as the JPEG baseline format.quality
of1
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
Save as the Radiance RGBE format. RGBE allows pixels to have the dynamic range and precision of floating-point values, andquality
is ignored.Only supports 32-bit per channel images (
Bitmap.Format.isChannelHDR()
is true). -
RAW
Save as the raw binary data, this is simply a memory dump. The byte order is determined by host endiannessByteOrder.nativeOrder()
.
-
-
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
-
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
-
getAllDescription
Reads: "Image Files (*.png;*.jpg;*.bmp)" -
getAllDescription
Reads: "[header] (*.png;*.jpg;*.bmp)" -
getFilters
-
getDescription
-
getDefaultExtension
-
getFileName
-