xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r959945 - in /xmlgraphics/fop/trunk: lib/ src/java/org/apache/fop/afp/ src/java/org/apache/fop/pdf/ src/java/org/apache/fop/svg/ src/java/org/apache/fop/util/ test/java/org/apache/fop/traits/ test/java/org/apache/fop/util/
Date Fri, 02 Jul 2010 10:44:18 GMT
Author: jeremias
Date: Fri Jul  2 10:44:18 2010
New Revision: 959945

URL: http://svn.apache.org/viewvc?rev=959945&view=rev
Log:
Restored ColorExt after removing it from XML Graphics Commons again.
Moved GrayScaleColorConverter as a package-local class from XGC to the AFP package (doesn't
require deprecation when we can put the functionality in XGC later with the new color infrastructure).

Added:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/GrayScaleColorConverter.java
      - copied, changed from r959938, xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/GrayScaleColorConverter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorExt.java   (props changed)
      - copied unchanged from r897220, xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorExt.java
Modified:
    xmlgraphics/fop/trunk/lib/xmlgraphics-commons-1.4svn.jar
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorUtil.java
    xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java
    xmlgraphics/fop/trunk/test/java/org/apache/fop/util/ColorUtilTestCase.java

Modified: xmlgraphics/fop/trunk/lib/xmlgraphics-commons-1.4svn.jar
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/lib/xmlgraphics-commons-1.4svn.jar?rev=959945&r1=959944&r2=959945&view=diff
==============================================================================
Binary files - no diff available.

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java?rev=959945&r1=959944&r2=959945&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java Fri Jul  2 10:44:18
2010
@@ -26,7 +26,6 @@ import org.apache.commons.logging.LogFac
 
 import org.apache.xmlgraphics.java2d.color.ColorConverter;
 import org.apache.xmlgraphics.java2d.color.DefaultColorConverter;
-import org.apache.xmlgraphics.java2d.color.GrayScaleColorConverter;
 
 import org.apache.fop.afp.fonts.AFPPageFonts;
 import org.apache.fop.util.AbstractPaintingState;

Copied: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/GrayScaleColorConverter.java (from
r959938, xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/GrayScaleColorConverter.java)
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/GrayScaleColorConverter.java?p2=xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/GrayScaleColorConverter.java&p1=xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/GrayScaleColorConverter.java&r1=959938&r2=959945&rev=959945&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/GrayScaleColorConverter.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/GrayScaleColorConverter.java Fri Jul
 2 10:44:18 2010
@@ -15,19 +15,21 @@
  * limitations under the License.
  */
 
-/* $Id:$ */
+/* $Id$ */
 
-package org.apache.xmlgraphics.java2d.color;
+package org.apache.fop.afp;
 
 import java.awt.Color;
 
 import org.apache.xmlgraphics.java2d.color.ColorConverter;
 
+import org.apache.fop.util.ColorUtil;
+
 /**
  * Converts to grayscale using the standard RED=30%, GREEN=59% and BLUE=11%
  * weights (see http://en.wikipedia.org/wiki/Grayscale)
  */
