[cairo-commit] [cairo-www] 5 commits - src/local.css src/operators src/operators.mdwn

Nis Martensen nmartensen at freedesktop.org
Sat Apr 30 13:44:12 PDT 2011


 src/local.css                    |    6 
 src/operators.mdwn               |  275 +++++++++++++++++++++++++++++++++++++--
 src/operators/color_burn.png     |binary
 src/operators/color_dodge.png    |binary
 src/operators/darken.png         |binary
 src/operators/difference.png     |binary
 src/operators/exclusion.png      |binary
 src/operators/hard_light.png     |binary
 src/operators/hsl_color.png      |binary
 src/operators/hsl_hue.png        |binary
 src/operators/hsl_luminosity.png |binary
 src/operators/hsl_saturation.png |binary
 src/operators/lighten.png        |binary
 src/operators/multiply.png       |binary
 src/operators/ops.c              |   46 ++++++
 src/operators/overlay.png        |binary
 src/operators/screen.png         |binary
 src/operators/soft_light.png     |binary
 18 files changed, 313 insertions(+), 14 deletions(-)

New commits:
commit da8be86f15065ab490a1b87a19cb340c660d40cd
Author: Nis Martensen <nis.martensen at web.de>
Date:   Sat Apr 30 22:41:07 2011 +0200

    operators: use html minus sign instead of hyphen in equations

diff --git a/src/operators.mdwn b/src/operators.mdwn
index 552d378..7813681 100644
--- a/src/operators.mdwn
+++ b/src/operators.mdwn
@@ -167,8 +167,8 @@ unbounded source.
 	<td>Resulting color (xR)</td>
 </tr>
 <tr>
-	<td>aA + aB·(1-aA)</td>
-	<td>(xaA + xaB·(1-aA))/aR</td>
+	<td>aA + aB·(1&minus;aA)</td>
+	<td>(xaA + xaB·(1&minus;aA))/aR</td>
 </tr>
 </table>
 
@@ -214,7 +214,7 @@ source. In cairo, this operator is **unbounded**.
 	<td>Resulting color (xR)</td>
 </tr>
 <tr>
-	<td>aA·(1-aB)</td>
+	<td>aA·(1&minus;aB)</td>
 	<td>xA</td>
 </tr>
 </table>
@@ -241,7 +241,7 @@ unbounded source.
 </tr>
 <tr>
 	<td>aB</td>
-	<td>xaA + xB·(1-aA)</td>
+	<td>xaA + xB·(1&minus;aA)</td>
 </tr>
 </table>
 
@@ -281,8 +281,8 @@ unbounded source.
 	<td>Resulting color (xR)</td>
 </tr>
 <tr>
-	<td>(1-aB)·aA + aB</td>
-	<td>(xaA·(1-aB) + xaB)/aR</td>
+	<td>(1&minus;aB)·aA + aB</td>
+	<td>(xaA·(1&minus;aB) + xaB)/aR</td>
 </tr>
 </table>
 
@@ -328,7 +328,7 @@ unbounded interpretations.
 	<td>Resulting color (xR)</td>
 </tr>
 <tr>
-	<td>(1-aA)·aB</td>
+	<td>(1&minus;aA)·aB</td>
 	<td>xB</td>
 </tr>
 </table>
@@ -349,7 +349,7 @@ In cairo, the `DEST_ATOP` operator is **unbounded**.
 </tr>
 <tr>
 	<td>aA</td>
-	<td>xA·(1-aB) + xaB</td>
+	<td>xA·(1&minus;aB) + xaB</td>
 </tr>
 </table>
 
@@ -366,8 +366,8 @@ unbounded source interpretations.
 	<td>Resulting color (xR)</td>
 </tr>
 <tr>
-	<td>aA + aB - 2·aA·aB</td>
-	<td>(xaA·(1-aB) + xaB·(1-aA))/aR</td>
+	<td>aA + aB &minus; 2·aA·aB</td>
+	<td>(xaA·(1&minus;aB) + xaB·(1&minus;aA))/aR</td>
 </tr>
 </table>
 
