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 THuiTextureAutoSizeParams AutoSizeParams ()
THuiRealSize CalculateAutoSize ()
TBool CalculatedAutoSizeChanged ()
IMPORT_C TInt ClearL (const TSize &, const TRgb &)
IMPORT_C TInt ClearWithAlphaL (const TSize &, const TRgb &, TUint8 )
void CreateShadowTextureL ( TInt , THuiShadowStyle )
IMPORT_C void EnableAutoSizeCalculation ( TBool )
IMPORT_C void EnableShadow ( TBool )
void GenerateBlobL (const TSize &)
TBool GetShadowTexture ( THuiTextureHandle &, TInt )
IMPORT_C TBool GetShadowTexture ( THuiTextureHandle &)
TBool HasAlpha ()
IMPORT_C TBool HasContent ()
IMPORT_C const TDesC & ImageFileName ()
TBool IsAutoSizeCalculationEnabled ()
IMPORT_C TBool IsNvgContent ()
IMPORT_C TBool IsShadowEnabled ()
IMPORT_C TBool IsSkinContent ()
TSize MaxTextureSize ()
IMPORT_C CHuiTexture * NewL (const THuiTextureHandle *)
IMPORT_C CHuiTexture * NewLC (const THuiTextureHandle *)
void NotifyPreferredSize (const THuiRealSize &)
void PartialUploadL ( THuiTextureFormat , const TPoint &, const TSize &, const TUint8 *)
IMPORT_C TInt Priority ()
IMPORT_C void Release ()
IMPORT_C void Reset ()
void ResetAutoSizeCalculation ()
IMPORT_C void ResetShadows ()
IMPORT_C void RestoreL ()
void SegmentClearL ( TInt , TBool , const TRgb &, TUint8 )
IMPORT_C TInt SegmentCount ()
IMPORT_C TUint SegmentName ( TInt )
IMPORT_C TPoint SegmentOffset ( TInt )
void SegmentPartialUpload ( TInt , THuiTextureFormat , const TPoint &, const TSize &, const TUint8 *)
IMPORT_C TSize SegmentSize ( TInt )
IMPORT_C TSize SegmentTextureSize ( TInt )
void SegmentUploadL ( TInt , THuiTextureFormat , const TSize &, const TUint8 *, TUint )
void SegmentUploadL ( TInt , const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags )
IMPORT_C MHuiSegmentedTexture * SegmentedTexture ()
IMPORT_C const MHuiSegmentedTexture * SegmentedTexture ()
IMPORT_C TInt SessionId ()
IMPORT_C void SetAutoSizeParams (const THuiTextureAutoSizeParams &)
void SetImageFileNameL (const TDesC &)
IMPORT_C void SetNvgContent ( TBool )
void SetPlaceholder ( THuiTextureHandle *)
IMPORT_C void SetPriority ( TInt )
IMPORT_C void SetSegmentCountL ( TInt )
IMPORT_C void SetSegmentName ( TInt , TUint )
IMPORT_C void SetSegmentOffset ( TInt , const TPoint &)
IMPORT_C void SetSegmentSize ( TInt , const TSize &)
IMPORT_C void SetSegmentTextureSize ( TInt , const TSize &)
IMPORT_C void SetSessionId ( TInt )
IMPORT_C void SetShadowStyle ( THuiShadowStyle )
IMPORT_C void SetSize (const TSize &)
IMPORT_C void SetSkinContent ( TBool )
IMPORT_C void SetTextureChanged ( TBool )
void SetupSegmentsL (const TSize &, const TSize &, THuiTextureUploadFlags )
IMPORT_C THuiShadowStyle ShadowStyle ()
IMPORT_C MHuiShadowedTexture * ShadowedTexture ()
IMPORT_C const MHuiShadowedTexture * ShadowedTexture ()
IMPORT_C TSize Size ()
IMPORT_C TBool TextureChanged ()
IMPORT_C void TextureClearChanged ()
IMPORT_C TType Type ()
void UploadDirectL (const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags )
void UploadL (const CFbsBitmap &, const CFbsBitmap *, THuiTextureUploadFlags )
void UploadL ( THuiTextureFormat , const TSize &, const TUint8 *, THuiTextureUploadFlags , TUint )
Protected Member Functions
CHuiTexture ()
IMPORT_C void BaseConstructL ()
void InitSegmentL ( TInt )
void ResetSegment ( TInt )
IMPORT_C void SetSegment ( TInt , const TSize &, const TPoint &, const TSize &)
IMPORT_C void TextureExtension (const TUid &, TAny **)
Private Member Functions
NONSHARABLE_STRUCT (TShadowData)
void RemoveAllSegments ()
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
enum THuiTextureFlags { 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
THuiTextureAutoSizeParams iAutoSizeParams
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_C CHuiTexture ( ) [protected]

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

~CHuiTexture()

IMPORT_C ~CHuiTexture ( )

Destructor.

Member Functions Documentation

AutoSizeParams()

IMPORT_C THuiTextureAutoSizeParams AutoSizeParams ( ) const

Gets parameters to be used when calculating auto size.

BaseConstructL()

IMPORT_C void BaseConstructL ( ) [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 TInt ClearL ( 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 & aSize Size of the texture. Does not matter if the size and segmentation of this texture has already been set up.
const TRgb & aColor Initial color of the texture.

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

IMPORT_C TInt ClearWithAlphaL ( const TSize & aSize,
const TRgb & aColor,
TUint8 aAlpha
)

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 & aSize Size 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 & aColor Initial color of the texture.
TUint8 aAlpha Initial alpha level of the texture.

CreateShadowTextureL(TInt, THuiShadowStyle)

void CreateShadowTextureL ( TInt aBlurDimension,
THuiShadowStyle aStyle
)

Parameters

TInt aBlurDimension
THuiShadowStyle aStyle

EnableAutoSizeCalculation(TBool)

IMPORT_C void EnableAutoSizeCalculation ( TBool aEnable = 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 = ETrue ETrue if auto size calculation is to be enabled.

EnableShadow(TBool)

IMPORT_C void EnableShadow ( TBool aEnable = ETrue ) [virtual]

Parameters

TBool aEnable = ETrue

GenerateBlobL(const TSize &)

void GenerateBlobL ( const TSize & aSize )

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

Parameters

const TSize & aSize Dimensions of the blob texture.

GetShadowTexture(THuiTextureHandle &, TInt)

TBool GetShadowTexture ( THuiTextureHandle & aHandle,
TInt aBlurDimension
) const

Parameters

THuiTextureHandle & aHandle
TInt aBlurDimension

GetShadowTexture(THuiTextureHandle &)

IMPORT_C TBool GetShadowTexture ( THuiTextureHandle & aHandle ) const

Parameters

THuiTextureHandle & aHandle

HasAlpha()

TBool HasAlpha ( ) const [pure virtual]

Determines if the texture has an alpha channel.

HasContent()

IMPORT_C TBool HasContent ( ) 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)

void InitSegmentL ( TInt aSegment ) [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 TBool IsNvgContent ( ) const

Informs whether this texture is in NVG format or not.

SetNvgContent()

IsShadowEnabled()

IMPORT_C TBool IsShadowEnabled ( ) const [virtual]

IsSkinContent()

IMPORT_C TBool IsSkinContent ( ) 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 &)

void NotifyPreferredSize ( 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 & aSize Auto size candidate.

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

void PartialUploadL ( THuiTextureFormat aFormat,
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 aFormat Format of the data buffer.
const TPoint & aOrigin Position to place the partial texture data.
const TSize & aSize Size of the texture in the data buffer.
const TUint8 * aBuffer Texture data buffer.

Priority()

IMPORT_C TInt Priority ( ) const

Returns the priority of the texture

SetPriority()

Release()

IMPORT_C void Release ( ) [virtual]

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

RemoveAllSegments()

void RemoveAllSegments ( ) [private]

Resets and removes all texture segments

Reset()

IMPORT_C void Reset ( ) [virtual]

Delete the texture.

ResetAutoSizeCalculation()

void ResetAutoSizeCalculation ( )

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

ResetSegment(TInt)

void ResetSegment ( TInt aSegment ) [protected, pure virtual]

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

Parameters

TInt aSegment

ResetShadows()

IMPORT_C void ResetShadows ( )

Deletes the shadow textures.

RestoreL()

IMPORT_C void RestoreL ( ) [virtual]

Restores the texture.

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

void SegmentClearL ( TInt aSegment,
TBool aWithAlpha,
const TRgb & aColor,
TUint8 aAlpha
) [pure virtual]

Clear a texture segment to a solid color.

Parameters

TInt aSegment
TBool aWithAlpha
const TRgb & aColor
TUint8 aAlpha

SegmentCount()

IMPORT_C TInt SegmentCount ( ) const

Number of segments in the texture.

SegmentName(TInt)

IMPORT_C TUint SegmentName ( TInt aSegment ) const

ID of the given segment.

Parameters

TInt aSegment The ordinal of the segment that we want the name of.

SegmentOffset(TInt)

IMPORT_C TPoint SegmentOffset ( TInt aSegment ) const

Return offset of a segment.

Parameters

TInt aSegment The ordinal of the segment that we want the offset of.

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

void SegmentPartialUpload ( TInt aSegment,
THuiTextureFormat aFormat,
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 aSegment Valid segment index for this texture.
THuiTextureFormat aFormat Format of the data buffer.
const TPoint & aOrigin Position to place the partial texture data.
const TSize & aSize Size of the texture in the data buffer.
const TUint8 * aBuffer Texture data buffer.

SegmentSize(TInt)

IMPORT_C TSize SegmentSize ( TInt aSegment ) const

Return logical dimensions of a segment.

Parameters

TInt aSegment The ordinal of the segment that we want the dimensions of.

SegmentTextureSize(TInt)

IMPORT_C TSize SegmentTextureSize ( TInt aSegment ) const

Return texture dimensions of a segment.

Parameters

TInt aSegment The ordinal of the segment that we want the texture dimensions of.

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

void SegmentUploadL ( TInt aSegment,
THuiTextureFormat aFormat,
const TSize & aSize,
const TUint8 * aBuffer,
TUint aBufferSize = 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 aSegment Valid segment index for this texture.
THuiTextureFormat aFormat Format of the image data buffer.
const TSize & aSize Size (width and height in pixels) of the texture in the data buffer (aBuffer).
const TUint8 * aBuffer Image data buffer.
TUint aBufferSize = 0 Length of the compressed image data. Set as 0 for non-compressed formats.

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

void SegmentUploadL ( TInt aSegment,
const CFbsBitmap & aBitmap,
const CFbsBitmap * aMaskBitmap = NULL,
THuiTextureUploadFlags aFlags = 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 aSegment Valid segment index for this texture.
const CFbsBitmap & aBitmap Bitmap to copy image contents and format from (RGB data).
const CFbsBitmap * aMaskBitmap = NULL Optional 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 = EHuiTextureUploadFlagDefault Specify 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 TInt SessionId ( ) const

Gets the session id for object.

SetAutoSizeParams(const THuiTextureAutoSizeParams &)

IMPORT_C void SetAutoSizeParams ( const THuiTextureAutoSizeParams & aParams )

Sets parameters to be used when calculating auto size.

Parameters

const THuiTextureAutoSizeParams & aParams New parameters.

SetImageFileNameL(const TDesC &)

void SetImageFileNameL ( const TDesC & aFileName )

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

Parameters

const TDesC & aFileName Image file name.

SetNvgContent(TBool)

IMPORT_C void SetNvgContent ( TBool aNvgContent )

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 aNvgContent ETrue to set this texture as extended with NVG content. EFalse to mark that this is not an extended texture.

SetPlaceholder(THuiTextureHandle *)

void SetPlaceholder ( THuiTextureHandle * aPlaceholder )

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

Parameters

THuiTextureHandle * aPlaceholder Placeholder texture.

SetPriority(TInt)

IMPORT_C void SetPriority ( TInt aPriority )

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

Parameters

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

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

IMPORT_C void SetSegment ( TInt aSegment,
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 void SetSegmentCountL ( TInt aSegmentCount ) [virtual]

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

Parameters

TInt aSegmentCount Number of segments.

SetSegmentName(TInt, TUint)

IMPORT_C void SetSegmentName ( TInt aSegment,
TUint aName
) [virtual]

Sets the name of a segment.

Parameters

TInt aSegment
TUint aName

SetSegmentOffset(TInt, const TPoint &)

IMPORT_C void SetSegmentOffset ( TInt aSegment,
const TPoint & aOffset
) [virtual]

Sets the logical offset of a texture segment.

Parameters

TInt aSegment Valid segment index for this texture.
const TPoint & aOffset Offset of the texture segment. Must be inside the logical dimensions of the whole texture.

SetSegmentSize(TInt, const TSize &)

IMPORT_C void SetSegmentSize ( TInt aSegment,
const TSize & aSegmentSize
) [virtual]

Sets the size of a segment.

Parameters

TInt aSegment
const TSize & aSegmentSize

SetSegmentTextureSize(TInt, const TSize &)

IMPORT_C void SetSegmentTextureSize ( TInt aSegment,
const TSize & aSegmentTextureSize
) [virtual]

Sets the texture size of the segment.

Parameters

TInt aSegment Valid segment index for this texture.
const TSize & aSegmentTextureSize

SetSessionId(TInt)

IMPORT_C void SetSessionId ( TInt aSessionId )

Sets the session id for object.

Parameters

TInt aSessionId

SetShadowStyle(THuiShadowStyle)

IMPORT_C void SetShadowStyle ( THuiShadowStyle aShadowStyle ) [virtual]

Sets the shadow generation style of the texture.

Parameters

THuiShadowStyle aShadowStyle Shadowing style.

SetSize(const TSize &)

IMPORT_C void SetSize ( 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 void SetSkinContent ( TBool aSkinContent ) [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 aSkinContent ETrue 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 void SetTextureChanged ( TBool aChanged )

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)

void SetupSegmentsL ( const TSize & aLogicalSize,
const TSize & aTextureSize,
THuiTextureUploadFlags aFlags = 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 & aLogicalSize Logical size of the full image.
const TSize & aTextureSize Texture resolution required, in pixels.
THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault

ShadowStyle()

IMPORT_C THuiShadowStyle ShadowStyle ( ) const

Determines the current shadow style.

ShadowedTexture()

IMPORT_C MHuiShadowedTexture * ShadowedTexture ( )

ShadowedTexture()

IMPORT_C const MHuiShadowedTexture * ShadowedTexture ( ) const

Size()

IMPORT_C TSize Size ( ) const

Return logical dimensions of texture. SetSize()

TextureChanged()

IMPORT_C TBool TextureChanged ( ) const [virtual]

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

TextureClearChanged()

IMPORT_C void TextureClearChanged ( ) 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 void TextureExtension ( const TUid & aExtensionUid,
TAny ** aExtensionParameters
) [protected]

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParameters

Type()

IMPORT_C TType Type ( ) const

Gets the object type.

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

void UploadDirectL ( const CFbsBitmap & aBitmap,
const CFbsBitmap * aMaskBitmap,
THuiTextureUploadFlags aFlags
)

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 & aBitmap Bitmap to copy image contents from.
const CFbsBitmap * aMaskBitmap Optional Bitmap for alpha (transparency) channel.
THuiTextureUploadFlags aFlags Specify texture upload behavior.

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

void UploadL ( const CFbsBitmap & aBitmap,
const CFbsBitmap * aMaskBitmap = NULL,
THuiTextureUploadFlags aFlags = 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 & aBitmap Bitmap 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 = NULL Optional 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 = EHuiTextureUploadFlagDefault Specify texture upload behavior - how to convert the bitmap to texture. You can OR these flags together.

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

void UploadL ( THuiTextureFormat aFormat,
const TSize & aSize,
const TUint8 * aBuffer,
THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault,
TUint aBufferSize = 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 aFormat Format of aBuffer, the image data buffer.
const TSize & aSize Size (width and height in pixels) of the texture in the data buffer (aBuffer).
const TUint8 * aBuffer Source Image data buffer.
THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault Specify upload behavior - how to convert the bitmap to texure.
TUint aBufferSize = 0 Length 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

THuiTextureAutoSizeParams iAutoSizeParams [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]