Desaturate QML Type
色の彩度を下げます。詳細...
Import Statement: | import Qt5Compat.GraphicalEffects |
Since: | QtGraphicalEffects 1.0 |
Inherits: |
プロパティ
- cached : bool
- desaturation : real
- source : variant
詳細説明
脱色されたピクセル値は、ソースアイテムの元のRGBコンポーネント値の平均として計算されます。
ソース | 適用される効果 |
---|---|
適用例
次の例は、効果を適用する方法を示しています。
import QtQuick import Qt5Compat.GraphicalEffects Item { width: 300 height: 300 Image { id: bug source: "images/bug.jpg" sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } Desaturate { anchors.fill: bug source: bug desaturation: 0.8 } }
プロパティの説明
cached : bool |
このプロパティは、レンダリングのパフォーマンスを向上させるために、エフェクトの出力ピクセルをキャッシュできるようにします。
ソースまたはエフェクトのプロパティが変更されるたびに、キャッシュ内のピクセルを更新する必要があります。エフェクト出力を保存するために余分なメモリバッファが必要になるため、メモリ消費量が増加します。
ソースまたはエフェクトプロパティがアニメーションするときは、キャッシュを無効にすることをお勧めします。
デフォルトでは、このプロパティはfalse
に設定されています。
desaturation : real |
このプロパティは、ソースカラーがどの程度彩度を下げるかを定義します。
値の範囲は 0.0(変化なし)から 1.0(脱色)です。デフ ォル ト では、 こ のプ ロ パテ ィ は0.0
(変化な し ) に設定 さ れてい ます。
彩度調整値を変えた出力例 | ||
---|---|---|
desaturation:0.0 | desaturation:0.5 | 脱飽和:1.0 |
source : variant |
このプロパティは、エフェクトにソースピクセルを提供するソースアイテムを定義します。
注意: 例えば source をエフェクトの親に設定することで、エフェクトがそれ自身を含むようにすることはサポートされていません。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.