Class TS3TCImage

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TS3TCImage = class(TEncodedImage)

Description

Image encoded with S3TC compression.

Hierarchy

Overview

Methods

Public constructor Create(const AWidth, AHeight: Cardinal; const ADepth: Cardinal; const ACompression: TS3TCCompression);
Public function HasAlpha: boolean; override;
Public function AlphaChannel( const AlphaTolerance: Byte; const WrongPixelsTolerance: Single): TAlphaChannel; override;
Public procedure FlipVertical;
Public function Decompress: TCastleImage;
Public function MakeCopy: TS3TCImage;

Properties

Public property Compression: TS3TCCompression read FCompression;
Public property Size: Cardinal read FSize;

Description

Methods

Public constructor Create(const AWidth, AHeight: Cardinal; const ADepth: Cardinal; const ACompression: TS3TCCompression);
 
Public function HasAlpha: boolean; override;
 
Public function AlphaChannel( const AlphaTolerance: Byte; const WrongPixelsTolerance: Single): TAlphaChannel; override;
 
Public 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.
Public 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.
Public function MakeCopy: TS3TCImage;
 

Properties

Public property Compression: TS3TCCompression read FCompression;
 
Public property Size: Cardinal read FSize;

Size of the whole image data inside RawPixels, in bytes.


Generated by PasDoc 0.12.1 on 2013-02-04 20:26:50