HueSaturation
ImportStatement: import QtGraphicalEffects 1.0
Since: QtGraphicalEffects 1.0
Inherits: Item
Properties
cached :bool
hue : real
lightness :real
saturation :real
source :variant
DetailedDescription
HueSaturation类似于Colorize影响,但色相和饱和度属性的处理不同。HueSaturation影响总是转换原始图片的色调、饱和度和亮度,而不是设置它们。
源 | 影响 |
---|---|
| |
示例代码:
importQtQuick 2.0
importQtGraphicalEffects 1.0
Item {
width: 300
height: 300
Image {
id: bug
source: "images/bug.jpg"
sourceSize: Qt.size(parent.width,parent.height)
smooth: true
visible: false
}
HueSaturation {
anchors.fill: bug
source: bug
hue: -0.3
saturation: 0.5
lightness: -0.1
}
}
PropertyDocumentation
cached :bool
是否缓冲输出,提高渲染效率但消耗更多内存。每当源或影响发生变化,缓冲的数据都会更新。当源或影响为动画时,推荐关闭缓冲。默认为假。
hue : real
定义了附加到源色调上的色调值。值在-1.0(减少)到1.0(增加)。默认为0.0。
色调的影响 | ||
---|---|---|
| | |
hue: -0.3 | hue: 0.0 | hue: 0.3 |
saturation: 0 | saturation: 0 | saturation: 0 |
lightness: 0 | lightness: 0 | lightness: 0 |
lightness :real
附加到源亮度上的亮度值。值在-1.0(减少)到1.0(增加)。默认为0.0。
亮度的影响 | ||
---|---|---|
| | |
lightness: -0.5 | lightness: 0.0 | lightness: 0.5 |
hue: 0 | hue: 0 | hue: 0 |
saturation: 0 | saturation: 0 | saturation: 0 |
saturation :real
附加到源饱和度上的饱和度值。值在-1.0(减少)到1.0(增加)。默认为0.0。
饱和度的影响 | ||
---|---|---|
| | |
saturation: -0.8 | saturation: 0.0 | saturation: 1.0 |
hue: 0 | hue: 0 | hue: 0 |
lightness: 0 | lightness: 0 | lightness: 0 |
source :variant
源图片。注意它不支持影响自身,所以不能设置父到source。