Wrapper for Ericsson texture compression. More...
#include <kanzi/core/legacy/memory/kzc_memory_manager.hpp>#include <kanzi/core/legacy/kzs_types.hpp>#include <kanzi/core/legacy/debug/kzs_error.hpp>Functions | |
| kzsError | kzcEtcCompressImageToBuffer (const struct KzcMemoryManager *memoryManager, const kzU8 *imageData, kzInt width, kzInt height, kzU8 *destinationBuffer, enum KzcEtcCompressionMode compressionMode, kzUint *out_bytesWritten) |
| Compress an rgb888 format image in imageData to compressed ETC format. More... | |
| kzsError | kzcEtcUncompressImageToBuffer (const struct KzcMemoryManager *memoryManager, const kzU8 *compressedImage, kzInt width, kzInt height, kzInt active_width, kzInt active_height, kzU8 *destinationImage, kzUint *out_bytesWritten) |
| Uncompress a compressed rgb888 format image to destination buffer. More... | |
| kzUint | kzcEtcGetCompressedBufferMemorySize (kzUint width, kzUint height) |
| Return number of bytes required for the storage of an ETC texture of the given dimensions. More... | |
Wrapper for Ericsson texture compression.
Original implementation licenced free of charge by Ericsson. See kzc_etc.c for licence.
For technical details, see OES_compressed_ETC1_RGB8_texture extension in the OpenGL ES extensions database.
For explanation of the compression routine see Strom, Akenine-Moller:'iPACKMAN: High-Quality, Low-Complexity Texture Compression for Mobile Phones'.
(iPackman == ETC)
Copyright 2008-2017 by Rightware. All rights reserved.
ETC compression modes.
| kzsError kzcEtcCompressImageToBuffer | ( | const struct KzcMemoryManager * | memoryManager, |
| const kzU8 * | imageData, | ||
| kzInt | width, | ||
| kzInt | height, | ||
| kzU8 * | destinationBuffer, | ||
| enum KzcEtcCompressionMode | compressionMode, | ||
| kzUint * | out_bytesWritten | ||
| ) |
Compress an rgb888 format image in imageData to compressed ETC format.
Width MUST be divisible by 2 and height by 4. To compress images of other sizes pad the image data to correct size first.
| [in] | imageData | rgb888 format image data |
| [in] | width | of image in imageData in pixels |
| [in] | height | of image in imageData in pixels |
| [in] | destinationBuffer | buffer to write the compressed data into. Must be preallocated to at least correct size. |
| [out] | out_bytesWritten | number of bytes written to output |
| kzsError kzcEtcUncompressImageToBuffer | ( | const struct KzcMemoryManager * | memoryManager, |
| const kzU8 * | compressedImage, | ||
| kzInt | width, | ||
| kzInt | height, | ||
| kzInt | active_width, | ||
| kzInt | active_height, | ||
| kzU8 * | destinationImage, | ||
| kzUint * | out_bytesWritten | ||
| ) |
Uncompress a compressed rgb888 format image to destination buffer.
| [in] | compressedImage | ETC compressed texture |
| [in] | width | of compressed texture in actual pixels |
| [in] | height | of compressed texture in actual pixels |
| [in] | active_width | of uncompressed texture. Can be less than width. |
| [in] | active_height | of uncompressed texture. Can be less than height. |