Using ktxTexture_SetImageFromStdioStream and ktxTexture_SetImageFromMemory to create a ktx2 file from a png file. #964
-
Hello, i'm trying to convert my png filles into ktx2 files using the mentioned functions, i followed the https://github.khronos.org/KTX-Software/libktx/index.html#writektx "Writing a KTX or KTX2 file" section wich only refers to ...SetImageFromMemory function, when i tried it, the src parametter wasn't working so i dig into the ktx.h file and found the ...SetImageFromStdioStrem wich already work, my questions are: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It is the byte size of the image: width * height * bytes_per_pixel.
A valid FILE* with its read pointer set to start of decoded image data. This function is not useful with a PNG file as you need to decode the data before passing it to libktx. There the data will already be loaded in memory.
It is the same as for You can use |
Beta Was this translation helpful? Give feedback.
src
is a pointer to the decoded image (i.e. the raw pixel data) in memory.It is the byte size of the image: width * height * bytes_per_pixel.
A valid FILE* with its read pointer set to start of decoded image data. This function is not useful with a PNG file as you need to decode the data before passing it to libktx. There the data will already be load…