CHuiTexture Class Reference

class CHuiTexture : public CBase

CHuiTexture is the base class for all texture objects. It implements the MHuiSegmentedTexture interface for multipart support. Multi-segment textures can be operated in the same way as one would operate single-segment textures.

The application will only need to call a method with "Segment" in its name if it explicitly wants to manipulate a specific segment in a texture. (E.g., when it wants to upload a new sub-texture into the segment.)

The base class enables CHuiTexture to handle large textures as smaller texture segments. Each segment has a position, dimensions, and a name that identifies the texture image of the segment. The purpose is that it is possible to compose large images out of smaller segments. The segments can overlap.

One use case is where the OpenGL texture size is limited (e.g., 256x256). CHuiTexture can split the uploaded source image to multiple segments and create a different OpenGL texture for each. All of the segments are hidden inside CHuiTexture, though, so it could be treated as a single entity.

A CHuiTexture always represents one or more fully loaded (OpenGL ES) texture objects. When drawing something, THuiImages are used for determining the area of the texture to draw. However, different segments may utilize textures in different resolutions.

THuiImage CHuiGc

Inherits from

Public Member Functions
~CHuiTexture()
IMPORT_C THuiTextureAutoSizeParamsAutoSizeParams()
THuiRealSize CalculateAutoSize()
TBool CalculatedAutoSizeChanged()
IMPORT_C TIntClearL(const TSize &, const TRgb &)
IMPORT_C TIntClearWithAlphaL(const TSize &, const TRgb &, TUint8)
voidCreateShadowTextureL(TInt, THuiShadowStyle)
IMPORT_C voidEnableAutoSizeCalculation(TBool)
IMPORT_C voidEnableShadow(TBool)
voidGenerateBlobL(const TSize &)
TBool GetShadowTexture(THuiTextureHandle &, TInt)
IMPORT_C TBoolGetShadowTexture(THuiTextureHandle &)
TBool HasAlpha()
IMPORT_C TBoolHasContent()
IMPORT_C const TDesC &ImageFileName()
TBool IsAutoSizeCalculationEnabled()
IMPORT_C TBoolIsNvgContent()
IMPORT_C TBoolIsShadowEnabled()
IMPORT_C TBoolIsSkinContent()
TSize MaxTextureSize()
IMPORT_C CHuiTexture *NewL(const THuiTextureHandle *)
IMPORT_C CHuiTexture *NewLC(const THuiTextureHandle *)
voidNotifyPreferredSize(const THuiRealSize &)
voidPartialUploadL(THuiTextureFormat, const TPoint &, const TSize &, const TUint8 *)
IMPORT_C TIntPriority()
IMPORT_C voidRelease()
IMPORT_C voidReset()
voidResetAutoSizeCalculation()
IMPORT_C voidResetShadows()
IMPORT_C voidRestoreL()
voidSegmentClearL(TInt, TBool, const TRgb &, TUint8)
IMPORT_C TIntSegmentCount()
IMPORT_C TUintSegmentName(TInt)
IMPORT_C TPointSegmentOffset(TInt)
voidSegmentPartialUpload(TInt, THuiTextureFormat, const TPoint &, const TSize &, const TUint8 *)
IMPORT_C TSizeSegmentSize(TInt)
IMPORT_C TSizeSegmentTextureSize(TInt)
voidSegmentUploadL(TInt, THuiTextureFormat, const TSize &, const TUint8 *, TUint)
voidSegmentUploadL(TInt, const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags)
IMPORT_C MHuiSegmentedTexture *SegmentedTexture()
IMPORT_C const MHuiSegmentedTexture *SegmentedTexture()
IMPORT_C TIntSessionId()
IMPORT_C voidSetAutoSizeParams(const THuiTextureAutoSizeParams &)
voidSetImageFileNameL(const TDesC &)
IMPORT_C voidSetNvgContent(TBool)
voidSetPlaceholder(THuiTextureHandle *)
IMPORT_C voidSetPriority(TInt)
IMPORT_C voidSetSegmentCountL(TInt)
IMPORT_C voidSetSegmentName(TInt, TUint)
IMPORT_C voidSetSegmentOffset(TInt, const TPoint &)
IMPORT_C voidSetSegmentSize(TInt, const TSize &)
IMPORT_C voidSetSegmentTextureSize(TInt, const TSize &)
IMPORT_C voidSetSessionId(TInt)
IMPORT_C voidSetShadowStyle(THuiShadowStyle)
IMPORT_C voidSetSize(const TSize &)
IMPORT_C voidSetSkinContent(TBool)
IMPORT_C voidSetTextureChanged(TBool)
voidSetupSegmentsL(const TSize &, const TSize &, THuiTextureUploadFlags)
IMPORT_C THuiShadowStyleShadowStyle()
IMPORT_C MHuiShadowedTexture *ShadowedTexture()
IMPORT_C const MHuiShadowedTexture *ShadowedTexture()
IMPORT_C TSizeSize()
IMPORT_C TBoolTextureChanged()
IMPORT_C voidTextureClearChanged()
IMPORT_C TTypeType()
voidUploadDirectL(const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags)
voidUploadL(const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags)
voidUploadL(THuiTextureFormat, const TSize &, const TUint8 *, THuiTextureUploadFlags, TUint)
Protected Member Functions
CHuiTexture()
IMPORT_C voidBaseConstructL()
voidInitSegmentL(TInt)
voidResetSegment(TInt)
IMPORT_C voidSetSegment(TInt, const TSize &, const TPoint &, const TSize &)
IMPORT_C voidTextureExtension(const TUid &, TAny **)
Private Member Functions
NONSHARABLE_STRUCT(TShadowData)
voidRemoveAllSegments()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enumTHuiTextureFlags { EHuiTextureFlagDefault = 0, EHuiTextureFlagShadowEnabled = 1, EHuiTextureFlagSkinContent = 2, EHuiTextureFlagAddedToTManager = 4, EHuiTextureFlagNvgContent = 8 }
Public Attributes
RHuiObserverArray< MHuiTextureContentObserver >iContentObservers
TInt iFrameCount
TInt iFrameInterval
TInt iFrameNumber
Private Attributes
TInt iActiveSegment
TBool iAutoSizeCalculationEnabled
THuiTextureAutoSizeParamsiAutoSizeParams
THuiRealSize iCalculatedAutoSize
THuiRealSize iCalculatedPreviousAutoSize
HBufC *iImageFileName
TUint iInternalState
THuiTextureHandle *iPlaceholder
RArray< THuiRealSize >iPreferredSizes
TInt iPriority
RArray< TSegment >iSegments
TInt iSessionId
THuiShadowStyle iShadowStyle
RArray< TShadowData >iShadows
TSize iSize
TBool iTextureChanged

