class MHuiSegmentedTexture |
MHuiSegmentedTexture is an abstract base class for texture image objects. It specifies one or more texture images that comprise a larger (virtual) image. THuiImage refers to objects that implement MHuiSegmentedTexture.
A segmented texture is a texture that is composed of one or more 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). A class implementing MHuiSegmentedTexture would in this case split the uploaded source image to multiple segments and create a different OpenGL texture for each. All of the segments would still be hidden inside the implementing MHuiSegmentedTexture-derived class, though, so it could be treated as a single entity.
When an object implements the MHuiSegmentedTexture interface, it can be drawn using the DrawImage() methods in CHuiGc (since THuiImage specifies the image as MHuiSegmentedTexture).
CHuiGc and CHuiTexture only support single-segment textures at the moment.
Public Member Functions | |
---|---|
~MHuiSegmentedTexture() | |
IMPORT_C void | Bind(TInt, TInt) |
IMPORT_C THuiTextureHandle | Handle(TInt) |
TInt | SegmentCount() |
TUint | SegmentName(TInt) |
TPoint | SegmentOffset(TInt) |
TSize | SegmentSize(TInt) |
TSize | SegmentTextureSize(TInt) |
TSize | Size() |
IMPORT_C | ~MHuiSegmentedTexture | ( | ) | [virtual] |
Construction / Destruction Virtual destructor, needed because we have a couple of implemented methods.
IMPORT_C void | Bind | ( | TInt | aSegment = 0, |
TInt | aTextureUnit = 0 | |||
) | const |
Binds given texture segment to the texture target. Binding makes the texture segment active.
SegmentCount() to get the number of available segments.
IMPORT_C THuiTextureHandle | Handle | ( | TInt | aSegment = 0 | ) | const |
Returns a handle to given texture segment. Defaults to first segment.
TInt aSegment = 0 |
TInt | SegmentCount | ( | ) | const [pure virtual] |
Determines how many segments the texture has. Will return 1 if the texture is not segmented.
TUint | SegmentName | ( | TInt | aSegment | ) | const [pure virtual] |
Determines the texture name of a segment. For example with OpenGL ES renderer, this will be the texture id generated with glGenTextures().
TInt aSegment | Segment index to access. |
TPoint | SegmentOffset | ( | TInt | aSegment | ) | const [pure virtual] |
Determines the logical offset for a texture segment.
TInt aSegment | Valid segment index for this texture. |
TSize | SegmentSize | ( | TInt | aSegment | ) | const [pure virtual] |
Determines the logical size of a texture segment. Can be non-power-of-two (NPOT) and may be different from the actual texture size.
Size() to return logical size of the whole texture. SegmentTextureSize() to determine the actual resolution of the texture.
TInt aSegment | Valid segment index for this texture. |
TSize | SegmentTextureSize | ( | TInt | aSegment | ) | const [pure virtual] |
Determines the actual resolution of the texture used by the segment. Most likely only Power-of-Two, unless NPOT supported by the graphics library.
TInt aSegment | Valid segment index for this texture. |
TSize | Size | ( | ) | const [pure virtual] |
Returns the logical size of this texture. Ie. the original size of the image represented with this texture. This size is independent of the possible segmentation of this texture.
On the other hand the actual texture size may vary across segments and typically has some driver/hw limitations.
Note that all the segments must be contained inside the logical area defined with this function.
SegmentSize() To return logical size for a particular texture segment. SegmentOffset() To return logical position for a particular texture segment. SegmentTextureSize() To return texture size for a segment.
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.