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 : * Permission is hereby granted, free of charge, to any person obtaining a 11 : * copy of this software and associated documentation files (the "Software"), 12 : * to deal in the Software without restriction, including without limitation 13 : * the rights to use, copy, modify, merge, publish, distribute, sublicense, 14 : * and/or sell copies of the Software, and to permit persons to whom the 15 : * Software is furnished to do so, subject to the following conditions: 16 : * 17 : * The above copyright notice and this permission notice shall be included 18 : * in all copies or substantial portions of the Software. 19 : * 20 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 23 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 26 : * DEALINGS IN THE SOFTWARE. 27 : ****************************************************************************/ 28 : 29 : #include "commoncore.h" 30 : 31 : /************************************************************************/ 32 : /* GDAL_KTX2_BASISU_GetCreationOptions() */ 33 : /************************************************************************/ 34 : 35 2460 : std::string GDAL_KTX2_BASISU_GetCreationOptions(bool bIsKTX2) 36 : { 37 : std::string osRet = 38 : "<CreationOptionList>" 39 : " <Option name='COMPRESSION' type='string-select' default='ETC1S'>" 40 : " <Value>ETC1S</Value>" 41 : " <Value>UASTC</Value>" 42 2460 : " </Option>"; 43 2460 : if (bIsKTX2) 44 : osRet += " <Option name='UASTC_SUPER_COMPRESSION' " 45 : "type='string-select' default='ZSTD'>" 46 : " <Value>NONE</Value>" 47 : " <Value>ZSTD</Value>" 48 1230 : " </Option>"; 49 : osRet += 50 : " <Option name='UASTC_LEVEL' type='int' min='0' max='4' default='2' " 51 : "description='The higher value, the higher the quality but the slower " 52 : "computing time. 4 is impractically slow'/>" 53 : " <Option name='UASTC_RDO_LEVEL' type='float' min='0' default='1' " 54 : "description='Rate distortion optimization level. " 55 : "The lower value, the higher the quality, but the larger the file " 56 : "size. " 57 : "Usual range is [0.2,3]'/>" 58 : " <Option name='ETC1S_LEVEL' type='int' min='0' max='6' default='1' " 59 : "description='The higher value, the higher the quality but the slower " 60 : "computing time.'/>" 61 : " <Option name='ETC1S_QUALITY_LEVEL' type='int' min='1' max='255' " 62 : "default='128' " 63 : "description='The higher value, the higher the quality, " 64 : "but the larger the file size.'/>" 65 : " <Option name='ETC1S_MAX_ENDPOINTS_CLUSTERS' type='int' min='1' " 66 : "max='16128' " 67 : "description='Maximum number of endpoint clusters. " 68 : "When set, ETC1S_MAX_SELECTOR_CLUSTERS must also be set. " 69 : "Mutually exclusive with ETC1S_QUALITY_LEVEL.'/>" 70 : " <Option name='ETC1S_MAX_SELECTOR_CLUSTERS' type='int' min='1' " 71 : "max='16128' " 72 : "description='Maximum number of selector clusters. " 73 : "When set, ETC1S_MAX_ENDPOINTS_CLUSTERS must also be set. " 74 : "Mutually exclusive with ETC1S_QUALITY_LEVEL.'/>" 75 : " <Option name='NUM_THREADS' type='int' description='Number of " 76 : "threads to use. " 77 : "By default, maximum number of virtual CPUs available'/>" 78 : " <Option name='MIPMAP' type='boolean' " 79 : "description='Whether to enable MIPMAP generation.' default='NO'/>" 80 : " <Option name='COLORSPACE' type='string-select' " 81 : "default='PERCEPTUAL_SRGB'>" 82 : " <Value>PERCEPTUAL_SRGB</Value>" 83 : " <Value>LINEAR</Value>" 84 : " </Option>" 85 2460 : "</CreationOptionList>"; 86 2460 : return osRet; 87 : }