Constructor & Destructor Documentation

CHuiTexture()

IMPORT_CCHuiTexture()[protected]

Constructor. Creates a new texture object with no texture maps.

~CHuiTexture()

IMPORT_C~CHuiTexture()

Destructor.

Member Functions Documentation

AutoSizeParams()

IMPORT_C THuiTextureAutoSizeParamsAutoSizeParams()const

Gets parameters to be used when calculating auto size.

BaseConstructL()

IMPORT_C voidBaseConstructL()[protected]

Second-phase constructor.

CalculateAutoSize()

THuiRealSize CalculateAutoSize()

Calculates one size which is most optimal based on all the reported sizes.

CalculatedAutoSizeChanged()

TBool CalculatedAutoSizeChanged()const

Checks if calculated auto size has been changed since last frame.

ClearL(const TSize &, const TRgb &)

IMPORT_C TIntClearL(const TSize &aSize,
const TRgb &aColor
)

Clears the texture object and initializes it with solid color pixels. Will setup the logical size and reserve space for the texture if size and segmentation has not yet been prepared.

Parameters

const TSize & aSizeSize of the texture. Does not matter if the size and segmentation of this texture has already been set up.
const TRgb & aColorInitial color of the texture.

ClearWithAlphaL(const TSize &, const TRgb &, TUint8)

