Skip to content

Commit

Permalink
Make ktxTexture2_Write functions public. (#985)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCallow authored Feb 24, 2025
1 parent 7356c0d commit b330a2e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
41 changes: 32 additions & 9 deletions include/ktx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1037,27 +1037,34 @@ KTX_API ktx_bool_t KTX_APIENTRY
ktxTexture1_NeedsTranscoding(ktxTexture1* This);

/*
* Write a ktxTexture object to a stdio stream in KTX format.
* These four write a ktxTexture1 object to a KTX v1 file.
*/
KTX_API KTX_error_code KTX_APIENTRY
ktxTexture1_WriteKTX2ToStdioStream(ktxTexture1* This, FILE* dstsstr);
ktxTexture1_WriteToStdioStream(ktxTexture1* This, FILE* dstsstr);

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture1_WriteToNamedFile(ktxTexture1* This, const char* const dstname);

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture1_WriteToMemory(ktxTexture1* This,
ktx_uint8_t** bytes, ktx_size_t* size);

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture1_WriteToStream(ktxTexture1* This, ktxStream *dststr);

/*
* Write a ktxTexture object to a named file in KTX format.
* These four write a ktxTexture1 object to a KTX v2 file.
*/
KTX_API KTX_error_code KTX_APIENTRY
ktxTexture1_WriteKTX2ToStdioStream(ktxTexture1* This, FILE* dstsstr);

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture1_WriteKTX2ToNamedFile(ktxTexture1* This, const char* const dstname);

/*
* Write a ktxTexture object to a block of memory in KTX format.
*/
KTX_API KTX_error_code KTX_APIENTRY
ktxTexture1_WriteKTX2ToMemory(ktxTexture1* This,
ktx_uint8_t** bytes, ktx_size_t* size);

/*
* Write a ktxTexture object to a ktxStream in KTX format.
*/
KTX_API KTX_error_code KTX_APIENTRY
ktxTexture1_WriteKTX2ToStream(ktxTexture1* This, ktxStream *dststr);

Expand Down Expand Up @@ -1151,6 +1158,22 @@ ktxTexture2_SetOETF(ktxTexture2* This, khr_df_transfer_e oetf);
KTX_API ktx_error_code_e KTX_APIENTRY
ktxTexture2_SetPrimaries(ktxTexture2* This, khr_df_primaries_e primaries);

/*
* These four write a ktxTexture2 object to a KTX v2 file.
*/
KTX_API KTX_error_code KTX_APIENTRY
ktxTexture2_WriteToStdioStream(ktxTexture2* This, FILE* dstsstr);

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture2_WriteToNamedFile(ktxTexture2* This, const char* const dstname);

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture2_WriteToMemory(ktxTexture2* This,
ktx_uint8_t** bytes, ktx_size_t* size);

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture2_WriteToStream(ktxTexture2* This, ktxStream *dststr);

/**
* @~English
* @brief Flags specifiying UASTC encoding options.
Expand Down
7 changes: 0 additions & 7 deletions lib/texture_funcs.inl
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ KTX_error_code CLASS_FUNC(SetImageFromMemory)(CLASS* This,
ktx_uint32_t faceSlice,
const ktx_uint8_t* src, ktx_size_t srcSize);

KTX_error_code CLASS_FUNC(WriteToStdioStream)(CLASS* This, FILE* dstsstr);
KTX_error_code CLASS_FUNC(WriteToNamedFile)(CLASS* This,
const char* const dstname);
KTX_error_code CLASS_FUNC(WriteToMemory)(CLASS* This,
ktx_uint8_t** ppDstBytes, ktx_size_t* pSize);
KTX_error_code CLASS_FUNC(WriteToStream)(CLASS* This,
ktxStream* dststr);

/*
======================================
Expand Down

0 comments on commit b330a2e

Please sign in to comment.