igraphic/dxtcompress.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2011 by Frank Richter 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00023 #ifndef __CS_IGRAPHIC_DXTCOMPRESS_H__ 00024 #define __CS_IGRAPHIC_DXTCOMPRESS_H__ 00025 00026 #include "csgfx/rgbpixel.h" 00027 #include "csutil/scf_interface.h" 00028 00034 namespace CS 00035 { 00036 namespace Graphics 00037 { 00045 struct UncompressedDXTDataLayout 00046 { 00052 size_t bytesToNextPixel; 00058 size_t bytesToNextRow; 00064 size_t bytesToNextBlock; 00071 size_t blocksPerRow; 00072 00073 UncompressedDXTDataLayout() 00074 : bytesToNextPixel (0), bytesToNextRow (0), bytesToNextBlock (0), blocksPerRow (1) {} 00075 00080 void Fix (size_t uncompressedSize) 00081 { 00082 if (!bytesToNextPixel) bytesToNextPixel = uncompressedSize; 00083 if (!bytesToNextRow) bytesToNextRow = 4*bytesToNextPixel; 00084 if (!bytesToNextBlock) bytesToNextBlock = 4*bytesToNextPixel; 00085 } 00086 }; 00087 00091 #define CS_DXTDECOMPRESSOR_DEFAULT "crystalspace.graphic.dxt.decompress.default" 00092 00093 struct iDXTDecompressor : public virtual iBase 00094 { 00095 SCF_INTERFACE(CS::Graphics::iDXTDecompressor, 0, 0, 1); 00096 00110 virtual const void* DecompressDXT1RGB (const void* inBlockPtr, 00111 size_t blockDistance, 00112 size_t numBlocks, 00113 csRGBpixel* outDataPtr, 00114 const UncompressedDXTDataLayout& outDataLayout) = 0; 00128 virtual const void* DecompressDXT1RGBA (const void* inBlockPtr, 00129 size_t blockDistance, 00130 size_t numBlocks, 00131 csRGBpixel* outDataPtr, 00132 const UncompressedDXTDataLayout& outDataLayout) = 0; 00133 00145 virtual const void* DecompressDXT3Alpha (const void* inBlockPtr, 00146 size_t blockDistance, 00147 size_t numBlocks, 00148 uint8* outDataPtr, 00149 const UncompressedDXTDataLayout& outDataLayout) = 0; 00150 00165 virtual const void* DecompressDXTUNormToUI8 (const void* inBlockPtr, 00166 size_t blockDistance, 00167 size_t numBlocks, 00168 uint8* outDataPtr, 00169 const UncompressedDXTDataLayout& outDataLayout) = 0; 00183 virtual const void* DecompressDXTSNormToI8 (const void* inBlockPtr, 00184 size_t blockDistance, 00185 size_t numBlocks, 00186 int8* outDataPtr, 00187 const UncompressedDXTDataLayout& outDataLayout) = 0; 00188 00205 virtual const void* DecompressDXTUNormToUI16 (const void* inBlockPtr, 00206 size_t blockDistance, 00207 size_t numBlocks, 00208 uint16* outDataPtr, 00209 const UncompressedDXTDataLayout& outDataLayout) = 0; 00225 virtual const void* DecompressDXTSNormToI16 (const void* inBlockPtr, 00226 size_t blockDistance, 00227 size_t numBlocks, 00228 int16* outDataPtr, 00229 const UncompressedDXTDataLayout& outDataLayout) = 0; 00230 }; 00231 00232 /* 00233 struct iDXTCompressor : public virtual iBase 00234 { 00235 }; 00236 */ 00237 } // namespace Graphics 00238 } // namespace CS 00239 00242 #endif // __CS_IGRAPHIC_DXTCOMPRESS_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