IMPORT_C TIntClearWithAlphaL(const TSize &aSize,
const TRgb &aColor,
TUint8aAlpha
)

Clears the texture object and initializes it with solid color pixels. The texture will be initialized with alpha data. Will setup the logical size and reserve space for the texture, if needed.

Parameters

const TSize & aSizeSize of the texture. Does not matter if the size and segmentation of this texture has already been set up. Use Reset() before calling Clear() to change the texture resolution and dimensions.
const TRgb & aColorInitial color of the texture.
TUint8 aAlphaInitial alpha level of the texture.

CreateShadowTextureL(TInt, THuiShadowStyle)

voidCreateShadowTextureL(TIntaBlurDimension,
THuiShadowStyleaStyle
)

Parameters

TInt aBlurDimension
THuiShadowStyle aStyle

EnableAutoSizeCalculation(TBool)

IMPORT_C voidEnableAutoSizeCalculation(TBoolaEnable = ETrue)

Enables auto size calculations for this texture.

Caller of this method may observe auto size changes through texture managers MHuiTextureAutoSizeObserver interface.

Parameters

TBool aEnable = ETrueETrue if auto size calculation is to be enabled.

EnableShadow(TBool)

IMPORT_C voidEnableShadow(TBoolaEnable = ETrue)[virtual]

Parameters

TBool aEnable = ETrue

GenerateBlobL(const TSize &)

voidGenerateBlobL(const TSize &aSize)

Generates a blob texture. The texture can be then used for drawing shadow edges, for example.

Parameters

const TSize & aSizeDimensions of the blob texture.

GetShadowTexture(THuiTextureHandle &, TInt)

TBool GetShadowTexture(THuiTextureHandle &aHandle,
TIntaBlurDimension
)const

Parameters

THuiTextureHandle & aHandle
TInt aBlurDimension

GetShadowTexture(THuiTextureHandle &)

IMPORT_C TBoolGetShadowTexture(THuiTextureHandle &aHandle)const

Parameters

THuiTextureHandle & aHandle

HasAlpha()

TBool HasAlpha()const [pure virtual]

Determines if the texture has an alpha channel.

HasContent()

IMPORT_C TBoolHasContent()const [virtual]

Determines whether the texture has content. Only textures that have content can be drawn.

Note that a texture that has not finished loading will return EFalse here, because its content will only become available after it has been fully loaded.

ImageFileName()

IMPORT_C const TDesC &ImageFileName()const

Returns the file name of the texture's source image (if any).

InitSegmentL(TInt)

voidInitSegmentL(TIntaSegment)[protected, pure virtual]

Initialize segment for holding texture data. Allocate texture name etc.

Parameters

TInt aSegment

IsAutoSizeCalculationEnabled()

TBool IsAutoSizeCalculationEnabled()const

Flag to indicate that auto size calculations for this texture is enabled.

IsNvgContent()

IMPORT_C TBoolIsNvgContent()const

Informs whether this texture is in NVG format or not.

SetNvgContent()

IsShadowEnabled()

IMPORT_C TBoolIsShadowEnabled()const [virtual]

IsSkinContent()

IMPORT_C TBoolIsSkinContent()const [virtual]

Informs whether this texture is part of skin content or not. By default textures are not part of skin content.

SetSkinContent()

MaxTextureSize()

TSize MaxTextureSize()const [pure virtual]

Determines the maximum possible actual (OpenGL/in-memory) size for textures. Typically returns power-of-two dimensions. This limit is usually set by the underlying graphics driver/hardware.

NONSHARABLE_STRUCT(TShadowData)

NONSHARABLE_STRUCT(TShadowData)[private, inline]

Parameters

TShadowData

NewL(const THuiTextureHandle *)

IMPORT_C CHuiTexture *NewL(const THuiTextureHandle *aExistingTexture = 0)[static]