@@ -402,7 +402,7 @@ unbounded source interpretations.
 </tr>
 <tr>
 	<td>min(1, aA+aB)</td>
-	<td>(min(aA, 1-aB)·xA + xaB)/aR</td>
+	<td>(min(aA, 1&minus;aB)·xA + xaB)/aR</td>
 </tr>
 </table>
 
@@ -419,11 +419,11 @@ The color computations are more complicated than for the previous
 operators, so a different presentation is used for the mathematical
 details. The resulting alpha (aR) is:
 
-<div class="eqn">aR = aA + aB·(1-aA)</div>
+<div class="eqn">aR = aA + aB·(1&minus;aA)</div>
 
 The equation for the color components follows this form:
 
-<div class="eqn">xR = 1/aR · [ (1-aB)·xaA + (1-aA)·xaB + aA·aB·f(xA,xB) ]</div>
+<div class="eqn">xR = 1/aR · [ (1&minus;aB)·xaA + (1&minus;aA)·xaB + aA·aB·f(xA,xB) ]</div>
 
 where the operators differ only in the blend mode function f(xA,xB). The
 respective blend mode functions used are given below. The result color
@@ -444,7 +444,7 @@ colors.
 
 Blend mode function:
 
-<div class="eqn">f(xA,xB) = xA + xB - xA·xB</div>
+<div class="eqn">f(xA,xB) = xA + xB &minus; xA·xB</div>
 
 Input colors are complemented and multiplied, the product is
 complemented again. The result is at least as light as the
@@ -458,7 +458,7 @@ Blend mode function:
 <div class="eqn">if (xB &le; 0.5)
 	f(xA,xB) = 2·xA·xB
 else
-	f(xA,xB) = 1 - 2·(1 - xA)·(1 - xB)</div>
+	f(xA,xB) = 1 &minus; 2·(1 &minus; xA)·(1 &minus; xB)</div>
 
 Multiplies or screens colors, depending on the lightness of the destination color.
 
@@ -486,7 +486,7 @@ Selects the lighter of the color values in each component.
 Blend mode function:
 
 <div class="eqn">if (xA < 1)
-	f(xA,xB) = min(1, xB/(1-xA))
+	f(xA,xB) = min(1, xB/(1&minus;xA))
 else
 	f(xA,xB) = 1</div>
 
@@ -499,7 +499,7 @@ color.
 Blend mode function:
 
 <div class="eqn">if (xA > 0)
-	f(xA,xB) = 1 - min(1, (1-xB)/xA)
+	f(xA,xB) = 1 &minus; min(1, (1&minus;xB)/xA)
 else
 	f(xA,xB) = 0</div>
 
@@ -514,7 +514,7 @@ Blend mode function:
 <div class="eqn">if (xA &le; 0.5)
 	f(xA,xB) = 2·xA·xB
 else
-	f(xA,xB) = 1 - 2·(1 - xA)·(1 - xB)</div>
+	f(xA,xB) = 1 &minus; 2·(1 &minus; xA)·(1 &minus; xB)</div>
 
 Multiplies or screens colors, depending on the lightness of the source color.
 
@@ -524,14 +524,14 @@ Multiplies or screens colors, depending on the lightness of the source color.
 Blend mode function:
 
 <div class="eqn">if (xA &le; 0.5)
-	f(xA,xB) = xB - (1 - 2·xA)·xB·(1 - xB)
+	f(xA,xB) = xB &minus; (1 &minus; 2·xA)·xB·(1 &minus; xB)
 else
-	f(xA,xB) = xB + (2·xA - 1)·(g(xB) - xB)</div>
+	f(xA,xB) = xB + (2·xA &minus; 1)·(g(xB) &minus; xB)</div>
 
 where
 
 <div class="eqn">if (x &le; 0.25)
-	g(x) = ((16·x - 12)·x + 4)·x
+	g(x) = ((16·x &minus; 12)·x + 4)·x
 else
 	g(x) = sqrt(x)</div>
 
