LCOV - code coverage report
Current view: top level - frmts/basisu_ktx2 - commoncore.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 6 6 100.0 %
Date: 2024-11-21 22:18:42 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  OpenGIS Simple Features Reference Implementation
       4             :  * Purpose:  Implements Basis Universal / KTX2 driver.
       5             :  * Author:   Even Rouault, <even dot rouault at spatialys.com>
       6             :  *
       7             :  ******************************************************************************
       8             :  * Copyright (c) 2022, Even Rouault <even dot rouault at spatialys.com>
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : 
      13             : #include "commoncore.h"
      14             : 
      15             : /************************************************************************/
      16             : /*                  GDAL_KTX2_BASISU_GetCreationOptions()               */
      17             : /************************************************************************/
      18             : 
      19        2606 : std::string GDAL_KTX2_BASISU_GetCreationOptions(bool bIsKTX2)
      20             : {
      21             :     std::string osRet =
      22             :         "<CreationOptionList>"
      23             :         "   <Option name='COMPRESSION' type='string-select' default='ETC1S'>"
      24             :         "       <Value>ETC1S</Value>"
      25             :         "       <Value>UASTC</Value>"
      26        2606 :         "   </Option>";
      27        2606 :     if (bIsKTX2)
      28             :         osRet += "   <Option name='UASTC_SUPER_COMPRESSION' "
      29             :                  "type='string-select' default='ZSTD'>"
      30             :                  "       <Value>NONE</Value>"
      31             :                  "       <Value>ZSTD</Value>"
      32        1303 :                  "   </Option>";
      33             :     osRet +=
      34             :         "   <Option name='UASTC_LEVEL' type='int' min='0' max='4' default='2' "
      35             :         "description='The higher value, the higher the quality but the slower "
      36             :         "computing time. 4 is impractically slow'/>"
      37             :         "   <Option name='UASTC_RDO_LEVEL' type='float' min='0' default='1' "
      38             :         "description='Rate distortion optimization level. "
      39             :         "The lower value, the higher the quality, but the larger the file "
      40             :         "size. "
      41             :         "Usual range is [0.2,3]'/>"
      42             :         "   <Option name='ETC1S_LEVEL' type='int' min='0' max='6' default='1' "
      43             :         "description='The higher value, the higher the quality but the slower "
      44             :         "computing time.'/>"
      45             :         "   <Option name='ETC1S_QUALITY_LEVEL' type='int' min='1' max='255' "
      46             :         "default='128' "
      47             :         "description='The higher value, the higher the quality, "
      48             :         "but the larger the file size.'/>"
      49             :         "   <Option name='ETC1S_MAX_ENDPOINTS_CLUSTERS' type='int' min='1' "
      50             :         "max='16128' "
      51             :         "description='Maximum number of endpoint clusters. "
      52             :         "When set, ETC1S_MAX_SELECTOR_CLUSTERS must also be set. "
      53             :         "Mutually exclusive with ETC1S_QUALITY_LEVEL.'/>"
      54             :         "   <Option name='ETC1S_MAX_SELECTOR_CLUSTERS' type='int' min='1' "
      55             :         "max='16128' "
      56             :         "description='Maximum number of selector clusters. "
      57             :         "When set, ETC1S_MAX_ENDPOINTS_CLUSTERS must also be set. "
      58             :         "Mutually exclusive with ETC1S_QUALITY_LEVEL.'/>"
      59             :         "   <Option name='NUM_THREADS' type='int' description='Number of "
      60             :         "threads to use. "
      61             :         "By default, maximum number of virtual CPUs available'/>"
      62             :         "   <Option name='MIPMAP' type='boolean' "
      63             :         "description='Whether to enable MIPMAP generation.' default='NO'/>"
      64             :         "   <Option name='COLORSPACE' type='string-select' "
      65             :         "default='PERCEPTUAL_SRGB'>"
      66             :         "       <Value>PERCEPTUAL_SRGB</Value>"
      67             :         "       <Value>LINEAR</Value>"
      68             :         "   </Option>"
      69        2606 :         "</CreationOptionList>";
      70        2606 :     return osRet;
      71             : }

Generated by: LCOV version 1.14