Exported static factory method. Creates a texture appropriate for the current renderer.

Parameters

const THuiTextureHandle * aExistingTexture = 0

NewLC(const THuiTextureHandle *)

IMPORT_C CHuiTexture *NewLC(const THuiTextureHandle *aExistingTexture = 0)[static]

Exported static factory method. Creates a texture appropriate for the current renderer.

Parameters

const THuiTextureHandle * aExistingTexture = 0

NotifyPreferredSize(const THuiRealSize &)

voidNotifyPreferredSize(const THuiRealSize &aSize)

Notifies one size what would be the most optimal size for this texture. This method can be called e.g. from some CHuiGc image drawing operation which knows the excact size that the image appears in the display.

Parameters

const THuiRealSize & aSizeAuto size candidate.

PartialUploadL(THuiTextureFormat, const TPoint &, const TSize &, const TUint8 *)

voidPartialUploadL(THuiTextureFormataFormat,
const TPoint &aOrigin,
const TSize &aSize,
const TUint8 *aBuffer
)[pure virtual]

Updates a partial area of this texture. Does not change the dimensions of the texture (logical size or segmentation).

Note:

You must first call Upload() at least once so the texture object has dimensions.

No local copy of the buffer data is made.
Note:

Does not work with multisegmented textures!

Parameters

THuiTextureFormat aFormatFormat of the data buffer.
const TPoint & aOriginPosition to place the partial texture data.
const TSize & aSizeSize of the texture in the data buffer.
const TUint8 * aBufferTexture data buffer.

Priority()

IMPORT_C TIntPriority()const

Returns the priority of the texture

SetPriority()

Release()

IMPORT_C voidRelease()[virtual]

Releases the texture. The caller is responsible of checking the release priority of the texture.

RemoveAllSegments()

voidRemoveAllSegments()[private]

Resets and removes all texture segments

Reset()

IMPORT_C voidReset()[virtual]

Delete the texture.

ResetAutoSizeCalculation()

voidResetAutoSizeCalculation()

Clears auto size candidates that has been reported (during last frame). This is called by the texture manager after each frame.

ResetSegment(TInt)

voidResetSegment(TIntaSegment)[protected, pure virtual]

Deallocate resources associated with segment. Will free all resources associated with a texture segment. SetSegmentCount()

Parameters

TInt aSegment

ResetShadows()

IMPORT_C voidResetShadows()

Deletes the shadow textures.

RestoreL()

IMPORT_C voidRestoreL()[virtual]

Restores the texture.

SegmentClearL(TInt, TBool, const TRgb &, TUint8)

voidSegmentClearL(TIntaSegment,
TBoolaWithAlpha,
const TRgb &aColor,
TUint8aAlpha
)[pure virtual]

Clear a texture segment to a solid color.

Parameters

TInt aSegment
TBool aWithAlpha
const TRgb & aColor
TUint8 aAlpha

SegmentCount()

IMPORT_C TIntSegmentCount()const

Number of segments in the texture.

SegmentName(TInt)

IMPORT_C TUintSegmentName(TIntaSegment)const

ID of the given segment.

Parameters

TInt aSegmentThe ordinal of the segment that we want the name of.

SegmentOffset(TInt)

IMPORT_C TPointSegmentOffset(TIntaSegment)const

Return offset of a segment.

Parameters

TInt aSegmentThe ordinal of the segment that we want the offset of.

SegmentPartialUpload(TInt, THuiTextureFormat, const TPoint &, const TSize &, const TUint8 *)

voidSegmentPartialUpload(TIntaSegment,
THuiTextureFormataFormat,
const TPoint &aOrigin,
const TSize &aSize,
const TUint8 *aBuffer
)[pure virtual]

Updates a partial area to a texture segment. Does not change the dimensions of the texture (logical size or segmentation).

This method allows direct access to texture segments. PartialUploadL() if you do not care about texture segmentation.
Note:

You must first call Upload() at least once so the texture object has dimensions and at least one segment to be updated.

