C
Qul::PlatformInterface::DrawingEngine Class
class Qul::PlatformInterface::DrawingEngineこのクラスは、ブレンディング関数のための抽象インターフェースを提供します。詳細...
| Header: | #include <platforminterface/drawingengine.h> |
| Since: | Qt Quick Ultralite (Platform) 1.5 |
パブリック型
(since Qt Quick Ultralite (Platform) 1.8) struct | Path |
(since Qt Quick Ultralite (Platform) 1.5) enum | BlendMode { BlendMode_SourceOver, BlendMode_Source } |
パブリック関数
(since Qt Quick Ultralite (Platform) 1.8) virtual Qul::PlatformInterface::DrawingEngine::Path * | allocatePath(const Qul::PlatformInterface::PathData *pathData, Qul::PlatformInterface::PathFillRule fillRule) |
| virtual void | blendAlphaMap(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Point &pos, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::Rect &sourceRect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver) |
| virtual void | blendImage(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Point &pos, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::Rect &sourceRect, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver) |
(since Qt Quick Ultralite (Platform) 1.8) virtual void | blendPath(Qul::PlatformInterface::DrawingDevice *drawingDevice, Qul::PlatformInterface::DrawingEngine::Path *path, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::Rect &clipRect, const Qul::PlatformInterface::Brush *fillBrush, const Qul::PlatformInterface::Brush *strokeBrush, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver) |
| virtual void | blendRect(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver) |
(since Qt Quick Ultralite (Platform) 1.6) virtual void | blendRoundedRect(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect, const Qul::PlatformInterface::Rect &clipRect, Qul::PlatformInterface::Rgba32 color, int radius, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver) |
| virtual void | blendTransformedAlphaMap(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::RectF &destinationRect, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::RectF &sourceRect, const Qul::PlatformInterface::Rect &clipRect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver) |
| virtual void | blendTransformedImage(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::RectF &destinationRect, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::RectF &sourceRect, const Qul::PlatformInterface::Rect &clipRect, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver) |
(since Qt Quick Ultralite (Platform) 1.8) virtual void | setStrokeProperties(Qul::PlatformInterface::DrawingEngine::Path *path, const Qul::PlatformInterface::StrokeProperties &strokeProperties) |
(since Qt Quick Ultralite (Platform) 2.12) virtual Qul::PlatformInterface::RenderHints | supportedRenderHints() const |
| virtual void | synchronizeForCpuAccess(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect) |
詳細な説明
このクラスのインスタンスを使用すると、描画デバイス上でグラフィック要素をブレンドすることができます。各プラットフォームの実装によっては、指定されたグラフィック要素のブレンド操作をサポートするハードウェアコンポーネントが利用可能な場合、その操作が高速化されることがあります。
各プラットフォームは、これらのブレンド関数を実装できます。プラットフォームに特別なサポートがない場合は、CPU を使用してタスクを実行するデフォルトのブレンド関数が呼び出されます。
関連項目: サポートされているターゲットボードおよび開発ホスト。
メンバ型のドキュメント
[since Qt Quick Ultralite (Platform) 1.5] enum DrawingEngine::BlendMode
この列挙型は、ブレンドモードを指定します。
| 定数 | 値 |
|---|---|
Qul::PlatformInterface::DrawingEngine::BlendMode_SourceOver | 0 |
ソースがデスティネーションの上に配置されます。
| 定数値ソースがデスティネーションの上に配置されます。 | 値ソースがデスティネーションの上に配置されます。定数 |
|---|---|
Qul::PlatformInterface::DrawingEngine::BlendMode_Source | 1 |
ブレンド処理を行わずに、ソースが宛先の上にブリットされます。
この列挙型は、Qt Quick Ultralite (Platform) 1.5 で導入されました。
メンバ関数のドキュメント
[virtual, since Qt Quick Ultralite (Platform) 1.8] Qul::PlatformInterface::DrawingEngine::Path *DrawingEngine::allocatePath(const Qul::PlatformInterface::PathData *pathData, Qul::PlatformInterface::PathFillRule fillRule)
指定されたパスデータに対してパスハンドルを割り当てます。
このパスハンドルは、指定されたpathData のプラットフォーム固有の表現であり、指定されたfillRule によって値が設定されます。
プラットフォームは、Path ハンドルのサブクラスを使用して、パスに関連するプラットフォーム固有のデータ(たとえば、ハードウェアブレンディングにより適した最適化された表現など)をキャッシュすることができます。そうすることで、パスが塗りつぶされたり描画されたりするたびに、最適化された表現を再計算する必要がなくなります。
プラットフォームは、`PathData `が`Path `ハンドルの存続期間全体を通じて有効であり続けると想定できます。つまり、`allocatePath`が呼び出された時点から、`Path `ハンドルが削除される時点までです。
注: フィルブラシが設定されていない場合、最適化された表現は必要ないため、実装では 、blendPath が呼び出されるまで待ってから、塗りつぶされたパスの最適化された表現を生成するのが理想的です。
デフォルトの実装では、NULL を返します。
この関数は、Qt Quick Ultralite (Platform) 1.8 で導入されました。
[virtual] void DrawingEngine::blendAlphaMap(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Point &pos, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::Rect &sourceRect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
アルファマップを描画デバイスに合成します。
指定された `sourceRect `(source )に `color ` を乗算し、`blendMode` を使用して、pos において `drawingDevice ` とブレンドします。デフォルトのブレンドモードはBlendMode_SourceOver
デフォルトの実装では、まずsynchronizeForCpuAccess を呼び出し、その後、fallbackDrawingEngine を使用して blendAlphaMap を呼び出します。
[virtual] void DrawingEngine::blendImage(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Point &pos, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::Rect &sourceRect, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
画像を描画デバイスに合成します。
指定された `sourceRect `(source )は、`blendMode` を使用して、`pos ` における `drawingDevice ` と合成されます。デフォルトの合成モードは `BlendMode_SourceOver ` です。`sourceOpacity ` は、ソースの全体的な不透明度を 0 から 256 の範囲で指定します(256 は完全に不透明です)。
デフォルトの実装では、まずsynchronizeForCpuAccess を呼び出し、その後、fallbackDrawingEngineを使用してblendImageを呼び出します。
[virtual, since Qt Quick Ultralite (Platform) 1.8] void DrawingEngine::blendPath(Qul::PlatformInterface::DrawingDevice *drawingDevice, Qul::PlatformInterface::DrawingEngine::Path *path, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::Rect &clipRect, const Qul::PlatformInterface::Brush *fillBrush, const Qul::PlatformInterface::Brush *strokeBrush, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
パスハンドルで表されるパスを、描画デバイス上にブレンドします。
指定されたpath ハンドルは、与えられたtransform およびblendMode を使用して、drawingDevice にブレンドされます。
fillBrush がNULL に設定されていない場合、パスは、パスの割り当て時に設定されたPathFillRule に従って、指定されたfillBrush で塗りつぶされます。
strokeBrush がNULL に設定されていない場合、パスは、setStrokeProperties で設定されたStrokeProperties に基づいて、指定されたstrokeBrush によってストロークされる必要があります。
結果は、描画デバイスの座標系におけるclipRect によってクリップされる必要があります。
sourceOpacity ソースの全体的な不透明度を 0 から 256 の範囲で指定します。256 は完全に不透明です。
デフォルトの実装では、何もしません。
この関数は、Qt Quick Ultralite (Platform) 1.8 で導入されました。
[virtual] void DrawingEngine::blendRect(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
描画デバイスに単色を塗りつぶします。
color は、blendMode を使用して、drawingDevice 上でrect を塗りつぶすために使用されます。デフォルトのブレンドモードはBlendMode_SourceOver
デフォルトの実装では、まずsynchronizeForCpuAccess を呼び出し、その後、fallbackDrawingEngineを使用してblendRectを呼び出します。
注:この 機能は 、すべてのリファレンスボードのハードウェアでサポートされているとは限りません。詳細については、「サポートされている機能」の表を参照してください。
[virtual, since Qt Quick Ultralite (Platform) 1.6] void DrawingEngine::blendRoundedRect(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect, const Qul::PlatformInterface::Rect &clipRect, Qul::PlatformInterface::Rgba32 color, int radius, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
角が丸い矩形を描画デバイスに描画します。
color blendMode を使用して、 上の を塗りつぶすために使用されます。デフォルトのブレンドモードは です。ブレンドは、指定された に対してクリップされる必要があります。 は、角が丸い矩形を描画するために使用される角の半径を定義します。4つの角すべてに同じ半径が使用されます。現在、角ごとに異なる半径を指定する方法はありません。drawingDevice rect BlendMode_SourceOver clipRect radius
デフォルトの実装では、まずsynchronizeForCpuAccess を呼び出し、その後、フォールバック描画エンジンでblendRoundedRectを呼び出します。
注:この 機能は 、すべてのリファレンスボードのハードウェアでサポートされているとは限りません。詳細については、「サポートされている機能」の表を参照してください。
この関数は、Qt Quick Ultralite (Platform) 1.6 で導入されました。
「DrawingDevice::fallbackDrawingEngine()」も参照してください 。
[virtual] void DrawingEngine::blendTransformedAlphaMap(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::RectF &destinationRect, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::RectF &sourceRect, const Qul::PlatformInterface::Rect &clipRect, Qul::PlatformInterface::Rgba32 color, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
変換されたアルファマップを描画デバイスにブレンドします。
指定されたsource のsourceRect は、color と乗算され、destinationRect でblendMode を用いてdrawingDevice とブレンドされます。ブレンド処理の前に、transform がsource に適用されます。結果は、描画デバイス座標系にあるclipRect によってクリップされる必要があります。
デフォルトのブレンドモードはBlendMode_SourceOver
デフォルトの実装では、まずsynchronizeForCpuAccess を呼び出し、その後、fallbackDrawingEngineを使用してblendTransformedAlphaMapを呼び出します。
[virtual] void DrawingEngine::blendTransformedImage(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Transform &transform, const Qul::PlatformInterface::RectF &destinationRect, const Qul::PlatformInterface::Texture &source, const Qul::PlatformInterface::RectF &sourceRect, const Qul::PlatformInterface::Rect &clipRect, int sourceOpacity, Qul::PlatformInterface::DrawingEngine::BlendMode blendMode = BlendMode_SourceOver)
変換された画像を描画デバイスに描画します。
指定された `sourceRect `(`source `)は、`blendMode` を使用して、destinationRect 座標で `drawingDevice ` と合成されます。合成処理の前に、`transform ` が `source ` に適用されます。結果は、描画デバイスの座標系にある `clipRect ` によってクリップされる必要があります。`sourceOpacity ` は、ソースの全体的な不透明度を 0 から 256 の範囲で指定します(256 は完全に不透明)。
デフォルトのブレンドモードはBlendMode_SourceOver
デフォルトの実装では、まずsynchronizeForCpuAccess を呼び出し、その後、fallbackDrawingEngineを使用してblendTransformedImageを呼び出します。
[virtual, since Qt Quick Ultralite (Platform) 1.8] void DrawingEngine::setStrokeProperties(Qul::PlatformInterface::DrawingEngine::Path *path, const Qul::PlatformInterface::StrokeProperties &strokeProperties)
指定されたpath ハンドルのストロークプロパティを設定します。
strokeProperties には、後でpath ハンドルをblendPath の呼び出しでブレンドする際に使用される情報が含まれます。ただし、blendPath の呼び出し時にstrokeBrush パラメータが設定されていることを前提とします。
これにより、プラットフォームの実装は、blendPath が呼び出されるたびに再計算を行う代わりに、ハードウェアブレンディングに適した最適化された表現をキャッシュすることができます。
注: ストロークブラシが設定されていない場合、最適化された表現は必要ないため、実装では 、blendPath が呼び出されるまで待ってから、ストロークされたパスの最適化された表現を生成するのが理想的です。
デフォルトの実装では、何も行われません。
この関数は、Qt Quick Ultralite (Platform) 1.8 で導入されました。
[virtual, since Qt Quick Ultralite (Platform) 2.12] Qul::PlatformInterface::RenderHints DrawingEngine::supportedRenderHints() const
このDrawingEngine がサポートしているレンダリングヒントを指定するフラグを返します。
各レンダリング関数が呼び出される前に、サポートされているレンダリングヒントが照会されます。ヒントがサポートされていない場合は、フォールバックレンダリングが適用されます。
この関数は、Qt Quick Ultralite (Platform) 2.12 で導入されました。
[virtual] void DrawingEngine::synchronizeForCpuAccess(Qul::PlatformInterface::DrawingDevice *drawingDevice, const Qul::PlatformInterface::Rect &rect)
CPUによるアクセスに合わせてグラフィックスハードウェアを同期させます。
drawingDevice ハードウェアは、CPUからアクセスされるように同期されます。これにより、指定されたrect 内でグラフィックスハードウェアがすべてのアクティブな操作を完了するまで、CPUはブロックされます。
デフォルトの実装では何も行われません。
特定の Qt ライセンスの下で利用可能です。
詳細はこちら。