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

Function ktxTexture2_constructFromStream

lib/texture2.c:1091–1108  ·  view source on GitHub ↗

* @memberof ktxTexture2 @private * @~English * @brief Construct a ktxTexture from a ktxStream reading from a KTX source. * * The stream object is copied into the constructed ktxTexture2. * * The create flag KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT should not be set, * if the ktxTexture is ultimately to be uploaded to OpenGL or Vulkan. This * will minimize memory usage by allowing, for exampl

Source from the content-addressed store, hash-verified

1089 * For other exceptions see ktxTexture2_constructFromStreamAndHeader().
1090 */
1091static KTX_error_code
1092ktxTexture2_constructFromStream(ktxTexture2* This, ktxStream* pStream,
1093 ktxTextureCreateFlags createFlags)
1094{
1095 KTX_header2 header;
1096 KTX_error_code result;
1097
1098 // Read header.
1099 result = pStream->read(pStream, &header, KTX2_HEADER_SIZE);
1100 if (result != KTX_SUCCESS)
1101 return result;
1102
1103#if IS_BIG_ENDIAN
1104 // byte swap the header
1105#endif
1106 return ktxTexture2_constructFromStreamAndHeader(This, pStream,
1107 &header, createFlags);
1108}
1109
1110/**
1111 * @memberof ktxTexture2 @private

Calls 2

readMethod · 0.45

Tested by

no test coverage detected