No local copy of the buffer data is made.

Parameters

TInt aSegmentValid segment index for this texture.
THuiTextureFormat aFormatFormat of the data buffer.
const TPoint & aOriginPosition to place the partial texture data.
const TSize & aSizeSize of the texture in the data buffer.
const TUint8 * aBufferTexture data buffer.

SegmentSize(TInt)

IMPORT_C TSizeSegmentSize(TIntaSegment)const

Return logical dimensions of a segment.

Parameters

TInt aSegmentThe ordinal of the segment that we want the dimensions of.

SegmentTextureSize(TInt)

IMPORT_C TSizeSegmentTextureSize(TIntaSegment)const

Return texture dimensions of a segment.

Parameters

TInt aSegmentThe ordinal of the segment that we want the texture dimensions of.

SegmentUploadL(TInt, THuiTextureFormat, const TSize &, const TUint8 *, TUint)

voidSegmentUploadL(TIntaSegment,
THuiTextureFormataFormat,
const TSize &aSize,
const TUint8 *aBuffer,
TUintaBufferSize = 0
)[pure virtual]

Uploads bitmap data onto a texture segment. Does not change the dimensions of the texture (logical size or segmentation).

This method allows direct access to texture segments. UploadL() if you do not care about texture segmentation.
Note:

The image segment has to have valid dimensions.

Parameters

TInt aSegmentValid segment index for this texture.
THuiTextureFormat aFormatFormat of the image data buffer.
const TSize & aSizeSize (width and height in pixels) of the texture in the data buffer (aBuffer).
const TUint8 * aBufferImage data buffer.
TUint aBufferSize = 0Length of the compressed image data. Set as 0 for non-compressed formats.

SegmentUploadL(TInt, const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags)

voidSegmentUploadL(TIntaSegment,
const CFbsBitmap &aBitmap,
const CFbsBitmap *aMaskBitmap = NULL,
THuiTextureUploadFlagsaFlags = EHuiTextureUploadFlagDefault
)[pure virtual]

Uploads FBS bitmap data onto a texture segment. Does not change the dimensions of the texture (logical size or segmentation).

This method allows direct access to texture segments. UploadL() if you do not care about texture segmentation.
Note:

The image segment has to have valid dimensions.

Parameters

TInt aSegmentValid segment index for this texture.
const CFbsBitmap & aBitmapBitmap to copy image contents and format from (RGB data).
const CFbsBitmap * aMaskBitmap = NULLOptional Bitmap for alpha (transparency) channel. If the image does not require an alpha channel or the aBitmap already has alpha information (RGBA image) this value may be left as NULL. The bitmap will be combined with aBitmap to single RGBA image. If used, this alpha mask bitmap will replace any alpha information in aBitmap.
THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefaultSpecify how the uploaded data is laid out to a texture.

SegmentedTexture()

IMPORT_C MHuiSegmentedTexture *SegmentedTexture()

SegmentedTexture()

IMPORT_C const MHuiSegmentedTexture *SegmentedTexture()const

SessionId()

IMPORT_C TIntSessionId()const

Gets the session id for object.

SetAutoSizeParams(const THuiTextureAutoSizeParams &)

IMPORT_C voidSetAutoSizeParams(const THuiTextureAutoSizeParams &aParams)

Sets parameters to be used when calculating auto size.

Parameters

const THuiTextureAutoSizeParams & aParamsNew parameters.

SetImageFileNameL(const TDesC &)

voidSetImageFileNameL(const TDesC &aFileName)

Sets the file name of the texture's source image.

Parameters

const TDesC & aFileNameImage file name.

SetNvgContent(TBool)

IMPORT_C voidSetNvgContent(TBoolaNvgContent)

Defines whether the texture is in NVG format or not. If the texture is in NVG format, it will not eat up any texture memory. Also the autosizing is being disabled by default, since the sizing is practically free with NVG and OpenVG backend.

EnableAutoSizeCalculation() IsNVGContent()

