aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/qtgraphicaleffects-blend.qdoc
blob: c9bbe0967f54a5da8f46d405b3ac79b3efa452a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the documentation of the Qt Graphical Effects module.
**
** $QT_BEGIN_LICENSE:FDL$
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms
** and conditions contained in a signed written agreement between you
** and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \qmltype Blend
    \inqmlmodule QtGraphicalEffects 1.0
    \since QtGraphicalEffects 1.0
    \inherits QtQuick2::Item
    \ingroup qtgraphicaleffects-blend
    \brief Merges two source items by using a blend mode.

    Blend mode can be selected with the \l{Blend::mode}{mode} property.

    \table
    \header
        \li source
        \li foregroundSource
        \li Effect applied
    \row
        \li \image Original_bug.png
        \li \image Original_butterfly.png
        \li \image Blend_bug_and_butterfly.png
    \endtable

    \section1 Example

    The following example shows how to apply the effect.
    \snippet snippets/Blend-example.qml example

*/

/*!
    \qmlproperty variant QtGraphicalEffects1::Blend::source

    This property defines the source item that is going to be the base when \l{Blend::foregroundSource}{foregroundSource} is blended over it.

*/

/*!
    \qmlproperty variant QtGraphicalEffects1::Blend::foregroundSource

    This property defines the item that is going to be blended over the \l{Blend::source}{source}.

*/

/*!
    \qmlproperty string QtGraphicalEffects1::Blend::mode

    This property defines the mode which is used when foregroundSource is blended over source. Values are
    case insensitive.

    \table
    \header
        \li mode
        \li description
    \row
        \li normal
        \li The pixel component values from foregroundSource are written over source by using alpha blending.
    \row
        \li addition
        \li The pixel component values from source and foregroundSource are added together and written.
    \row
        \li average
        \li The pixel component values from source and foregroundSource are averaged and written.
    \row
        \li color
        \li The lightness value from source is combined with hue and saturation from foregroundSource and written.
    \row
        \li colorBurn
        \li The darker pixels from source are darkened more, if both source and foregroundSource pixels are light the result is light.
    \row
        \li colorDodge
        \li The lighter pixels from source are lightened more, if both source and foregroundSource pixels are dark the result is dark.
    \row
        \li darken
        \li The darker pixel component value from source and foregroundSource is written.
    \row
        \li darkerColor
        \li The lower luminance pixel rgb-value from source and foregroundSource is written.
    \row
        \li difference
        \li The absolute pixel component value difference between source and foregroundSource is written.
    \row
        \li divide
        \li The pixel component values from source is divided by the value from foregroundSource and written.
    \row
        \li exclusion
        \li The pixel component value difference with reduced contrast between source and foregroundSource is written.
    \row
        \li hardLight
        \li The pixel component values from source are lightened or darkened according to foregroundSource values and written.
    \row
        \li hue
        \li The hue value from foregroundSource is combined with saturation and lightness from source and written.
    \row
        \li lighten
        \li The lightest pixel component value from source and foregroundSource is written.
    \row
        \li lighterColor
        \li The higher luminance pixel rgb-value from source and foregroundSource is written.
    \row
        \li lightness
        \li The lightness value from foregroundSource is combined with hue and saturation from source and written.
    \row
        \li multiply
        \li The pixel component values from source and foregroundSource are multiplied together and written.
    \row
        \li negation
        \li The inverted absolute pixel component value difference between source and foregroundSource is written.
    \row
        \li saturation
        \li The saturation value from foregroundSource is combined with hue and lightness from source and written.
    \row
        \li screen
        \li The pixel values from source and foregroundSource are negated, then multiplied, negated again, and written.
    \row
        \li subtract
        \li Pixel value from foregroundSource is subracted from source and written.
    \row
        \li softLight
        \li The pixel component values from source are lightened or darkened slightly according to foregroundSource values and written.

    \endtable

    \table
    \header
        \li Example source
        \li Example foregroundSource
    \row
        \li \image Original_bug.png
        \li \image Original_butterfly.png
    \endtable

    \table
    \header
    \li Output examples with different mode values
    \li
    \li
    \row
        \li \image Blend_mode1.png
        \li \image Blend_mode2.png
        \li \image Blend_mode3.png
    \row
        \li \b { mode: normal }
        \li \b { mode: addition }
        \li \b { mode: average }
    \row
        \li \image Blend_mode4.png
        \li \image Blend_mode5.png
        \li \image Blend_mode6.png
    \row
        \li \b { mode: color }
        \li \b { mode: colorBurn }
        \li \b { mode: colorDodge }
    \row
        \li \image Blend_mode7.png
        \li \image Blend_mode8.png
        \li \image Blend_mode9.png
    \row
        \li \b { mode: darken }
        \li \b { mode: darkerColor }
        \li \b { mode: difference }
    \row
        \li \image Blend_mode10.png
        \li \image Blend_mode11.png
        \li \image Blend_mode12.png
    \row
        \li \b { mode: divide }
        \li \b { mode: exclusion }
        \li \b { mode: hardlight }
    \row
        \li \image Blend_mode13.png
        \li \image Blend_mode14.png
        \li \image Blend_mode15.png
    \row
        \li \b { mode: hue }
        \li \b { mode: lighten }
        \li \b { mode: lighterColor }
    \row
        \li \image Blend_mode16.png
        \li \image Blend_mode17.png
        \li \image Blend_mode18.png
    \row
        \li \b { mode: lightness }
        \li \b { mode: negation }
        \li \b { mode: multiply }
    \row
        \li \image Blend_mode19.png
        \li \image Blend_mode20.png
        \li \image Blend_mode21.png
    \row
        \li \b { mode: saturation }
        \li \b { mode: screen }
        \li \b { mode: subtract }
    \row
        \li \image Blend_mode22.png
    \row
        \li \b { mode: softLight }
    \endtable


*/

/*!
    \qmlproperty bool QtGraphicalEffects1::Blend::cached

    This property allows the effect output pixels to be cached in order to improve the rendering performance.

    Every time the source or effect properties are changed, the pixels in the cache must be updated.
    Memory consumption is increased, because an extra buffer of memory is required for storing the effect output.

    It is recommended to disable the cache when the source or the effect properties are animated.

    By default, the property is set to false.

*/