aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/qtgraphicaleffects-leveladjust.qdoc
blob: eac97a2cfcc0c4d2aa40286de82389fefed257c3 (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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
/****************************************************************************
**
** 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 LevelAdjust
    \inqmlmodule QtGraphicalEffects 1.0
    \since QtGraphicalEffects 1.0
    \inherits QtQuick2::Item
    \ingroup qtgraphicaleffects-color
    \brief Adjusts color levels in the RGBA color space.

    This effect adjusts the source item colors separately for each color channel.
    Source item contrast can be adjusted and color balance altered.

    \table
    \header
        \li Source
        \li Effect applied
    \row
        \li \image Original_butterfly.png
        \li \image LevelAdjust_butterfly.png
    \endtable

    \section1 Example

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

*/

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

    This property defines the source item that provides the source pixels for
    the effect.

*/

/*!
    \qmlproperty color QtGraphicalEffects1::LevelAdjust::minimumInput

    This property defines the minimum input level for each color channel. It sets
    the black-point, all pixels having lower value than this property are rendered
    as black (per color channel). Increasing the value darkens the dark areas.

    The value ranges from "#00000000" to "#ffffffff". By default, the property
    is set to \c "#00000000" (no change).

    \table
    \header
    \li Output examples with different minimumInput values
    \li
    \li
    \row
        \li \image LevelAdjust_minimumInput1.png
        \li \image LevelAdjust_minimumInput2.png
        \li \image LevelAdjust_minimumInput3.png
    \row
        \li \b { minimumInput: #00000000 }
        \li \b { minimumInput: #00000040 }
        \li \b { minimumInput: #00000070 }
    \row
        \li \l maximumInput: #ffffff
        \li \l maximumInput: #ffffff
        \li \l maximumInput: #ffffff
    \row
        \li \l minimumOutput: #000000
        \li \l minimumOutput: #000000
        \li \l minimumOutput: #000000
    \row
        \li \l maximumOutput: #ffffff
        \li \l maximumOutput: #ffffff
        \li \l maximumOutput: #ffffff
    \row
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
    \endtable

    \table
    \header
        \li Pixel color channel luminance curves of the above images.
        \li
        \li
    \row
        \li \image LevelAdjust_default_curve.png
        \li \image LevelAdjust_minimumInput2_curve.png
        \li \image LevelAdjust_minimumInput3_curve.png
    \row
        \li X-axis: pixel original luminance
        \li
        \li
    \row
        \li Y-axis: color channel luminance with effect applied
        \li
        \li
    \endtable

*/

/*!
    \qmlproperty color QtGraphicalEffects1::LevelAdjust::maximumInput

    This property defines the maximum input level for each color channel.
    It sets the white-point, all pixels having higher value than this
    property are rendered as white (per color channel).
    Decreasing the value lightens the light areas.

    The value ranges from "#ffffffff" to "#00000000". By default, the property
    is set to \c "#ffffffff" (no change).

    \table
    \header
    \li Output examples with different maximumInput values
    \li
    \li
    \row
        \li \image LevelAdjust_maximumInput1.png
        \li \image LevelAdjust_maximumInput2.png
        \li \image LevelAdjust_maximumInput3.png
    \row
        \li \b { maximumInput: #FFFFFFFF }
        \li \b { maximumInput: #FFFFFF80 }
        \li \b { maximumInput: #FFFFFF30 }
    \row
        \li \l minimumInput: #000000
        \li \l minimumInput: #000000
        \li \l minimumInput: #000000
    \row
        \li \l minimumOutput: #000000
        \li \l minimumOutput: #000000
        \li \l minimumOutput: #000000
    \row
        \li \l maximumOutput: #ffffff
        \li \l maximumOutput: #ffffff
        \li \l maximumOutput: #ffffff
    \row
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
    \endtable

    \table
    \header
        \li Pixel color channel luminance curves of the above images.
        \li
        \li
    \row
        \li \image LevelAdjust_default_curve.png
        \li \image LevelAdjust_maximumInput2_curve.png
        \li \image LevelAdjust_maximumInput3_curve.png
    \row
        \li X-axis: pixel original luminance
        \li
        \li
    \row
        \li Y-axis: color channel luminance with effect applied
        \li
        \li
    \endtable

*/

/*!
    \qmlproperty color QtGraphicalEffects1::LevelAdjust::minimumOutput

    This property defines the minimum output level for each color channel.
    Increasing the value lightens the dark areas, reducing the contrast.

    The value ranges from "#00000000" to "#ffffffff". By default, the property
    is set to \c "#00000000" (no change).

    \table
    \header
    \li Output examples with different minimumOutput values
    \li
    \li
    \row
        \li \image LevelAdjust_minimumOutput1.png
        \li \image LevelAdjust_minimumOutput2.png
        \li \image LevelAdjust_minimumOutput3.png
    \row
        \li \b { minimumOutput: #00000000 }
        \li \b { minimumOutput: #00000070 }
        \li \b { minimumOutput: #000000A0 }
    \row
        \li \l minimumInput: #000000
        \li \l minimumInput: #000000
        \li \l minimumInput: #000000
    \row
        \li \l maximumInput: #ffffff
        \li \l maximumInput: #ffffff
        \li \l maximumInput: #ffffff
    \row
        \li \l maximumOutput: #ffffff
        \li \l maximumOutput: #ffffff
        \li \l maximumOutput: #ffffff
    \row
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
    \endtable

    \table
    \header
        \li Pixel color channel luminance curves of the above images.
        \li
        \li
    \row
        \li \image LevelAdjust_default_curve.png
        \li \image LevelAdjust_minimumOutput2_curve.png
        \li \image LevelAdjust_minimumOutput3_curve.png
    \row
        \li X-axis: pixel original luminance
        \li
        \li
    \row
        \li Y-axis: color channel luminance with effect applied
        \li
        \li
    \endtable

*/

/*!
    \qmlproperty color QtGraphicalEffects1::LevelAdjust::maximumOutput

    This property defines the maximum output level for each color channel.
    Decreasing the value darkens the light areas, reducing the contrast.

    The value ranges from "#ffffffff" to "#00000000". By default, the property
    is set to \c "#ffffffff" (no change).

    \table
    \header
    \li Output examples with different maximumOutput values
    \li
    \li
    \row
        \li \image LevelAdjust_maximumOutput1.png
        \li \image LevelAdjust_maximumOutput2.png
        \li \image LevelAdjust_maximumOutput3.png
    \row
        \li \b { maximumOutput: #FFFFFFFF }
        \li \b { maximumOutput: #FFFFFF80 }
        \li \b { maximumOutput: #FFFFFF30 }
    \row
        \li \l minimumInput: #000000
        \li \l minimumInput: #000000
        \li \l minimumInput: #000000
    \row
        \li \l maximumInput: #ffffff
        \li \l maximumInput: #ffffff
        \li \l maximumInput: #ffffff
    \row
        \li \l minimumOutput: #000000
        \li \l minimumOutput: #000000
        \li \l minimumOutput: #000000
    \row
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
        \li \l gamma: Qt.vector3d(1.0, 1.0, 1.0)
    \endtable

    \table
    \header
        \li Pixel color channel luminance curves of the above images.
        \li
        \li
    \row
        \li \image LevelAdjust_default_curve.png
        \li \image LevelAdjust_maximumOutput2_curve.png
        \li \image LevelAdjust_maximumOutput3_curve.png
    \row
        \li X-axis: pixel original luminance
        \li
        \li
    \row
        \li Y-axis: color channel luminance with effect applied
        \li
        \li
    \endtable


*/

/*!
    \qmlproperty variant QtGraphicalEffects1::LevelAdjust::gamma

    This property defines the change factor for how the value of each pixel
    color channel is altered according to the equation:

    \code result.rgb = pow(original.rgb, 1.0 / gamma.rgb); \endcode

    Setting the gamma values under QtVector3d(1.0, 1.0, 1.0) makes the image darker, the values
    above QtVector3d(1.0, 1.0, 1.0) lighten it.

    The value ranges from QtVector3d(0.0, 0.0, 0.0) (darkest) to inf (lightest). By default, the property
    is set to \c QtVector3d(1.0, 1.0, 1.0) (no change).

    \table
    \header
    \li Output examples with different gamma values
    \li
    \li
    \row
        \li \image LevelAdjust_gamma1.png
        \li \image LevelAdjust_gamma2.png
        \li \image LevelAdjust_gamma3.png
    \row
        \li \b { gamma: Qt.vector3d(1.0, 1.0, 1.0) }
        \li \b { gamma: Qt.vector3d(1.0, 0.4, 2.0) }
        \li \b { gamma: Qt.vector3d(1.0, 0.1, 4.0) }
    \row
        \li \l minimumInput: #000000
        \li \l minimumInput: #000000
        \li \l minimumInput: #000000
    \row
        \li \l maximumInput: #ffffff
        \li \l maximumInput: #ffffff
        \li \l maximumInput: #ffffff
    \row
        \li \l minimumOutput: #000000
        \li \l minimumOutput: #000000
        \li \l minimumOutput: #000000
    \row
        \li \l maximumOutput: #ffffff
        \li \l maximumOutput: #ffffff
        \li \l maximumOutput: #ffffff
    \endtable

    \table
    \header
        \li Pixel color channel luminance curves of the above images.
        \li
        \li
    \row
        \li \image LevelAdjust_default_curve.png
        \li \image LevelAdjust_gamma2_curve.png
        \li \image LevelAdjust_gamma3_curve.png
    \row
        \li X-axis: pixel original luminance
        \li
        \li
    \row
        \li Y-axis: color channel luminance with effect applied
        \li
        \li
    \endtable

*/

/*!
    \qmlproperty bool QtGraphicalEffects1::LevelAdjust::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 \c false.

*/