public class PixmapIO
extends java.lang.Object
| Constructor and Description |
|---|
PixmapIO() |
| Modifier and Type | Method and Description |
|---|---|
static Pixmap |
readCIM(FileHandle file)
Reads the
Pixmap from the given file, assuming the Pixmap was written with the
writeCIM(FileHandle, Pixmap) method. |
static void |
writeCIM(FileHandle file,
Pixmap pixmap)
Writes the
Pixmap to the given file using a custom compression scheme. |
static void |
writePNG(FileHandle file,
Pixmap pixmap)
Writes the pixmap as a PNG.
|
public static void writeCIM(FileHandle file, Pixmap pixmap)
Pixmap to the given file using a custom compression scheme. First three integers define the width, height
and format, remaining bytes are zlib compressed pixels. To be able to load the Pixmap to a Texture, use ".cim" as the file
suffix! Throws a GdxRuntimeException in case the Pixmap couldn't be written to the file.file - the file to write the Pixmap topublic static Pixmap readCIM(FileHandle file)
Pixmap from the given file, assuming the Pixmap was written with the
writeCIM(FileHandle, Pixmap) method. Throws a GdxRuntimeException in case the file couldn't be read.file - the file to read the Pixmap frompublic static void writePNG(FileHandle file, Pixmap pixmap)
writeCIM(FileHandle, Pixmap) is
faster if the file does not need to be read outside of libgdx.