IT. Expert System.

Android Reference

ETC1


android.opengl

Class ETC1



  • public class ETC1
    extends Object
    Methods for encoding and decoding ETC1 textures.

    The standard for the ETC1 texture format can be found at http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt

    The PKM file format is of a 16-byte header that describes the image bounds followed by the encoded ETC1 texture data.

    See Also:
    ETC1Util
    • Field Detail

      • ENCODED_BLOCK_SIZE

        public static final int ENCODED_BLOCK_SIZE
        Size in bytes of an encoded block.
        See Also:
        Constant Field Values
      • DECODED_BLOCK_SIZE

        public static final int DECODED_BLOCK_SIZE
        Size in bytes of a decoded block.
        See Also:
        Constant Field Values
      • ETC_PKM_HEADER_SIZE

        public static final int ETC_PKM_HEADER_SIZE
        Size of a PKM file header, in bytes.
        See Also:
        Constant Field Values
      • ETC1_RGB8_OES

        public static final int ETC1_RGB8_OES
        Accepted by the internalformat parameter of glCompressedTexImage2D.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ETC1

        public ETC1()
    • Method Detail

      • encodeBlock

        public static void encodeBlock(Buffer in,
                       int validPixelMask,
                       Buffer out)
        Encode a block of pixels.
        Parameters:
        in - a native order direct buffer of size DECODED_BLOCK_SIZE that represent a 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R value of pixel (x, y).
        validPixelMask - is a 16-bit mask where bit (1 << (x + y * 4)) indicates whether the corresponding (x,y) pixel is valid. invalid pixel color values are ignored when compressing.
        out - a native order direct buffer of size ENCODED_BLOCK_SIZE that receives the ETC1 compressed version of the data.
      • decodeBlock

        public static void decodeBlock(Buffer in,
                       Buffer out)
        Decode a block of pixels.
        Parameters:
        in - a native order direct buffer of size ENCODED_BLOCK_SIZE that contains the ETC1 compressed version of the data.
        out - a native order direct buffer of size DECODED_BLOCK_SIZE that will receive the decoded data. The data represents a 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R value of pixel (x, y).
      • getEncodedDataSize

        public static int getEncodedDataSize(int width,
                             int height)
        Return the size of the encoded image data (does not include size of PKM header).
      • encodeImage

        public static void encodeImage(Buffer in,
                       int width,
                       int height,
                       int pixelSize,
                       int stride,
                       Buffer out)
        Encode an entire image.
        Parameters:
        in - a native order direct buffer of the image data. Formatted such that pixel (x,y) is at pIn + pixelSize * x + stride * y;
        out - a native order direct buffer of the encoded data. Must be large enough to store entire encoded image.
        pixelSize - must be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image.
      • decodeImage

        public static void decodeImage(Buffer in,
                       Buffer out,
                       int width,
                       int height,
                       int pixelSize,
                       int stride)
        Decode an entire image.
        Parameters:
        in - native order direct buffer of the encoded data.
        out - native order direct buffer of the image data. Will be written such that pixel (x,y) is at pIn + pixelSize * x + stride * y. Must be large enough to store entire image.
        pixelSize - must be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image.
      • formatHeader

        public static void formatHeader(Buffer header,
                        int width,
                        int height)
        Format a PKM header
        Parameters:
        header - native order direct buffer of the header.
        width - the width of the image in pixels.
        height - the height of the image in pixels.
      • isValid

        public static boolean isValid(Buffer header)
        Check if a PKM header is correctly formatted.
        Parameters:
        header - native order direct buffer of the header.
      • getWidth

        public static int getWidth(Buffer header)
        Read the image width from a PKM header
        Parameters:
        header - native order direct buffer of the header.
      • getHeight

        public static int getHeight(Buffer header)
        Read the image height from a PKM header
        Parameters:
        header - native order direct buffer of the header.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 21 / 158862507. Delta: 0.07355 с