CHuiTextureProcessor Class Reference

class CHuiTextureProcessor : public CBase

CHuiTextureProcessor is a collection of texture filters. Each filter takes a texture as input, processes it, and produces a new texture as a result. Examples of processing filters are blurring and shadow generation. Concrete implementations of this class are rendering plugin specific. CHuiTextureProcessor is the public, user-friendly way of filtering textures, because each filtering operation can be applied with a single function call.

TodoCreate an abstract CHuiTextureFilter class to represent a filter operation. Each filter could then be configured with an arbitrary number of parameters, and then applied on a texture. This would allow filters to have persistent state information.

Inherits from

  • CHuiTextureProcessor

Constructor & Destructor Documentation

CHuiTextureProcessor(CHuiEnv &)

IMPORT_CCHuiTextureProcessor(CHuiEnv &aEnv)[protected]

Constructor.

Parameters

CHuiEnv & aEnv

~CHuiTextureProcessor()

IMPORT_C~CHuiTextureProcessor()[virtual]

Destructor.

Member Functions Documentation

BlurL(const THuiTextureHandle &, THuiTextureHandle &, TInt, TInt)

IMPORT_C voidBlurL(const THuiTextureHandle &aSrc,
THuiTextureHandle &aDest,
TIntaFilterSize = 3,
TIntaFlags = 0
)[pure virtual]

Blurs a texture. The dimensions of the resulting image are chosen automatically.

Returns a handle to a new texture which contains a blurred version of the texture. Ownership of the new texture is transferred to the caller, which means it is responsible for either creating a CHuiTexture out of the handle, or calling THuiTextureHandle::Release() when the generated texture is no longer needed.

Note that the algorithm used for blurring favors speed over accuracy. This means that when hardware acceleration is available, the blurring can be redone for each frame. However, the quality of the blurring may not be optimal. For example, color range reduction and pixel artifacts may be visible.

TBlurFlags

Parameters

const THuiTextureHandle & aSrcTexture to be blurred (single segment). Not modified.
THuiTextureHandle & aDestNew blurred texture. Ownership is transferred to the caller. Allowed to be the same as aSrc.
TInt aFilterSize = 3Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
TInt aFlags = 0Flags that modify the filter's parameters.

BlurL(const THuiTextureHandle &, THuiTextureHandle &, const TSize &, TInt, TInt)

IMPORT_C voidBlurL(const THuiTextureHandle &aSrc,
THuiTextureHandle &aDest,
const TSize &aPreferredSize,
TIntaFilterSize = 3,
TIntaFlag = 0
)[pure virtual]

Blurs a texture. The dimensions of the resulting image are as close to aPreferredSize as possible, depending on the limitations of the implementation.

See comments avobe.

TBlurFlags

Parameters

const THuiTextureHandle & aSrcTexture to be blurred (single segment). Not modified.
THuiTextureHandle & aDestNew blurred texture. Ownership is transferred to the caller. Allowed to be the same as aSrc.
const TSize & aPreferredSizePreferred size of the result.
TInt aFilterSize = 3Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
TInt aFlag = 0

BlurSegmentedL(const MHuiSegmentedTexture &, THuiTextureHandle &, TInt, TInt)

IMPORT_C voidBlurSegmentedL(const MHuiSegmentedTexture &aSrc,
THuiTextureHandle &aDest,
TIntaFilterSize = 3,
TIntaFlags = 0
)[pure virtual]

Blurs a texture. The dimensions of the resulting image are chosen automatically.

See comments avobe.

TBlurFlags

Parameters

const MHuiSegmentedTexture & aSrcTexture to be blurred (multi segment). Not modified.
THuiTextureHandle & aDestNew blurred texture. Ownership is transferred to the caller. Allowed to be the same as aSrc.
TInt aFilterSize = 3Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
TInt aFlags = 0Flags that modify the filter's parameters.

BlurSegmentedL(const MHuiSegmentedTexture &, THuiTextureHandle &, const TSize &, TInt, TInt)

IMPORT_C voidBlurSegmentedL(const MHuiSegmentedTexture &aSrc,
THuiTextureHandle &aDest,
const TSize &aPreferredSize,
TIntaFilterSize = 3,
TIntaFlag = 0
)[pure virtual]

Blurs a texture. The dimensions of the resulting image are as close to aPreferredSize as possible, depending on the limitations of the implementation.

See comments avobe.

TBlurFlags

Parameters

const MHuiSegmentedTexture & aSrcTexture to be blurred (multi segment). Not modified.
THuiTextureHandle & aDestNew blurred texture. Ownership is transferred to the caller. Allowed to be the same as aSrc.
const TSize & aPreferredSizePreferred size of the result.
TInt aFilterSize = 3Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
TInt aFlag = 0

Env()

IMPORT_C CHuiEnv &Env()

Returns the environment of the texture processor.

Release()

IMPORT_C voidRelease()[virtual]

RestoreL()

IMPORT_C voidRestoreL()[virtual]

TextureProcessorExtension(const TUid &, TAny **)

IMPORT_C voidTextureProcessorExtension(const TUid &aExtensionUid,
TAny **aExtensionParams
)[protected, virtual]

Provides expandability, helps keeping the binary compatibility. Since virtual table is now exported and this class is dll derivable and the implementation is more difficult to change, hence this method, which can provide additional extension APIs.

Parameters

const TUid & aExtensionUidUID, which is being used for recognizing the extension
TAny ** aExtensionParamsReturn pointer to the extension API, once recognized from the extension uid

Member Enumerations Documentation

Enum TBlurFlags

Flags for blur filtering.

Enumerators

EBlurFlagDefault = 0

Default blurring settings.

EBlurFlagAlpha = 1

Include an alpha channel in the result.

EBlurFlagExpandEdges = 2

Retain extra space for edges so that the blurred edges that will always remain within the bounds of the resulting texture. Note that when the blurred texture is drawn, it has to be expanded so that it will match the original images content.

EBlurFlagWhite = 4

Replace source color RGB with white. Note that this flag is mutually exclusive with flag EBlurFlagBlack. If both are defined then this flag overrides the EBlurFlagBlack.

EBlurFlagBlack = 8

Replace source color RGB with black. Note that this flag is mutually exclusive with flag EBlurFlagWhite. If both are defined then this flag overridden by EBlurFlagWhite.

EBlurFlagHighQuality = 16

High quality blur. The blurring process is done twice, and the results are averaged.

Member Data Documentation

CHuiEnv & iEnv

CHuiEnv &iEnv[private]

Environment.

TInt iSpare

TInt iSpare[private]

Spare member to help keeping binary compatibility, since HuiTextureProcessor is now dll derivable