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 (変更なし)に設定されています。
| さまざまな彩度低減値による出力例 | ||
|---|---|---|
|
|
|
| 彩度低下: 0.0 | 彩度低下: 0.5 | 彩度低下: 1.0 |
source : variant
このプロパティは、エフェクトにソースピクセルを提供するソースアイテムを定義します。
注: エフェクトの親をソースに設定するなどして、エフェクトが自分自身を含めるようにすることは サポートされていません。
© 2026 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.




