OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ETCHeader.h
Go to the documentation of this file.
1 /* Copyright (c) 2012-2017, ARM Limited and Contributors
2  *
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge,
6  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 
22 #ifndef ETCHEADER_H
23 #define ETCHEADER_H
24 
25 #if GLES_VERSION == 2
26 #include <GLES2/gl2.h>
27 #elif GLES_VERSION == 3
28 #include <GLES3/gl3.h>
29 #else
30 #error "GLES_VERSION must be defined as either 2 or 3"
31 #endif
32 
33 namespace MaliSDK
34 {
38  class ETCHeader
39  {
40  private:
41  unsigned char paddedWidthMSB;
42  unsigned char paddedWidthLSB;
43  unsigned char paddedHeightMSB;
44  unsigned char paddedHeightLSB;
45  unsigned char widthMSB;
46  unsigned char widthLSB;
47  unsigned char heightMSB;
48  unsigned char heightLSB;
49  public:
53  ETCHeader();
54 
58  ETCHeader(unsigned char *data);
59 
68  unsigned short getWidth(void);
69 
78  unsigned short getHeight(void);
79 
87  unsigned short getPaddedWidth(void);
88 
96  unsigned short getPaddedHeight(void);
97 
105  GLsizei getSize(GLenum internalFormat);
106  };
107 }
108 #endif /* ETCHEADER_H */
unsigned short getPaddedHeight(void)
The height of the compressed texture with the padding added.
Definition: ETCHeader.cpp:63
Class to extract information from the ETC headers of compressed textures.
Definition: ETCHeader.h:38
unsigned char heightLSB
Definition: ETCHeader.h:48
unsigned char paddedHeightMSB
Definition: ETCHeader.h:43
unsigned char paddedWidthLSB
Definition: ETCHeader.h:42
unsigned short getHeight(void)
The height of the original texture.
Definition: ETCHeader.cpp:53
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Definition: gl2ext.h:179
unsigned char heightMSB
Definition: ETCHeader.h:47
unsigned short getPaddedWidth(void)
The width of the compressed texture with the padding added.
Definition: ETCHeader.cpp:58
unsigned char widthMSB
Definition: ETCHeader.h:45
unsigned char widthLSB
Definition: ETCHeader.h:46
unsigned char paddedWidthMSB
Definition: ETCHeader.h:41
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
unsigned short getWidth(void)
The width of the original texture.
Definition: ETCHeader.cpp:48
GLsizei getSize(GLenum internalFormat)
The size of the compressed texture with the padding added.
Definition: ETCHeader.cpp:66
unsigned char paddedHeightLSB
Definition: ETCHeader.h:44
ETCHeader()
Default constructor.
Definition: ETCHeader.cpp:25