]> git.sesse.net Git - kdenlive/commitdiff
Add support of SOP/Sat effect version 0.2.
authorTill Theato <root@ttill.de>
Sat, 10 Sep 2011 23:43:49 +0000 (23:43 +0000)
committerTill Theato <root@ttill.de>
Sat, 10 Sep 2011 23:43:49 +0000 (23:43 +0000)
svn path=/trunk/kdenlive/; revision=5911

effects/frei0r_sopsat.xml
effects/update/CMakeLists.txt
effects/update/frei0r.sopsat.js [new file with mode: 0644]

index c43cff2e37206658a94c56f4f730cca0a031453d..f4a9c1e3a5f00b391990192b0082bfdd370bb864 100644 (file)
@@ -1,5 +1,6 @@
 <!DOCTYPE kpartgui>
-<effect tag="frei0r.sopsat" id="frei0r.sopsat">
+<group>
+    <effect tag="frei0r.sopsat" id="frei0r.sopsat">
         <name>SOP/Sat</name>
         <description>Changes Slope, Offset, and Power of the color components, and the overall Saturation, according to the ASC CDL (Color Decision List).</description>
         <author>Simon A. Eugster (Granjow)</author>
                 <comment>The overall saturation will be changed in the last step of this filter.</comment>
         </parameter>
 
-</effect>
+    </effect>
+
+    <effect LC_NUMERIC="C" tag="frei0r.sopsat" id="frei0r.sopsat" version="0.2">
+        <name>SOP/Sat</name>
+        <description>Changes Slope, Offset, and Power of the color components, and the overall Saturation, according to the ASC CDL (Color Decision List).</description>
+        <author>Simon A. Eugster (Granjow)</author>
+        <parameter type="simplekeyframe" name="rSlope" default="100" min="0" max="1000" factor="2000">
+                <name>Slope Red</name>
+                <comment><![CDATA[Changing the slope means multiplying the pixel value with a constant value. Black pixels will remain black, whileas brighter ones will be changed.<br/>
+                All effects can be observed well when applied on a greyscale gradient and looking at the RGB Parade monitor.]]></comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="gSlope" default="100" min="0" max="1000" factor="2000">
+                <name>Slope Green</name>
+        </parameter>
+        <parameter type="simplekeyframe" name="bSlope" default="100" min="0" max="1000" factor="2000">
+                <name>Slope Blue</name>
+        </parameter>
+        <parameter type="simplekeyframe" name="aSlope" default="100" min="0" max="1000" factor="2000">
+                <name>Slope Alpha</name>
+        </parameter>
+
+        <parameter type="simplekeyframe" name="rOffset" default="0" min="-1024" max="1024" factor="2048" offset="-1024">
+                <name>Offset Red</name>
+                <comment>Changing the offset lifts (or lowers) the brightness of each pixel by the given value.</comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="gOffset" default="0" min="-1024" max="1024" factor="2048" offset="-1024">
+                <name>Offset Green</name>
+        </parameter>
+        <parameter type="simplekeyframe" name="bOffset" default="0" min="-1024" max="1024" factor="2048" offset="-1024">
+                <name>Offset Blue</name>
+        </parameter>
+        <parameter type="simplekeyframe" name="aOffset" default="0" min="-1024" max="1024" factor="2048" offset="-1024">
+                <name>Offset Alpha</name>
+        </parameter>
+
+        <parameter type="simplekeyframe" name="rPower" default="100" min="1" max="1000" factor="2000">
+                <name>Power Red</name>
+                <comment><![CDATA[Changes the Gamma value for the selected channel. Black and white pixel values will not be affected, but everything between.<br/>
+                Mathematically, what happens is an exponentiation of the pixel brightness on <code>[0,1]</code> by the gamma value.]]></comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="gPower" default="100" min="1" max="1000" factor="2000">
+                <name>Power Green</name>
+        </parameter>
+        <parameter type="simplekeyframe" name="bPower" default="100" min="1" max="1000" factor="2000">
+                <name>Power Blue</name>
+        </parameter>
+        <parameter type="simplekeyframe" name="aPower" default="100" min="1" max="1000" factor="2000">
+                <name>Power Alpha</name>
+        </parameter>
+
+        <parameter type="simplekeyframe" name="saturation" default="100" min="0" max="500" factor="1000">
+                <name>Overall Saturation</name>
+                <comment>The overall saturation will be changed in the last step of this filter.</comment>
+        </parameter>
+
+    </effect>
+</group>
index 0112dd0f56c7add4d516bda7455164e8fd1de816..6422b4055f3f4787c57048df3a8b95b15187c120 100644 (file)
@@ -5,5 +5,6 @@ frei0r.cartoon.js
 frei0r.curves.js
 frei0r.levels.js
 frei0r.lightgraffiti.js
+frei0r.sopsat.js
 frei0r.vertigo.js
 DESTINATION ${DATA_INSTALL_DIR}/kdenlive/effects/update)
diff --git a/effects/update/frei0r.sopsat.js b/effects/update/frei0r.sopsat.js
new file mode 100644 (file)
index 0000000..5ad7c04
--- /dev/null
@@ -0,0 +1,26 @@
+
+var update = new Object();
+
+update["rSlope"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 20., 0); }));
+update["gSlope"] = update["rSlope"];
+update["bSlope"] = update["rSlope"];
+update["aSlope"] = update["rSlope"];
+update["rOffset"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 8., -4); }));
+update["gOffset"] = update["rOffset"];
+update["bOffset"] = update["rOffset"];
+update["aOffset"] = update["rOffset"];
+update["rPower"] = update["rSlope"];
+update["gPower"] = update["rSlope"];
+update["bPower"] = update["rSlope"];
+update["aPower"] = update["rSlope"];
+update["saturation"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 10., 0); }));
+
+function upd1(value, isDowngrade, factor, offset) {
+    var valueList = value.split(';');
+    var locale = new QLocale();
+    for (var i = 0; i < valueList.length; ++i) {
+        var current = valueList[i].split('=');
+        valueList[i] = current[0] + '=' + locale.toString(isDowngrade ? offset + current[1] * factor : (current[1] - offset) / factor);
+    }
+    return valueList.join(';');
+}