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

Method open

interface/basisu_c_binding/src/basisu_c_binding.cpp:13–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#define MAGIC 0xDEADBEE1
12
13bool basis_file::open(const uint8_t *buffer, uint32_t newByteLength) {
14 m_file = buffer;
15 byteLength = newByteLength;
16
17 if (!m_transcoder.validate_header(buffer, newByteLength)) {
18 m_file = nullptr;
19 byteLength = 0;
20 return false;
21 }
22
23 if (!m_transcoder.get_file_info(m_file, byteLength, fileinfo))
24 {
25 return false;
26 }
27
28 // Initialized after validation
29 m_magic = MAGIC;
30 return true;
31}
32
33void basis_file::close() {
34 assert(m_magic == MAGIC);

Callers 1

ktx_basisu_open_basisFunction · 0.45

Calls 2

validate_headerMethod · 0.80
get_file_infoMethod · 0.80

Tested by

no test coverage detected