MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / ktxTexture2_constructFromMemory

Function ktxTexture2_constructFromMemory

lib/texture2.c:1211–1227  ·  view source on GitHub ↗

* @memberof ktxTexture2 @private * @~English * @brief Construct a ktxTexture 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 i

Source from the content-addressed store, hash-verified

1209 * For other exceptions, see ktxTexture_constructFromStream().
1210 */
1211static KTX_error_code
1212ktxTexture2_constructFromMemory(ktxTexture2* This,
1213 const ktx_uint8_t* bytes, ktx_size_t size,
1214 ktxTextureCreateFlags createFlags)
1215{
1216 KTX_error_code result;
1217 ktxStream stream;
1218
1219 if (bytes == NULL || size == 0)
1220 return KTX_INVALID_VALUE;
1221
1222 result = ktxMemStream_construct_ro(&stream, bytes, size);
1223 if (result == KTX_SUCCESS)
1224 result = ktxTexture2_constructFromStream(This, &stream, createFlags);
1225
1226 return result;
1227}
1228
1229/**
1230 * @memberof ktxTexture2 @private

Callers 1

Calls 2

Tested by

no test coverage detected