]> git.sesse.net Git - kdenlive/blob - effects/update/frei0r.lightgraffiti.js
Const'ref
[kdenlive] / effects / update / frei0r.lightgraffiti.js
1
2 var update = new Object();
3
4 update["sensitivity"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 5.); }));
5 update["thresholdBrightness"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 765.); }));
6 update["thresholdDifference"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 255.); }));
7 update["thresholdDiffSum"] = update["thresholdBrightness"];
8 update["saturation"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 4.); }));
9 update["lowerOverexposure"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 10.); }));
10
11 function upd1(value, isDowngrade, factor) {
12     var valueList = value.split(';');
13     var locale = new QLocale();
14     for (var i = 0; i < valueList.length; ++i) {
15         var current = valueList[i].split('=');
16         valueList[i] = current[0] + '=' + locale.toString(isDowngrade ? current[1] * factor : current[1] / factor);
17     }
18     return valueList.join(';');
19 }