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.
Public Member Functions | |
---|---|
~CHuiTextureProcessor() | |
IMPORT_C void | BlurL(const THuiTextureHandle &, THuiTextureHandle &, TInt, TInt) |
IMPORT_C void | BlurL(const THuiTextureHandle &, THuiTextureHandle &, const TSize &, TInt, TInt) |
IMPORT_C void | BlurSegmentedL(const MHuiSegmentedTexture &, THuiTextureHandle &, TInt, TInt) |
IMPORT_C void | BlurSegmentedL(const MHuiSegmentedTexture &, THuiTextureHandle &, const TSize &, TInt, TInt) |
IMPORT_C CHuiEnv & | Env() |
IMPORT_C void | Release() |
IMPORT_C void | RestoreL() |
Protected Member Functions | |
---|---|
CHuiTextureProcessor(CHuiEnv &) | |
IMPORT_C void | TextureProcessorExtension(const TUid &, TAny **) |
Public Member Enumerations | |
---|---|
enum | TBlurFlags { EBlurFlagDefault = 0, EBlurFlagAlpha = 1, EBlurFlagExpandEdges = 2, EBlurFlagWhite = 4, EBlurFlagBlack = 8, EBlurFlagHighQuality = 16 } |
Private Attributes | |
---|---|
CHuiEnv & | iEnv |
TInt | iSpare |
IMPORT_C | CHuiTextureProcessor | ( | CHuiEnv & | aEnv | ) | [protected] |
Constructor.
CHuiEnv & aEnv |
IMPORT_C void | BlurL | ( | const THuiTextureHandle & | aSrc, |
THuiTextureHandle & | aDest, | |||
TInt | aFilterSize = 3, | |||
TInt | aFlags = 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.
const THuiTextureHandle & aSrc | Texture to be blurred (single segment). Not modified. |
THuiTextureHandle & aDest | New blurred texture. Ownership is transferred to the caller. Allowed to be the same as aSrc. |
TInt aFilterSize = 3 | Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter. |
TInt aFlags = 0 | Flags that modify the filter's parameters. |
IMPORT_C void | BlurL | ( | const THuiTextureHandle & | aSrc, |
THuiTextureHandle & | aDest, | |||
const TSize & | aPreferredSize, | |||
TInt | aFilterSize = 3, | |||
TInt | aFlag = 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.
const THuiTextureHandle & aSrc | Texture to be blurred (single segment). Not modified. |
THuiTextureHandle & aDest | New blurred texture. Ownership is transferred to the caller. Allowed to be the same as aSrc. |
const TSize & aPreferredSize | Preferred size of the result. |
TInt aFilterSize = 3 | Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter. |
TInt aFlag = 0 |
IMPORT_C void | BlurSegmentedL | ( | const MHuiSegmentedTexture & | aSrc, |
THuiTextureHandle & | aDest, | |||
TInt | aFilterSize = 3, | |||
TInt | aFlags = 0 | |||
) | [pure virtual] |
Blurs a texture. The dimensions of the resulting image are chosen automatically.
See comments avobe.
const MHuiSegmentedTexture & aSrc | Texture to be blurred (multi segment). Not modified. |
THuiTextureHandle & aDest | New blurred texture. Ownership is transferred to the caller. Allowed to be the same as aSrc. |
TInt aFilterSize = 3 | Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter. |
TInt aFlags = 0 | Flags that modify the filter's parameters. |
IMPORT_C void | BlurSegmentedL | ( | const MHuiSegmentedTexture & | aSrc, |
THuiTextureHandle & | aDest, | |||
const TSize & | aPreferredSize, | |||
TInt | aFilterSize = 3, | |||
TInt | aFlag = 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.
const MHuiSegmentedTexture & aSrc | Texture to be blurred (multi segment). Not modified. |
THuiTextureHandle & aDest | New blurred texture. Ownership is transferred to the caller. Allowed to be the same as aSrc. |
const TSize & aPreferredSize | Preferred size of the result. |
TInt aFilterSize = 3 | Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter. |
TInt aFlag = 0 |
IMPORT_C void | TextureProcessorExtension | ( | 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.
Flags for blur filtering.
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. |
TInt | iSpare | [private] |
Spare member to help keeping binary compatibility, since HuiTextureProcessor is now dll derivable
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.