MCPcopy Create free account
hub / github.com/defold/defold / GetAstcDimensions

Function GetAstcDimensions

engine/dlib/src/dlib/image.cpp:188–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 }
187
188 bool GetAstcDimensions(const void* mem, uint32_t memsize, uint32_t* width, uint32_t* height, uint32_t* depth)
189 {
190 if (!IsAstc(mem, memsize))
191 return false;
192
193 AstcHeader* header = (AstcHeader*)mem;
194 *width = header->m_DimensionX[0] + (header->m_DimensionX[1] << 8) + (header->m_DimensionX[2] << 16);
195 *height = header->m_DimensionY[0] + (header->m_DimensionY[1] << 8) + (header->m_DimensionY[2] << 16);
196 *depth = header->m_DimensionZ[0] + (header->m_DimensionZ[1] << 8) + (header->m_DimensionZ[2] << 16);
197 return true;
198 }
199}
200

Callers 4

TESTFunction · 0.50
NewDynamicTextureFunction · 0.50
SetDynamicTextureDataFunction · 0.50
Image_GetAstcHeaderFunction · 0.50

Calls 1

IsAstcFunction · 0.85

Tested by 1

TESTFunction · 0.40