/* -*- tab-width: 4; -*- */ /* vi: set sw=2 ts=4 expandtab: */ /* $Id$ */ /* * Copyright 2010-2020 The Khronos Group Inc. * SPDX-License-Identifier: Apache-2.0 */ /** * @internal * @file checkheader.c * @~English * * @brief Function to verify a KTX file header * * @author Mark Callow, HI Corporation */ /* * Author: Georg Kolling, Imagination Technology with modifications * by Mark Callow, HI Corporation. */ #include <assert.h> #include <string.h> #include "ktx.h" #include "ktxint.h" #include "vkformat_enum.h" bool isProhibitedFormat(VkFormat format); bool isValidFormat(VkFormat format); /** * @internal * @~English * @brief Check a KTX file header. * * As well as checking that the header identifies a KTX file, the function * sanity checks the values and returns information about the texture in a * struct KTX_supplementary_info. * * @param pHeader pointer to the KTX header to check * @param pSuppInfo pointer to a KTX_supplementary_info structure in which to * return information about the texture. * * @author Georg Kolling, Imagination Technology * @author Mark Callow, HI Corporation */ KTX_error_code ktxCheckHeader1_(KTX_header* pHeader, KTX_supplemental_info* pSuppInfo) { … } /** * @internal * @~English * @brief Check a KTX2 file header. * * As well as checking that the header identifies a KTX 2 file, the function * sanity checks the values and returns information about the texture in a * struct KTX_supplementary_info. * * @param pHeader pointer to the KTX header to check * @param pSuppInfo pointer to a KTX_supplementary_info structure in which to * return information about the texture. * * @author Mark Callow, HI Corporation */ KTX_error_code ktxCheckHeader2_(KTX_header2* pHeader, KTX_supplemental_info* pSuppInfo) { … }