File indexing completed on 2024-12-22 04:10:30
0001 /* 0002 * SPDX-FileCopyrightText: 2010 Dmitry Kazakov <dimula73@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef __KIS_TILE_COMPRESSOR_FACTORY_H 0008 #define __KIS_TILE_COMPRESSOR_FACTORY_H 0009 0010 #include "tiles3/swap/kis_legacy_tile_compressor.h" 0011 #include "tiles3/swap/kis_tile_compressor_2.h" 0012 0013 class KRITAIMAGE_EXPORT KisTileCompressorFactory 0014 { 0015 public: 0016 static KisAbstractTileCompressorSP create(qint32 version) { 0017 switch(version) { 0018 case 1: 0019 return KisAbstractTileCompressorSP(new KisLegacyTileCompressor()); 0020 break; 0021 case 2: 0022 return KisAbstractTileCompressorSP(new KisTileCompressor2()); 0023 break; 0024 default: 0025 qFatal("Unknown version of the tiles"); 0026 return KisAbstractTileCompressorSP(); 0027 }; 0028 } 0029 0030 private: 0031 KisTileCompressorFactory(); 0032 }; 0033 0034 #endif /* __KIS_TILE_COMPRESSOR_FACTORY_H */ 0035