Skip to content
Discussion options

You must be logged in to vote
ktxTexture2_SetImageMemory((ktx_uint8_t *) data); // <-------- I NEED THIS
// Or simply: texture->pData = (ktx_uint8_t *) data; Is this safe???

Yes, it is safe provided the memory chunk with the data can be freed by a call to free. ktxTexture2_destruct will free a non-zero texture->pData.

But ...

// Now I should be able to use following functions in-place
ktxTexture2_CompressBasisEx(texture, ...);
ktxTexture2_TranscodeBasis(texture, ...);

... you must correctly initialize the DFD (texture->pDfd) for the data you have loaded. That includes the color space information. The correct transferFunction is vital for correct compression and eventually correct transcode results. Also the trans…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@MarkCallow
Comment options

Answer selected by Lephar
@Lephar
Comment options

@MarkCallow
Comment options

@MarkCallow
Comment options

@Lephar
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants