Dali 3D User Interface Engine
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
loader-ktx.cpp File Reference
#include "loader-ktx.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <stdint.h>
#include <dali/public-api/common/compile-time-assert.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/bitmap.h>
#include <dali/public-api/images/pixel.h>
Include dependency graph for loader-ktx.cpp:

Go to the source code of this file.

Classes

struct  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KtxFileHeader
 

Namespaces

namespace  Dali
 The top level DALi namespace.
 
namespace  Dali::TizenPlatform
 
namespace  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}
 

Typedefs

typedef uint8_t Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::Byte
 

Enumerations

enum  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KtxInternalFormat {
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_NOTEXIST = 0, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_ETC1_RGB8_OES = 0x8D64, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_R11_EAC = 0x9270,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SIGNED_R11_EAC = 0x9271, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RG11_EAC = 0x9272, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SIGNED_RG11_EAC = 0x9273, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGB8_ETC2 = 0x9274,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ETC2 = 0x9275, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA8_ETC2_EAC = 0x9278,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC,
  Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD, Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KTX_SENTINEL = ~0u
}
 The formats we support inside a KTX file container. More...
 

Functions

struct
Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KtxFileHeader 
Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::__attribute__ ((__packed__))
 
template<typename T >
bool Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::ReadHeader (FILE *fp, T &header)
 Template function to read from the file directly into our structure. More...
 
template<int BYTES_IN_SIGNATURE>
bool Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::CheckFileIdentifier (const Byte *const signature)
 Check whether the array passed in is the right size and matches the magic values defined to be at the start of a KTX file by the specification. More...
 
bool Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::ValidInternalFormat (const unsigned format)
 
bool Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::ConvertPixelFormat (const uint32_t ktxPixelFormat, Dali::Pixel::Format &format)
 
bool Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::LoadKtxHeader (FILE *const fp, unsigned int &width, unsigned int &height, KtxFileHeader &fileHeader)
 
bool Dali::TizenPlatform::LoadKtxHeader (const ImageLoader::Input &input, unsigned int &width, unsigned int &height)
 Loads the header of a KTX file and fills in the width and height appropriately. More...
 
bool Dali::TizenPlatform::LoadBitmapFromKtx (const ResourceLoadingClient &client, const ImageLoader::Input &input, Integration::Bitmap &bitmap)
 Loads a compressed bitmap from a KTX file without decoding it. More...
 

Variables

const unsigned Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::MAX_TEXTURE_DIMENSION = 4096
 Max width or height of an image. More...
 
const unsigned Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::MAX_IMAGE_DATA_SIZE = MAX_TEXTURE_DIMENSION * MAX_TEXTURE_DIMENSION
 Max bytes of image data allowed. More...
 
const unsigned Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::MAX_BYTES_OF_KEYVALUE_DATA = 65536U
 We don't read any of this but limit it to a resonable amount in order to be friendly to files from random tools. More...
 
const Byte Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::FileIdentifier []
 
const unsigned Dali::TizenPlatform::anonymous_namespace{loader-ktx.cpp}::KtxInternalFormats []
 
Byte identifier [12]
 
uint32_t endianness
 
uint32_t glType
 
uint32_t glTypeSize
 
uint32_t glFormat
 
uint32_t glInternalFormat
 
uint32_t glBaseInternalFormat
 
uint32_t pixelWidth
 
uint32_t pixelHeight
 
uint32_t pixelDepth
 
uint32_t numberOfArrayElements
 
uint32_t numberOfFaces
 
uint32_t numberOfMipmapLevels
 
uint32_t bytesOfKeyValueData
 

Variable Documentation

uint32_t bytesOfKeyValueData

Definition at line 195 of file loader-ktx.cpp.

uint32_t endianness

Definition at line 183 of file loader-ktx.cpp.

uint32_t glBaseInternalFormat

Definition at line 188 of file loader-ktx.cpp.

uint32_t glFormat

Definition at line 186 of file loader-ktx.cpp.

uint32_t glInternalFormat

Definition at line 187 of file loader-ktx.cpp.

uint32_t glType

Definition at line 184 of file loader-ktx.cpp.

uint32_t glTypeSize

Definition at line 185 of file loader-ktx.cpp.

Byte identifier[12]

Definition at line 182 of file loader-ktx.cpp.

uint32_t numberOfArrayElements

Definition at line 192 of file loader-ktx.cpp.

uint32_t numberOfFaces

Definition at line 193 of file loader-ktx.cpp.

uint32_t numberOfMipmapLevels

Definition at line 194 of file loader-ktx.cpp.

uint32_t pixelDepth

Definition at line 191 of file loader-ktx.cpp.

Referenced by Dali::Internal::BitmapTexture::AreaUpdated().

uint32_t pixelHeight

Definition at line 190 of file loader-ktx.cpp.

uint32_t pixelWidth
Dali Docs Home
Read more about Dali