pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1648770 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading: GouraudShadingContext.java PatchMeshesShadingContext.java TriangleBasedShadingContext.java
Date Wed, 31 Dec 2014 19:43:56 GMT
Author: jahewson
Date: Wed Dec 31 19:43:55 2014
New Revision: 1648770

URL: http://svn.apache.org/r1648770
Log:
PDFBOX-1094: Rename method with confusing name

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=1648770&r1=1648769&r2=1648770&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
Wed Dec 31 19:43:55 2014
@@ -130,7 +130,8 @@ abstract class GouraudShadingContext ext
         return dstMin + (src * (dstMax - dstMin) / srcMax);
     }
 
-    protected boolean emptyList()
+    @Override
+    protected boolean isDataEmpty()
     {
         return triangleList.isEmpty();
     }

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=1648770&r1=1648769&r2=1648770&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
Wed Dec 31 19:43:55 2014
@@ -265,7 +265,7 @@ abstract class PatchMeshesShadingContext
     }
 
     @Override
-    protected boolean emptyList()
+    protected boolean isDataEmpty()
     {
         return patchList.isEmpty();
     }    

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=1648770&r1=1648769&r2=1648770&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
Wed Dec 31 19:43:55 2014
@@ -19,7 +19,6 @@ import java.awt.PaintContext;
 import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
 import java.awt.image.ColorModel;
 import java.awt.image.Raster;
 import java.awt.image.WritableRaster;
@@ -75,18 +74,21 @@ abstract class TriangleBasedShadingConte
     /**
      * Calculate every point and its color and store them in a Hash table.
      *
-     * @return a Hash table which contains all the points' positions and colors
-     * of one image
+     * @return a Hash table which contains all the points' positions and colors of one image
      */
     abstract Map<Point, Integer> calcPixelTable();
-    
+
+    /**
+     * Creates the pixel table.
+     */
     protected void createPixelTable()
     {
         pixelTable = calcPixelTable();
     }
 
-    // get the points from the triangles, calculate their color and add 
-    // point-color mappings to the map
+    /**
+     * Get the points from the triangles, calculate their color and add  point-color mappings.
+     */
     protected void calcPixelTable(List<ShadedTriangle> triangleList, Map<Point,
Integer> map)
     {
         for (ShadedTriangle tri : triangleList)
@@ -122,9 +124,10 @@ abstract class TriangleBasedShadingConte
         }
     }
 
-    // convert color to RGB color value, using function if required,
-    // then convert from the shading colorspace to an RGB value,
-    // which is encoded into an integer.
+    /**
+     * Convert color to RGB color value, using function if required, then convert from the
shading
+     * color space to an RGB value, which is encoded into an integer.
+     */
     private int evalFunctionAndConvertToRGB(float[] values)
     {
         if (hasFunction)
@@ -142,9 +145,9 @@ abstract class TriangleBasedShadingConte
     }
 
     /**
-     * True if the relevant list is empty.
+     * Returns true if the shading has an empty data stream.
      */
-    abstract boolean emptyList();
+    abstract boolean isDataEmpty();
 
     @Override
     public final ColorModel getColorModel()
@@ -164,7 +167,7 @@ abstract class TriangleBasedShadingConte
     {
         WritableRaster raster = getColorModel().createCompatibleWritableRaster(w, h);
         int[] data = new int[w * h * 4];
-        if (!emptyList() || background != null)
+        if (!isDataEmpty() || background != null)
         {
             for (int row = 0; row < h; row++)
             {



Mime
View raw message