public class ETC1 extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ETC1.ETC1Data
Class for storing ETC1 compressed image data.
|
Modifier and Type | Field and Description |
---|---|
static int |
ETC1_RGB8_OES |
static int |
PKM_HEADER_SIZE
The PKM header size in bytes
|
Constructor and Description |
---|
ETC1() |
Modifier and Type | Method and Description |
---|---|
static Pixmap |
decodeImage(ETC1.ETC1Data etc1Data,
Pixmap.Format format)
Takes ETC1 compressed image data and converts it to a
Pixmap.Format.RGB565 or Pixmap.Format.RGB888 Pixmap . |
static ETC1.ETC1Data |
encodeImage(Pixmap pixmap)
Encodes the image via the ETC1 compression scheme.
|
static ETC1.ETC1Data |
encodeImagePKM(Pixmap pixmap)
Encodes the image via the ETC1 compression scheme.
|
static void |
formatHeader(ByteBuffer header,
int offset,
int width,
int height)
Writes a PKM header to the
ByteBuffer . |
static int |
getCompressedDataSize(int width,
int height) |
public static int PKM_HEADER_SIZE
public static int ETC1_RGB8_OES
public static ETC1.ETC1Data encodeImage(Pixmap pixmap)
Pixmap.Format.RGB565
and Pixmap.Format.RGB888
are supported.pixmap
- the Pixmap
ETC1.ETC1Data
public static ETC1.ETC1Data encodeImagePKM(Pixmap pixmap)
Pixmap.Format.RGB565
and Pixmap.Format.RGB888
are supported. Adds
a PKM header in front of the compressed image data.pixmap
- the Pixmap
ETC1.ETC1Data
public static Pixmap decodeImage(ETC1.ETC1Data etc1Data, Pixmap.Format format)
Pixmap.Format.RGB565
or Pixmap.Format.RGB888
Pixmap
. Does
not modify the ByteBuffer's position or limit.etc1Data
- the ETC1.ETC1Data
instanceformat
- either Pixmap.Format.RGB565
or Pixmap.Format.RGB888
public static int getCompressedDataSize(int width, int height)
width
- the width in pixelsheight
- the height in pixelspublic static void formatHeader(ByteBuffer header, int offset, int width, int height)
ByteBuffer
. Does not modify the position or limit of the ByteBuffer.header
- the direct native order ByteBuffer
offset
- the offset to the header in byteswidth
- the width in pixelsheight
- the height in pixelsCopyright © 2014. All rights reserved.