@@ -542,7 +542,7 @@ Darkens or lightens, depending on the source color.
 
 Blend mode function:
 
-<div class="eqn">f(xA,xB) = abs(xB-xA)</div>
+<div class="eqn">f(xA,xB) = abs(xB&minus;xA)</div>
 
 Takes the difference of the destination and source colors.
 
@@ -551,7 +551,7 @@ Takes the difference of the destination and source colors.
 
 Blend mode function:
 
-<div class="eqn">f(xA,xB) = xA + xB - 2·xA·xB</div>
+<div class="eqn">f(xA,xB) = xA + xB &minus; 2·xA·xB</div>
 
 The effect is similar to `DIFFERENCE`, but has lower contrast.
 
@@ -565,7 +565,7 @@ them. "`c`" is the color defined by the tuple (r,g,b).
 The original functions are provided in the PDF specfication (see Links
 below).
 
-<div class="eqn">sat(c) := max(r,g,b) - min(r,g,b)
+<div class="eqn">sat(c) := max(r,g,b) &minus; min(r,g,b)
 
 lum(c) := 0.3·r + 0.59·g + 0.11·b
 
@@ -574,18 +574,18 @@ clip_color(c) := {
 	N = min(r,g,b)
 	X = max(r,g,b)
 	if N < 0.0
-		r = L + (((r - L)·L)⁄(L - N))
-		g = L + (((g - L)·L)⁄(L - N))
-		b = L + (((b - L)·L)⁄(L - N))
+		r = L + (((r &minus; L)·L)⁄(L &minus; N))
+		g = L + (((g &minus; L)·L)⁄(L &minus; N))
+		b = L + (((b &minus; L)·L)⁄(L &minus; N))
 	if X > 1.0
-		r = L + (((r - L)·(1 - L))⁄(X - L))
-		g = L + (((g - L)·(1 - L))⁄(X - L))
-		b = L + (((b - L)·(1 - L))⁄(X - L))
+		r = L + (((r &minus; L)·(1 &minus; L))⁄(X &minus; L))
+		g = L + (((g &minus; L)·(1 &minus; L))⁄(X &minus; L))
+		b = L + (((b &minus; L)·(1 &minus; L))⁄(X &minus; L))
 	return c
 }
 
 set_lum(c, L) := {
-	D = L - lum(c)
+	D = L &minus; lum(c)
 	r = r + D
 	g = g + D
 	b = b + D
@@ -598,7 +598,7 @@ colors with the highest and lowest values. "`cmid`" is the third
 
 <div class="eqn">set_sat(c, S) := {
 	if (cmax > cmin)
-		cmid = (((cmid - cmin)·S)⁄(cmax - cmin))
+		cmid = (((cmid &minus; cmin)·S)⁄(cmax &minus; cmin))
 		cmax = S
 	else
 		cmid = cmax = 0.0
commit 65caaf323ee082e0e9c78cb89129b6b16c6fc289
Author: Nis Martensen <nis.martensen at web.de>
Date:   Fri Apr 29 22:39:28 2011 +0200

    operators: describe PDF blend modes

diff --git a/src/operators.mdwn b/src/operators.mdwn
index a3ace07..552d378 100644
--- a/src/operators.mdwn
+++ b/src/operators.mdwn
@@ -4,7 +4,8 @@ Normally, you will be using cairo to draw objects on top of each other.
 But cairo can do differently, if you need it! In fact, you can use all
 the Porter/Duff compositing operators.
 
-Fourteen different operators are currently available in cairo. This page
+Fourteen different operators are available since cairo 1.0; more
+operators have been added in cairo 1.10. This page
 is a try to describe them. It may contain errors and is possibly
 incomplete. Please help to improve it!
 
@@ -405,6 +406,250 @@ unbounded source interpretations.
 </tr>
 </table>
 
+# Blend Modes
+
+Since cairo 1.10, the set of operators is extended by 15 additional
+operators. These originate from the PDF specification and extend the
+range of available color computation equations. All of them share the
+same alpha computation equation, which is identical to the one from
+`CAIRO_OPERATOR_OVER`. The output of the new operators is the same for
+both bounded and unbounded source.
+
+The color computations are more complicated than for the previous
+operators, so a different presentation is used for the mathematical
+details. The resulting alpha (aR) is:
+
+<div class="eqn">aR = aA + aB·(1-aA)</div>
+
+The equation for the color components follows this form:
+
+<div class="eqn">xR = 1/aR · [ (1-aB)·xaA + (1-aA)·xaB + aA·aB·f(xA,xB) ]</div>
+
+where the operators differ only in the blend mode function f(xA,xB). The
+respective blend mode functions used are given below. The result color
+is undefined when aR is zero (full transparency).
+
+<h2 id="multiply">CAIRO_OPERATOR_MULTIPLY</h2>
+<div class="tutright">[[!img "multiply.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(xA,xB) = xA·xB</div>
+
+The result color is at least as dark as the darker of the two input
+colors.
+
+<h2 id="screen">CAIRO_OPERATOR_SCREEN</h2>
+<div class="tutright">[[!img "screen.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(xA,xB) = xA + xB - xA·xB</div>
+
+Input colors are complemented and multiplied, the product is
+complemented again. The result is at least as light as the
+lighter of the input colors.
+
+<h2 id="overlay">CAIRO_OPERATOR_OVERLAY</h2>
+<div class="tutright">[[!img "overlay.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">if (xB &le; 0.5)
+	f(xA,xB) = 2·xA·xB
+else
+	f(xA,xB) = 1 - 2·(1 - xA)·(1 - xB)</div>
+
+Multiplies or screens colors, depending on the lightness of the destination color.
+
+<h2 id="darken">CAIRO_OPERATOR_DARKEN</h2>
+<div class="tutright">[[!img "darken.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(xA,xB) = min(xA,xB)</div>
+
+Selects the darker of the color values in each component.
+
+<h2 id="lighten">CAIRO_OPERATOR_LIGHTEN</h2>
+<div class="tutright">[[!img "lighten.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(xA,xB) = max(xA,xB)</div>
+
+Selects the lighter of the color values in each component.
+
+<h2 id="color_dodge">CAIRO_OPERATOR_COLOR_DODGE</h2>
+<div class="tutright">[[!img "color_dodge.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">if (xA < 1)
+	f(xA,xB) = min(1, xB/(1-xA))
+else
+	f(xA,xB) = 1</div>
+
+Brightens the destination color by a factor depending on the source
+color.
+
+<h2 id="color_burn">CAIRO_OPERATOR_COLOR_BURN</h2>
+<div class="tutright">[[!img "color_burn.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">if (xA > 0)
+	f(xA,xB) = 1 - min(1, (1-xB)/xA)
+else
+	f(xA,xB) = 0</div>
+
+Darkens the destination color by a factor depending on the source
+color.
+
+<h2 id="hard_light">CAIRO_OPERATOR_HARD_LIGHT</h2>
+<div class="tutright">[[!img "hard_light.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">if (xA &le; 0.5)
+	f(xA,xB) = 2·xA·xB
+else
+	f(xA,xB) = 1 - 2·(1 - xA)·(1 - xB)</div>
+
+Multiplies or screens colors, depending on the lightness of the source color.
+
+<h2 id="soft_light">CAIRO_OPERATOR_SOFT_LIGHT</h2>
+<div class="tutright">[[!img "soft_light.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">if (xA &le; 0.5)
+	f(xA,xB) = xB - (1 - 2·xA)·xB·(1 - xB)
+else
+	f(xA,xB) = xB + (2·xA - 1)·(g(xB) - xB)</div>
+
+where
+
+<div class="eqn">if (x &le; 0.25)
+	g(x) = ((16·x - 12)·x + 4)·x
+else
+	g(x) = sqrt(x)</div>
+
+Darkens or lightens, depending on the source color.
+
+<h2 id="difference">CAIRO_OPERATOR_DIFFERENCE</h2>
+<div class="tutright">[[!img "difference.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(xA,xB) = abs(xB-xA)</div>
+
+Takes the difference of the destination and source colors.
+
+<h2 id="exclusion">CAIRO_OPERATOR_EXCLUSION</h2>
+<div class="tutright">[[!img "exclusion.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(xA,xB) = xA + xB - 2·xA·xB</div>
+
+The effect is similar to `DIFFERENCE`, but has lower contrast.
+
+# Non-separable Blend Modes
+
+The following blend modes are non-separable, i.e., they consider all
+color components in combination. The blend mode functions `f(xA,xB)`
+become `f(cA,cB)`. A few more functions are necessary to describe
+them. "`c`" is the color defined by the tuple (r,g,b).
+
+The original functions are provided in the PDF specfication (see Links
+below).
+
+<div class="eqn">sat(c) := max(r,g,b) - min(r,g,b)
+
+lum(c) := 0.3·r + 0.59·g + 0.11·b
+
+clip_color(c) := {
+	L = lum(c)
+	N = min(r,g,b)
+	X = max(r,g,b)
+	if N < 0.0
+		r = L + (((r - L)·L)⁄(L - N))
+		g = L + (((g - L)·L)⁄(L - N))
+		b = L + (((b - L)·L)⁄(L - N))
+	if X > 1.0
+		r = L + (((r - L)·(1 - L))⁄(X - L))
+		g = L + (((g - L)·(1 - L))⁄(X - L))
+		b = L + (((b - L)·(1 - L))⁄(X - L))
+	return c
+}
+
+set_lum(c, L) := {
+	D = L - lum(c)
+	r = r + D
+	g = g + D
+	b = b + D
+	return clip_color(c)
+}</div>
+
+In the following function "`cmax`" and "`cmin`" serve as aliases for the
+colors with the highest and lowest values. "`cmid`" is the third
+(remaining) color.
+
+<div class="eqn">set_sat(c, S) := {
+	if (cmax > cmin)
+		cmid = (((cmid - cmin)·S)⁄(cmax - cmin))
+		cmax = S
+	else
+		cmid = cmax = 0.0
+	cmin = 0.0
+	return c
+}</div>
+
+<h2 id="hsl_hue">CAIRO_OPERATOR_HSL_HUE</h2>
+<div class="tutright">[[!img "hsl_hue.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(cA,cB) = set_lum(set_sat(cA, sat(cB)), lum(cB))</div>
+
+Creates a color with the hue of the source and the saturation and
+luminosity of the destination.
+
+<h2 id="hsl_saturation">CAIRO_OPERATOR_HSL_SATURATION</h2>
+<div class="tutright">[[!img "hsl_saturation.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(cA,cB) = set_lum(set_sat(cB, sat(cA)), lum(cB))</div>
+
+Creates a color with the saturation of the source and the hue and
+luminosity of the destination. Painting with this mode onto a gray area
+produces no change.
+
+<h2 id="hsl_color">CAIRO_OPERATOR_HSL_COLOR</h2>
+<div class="tutright">[[!img "hsl_color.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(cA,cB) = set_lum(cA, lum(cB))</div>
+
+Creates a color with the hue and saturation of the source and the
+luminosity of the destination. This preserves the gray levels of the
+destination and is useful for coloring monochrome images or tinting
+color images.
+
+<h2 id="hsl_luminosity">CAIRO_OPERATOR_HSL_LUMINOSITY</h2>
+<div class="tutright">[[!img "hsl_luminosity.png" link="no"]]</div>
+
+Blend mode function:
+
+<div class="eqn">f(cA,cB) = set_lum(cB, lum(cA))</div>
+
+Creates a color with the luminosity of the source and the hue and
+saturation of the destination. This produces an inverse effect to
+`CAIRO_OPERATOR_HSL_COLOR`.
+
 <h1 id="clipmask">Clipping and masking</h1>
 
 This section augments the documentation of cairo's compositing model
@@ -540,3 +785,5 @@ which all three variants coincide.
  * A description of compositing in SVG 1.2 by Craig Northway:
    <http://www.svgopen.org/2005/papers/abstractsvgopen/>
 
+ * The PDF specification is available from Adobe at
+   <http://www.adobe.com/devnet/pdf/pdf_reference.html>
commit f3515e54181e3a58cc1e3b82ffdddc0592208408
Author: Nis Martensen <nis.martensen at web.de>
Date:   Tue Apr 26 22:51:45 2011 +0200

    operators: sample images for operators added in 1.10

diff --git a/src/operators/color_burn.png b/src/operators/color_burn.png
new file mode 100644
index 0000000..47e1619
Binary files /dev/null and b/src/operators/color_burn.png differ
diff --git a/src/operators/color_dodge.png b/src/operators/color_dodge.png
new file mode 100644
index 0000000..1946af9
Binary files /dev/null and b/src/operators/color_dodge.png differ
diff --git a/src/operators/darken.png b/src/operators/darken.png
new file mode 100644
index 0000000..47e1619
Binary files /dev/null and b/src/operators/darken.png differ
diff --git a/src/operators/difference.png b/src/operators/difference.png
new file mode 100644
index 0000000..7506e98
Binary files /dev/null and b/src/operators/difference.png differ
diff --git a/src/operators/exclusion.png b/src/operators/exclusion.png
new file mode 100644
index 0000000..7506e98
Binary files /dev/null and b/src/operators/exclusion.png differ
diff --git a/src/operators/hard_light.png b/src/operators/hard_light.png
new file mode 100644
index 0000000..c139e0b
Binary files /dev/null and b/src/operators/hard_light.png differ
diff --git a/src/operators/hsl_color.png b/src/operators/hsl_color.png
new file mode 100644
index 0000000..dd200c0
Binary files /dev/null and b/src/operators/hsl_color.png differ
diff --git a/src/operators/hsl_hue.png b/src/operators/hsl_hue.png
new file mode 100644
index 0000000..362daff
Binary files /dev/null and b/src/operators/hsl_hue.png differ
diff --git a/src/operators/hsl_luminosity.png b/src/operators/hsl_luminosity.png
new file mode 100644
index 0000000..58528fc
Binary files /dev/null and b/src/operators/hsl_luminosity.png differ
diff --git a/src/operators/hsl_saturation.png b/src/operators/hsl_saturation.png
new file mode 100644
index 0000000..f14fec0
Binary files /dev/null and b/src/operators/hsl_saturation.png differ
diff --git a/src/operators/lighten.png b/src/operators/lighten.png
new file mode 100644
index 0000000..7506e98
Binary files /dev/null and b/src/operators/lighten.png differ
diff --git a/src/operators/multiply.png b/src/operators/multiply.png
new file mode 100644
index 0000000..47e1619
Binary files /dev/null and b/src/operators/multiply.png differ
diff --git a/src/operators/ops.c b/src/operators/ops.c
index 9253166..bf35216 100644
--- a/src/operators/ops.c
+++ b/src/operators/ops.c
@@ -24,6 +24,22 @@ int main (int argc, char *argv[])
 	example ("add");
 	example ("saturate");
 
+	example ("multiply");
+	example ("screen");
+	example ("overlay");
+	example ("darken");
+	example ("lighten");
+	example ("color_dodge");
+	example ("color_burn");
+	example ("hard_light");
+	example ("soft_light");
+	example ("difference");
+	example ("exclusion");
+	example ("hsl_hue");
+	example ("hsl_saturation");
+	example ("hsl_color");
+	example ("hsl_luminosity");
+
         return 0;
 }
 
@@ -77,6 +93,36 @@ void example (char *name)
 		cairo_set_operator (cr, CAIRO_OPERATOR_ADD);
 	else if (strcmp(name, "saturate") == 0)
 		cairo_set_operator (cr, CAIRO_OPERATOR_SATURATE);
+	else if (strcmp(name, "multiply") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_MULTIPLY);
+	else if (strcmp(name, "screen") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_SCREEN);
+	else if (strcmp(name, "overlay") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_OVERLAY);
+	else if (strcmp(name, "darken") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_DARKEN);
+	else if (strcmp(name, "lighten") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_LIGHTEN);
+	else if (strcmp(name, "color_dodge") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_COLOR_DODGE);
+	else if (strcmp(name, "color_burn") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_COLOR_BURN);
+	else if (strcmp(name, "hard_light") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_HARD_LIGHT);
+	else if (strcmp(name, "soft_light") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_SOFT_LIGHT);
+	else if (strcmp(name, "difference") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE);
+	else if (strcmp(name, "exclusion") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_EXCLUSION);
+	else if (strcmp(name, "hsl_hue") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_HSL_HUE);
+	else if (strcmp(name, "hsl_saturation") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_HSL_SATURATION);
+	else if (strcmp(name, "hsl_color") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_HSL_COLOR);
+	else if (strcmp(name, "hsl_luminosity") == 0)
+		cairo_set_operator (cr, CAIRO_OPERATOR_HSL_LUMINOSITY);
 
 	cairo_rectangle (cr, 40, 30, 120, 90);
 	cairo_set_source_rgba (cr, 0, 0, 0.9, 0.4);
diff --git a/src/operators/overlay.png b/src/operators/overlay.png
new file mode 100644
index 0000000..671f5a8
Binary files /dev/null and b/src/operators/overlay.png differ
diff --git a/src/operators/screen.png b/src/operators/screen.png
new file mode 100644
index 0000000..7506e98
Binary files /dev/null and b/src/operators/screen.png differ
diff --git a/src/operators/soft_light.png b/src/operators/soft_light.png
new file mode 100644
index 0000000..7935984
Binary files /dev/null and b/src/operators/soft_light.png differ
commit 7e0a27bda3c529418261e0794e6fba59e529fa71
Author: Nis Martensen <nis.martensen at web.de>
Date:   Sat Apr 30 17:12:53 2011 +0200

    css: prepare equation style

diff --git a/src/local.css b/src/local.css
index 6d78973..c40c7dd 100644
--- a/src/local.css
+++ b/src/local.css
@@ -196,6 +196,12 @@ div.tutright img {
 div.clear {
 	clear: both;
 }
+div.eqn {
+	font-family: mono;
+	margin-left: 10%;
+	padding: .5em;
+	white-space: pre;
+}
 a {
 	text-decoration: none;
 }
commit 9e2a0a36f686e7b30d2c087bfb3662916a37cf95
Author: Nis Martensen <nis.martensen at web.de>
Date:   Sat Apr 30 15:20:44 2011 +0200

    html fixes

diff --git a/src/operators.mdwn b/src/operators.mdwn
index 3d4f7ed..a3ace07 100644
--- a/src/operators.mdwn
+++ b/src/operators.mdwn
@@ -411,7 +411,7 @@ This section augments the documentation of cairo's compositing model
 by describing how clipping and masking are taken into account when
 rendering.  In this context the <i>clip</i> and <i>mask</i> are treated as
 cairo surfaces with <a
-href=http://cairographics.org/manual/cairo-surface.html#cairo-content-t"">alpha
+href="http://cairographics.org/manual/cairo-surface.html#cairo-content-t">alpha
 content</a> that both default to full opaqueness when not explicitly given.
 The basic approach to clipping in cairo is to first perform the
 operation without clipping and then interpolating by the clip
@@ -452,7 +452,7 @@ implement clipping and masking, which can be described using the
 
 The XRender-kind definition most closely matches the letter of the
 XRender specification as it reduces to XRender's equation when
-<i>clip</i> is binary valued -- the only kind of clip talked about in
+<i>clip</i> is binary valued &ndash; the only kind of clip talked about in
 the spec.  The Simple-kind definition is the fastest to execute and
 was conceived of as an optimisation of the XRender-kind
 definition to take advantage of the fact that for many operators the two coincide.


More information about the cairo-commit mailing list