Class TS3TCImage
Unit
CastleImages
Declaration
type TS3TCImage = class(TEncodedImage )
Description
Image encoded with S3TC compression.
Hierarchy
Overview
Methods
Properties
Description
Methods
constructor Create (const AWidth, AHeight: Cardinal; const ADepth: Cardinal; const ACompression: TS3TCCompression );
function HasAlpha : boolean; override;
function AlphaChannel ( const AlphaTolerance: Byte; const WrongPixelsTolerance: Single): TAlphaChannel ; override;
procedure FlipVertical ;
Flip compressed image vertically, losslessly.
This usese the knowledge of how S3TC compression works, how the data is coded for each 4x4 block, to losslessly flip the image, without re-compressing it. The idea is described here [http://users.telenet.be/tfautre/softdev/ddsload/explanation.htm ].
Exceptions raised
ECannotFlipS3TCImage
Raises ECannotFlipS3TCImage when image Height is not 1, 2, 3 or a multiple of 4 (since the trick doesn't work in these cases, pixels would move between 4x4 blocks). Note that if Height is a power of two (as common for OpenGL textures) then it's always possible to make a flip.
function Decompress : TCastleImage ;
Decompress S3TC image.
This uses DecompressS3TC variable, so you have to initialialize it first (for example to GLImage.GLDecompressS3TC) before using this.
Exceptions raised
ECannotDecompressS3TC
If cannot decompress S3TC, because decompressor is not set and there was some other error within decompressor.
Properties
property Size : Cardinal read FSize;
Size of the whole image data inside RawPixels , in bytes.
Generated by PasDoc 0.13.0 on 2014-04-30 22:06:43