public class PixmapIO extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PixmapIO.PNG
PNG encoder with compression.
|
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 with compression.
|
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)
PixmapIO.PNG
to configure the compression level, more efficiently flip the
pixmap vertically, and to write out multiple PNGs with minimal allocation.Copyright © 2015. All rights reserved.