Parameters

TBool aNvgContentETrue to set this texture as extended with NVG content. EFalse to mark that this is not an extended texture.

SetPlaceholder(THuiTextureHandle *)

voidSetPlaceholder(THuiTextureHandle *aPlaceholder)

Sets the placeholder texture. Set to zero to disable the placeholder.

Parameters

THuiTextureHandle * aPlaceholderPlaceholder texture.

SetPriority(TInt)

IMPORT_C voidSetPriority(TIntaPriority)

Sets the texture priority. The prioriry is used when the textures are released/restored.

Parameters

TInt aPriority0 = never release other values to be decided By default != 0

SetSegment(TInt, const TSize &, const TPoint &, const TSize &)

IMPORT_C voidSetSegment(TIntaSegment,
const TSize &iSize,
const TPoint &iOffset,
const TSize &iTextureSize
)[protected, virtual]

Set segment data. Note that the texture name is allocated when calling InitSegmentL().

Set segment data.

Parameters

TInt aSegment
const TSize & iSize
const TPoint & iOffset
const TSize & iTextureSize

SetSegmentCountL(TInt)

IMPORT_C voidSetSegmentCountL(TIntaSegmentCount)[virtual]

Sets the number of segments. Will delete/create new segments as needed.

Parameters

TInt aSegmentCountNumber of segments.

SetSegmentName(TInt, TUint)

IMPORT_C voidSetSegmentName(TIntaSegment,
TUintaName
)[virtual]

Sets the name of a segment.

Parameters

TInt aSegment
TUint aName

SetSegmentOffset(TInt, const TPoint &)

IMPORT_C voidSetSegmentOffset(TIntaSegment,
const TPoint &aOffset
)[virtual]

Sets the logical offset of a texture segment.

Parameters

TInt aSegmentValid segment index for this texture.
const TPoint & aOffsetOffset of the texture segment. Must be inside the logical dimensions of the whole texture.

SetSegmentSize(TInt, const TSize &)

IMPORT_C voidSetSegmentSize(TIntaSegment,
const TSize &aSegmentSize
)[virtual]

Sets the size of a segment.

Parameters

TInt aSegment
const TSize & aSegmentSize

SetSegmentTextureSize(TInt, const TSize &)

IMPORT_C voidSetSegmentTextureSize(TIntaSegment,
const TSize &aSegmentTextureSize
)[virtual]

Sets the texture size of the segment.

Parameters

TInt aSegmentValid segment index for this texture.
const TSize & aSegmentTextureSize

SetSessionId(TInt)

IMPORT_C voidSetSessionId(TIntaSessionId)

Sets the session id for object.

Parameters

TInt aSessionId

SetShadowStyle(THuiShadowStyle)

IMPORT_C voidSetShadowStyle(THuiShadowStyleaShadowStyle)[virtual]

Sets the shadow generation style of the texture.

Parameters

THuiShadowStyle aShadowStyleShadowing style.

SetSize(const TSize &)

IMPORT_C voidSetSize(const TSize &aSize)[virtual]

Set the logical dimensions of the texture. This is the original size of the image loaded as a texture. Also will update (resize) the logical sizes and offsets of texture segments, if such segments have been previously configured.

Size() Use to check the logical size of the texture.

Parameters

const TSize & aSize

SetSkinContent(TBool)

IMPORT_C voidSetSkinContent(TBoolaSkinContent)[virtual]

Defines whether the texture is of skin content or not. If this texture is a part of skin content this texture will be released and restored whenever CHuiEnv::NotifySkinChangedL is called. This allows skin specific texture observers to update the content of this texture depending on the skin and it's parameters. Textures that are not part of skin content will be inaffected by the call to the CHuiEnv::NotifySkinChangedL.

CHuiEnv::NotifySkinChangedL() IsSkinContent()

Parameters

TBool aSkinContentETrue to set this texture as part of skin content. EFalse to mark that this texture is not part of skin content.

SetTextureChanged(TBool)

