* @memberof ktxTexture1 @private * @brief Construct a ktxTexture1 from KTX-formatted data in memory. * * See ktxTextureInt_constructFromStream for details. * * @param[in] This pointer to a ktxTextureInt-sized block of memory to * initialize. * @param[in] bytes pointer to the memory containing the serialized KTX data. * @param[in] size length of the KTX data in bytes. *
| 520 | * For other exceptions, see ktxTexture_constructFromStream(). |
| 521 | */ |
| 522 | static KTX_error_code |
| 523 | ktxTexture1_constructFromMemory(ktxTexture1* This, |
| 524 | const ktx_uint8_t* bytes, ktx_size_t size, |
| 525 | ktxTextureCreateFlags createFlags) |
| 526 | { |
| 527 | ktxStream stream; |
| 528 | KTX_error_code result; |
| 529 | |
| 530 | if (bytes == NULL || size == 0) |
| 531 | return KTX_INVALID_VALUE; |
| 532 | |
| 533 | result = ktxMemStream_construct_ro(&stream, bytes, size); |
| 534 | if (result == KTX_SUCCESS) |
| 535 | result = ktxTexture1_constructFromStream(This, &stream, createFlags); |
| 536 | |
| 537 | return result; |
| 538 | } |
| 539 | |
| 540 | void |
| 541 | ktxTexture1_destruct(ktxTexture1* This) |
no test coverage detected