C

LayerEngine Class

class Qul::PlatformInterface::LayerEngine

This class provides an abstract interface for managing hardware layers. More...

Header: #include <platforminterface/layerengine.h>
Since: Qt Quick Ultralite (Platform) 1.7

Public Types

struct ImageLayer
struct ImageLayerProperties
struct ItemLayer
struct ItemLayerProperties
struct LayerPropertiesBase
struct SizedLayerPropertiesBase
struct SpriteLayer
struct SpriteLayerProperties
enum ColorDepth { Bpp8, Bpp16, Bpp16Alpha, Bpp24, Bpp32, Bpp32Alpha }
enum RenderingHints { NoRenderingHint, OptimizeForSpeed, OptimizeForSize }

Public Functions

virtual Qul::PlatformInterface::LayerEngine::ImageLayer *allocateImageLayer(const Qul::PlatformInterface::Screen *screen, const Qul::PlatformInterface::LayerEngine::ImageLayerProperties &properties, Qul::PlatformInterface::LayerEngine::SpriteLayer *spriteLayer = NULL)
virtual Qul::PlatformInterface::LayerEngine::ItemLayer *allocateItemLayer(const Qul::PlatformInterface::Screen *screen, const Qul::PlatformInterface::LayerEngine::ItemLayerProperties &properties, Qul::PlatformInterface::LayerEngine::SpriteLayer *spriteLayer = NULL)
virtual Qul::PlatformInterface::LayerEngine::SpriteLayer *allocateSpriteLayer(const Qul::PlatformInterface::Screen *screen, const Qul::PlatformInterface::LayerEngine::SpriteLayerProperties &properties)
virtual void deallocateImageLayer(Qul::PlatformInterface::LayerEngine::ImageLayer *layer)
virtual void deallocateItemLayer(Qul::PlatformInterface::LayerEngine::ItemLayer *layer)
virtual void deallocateSpriteLayer(Qul::PlatformInterface::LayerEngine::SpriteLayer *layer)
virtual void updateImageLayer(Qul::PlatformInterface::LayerEngine::ImageLayer *layer, const Qul::PlatformInterface::LayerEngine::ImageLayerProperties &properties)
virtual void updateItemLayer(Qul::PlatformInterface::LayerEngine::ItemLayer *layer, const Qul::PlatformInterface::LayerEngine::ItemLayerProperties &properties)
virtual void updateSpriteLayer(Qul::PlatformInterface::LayerEngine::SpriteLayer *layer, const Qul::PlatformInterface::LayerEngine::SpriteLayerProperties &properties)

Detailed Description

An instance of this class can be used to allocate, update and deallocate hardware layers. There are three types of hardware layers: image layers, item layers, and sprite layers. Image layers are used for static image content, item layers are used for content dynamically rendered using DrawingEngine, and sprite layers are aggregate layers that can contain multiple image or item sub-layers.

The layers' positions and opacity can be updated independently. Also the layers might have an arbitrary transform matrix applied to them.

Note: A particular LayerEngine instance doesn't necessarily need to support all these layer types or arbitrary transforms.

Member Type Documentation

enum LayerEngine::ColorDepth

This enum specifies the color depth used for a layer, and whether or not to use an alpha channel.

Note: The platform might decide exactly which pixel format to use for a given color depth and alpha channel configuration.

ConstantValueDescription
Qul::PlatformInterface::LayerEngine::Bpp808 bits per pixel color depth, no alpha channel
Qul::PlatformInterface::LayerEngine::Bpp16116 bits per pixel color depth, no alpha channel
Qul::PlatformInterface::LayerEngine::Bpp16Alpha216 bits per pixel color depth, with alpha channel
Qul::PlatformInterface::LayerEngine::Bpp24324 bits per pixel color depth, no alpha channel
Qul::PlatformInterface::LayerEngine::Bpp32432 bits per pixel color depth, no alpha channel
Qul::PlatformInterface::LayerEngine::Bpp32Alpha532 bits per pixel color depth, with alpha channel

enum LayerEngine::RenderingHints

The rendering optimization hints for the layer.

The hints are used by the platform layer engine to configure the layer in the most optimal way for the application.

Possible values:

ConstantValueDescription
Qul::PlatformInterface::LayerEngine::NoRenderingHint0No rendering hint specified
Qul::PlatformInterface::LayerEngine::OptimizeForSpeed1U << 0The layer is optimized for fast rendering
Qul::PlatformInterface::LayerEngine::OptimizeForSize1U << 1The layer is optimized for low memory usage (default)

Member Function Documentation