IMPORT_C voidSetTextureChanged(TBoolaChanged)

Set texture as (not) changed. Clear the changed flag of this texture once changes have been handled. TextureChanged()

Parameters

TBool aChanged

SetupSegmentsL(const TSize &, const TSize &, THuiTextureUploadFlags)

voidSetupSegmentsL(const TSize &aLogicalSize,
const TSize &aTextureSize,
THuiTextureUploadFlagsaFlags = EHuiTextureUploadFlagDefault
)[pure virtual]

Calculates and sets up segmentation for given size. If the given size exceeds the available maximum texture size, the area is split up to segments having dimensions no more than the maximum texture size.

Parameters

const TSize & aLogicalSizeLogical size of the full image.
const TSize & aTextureSizeTexture resolution required, in pixels.
THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault

ShadowStyle()

IMPORT_C THuiShadowStyleShadowStyle()const

Determines the current shadow style.

ShadowedTexture()

IMPORT_C MHuiShadowedTexture *ShadowedTexture()

ShadowedTexture()

IMPORT_C const MHuiShadowedTexture *ShadowedTexture()const

Size()

IMPORT_C TSizeSize()const

Return logical dimensions of texture. SetSize()

TextureChanged()

IMPORT_C TBoolTextureChanged()const [virtual]

Has texture changed. Check if the texture has changed since the last update.

TextureClearChanged()

IMPORT_C voidTextureClearChanged()const [virtual]

Set texture as not changed. Clear the changed flag of this texture once changes have been handled. TextureChanged()

TextureExtension(const TUid &, TAny **)

IMPORT_C voidTextureExtension(const TUid &aExtensionUid,
TAny **aExtensionParameters
)[protected]

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParameters

Type()

IMPORT_C TTypeType()const

Gets the object type.

UploadDirectL(const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags)

voidUploadDirectL(const CFbsBitmap &aBitmap,
const CFbsBitmap *aMaskBitmap,
THuiTextureUploadFlagsaFlags
)

Uploads the texture data to the texture. Allows using EHuiTextureFlagAllowDirectBitmapUsage flag, but the caller have to take care of deleting the bitmaps.

The bitmaps must be suitable for direct usage. Otherwise this can cause panic in rendering.

Parameters

const CFbsBitmap & aBitmapBitmap to copy image contents from.
const CFbsBitmap * aMaskBitmapOptional Bitmap for alpha (transparency) channel.
THuiTextureUploadFlags aFlagsSpecify texture upload behavior.

UploadL(const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags)

voidUploadL(const CFbsBitmap &aBitmap,
const CFbsBitmap *aMaskBitmap = NULL,
THuiTextureUploadFlagsaFlags = EHuiTextureUploadFlagDefault
)[pure virtual]

Uploads texture data from an FBS bitmap onto this texture.

Bitmap to texture upload consists of the following tasks:
  • Setups the texture (logical) size.

  • Calculates if segmentation is needed, and setups the segments (as necessary / optional).

  • Convert / downscale and crop the bitmap data to create bitmap(s) suitable for uploading.

  • Transfers bitmap data to the graphics device driver.

If the texture uses EHuiTextureFlagAllowDirectBitmapUsage flag, the method CHuiTextureManager::UpdateTextureFromBitmapL() should be used instead. This method leaves with KErrNotSupported in that case.

If the UploadL runs out of memory while uploading/converting the method may try to upload with smaller bitmap sizes and force use of more memory-efficient single-segment texture.

SetSize() Use if you want to change the logical size (for example to fix the aspect ratio of the bitmap) of the texture after uploading.

Parameters

const CFbsBitmap & aBitmapBitmap to copy image contents and format from (RGB data). The support for input CFbsBitmap formats varies between different renderers. See Input bitmaps supported Table describing renderer bitmap support.
const CFbsBitmap * aMaskBitmap = NULLOptional Bitmap for alpha (transparency) channel. If the image does not require an alpha channel or the aBitmap already has alpha information (RGBA image) this value may be left as NULL. The bitmap will be combined with aBitmap to single RGBA image. If used, this alpha mask bitmap will replace any alpha information in aBitmap.
THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefaultSpecify texture upload behavior - how to convert the bitmap to texture. You can OR these flags together.

