libktx Reference 4.3.2
Libraries and tools to create and read KTX image texture files.
Loading...
Searching...
No Matches
ktxTexture1 Class Reference

Class representing a KTX version 1 format texture. More...

#include <ktx.h>

Public Member Functions

KTX_error_code ktxTexture1_GLUpload (ktxTexture1 *This, GLuint *pTexture, GLenum *pTarget, GLenum *pGlerror)
 Create a GL texture object from a ktxTexture1 object.
 
KTX_error_code ktxTexture1_Create (ktxTextureCreateInfo *createInfo, ktxTextureCreateStorageEnum storageAllocation, ktxTexture1 **newTex)
 Create a new empty ktxTexture1.
 
KTX_error_code ktxTexture1_CreateFromStdioStream (FILE *stdioStream, ktxTextureCreateFlags createFlags, ktxTexture1 **newTex)
 Create a ktxTexture1 from a stdio stream reading from a KTX source.
 
KTX_error_code ktxTexture1_CreateFromNamedFile (const char *const filename, ktxTextureCreateFlags createFlags, ktxTexture1 **newTex)
 Create a ktxTexture1 from a named KTX file.
 
KTX_error_code ktxTexture1_CreateFromMemory (const ktx_uint8_t *bytes, ktx_size_t size, ktxTextureCreateFlags createFlags, ktxTexture1 **newTex)
 Create a ktxTexture1 from KTX-formatted data in memory.
 
KTX_error_code ktxTexture1_CreateFromStream (ktxStream *pStream, ktxTextureCreateFlags createFlags, ktxTexture1 **newTex)
 Create a ktxTexture1 from KTX-formatted data from a ktxStream.
 
void ktxTexture1_Destroy (ktxTexture1 *This)
 Destroy a ktxTexture1 object.
 
KTX_error_code ktxTexture1_GetImageOffset (ktxTexture1 *This, ktx_uint32_t level, ktx_uint32_t layer, ktx_uint32_t faceSlice, ktx_size_t *pOffset)
 Find the offset of an image within a ktxTexture's image data.
 
ktx_size_t ktxTexture1_GetDataSizeUncompressed (ktxTexture1 *This)
 Return the total size in bytes of the uncompressed data of a ktxTexture1.
 
ktx_size_t ktxTexture1_GetImageSize (ktxTexture1 *This, ktx_uint32_t level)
 Calculate & return the size in bytes of an image at the specified mip level.
 
KTX_error_code ktxTexture1_IterateLevels (ktxTexture1 *This, PFNKTXITERCB iterCb, void *userdata)
 Iterate over the mip levels in a ktxTexture1 object.
 
KTX_error_code ktxTexture1_IterateLoadLevelFaces (ktxTexture1 *This, PFNKTXITERCB iterCb, void *userdata)
 Iterate over the images in a ktxTexture1 object while loading the image data.
 
KTX_error_code ktxTexture1_LoadImageData (ktxTexture1 *This, ktx_uint8_t *pBuffer, ktx_size_t bufSize)
 Load all the image data from the ktxTexture1's source.
 
KTX_error_code ktxTexture1_VkUploadEx_WithSuballocator (ktxTexture1 *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture, VkImageTiling tiling, VkImageUsageFlags usageFlags, VkImageLayout finalLayout, ktxVulkanTexture_subAllocatorCallbacks *subAllocatorCallbacks)
 Create a Vulkan image object from a ktxTexture1 object.
 
KTX_error_code ktxTexture1_VkUploadEx (ktxTexture1 *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture, VkImageTiling tiling, VkImageUsageFlags usageFlags, VkImageLayout finalLayout)
 Create a Vulkan image object from a ktxTexture1 object.
 
KTX_error_code ktxTexture1_VkUpload (ktxTexture1 *texture, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture)
 Create a Vulkan image object from a ktxTexture1 object.
 
VkFormat ktxTexture1_GetVkFormat (ktxTexture1 *This)
 Return the VkFormat enum of a ktxTexture1 object.
 
KTX_error_code ktxTexture1_SetImageFromStdioStream (ktxTexture1 *This, ktx_uint32_t level, ktx_uint32_t layer, ktx_uint32_t faceSlice, FILE *src, ktx_size_t srcSize)
 Set image for level, layer, faceSlice from a stdio stream source.
 
KTX_error_code ktxTexture1_SetImageFromMemory (ktxTexture1 *This, ktx_uint32_t level, ktx_uint32_t layer, ktx_uint32_t faceSlice, const ktx_uint8_t *src, ktx_size_t srcSize)
 Set image for level, layer, faceSlice from an image in memory.
 
KTX_error_code ktxTexture1_WriteToStream (ktxTexture1 *This, ktxStream *dststr)
 Write a ktxTexture object to a ktxStream in KTX format.
 
KTX_error_code ktxTexture1_WriteToStdioStream (ktxTexture1 *This, FILE *dstsstr)
 Write a ktxTexture object to a stdio stream in KTX format.
 
KTX_error_code ktxTexture1_WriteToNamedFile (ktxTexture1 *This, const char *const dstname)
 Write a ktxTexture object to a named file in KTX format.
 
KTX_error_code ktxTexture1_WriteToMemory (ktxTexture1 *This, ktx_uint8_t **ppDstBytes, ktx_size_t *pSize)
 Write a ktxTexture object to block of memory in KTX format.
 
KTX_error_code ktxTexture1_WriteKTX2ToStream (ktxTexture1 *This, ktxStream *dststr)
 Write a ktxTexture object to a ktxStream in KTX 2 format.
 
KTX_error_code ktxTexture1_WriteKTX2ToStdioStream (ktxTexture1 *This, FILE *dstsstr)
 Write a ktxTexture object to a stdio stream in KTX2 format.
 
KTX_error_code ktxTexture1_WriteKTX2ToNamedFile (ktxTexture1 *This, const char *const dstname)
 Write a ktxTexture object to a named file in KTX2 format.
 
KTX_error_code ktxTexture1_WriteKTX2ToMemory (ktxTexture1 *This, ktx_uint8_t **ppDstBytes, ktx_size_t *pSize)
 Write a ktxTexture object to block of memory in KTX2 format.
 

Data Fields

ktx_uint32_t glFormat
 
ktx_uint32_t glInternalformat
 
ktx_uint32_t glBaseInternalformat
 
ktx_uint32_t glType
 
struct ktxTexture1_private * _private
 

Detailed Description

Class representing a KTX version 1 format texture.

ktxTextures should be created only by one of the ktxTexture_Create* functions and these fields should be considered read-only.

Examples
glloader.c.

Field Documentation

◆ _private

struct ktxTexture1_private* _private

Private data.

◆ glBaseInternalformat

ktx_uint32_t glBaseInternalformat

Base format of the texture data, e.g., GL_RGB.

Examples
glloader.c.

◆ glFormat

ktx_uint32_t glFormat

Format of the texture data, e.g., GL_RGB.

Examples
glloader.c.

◆ glInternalformat

ktx_uint32_t glInternalformat

Internal format of the texture data, e.g., GL_RGB8.

Examples
glloader.c.

◆ glType

ktx_uint32_t glType

Type of the texture data, e.g, GL_UNSIGNED_BYTE.

Examples
glloader.c.