Class ETC1


  • public class ETC1
    extends java.lang.Object
    Class for encoding and decoding ETC1 compressed images. Also provides methods to add a PKM header.
    • Field Detail

      • PKM_HEADER_SIZE

        public static int PKM_HEADER_SIZE
        The PKM header size in bytes
      • ETC1_RGB8_OES

        public static int ETC1_RGB8_OES
    • Constructor Detail

      • ETC1

        public ETC1()
    • Method Detail

      • getCompressedDataSize

        public static int getCompressedDataSize​(int width,
                                                int height)
        Parameters:
        width - the width in pixels
        height - the height in pixels
        Returns:
        the number of bytes needed to store the compressed data
      • formatHeader

        public static void formatHeader​(java.nio.ByteBuffer header,
                                        int offset,
                                        int width,
                                        int height)
        Writes a PKM header to the ByteBuffer. Does not modify the position or limit of the ByteBuffer.
        Parameters:
        header - the direct native order ByteBuffer
        offset - the offset to the header in bytes
        width - the width in pixels
        height - the height in pixels