pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1617136 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading: GouraudShadingContext.java PatchMeshesShadingContext.java TriangleBasedShadingContext.java
Date Sun, 10 Aug 2014 17:39:51 GMT
Author: tilman
Date: Sun Aug 10 17:39:51 2014
New Revision: 1617136

URL: http://svn.apache.org/r1617136
Log:
PDFBOX-1915: refactoring: move variable numberOfColorComponents up one level

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/GouraudShadingContext.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/TriangleBasedShadingContext.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/GouraudShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/GouraudShadingContext.java?rev=1617136&r1=1617135&r2=1617136&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/GouraudShadingContext.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/GouraudShadingContext.java
Sun Aug 10 17:39:51 2014
@@ -46,11 +46,6 @@ abstract class GouraudShadingContext ext
     private static final Log LOG = LogFactory.getLog(GouraudShadingContext.class);
 
     /**
-     * number of color components.
-     */
-    protected int numberOfColorComponents;
-
-    /**
      * triangle list.
      */
     protected ArrayList<ShadedTriangle> triangleList;
@@ -78,7 +73,6 @@ abstract class GouraudShadingContext ext
     {
         super(shading, colorModel, xform, ctm, pageHeight, dBounds);
         triangleList = new ArrayList<ShadedTriangle>();
-        numberOfColorComponents = hasFunction ? 1 : shadingColorSpace.getNumberOfComponents();
         LOG.debug("Background: " + shading.getBackground());
         COSArray bg = shading.getBackground();
         if (bg != null)

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java?rev=1617136&r1=1617135&r2=1617136&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java
Sun Aug 10 17:39:51 2014
@@ -47,7 +47,6 @@ abstract class PatchMeshesShadingContext
 {
     private static final Log LOG = LogFactory.getLog(PatchMeshesShadingContext.class);
 
-    protected final int numberOfColorComponents; // number of color components
     protected float[] background; // background values.
     protected int rgbBackground;
     protected final PDShading patchMeshesShadingType;
@@ -75,7 +74,6 @@ abstract class PatchMeshesShadingContext
         patchMeshesShadingType = shading;
         bitsPerFlag = ((PDShadingType6) shading).getBitsPerFlag();
         patchList = new ArrayList<Patch>();
-        numberOfColorComponents = hasFunction ? 1 : shadingColorSpace.getNumberOfComponents();
 
         COSArray bg = shading.getBackground();
         if (bg != null)

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/TriangleBasedShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/TriangleBasedShadingContext.java?rev=1617136&r1=1617135&r2=1617136&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/TriangleBasedShadingContext.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/TriangleBasedShadingContext.java
Sun Aug 10 17:39:51 2014
@@ -23,7 +23,6 @@ import java.awt.image.ColorModel;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.util.Matrix;
@@ -49,6 +48,11 @@ abstract class TriangleBasedShadingConte
      */
     protected int bitsPerColorComponent;
 
+    /**
+     * number of color components.
+     */
+    protected int numberOfColorComponents;
+
     final protected boolean hasFunction;
 
     public TriangleBasedShadingContext(PDShading shading, ColorModel cm,
@@ -62,6 +66,8 @@ abstract class TriangleBasedShadingConte
         LOG.debug("bitsPerCoordinate: " + (Math.pow(2, bitsPerCoordinate) - 1));
         bitsPerColorComponent = triangleBasedShadingType.getBitsPerComponent();
         LOG.debug("bitsPerColorComponent: " + bitsPerColorComponent);
+        numberOfColorComponents = hasFunction ? 1 : shadingColorSpace.getNumberOfComponents();
+        LOG.debug("numberOfColorComponents: " + numberOfColorComponents);
     }
 
     // get the points from the triangles, calculate their color and add 



Mime
View raw message