This class provides an abstract interface for managing hardware layers. 更多...
Header: | #include <platforminterface/layerengine.h> |
Since: | Qt Quick Ultralite (Platform) 1.7 |
This class was introduced in Qt Quick Ultralite (Platform) 1.7.
struct | ImageLayer |
struct | ImageLayerProperties |
struct | ItemLayer |
struct | ItemLayerProperties |
struct | LayerPropertiesBase |
struct | SizedLayerPropertiesBase |
struct | SpriteLayer |
struct | SpriteLayerProperties |
enum | ColorDepth { Bpp16, Bpp16Alpha, Bpp24, Bpp32, Bpp32Alpha } |
virtual Qul::PlatformInterface::LayerEngine::ImageLayer * | allocateImageLayer (const Qul::PlatformInterface::Screen * screen , const Qul::PlatformInterface::LayerEngine::ImageLayerProperties & properties , Qul::PlatformInterface::LayerEngine::SpriteLayer * spriteLayer = nullptr) |
virtual Qul::PlatformInterface::LayerEngine::ItemLayer * | allocateItemLayer (const Qul::PlatformInterface::Screen * screen , const Qul::PlatformInterface::LayerEngine::ItemLayerProperties & properties , Qul::PlatformInterface::LayerEngine::SpriteLayer * spriteLayer = nullptr) |
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 ) |
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.
注意: A particular LayerEngine instance doesn't necessarily need to support all these layer types or arbitrary transforms.
This enum specifies the color depth used for a layer, and whether or not to use an alpha channel.
注意: The platform might decide exactly which pixel format to use for a given color depth and alpha channel configuration.
常量 | 值 | 描述 |
---|---|---|
Qul::PlatformInterface::LayerEngine::Bpp16
|
0
|
16 bits per pixel color depth, no alpha channel |
Qul::PlatformInterface::LayerEngine::Bpp16Alpha
|
1
|
16 bits per pixel color depth, with alpha channel |
Qul::PlatformInterface::LayerEngine::Bpp24
|
2
|
24 bits per pixel color depth, no alpha channel |
Qul::PlatformInterface::LayerEngine::Bpp32
|
3
|
32 bits per pixel color depth, no alpha channel |
Qul::PlatformInterface::LayerEngine::Bpp32Alpha
|
4
|
32 bits per pixel color depth, with alpha channel |
[virtual]
Qul::PlatformInterface::LayerEngine::ImageLayer
*LayerEngine::
allocateImageLayer
(const
Qul::PlatformInterface::Screen
*
screen
, const
Qul::PlatformInterface::LayerEngine::ImageLayerProperties
&
properties
,
Qul::PlatformInterface::LayerEngine::SpriteLayer
*
spriteLayer
= nullptr)
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.
若 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.
注意: 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.
另请参阅 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
= nullptr)
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.
若 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.
注意: 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.
另请参阅 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.
给定 properties specify the sprite layer's position, z-order, size, and color depth, and whether the sprite layer should be enabled or not.
另请参阅 ItemLayer , ImageLayer , updateSpriteLayer ,和 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.
另请参阅 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.
另请参阅 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.
另请参阅 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 采用给定 properties .
properties specify the image layer's position, z-order, transform, opacity and image source, and whether the image layer should be enabled or not.
另请参阅 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 采用给定 properties .
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.
另请参阅 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 采用给定 properties .
properties specify the sprite layer's position, z-order, size, color depth, and whether the sprite layer should be enabled or not.
另请参阅 allocateSpriteLayer .