You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by je...@apache.org on 2010/07/12 14:14:09 UTC

svn commit: r963253 - in /xmlgraphics/batik/branches/svgcolor12/samples/tests/spec12/paints: colorFunctions.svg ncp-example.icc

Author: jeremias
Date: Mon Jul 12 12:14:08 2010
New Revision: 963253

URL: http://svn.apache.org/viewvc?rev=963253&view=rev
Log:
Test/Demo for calibrated color functions from SVG Color 1.2.

Added:
    xmlgraphics/batik/branches/svgcolor12/samples/tests/spec12/paints/colorFunctions.svg   (with props)
    xmlgraphics/batik/branches/svgcolor12/samples/tests/spec12/paints/ncp-example.icc
      - copied unchanged from r958986, xmlgraphics/commons/branches/Temp_Color/test/resources/org/apache/xmlgraphics/java2d/color/profile/ncp-example.icc

Added: xmlgraphics/batik/branches/svgcolor12/samples/tests/spec12/paints/colorFunctions.svg
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/svgcolor12/samples/tests/spec12/paints/colorFunctions.svg?rev=963253&view=auto
==============================================================================
--- xmlgraphics/batik/branches/svgcolor12/samples/tests/spec12/paints/colorFunctions.svg (added)
+++ xmlgraphics/batik/branches/svgcolor12/samples/tests/spec12/paints/colorFunctions.svg Mon Jul 12 12:14:08 2010
@@ -0,0 +1,125 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+-->
+<!-- ====================================================================== -->
+<!-- Test for the color functions introduced with SVG Color 1.2             -->
+<!-- http://www.w3.org/TR/SVGColor12                                        -->
+<!--                                                                        -->
+<!-- @version $Id$ -->
+<!-- ====================================================================== -->
+
+<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
+
+<svg id="body" width="450" height="500" viewBox="0 0 450 500"
+     xmlns="http://www.w3.org/2000/svg" version="1.2"
+     xmlns:xlink="http://www.w3.org/1999/xlink" >
+
+    <title>SVG Color 1.2 Test</title>
+  
+    <!-- ============================================================= -->
+    <!-- Test content                                                  -->
+    <!-- ============================================================= -->
+    <defs>
+        <color-profile name="MyNamedColors" xlink:href="file:ncp-example.icc" />
+      
+    </defs>
+
+    <g id="testContent" class="legend" style="text-anchor:middle">
+        <text x="225" y="40" class="title">
+            SVG Color 1.2 Functions (Calibrated Colors)
+        </text>
+
+        <g stroke="black" stroke-width="2" transform="translate(35, 90)">
+          
+            <rect y="0" width="40" height="40" fill="#FF0000 icc-named-color(MyNamedColors, Postgelb)"/>
+          
+            <rect y="60" width="40" height="40" fill="#FF0000 icc-named-color(MissingProfile, SomeName)"/>
+          
+            <rect y="120" width="40" height="40" fill="#FF0000 cielab(83.25, 16.45, 96.89)"/>
+          
+            <rect y="180" width="40" height="40" fill="#FF0000 cielch(83.25, 98.28, 80.36)"/>
+          
+        </g>
+      
+        <!--
+          Unsupported color functions or missing profiles will result in the boxes appearing
+          red meaning that the sRGB fallback was used. All but the second box of the four
+          should be a darker yellow.
+        -->
+      
+        <g text-anchor="start" transform="translate(90, 110)">
+          <text y="0">
+            <tspan>fill="#FF0000 icc-named-color(MyNamedColors, Postgelb)"</tspan>
+            <tspan x="0" dy="12">Box should be yellow.</tspan>
+          </text>
+          <text y="60">
+            <tspan>fill="#FF0000 icc-named-color(MissingProfile, SomeName)"</tspan>
+            <tspan x="0" dy="12">Box should be red.</tspan>
+          </text>
+          <text y="120">
+            <tspan>fill="#FF0000 cielab(83.25, 16.45, 96.89)"</tspan>
+            <tspan x="0" dy="12">Box should be yellow.</tspan>
+          </text>
+          <text y="180">
+            <tspan>fill="#FF0000 cielch(83.25, 98.28, 80.36)"</tspan>
+            <tspan x="0" dy="12">Box should be yellow.</tspan>
+          </text>
+        </g>
+      
+        <g transform="translate(25, 360)">
+          <defs>
+            <linearGradient id="NCGradient">
+              <stop offset="10%" stop-color="#FF0000 icc-named-color(MyNamedColors, Postgelb)" />
+              <stop offset="90%" stop-color="#0000FF icc-named-color(MyNamedColors, MyRed)" />
+            </linearGradient>
+            <filter id="MyFilter" filterUnits="userSpaceOnUse" x="-50" y="-50" width="200" height="120">
+              <feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
+              <feOffset in="blur" dx="4" dy="4" result="offsetBlur"/>
+              <feSpecularLighting in="blur" surfaceScale="5" specularConstant=".75" 
+                specularExponent="20" lighting-color="#bbbbbb"  
+                result="specOut">
+                <fePointLight x="-5000" y="-10000" z="20000"/>
+              </feSpecularLighting>
+              <feComposite in="specOut" in2="SourceAlpha" operator="in" result="specOut"/>
+              <feComposite in="SourceGraphic" in2="specOut" operator="arithmetic" 
+              k1="0" k2="1" k3="1" k4="0" result="litPaint"/>
+              <feMerge>
+                <feMergeNode in="offsetBlur"/>
+                <feMergeNode in="litPaint"/>
+              </feMerge>
+            </filter>
+          </defs>
+          <rect x="10" y="0" width="40" height="40" fill="#FF0000 icc-named-color(MyNamedColors, Postgelb)"/>
+          <rect x="80" y="0" width="100" height="40" fill="url(#NCGradient)"/>
+          <g filter="url(#MyFilter)" transform="translate(220, 0)">
+            <path d="M0,20 c20,-50 20,50 40,0 s20,50 40,0 s20,50 40,0" 
+              fill="none" stroke="#FF0000 icc-named-color(MyNamedColors, Postgelb)" stroke-width="12"/> 
+          </g>
+          
+          <rect x="0" y="30" width="400" height="20" fill="gray" opacity="0.4"/>
+
+        </g>
+        <text x="225" y="430">Opacity test with fill, gradient and filter.</text>
+    </g>
+
+    <!-- ============================================================= -->
+    <!-- Batik sample mark                                             -->
+    <!-- ============================================================= -->
+    <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
+</svg>

Propchange: xmlgraphics/batik/branches/svgcolor12/samples/tests/spec12/paints/colorFunctions.svg
------------------------------------------------------------------------------
    svn:mime-type = text/xml