[virtual] Qul::PlatformInterface::LayerEngine::ImageLayer *LayerEngine::allocateImageLayer(const Qul::PlatformInterface::Screen *screen, const Qul::PlatformInterface::LayerEngine::ImageLayerProperties &properties, Qul::PlatformInterface::LayerEngine::SpriteLayer *spriteLayer = NULL)

Allocates an image layer for displaying static image content.

This method allocates an image layer for the given screen, which is used to display static image data from some memory address. The given properties specify the image layer's position, z-order, transform, opacity and image source, and whether the image layer should be enabled or not.

If spriteLayer is set, it represents the sprite layer that the image layer should belong to. It can be assumed that the sprite layer was also created on the same screen as the image layer.

Note: Some platforms might require that the item and image layers inside a sprite layer all use the same color depth as the sprite layer itself.

See also updateImageLayer and deallocateImageLayer.

[virtual] Qul::PlatformInterface::LayerEngine::ItemLayer *LayerEngine::allocateItemLayer(const Qul::PlatformInterface::Screen *screen, const Qul::PlatformInterface::LayerEngine::ItemLayerProperties &properties, Qul::PlatformInterface::LayerEngine::SpriteLayer *spriteLayer = NULL)

Allocates an item layer for rendering dynamic content.

This method allocates an item layer for the given screen, which is rendered into using DrawingEngine in order to display dynamic content. The given properties specify the item layer's position, z-order, size, color depth, transform and opacity, and whether the item layer should be enabled or not.

If spriteLayer is set, it represents the sprite layer that the item layer should belong to. It can be assumed that the sprite layer was also created on the same screen as the item layer.

Note: Some platforms might require that the item and image layers inside a sprite layer all use the same color depth as the sprite layer itself.

See also updateItemLayer and deallocateItemLayer.

[virtual] Qul::PlatformInterface::LayerEngine::SpriteLayer *LayerEngine::allocateSpriteLayer(const Qul::PlatformInterface::Screen *screen, const Qul::PlatformInterface::LayerEngine::SpriteLayerProperties &properties)

Allocates a sprite layer for displaying sprites.

This method allocates a sprite layer for the given screen, which is used to display sprites. The image contents of each sprite is provided by a sub-layer, which can either be an item layer or an image layer. If two sprites are overlapping, it might be that only the top-most sprite is shown.

The given properties specify the sprite layer's position, z-order, size, and color depth, and whether the sprite layer should be enabled or not.

See also ItemLayer, ImageLayer, updateSpriteLayer, and deallocateSpriteLayer.

[virtual] void LayerEngine::deallocateImageLayer(Qul::PlatformInterface::LayerEngine::ImageLayer *layer)

Deallocates an image layer.

This method deallocates an image layer and makes it no longer visible.

After calling this method, the layer pointer is invalid.

See also allocateImageLayer and updateImageLayer.

[virtual] void LayerEngine::deallocateItemLayer(Qul::PlatformInterface::LayerEngine::ItemLayer *layer)

Deallocates an item layer.

This method deallocates an item layer and makes it no longer visible.

After calling this method, the layer pointer is invalid.

See also allocateItemLayer and updateItemLayer.

[virtual] void LayerEngine::deallocateSpriteLayer(Qul::PlatformInterface::LayerEngine::SpriteLayer *layer)

Deallocates a sprite layer.

This method deallocates a sprite layer and makes it no longer visible.

After calling this method, the layer pointer is invalid.

See also allocateSpriteLayer and updateSpriteLayer.

[virtual] void LayerEngine::updateImageLayer(Qul::PlatformInterface::LayerEngine::ImageLayer *layer, const Qul::PlatformInterface::LayerEngine::ImageLayerProperties &properties)

Updates the properties of an image layer.

This method updates the properties of layer with the given properties.

The properties specify the image layer's position, z-order, transform, opacity and image source, and whether the image layer should be enabled or not.

See also allocateImageLayer.

[virtual] void LayerEngine::updateItemLayer(Qul::PlatformInterface::LayerEngine::ItemLayer *layer, const Qul::PlatformInterface::LayerEngine::ItemLayerProperties &properties)

Updates the properties of an item layer.

This method updates the properties of layer with the given properties.

The properties specify the item layer's position, z-order, size, color depth, transform and opacity, and whether the item layer should be enabled or not.

See also allocateItemLayer.

[virtual] void LayerEngine::updateSpriteLayer(Qul::PlatformInterface::LayerEngine::SpriteLayer *layer, const Qul::PlatformInterface::LayerEngine::SpriteLayerProperties &properties)

Updates the properties of a sprite layer.

This method updates the properties of layer with the given properties.

The properties specify the sprite layer's position, z-order, size, color depth, and whether the sprite layer should be enabled or not.

See also allocateSpriteLayer.

Available under certain Qt licenses.
Find out more.