-public final class GrayScaleColorConverter implements ColorConverter {
+final class GrayScaleColorConverter implements ColorConverter {
 
     private static final int RED_WEIGHT = 77;
     private static final int GREEN_WEIGTH = 150;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java?rev=959945&r1=959944&r2=959945&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java Fri Jul  2 10:44:18 2010
@@ -26,8 +26,9 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.xmlgraphics.java2d.color.CMYKColorSpace;
-import org.apache.xmlgraphics.java2d.color.ColorExt;
+import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace;
+
+import org.apache.fop.util.ColorExt;
 
 /**
  * PDF Color object.
@@ -122,7 +123,7 @@ public class PDFColor extends PDFPathPai
             ce = (ColorExt)col;
             cs = ce.getOrigColorSpace();
         }
-        if (cs != null && cs instanceof CMYKColorSpace) {
+        if (cs != null && cs instanceof DeviceCMYKColorSpace) {
             // CMYK case
             this.colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_CMYK);
             float[] cmyk = (ce == null

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java?rev=959945&r1=959944&r2=959945&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java Fri Jul  2 10:44:18
2010
@@ -67,7 +67,6 @@ import org.apache.xmlgraphics.image.load
 import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
 import org.apache.xmlgraphics.java2d.AbstractGraphics2D;
 import org.apache.xmlgraphics.java2d.GraphicContext;
-import org.apache.xmlgraphics.java2d.color.ColorExt;
 
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fonts.FontInfo;
@@ -92,6 +91,7 @@ import org.apache.fop.pdf.PDFXObject;
 import org.apache.fop.render.pdf.ImageRawCCITTFaxAdapter;
 import org.apache.fop.render.pdf.ImageRawJPEGAdapter;
 import org.apache.fop.render.pdf.ImageRenderedAdapter;
+import org.apache.fop.util.ColorExt;
 
 /**
  * PDF Graphics 2D.

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorExt.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorExt.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorExt.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Jul  2 10:44:18 2010
@@ -0,0 +1,4 @@
+/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/util/ColorExt.java:630874-721418
+/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/util/ColorExt.java:745924-830281
+/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/util/ColorExt.java:603620-746655
+/xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/util/ColorExt.java:684572,688085,688696

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorUtil.java?rev=959945&r1=959944&r2=959945&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorUtil.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorUtil.java Fri Jul  2 10:44:18
2010
@@ -27,8 +27,7 @@ import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import org.apache.xmlgraphics.java2d.color.CMYKColorSpace;
-import org.apache.xmlgraphics.java2d.color.ColorExt;
+import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace;
 
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fo.expr.PropertyException;
@@ -329,7 +328,7 @@ public final class ColorUtil {
                 String iccProfileSrc = null;
                 if (isPseudoProfile(iccProfileName)) {
                     if (CMYK_PSEUDO_PROFILE.equalsIgnoreCase(iccProfileName)) {
-                        colorSpace = CMYKColorSpace.getInstance();
+                        colorSpace = DeviceCMYKColorSpace.getInstance();
                     } else {
                         assert false : "Incomplete implementation";
                     }
@@ -454,7 +453,7 @@ public final class ColorUtil {
                             + "Arguments to cmyk() must be in the range [0%-100%] or [0.0-1.0]");
                 }
                 float[] cmyk = new float[] {cyan, magenta, yellow, black};
-                CMYKColorSpace cmykCs = CMYKColorSpace.getInstance();
+                DeviceCMYKColorSpace cmykCs = DeviceCMYKColorSpace.getInstance();
                 float[] rgb = cmykCs.toRGB(cmyk);
                 parsedColor = ColorExt.createFromFoRgbIcc(rgb[0], rgb[1], rgb[2],
                         CMYK_PSEUDO_PROFILE, null, cmykCs, cmyk);
@@ -705,12 +704,16 @@ public final class ColorUtil {
     }
 
     /**
-     * Creates an uncalibrary CMYK color with the given gray value.
+     * Creates an uncalibrated CMYK color with the given gray value.
      * @param black the gray component (0 - 1)
      * @return the CMYK color
      */
     public static Color toCMYKGrayColor(float black) {
-
-        return org.apache.xmlgraphics.java2d.color.ColorUtil.toCMYKGrayColor(black);
+        float[] cmyk = new float[] {0f, 0f, 0f, 1.0f - black};
+        DeviceCMYKColorSpace cmykCs = DeviceCMYKColorSpace.getInstance();
+        float[] rgb = cmykCs.toRGB(cmyk);
+        return ColorExt.createFromFoRgbIcc(rgb[0], rgb[1], rgb[2],
+                CMYK_PSEUDO_PROFILE, null, cmykCs, cmyk);
     }
+
 }

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java?rev=959945&r1=959944&r2=959945&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/traits/BorderPropsTestCase.java Fri Jul
 2 10:44:18 2010
@@ -23,10 +23,10 @@ import java.awt.Color;
 
 import junit.framework.TestCase;
 
-import org.apache.xmlgraphics.java2d.color.CMYKColorSpace;
-import org.apache.xmlgraphics.java2d.color.ColorExt;
+import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace;
 
 import org.apache.fop.fo.Constants;
+import org.apache.fop.util.ColorExt;
 import org.apache.fop.util.ColorUtil;
 
 /**
@@ -50,7 +50,7 @@ public class BorderPropsTestCase extends
         assertEquals(b1, b2);
 
         float[] cmyk = new float[] {1.0f, 1.0f, 0.5f, 1.0f};
-        CMYKColorSpace cmykCs = CMYKColorSpace.getInstance();
+        DeviceCMYKColorSpace cmykCs = DeviceCMYKColorSpace.getInstance();
         float[] rgb = cmykCs.toRGB(cmyk);
         col = ColorExt.createFromFoRgbIcc(rgb[0], rgb[1], rgb[2],
                 "#CMYK", null, cmykCs, cmyk);

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/util/ColorUtilTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/util/ColorUtilTestCase.java?rev=959945&r1=959944&r2=959945&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/util/ColorUtilTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/util/ColorUtilTestCase.java Fri Jul  2
10:44:18 2010
@@ -24,8 +24,7 @@ import java.awt.color.ColorSpace;
 
 import junit.framework.TestCase;
 
-import org.apache.xmlgraphics.java2d.color.CMYKColorSpace;
-import org.apache.xmlgraphics.java2d.color.ColorExt;
+import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace;
 
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.apps.FopFactory;
@@ -157,7 +156,7 @@ public class ColorUtilTestCase extends T
         assertEquals(255, colActual.getRed());
         assertEquals(255, colActual.getGreen());
         assertEquals(0, colActual.getBlue());
-        assertEquals(CMYKColorSpace.getInstance(), colActual.getColorSpace());
+        assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace());
         float[] comps = colActual.getColorComponents(null);
         assertEquals(4, comps.length);
         assertEquals(0f, comps[0], 0);
@@ -172,7 +171,7 @@ public class ColorUtilTestCase extends T
         assertEquals(248, colActual.getRed());
         assertEquals(199, colActual.getGreen());
         assertEquals(172, colActual.getBlue());
-        assertEquals(CMYKColorSpace.getInstance(), colActual.getColorSpace());
+        assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace());
         comps = colActual.getColorComponents(null);
         assertEquals(0.0274f, comps[0], 0.001);
         assertEquals(0.2196f, comps[1], 0.001);
@@ -186,7 +185,7 @@ public class ColorUtilTestCase extends T
         assertEquals(255, colActual.getRed());
         assertEquals(255, colActual.getGreen());
         assertEquals(0, colActual.getBlue());
-        assertEquals(CMYKColorSpace.getInstance(), colActual.getColorSpace());
+        assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace());
         comps = colActual.getColorComponents(null);
         assertEquals(4, comps.length);
         assertEquals(0f, comps[0], 0);
@@ -201,7 +200,7 @@ public class ColorUtilTestCase extends T
         assertEquals(127, colActual.getRed());
         assertEquals(127, colActual.getGreen());
         assertEquals(127, colActual.getBlue());
-        assertEquals(CMYKColorSpace.getInstance(), colActual.getColorSpace());
+        assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace());
         comps = colActual.getColorComponents(null);
         assertEquals(4, comps.length);
         assertEquals(0f, comps[0], 0);



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message