UploadL(THuiTextureFormat, const TSize &, const TUint8 *, THuiTextureUploadFlags, TUint)

voidUploadL(THuiTextureFormataFormat,
const TSize &aSize,
const TUint8 *aBuffer,
THuiTextureUploadFlagsaFlags = EHuiTextureUploadFlagDefault,
TUintaBufferSize = 0
)[pure virtual]

Uploads bitmap data onto this texture.

Bitmap to texture upload consists of the following tasks:
  • Setups the texture (logical) size.

  • Transfers bitmap data to the graphics device driver.

Note: This method does NOT support texture segmentation. See the CFbsBitmap upload methods (UploadL()) to create segmented textures.

Parameters

THuiTextureFormat aFormatFormat of aBuffer, the image data buffer.
const TSize & aSizeSize (width and height in pixels) of the texture in the data buffer (aBuffer).
const TUint8 * aBufferSource Image data buffer.
THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefaultSpecify upload behavior - how to convert the bitmap to texure.
TUint aBufferSize = 0Length of the compressed image data. Set as 0 for non-compressed formats.

Member Enumerations Documentation

Enum THuiTextureFlags

Flags for texture state.

Enumerators

EHuiTextureFlagDefault = 0

Default flags. All special properties disabled.

EHuiTextureFlagShadowEnabled = 1

Shadow is enabled in the texture.

EHuiTextureFlagSkinContent = 2

Texture is included in the skin content.

EHuiTextureFlagAddedToTManager = 4
EHuiTextureFlagNvgContent = 8

Texture is extended and has NVG content

Member Data Documentation

TInt iActiveSegment

TInt iActiveSegment[private]

Index of the active segment.

TBool iAutoSizeCalculationEnabled

TBool iAutoSizeCalculationEnabled[private]

Flag to indicate that auto size calculations for this texture is enabled

THuiTextureAutoSizeParams iAutoSizeParams

THuiTextureAutoSizeParamsiAutoSizeParams[private]

THuiRealSize iCalculatedAutoSize

THuiRealSize iCalculatedAutoSize[private]

Most optimal size calculated based on all reported sizes

THuiRealSize iCalculatedPreviousAutoSize

THuiRealSize iCalculatedPreviousAutoSize[private]

Previous most optimal size calculated based on all reported sizes

RHuiObserverArray< MHuiTextureContentObserver > iContentObservers

RHuiObserverArray< MHuiTextureContentObserver >iContentObservers

Array of content observers.

TInt iFrameCount

TInt iFrameCount

TInt iFrameInterval

TInt iFrameInterval

TInt iFrameNumber

TInt iFrameNumber

HBufC * iImageFileName

HBufC *iImageFileName[private]

Name of the image file where the texture was loaded from.

TUint iInternalState

TUint iInternalState[private]

The internal texture state. Composed of THuiTextureFlags.

THuiTextureHandle * iPlaceholder

THuiTextureHandle *iPlaceholder[private]

Temporary texture to use until the real texture has been loaded.

RArray< THuiRealSize > iPreferredSizes

RArray< THuiRealSize >iPreferredSizes[private]

Sizes reported for this texture during last frame

TInt iPriority

TInt iPriority[private]

Priority

RArray< TSegment > iSegments

RArray< TSegment >iSegments[private]

Names of the segments.

TInt iSessionId

TInt iSessionId[private]

Session id

THuiShadowStyle iShadowStyle

THuiShadowStyle iShadowStyle[private]

Shadow generation style.

RArray< TShadowData > iShadows

RArray< TShadowData >iShadows[private]

TSize iSize

TSize iSize[private]

The logical size of this texture.

TBool iTextureChanged

TBool iTextureChanged[private]