Accessing Texture Metadata

A short code example showing how to read metadata from the header of a texture

In this example, metadata is read from the header of a texture and interpreted based on values of DevFOURCC and u32Key.

#include "PVRTexture.h"

using namespace pvrtexture;

CPVRTString filePath = "test.pvr";

// Open and reads a pvr texture from the file location specified by filePath
CPVRTexture cTexture(filePath);

// Get a reference to the header
const CPVRTextureHeader& rHeader = cTexture.getHeader();

// As the developer, we choose our own values for DevFOURCC and u32Key
// As such, we know what they are, in this case ‘aCC’ and ‘aKey’ respectively.

if(rHeader.hasMetaData(aCC, aKey))
   // Handle the block based on ‘aCC’ and ‘aKey’