You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2014/07/18 21:31:42 UTC

svn commit: r1611778 - in /xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop: pdf/PDFFunction.java pdf/PDFShading.java render/gradient/Function.java render/gradient/GradientMaker.java render/gradient/Shading.java

Author: vhennebert
Date: Fri Jul 18 19:31:41 2014
New Revision: 1611778

URL: http://svn.apache.org/r1611778
Log:
Removed unused code

Modified:
    xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFunction.java
    xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFShading.java
    xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Function.java
    xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/GradientMaker.java
    xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Shading.java

Modified: xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFunction.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFunction.java?rev=1611778&r1=1611777&r2=1611778&view=diff
==============================================================================
--- xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFunction.java (original)
+++ xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFunction.java Fri Jul 18 19:31:41 2014
@@ -168,13 +168,6 @@ public class PDFFunction extends PDFObje
         } else if (func.getRange() != null) {
             return false;
         }
-        if (function.getSize() != null) {
-            if (!function.getSize().equals(func.getSize())) {
-                return false;
-            }
-        } else if (func.getSize() != null) {
-            return false;
-        }
         if (function.getEncode() != null) {
             if (!function.getEncode().equals(func.getEncode())) {
                 return false;
@@ -182,27 +175,6 @@ public class PDFFunction extends PDFObje
         } else if (func.getEncode() != null) {
             return false;
         }
-        if (function.getDecode() != null) {
-            if (!function.getDecode().equals(func.getDecode())) {
-                return false;
-            }
-        } else if (func.getDecode() != null) {
-            return false;
-        }
-        if (function.getDataStream() != null) {
-            if (!function.getDataStream().equals(func.getDataStream())) {
-                return false;
-            }
-        } else if (func.getDataStream() != null) {
-            return false;
-        }
-        if (function.getFilter() != null) {
-            if (!function.getFilter().equals(func.getFilter())) {
-                return false;
-            }
-        } else if (func.getFilter() != null) {
-            return false;
-        }
         if (!Arrays.equals(function.getCZero(), func.getCZero())) {
             return false;
         }

Modified: xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFShading.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFShading.java?rev=1611778&r1=1611777&r2=1611778&view=diff
==============================================================================
--- xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFShading.java (original)
+++ xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFShading.java Fri Jul 18 19:31:41 2014
@@ -47,10 +47,6 @@ public class PDFShading extends PDFObjec
     private final Shading shading;
 
     private final PDFFunction pdfFunction;
-    /**
-     * A ColorSpace representing the colorspace. "DeviceRGB" is an example.
-     */
-    protected PDFDeviceColorSpace colorSpace;
 
     /**
      * Constructor for Type 2 and 3
@@ -155,27 +151,6 @@ public class PDFShading extends PDFObjec
         } else if (other.getColorSpace() != null) {
             return false;
         }
-        if (shading.getBackground() != null) {
-            if (!shading.getBackground().equals(other.getBackground())) {
-                return false;
-            }
-        } else if (other.getBackground() != null) {
-            return false;
-        }
-        if (shading.getBBox() != null) {
-            if (!shading.getBBox().equals(other.getBBox())) {
-                return false;
-            }
-        } else if (other.getBBox() != null) {
-            return false;
-        }
-        if (shading.getMatrix() != null) {
-            if (!shading.getMatrix().equals(other.getMatrix())) {
-                return false;
-            }
-        } else if (other.getMatrix() != null) {
-            return false;
-        }
         if (shading.getCoords() != null) {
             if (!shading.getCoords().equals(other.getCoords())) {
                 return false;
@@ -190,13 +165,6 @@ public class PDFShading extends PDFObjec
         } else if (other.getExtend() != null) {
             return false;
         }
-        if (shading.getDecode() != null) {
-            if (!shading.getDecode().equals(other.getDecode())) {
-                return false;
-            }
-        } else if (other.getDecode() != null) {
-            return false;
-        }
         if (shading.getFunction() != null) {
             if (!shading.getFunction().equals(other.getFunction())) {
                 return false;

Modified: xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Function.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Function.java?rev=1611778&r1=1611777&r2=1611778&view=diff
==============================================================================
--- xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Function.java (original)
+++ xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Function.java Fri Jul 18 19:31:41 2014
@@ -46,16 +46,6 @@ public class Function {
      */
     private List<Double> range;
 
-    /* ********************TYPE 0***************************** */
-    // FunctionType 0 specific function guts
-
-    /**
-     * Required: Array containing the Integer size of the Domain and Range, respectively.
-     * Note: This is really more like two seperate integers, sizeDomain, and sizeRange,
-     * but since they're expressed as an array in PDF, my implementation reflects that.
-     */
-    protected List<Double> size;
-
     /**
      * Required for Type 0: Number of Bits used to represent each sample value.
      * Limited to 1,2,4,8,12,16,24, or 32
@@ -80,28 +70,6 @@ public class Function {
      */
     private List<Double> encode;
 
-    /**
-     * Optional for Type 0: A 2 * n array of Doubles which provides
-     * a linear mapping of sample values to the range. Defaults to Range.
-     */
-    private List<Double> decode;
-
-    /**
-     * Optional For Type 0: A stream of sample values
-     */
-
-    /**
-     * Required For Type 4: Postscript Calculator function
-     * composed of arithmetic, boolean, and stack operators + boolean constants
-     */
-    private StringBuffer functionDataStream;
-
-    /**
-     * Required (possibly) For Type 0: A vector of Strings for the
-     * various filters to be used to decode the stream.
-     * These are how the string is compressed. Flate, LZW, etc.
-     */
-    private List<String> filter;
     /* *************************TYPE 2************************** */
 
     /**
@@ -259,13 +227,6 @@ public class Function {
     }
 
     /**
-     * The function size
-     */
-    public List<Double> getSize() {
-        return size;
-    }
-
-    /**
      * Gets the function encoding
      */
     public List<Double> getEncode() {
@@ -284,13 +245,6 @@ public class Function {
     }
 
     /**
-     * Gets the function filter
-     */
-    public List<String> getFilter() {
-        return filter;
-    }
-
-    /**
      * Gets the bits per sample of the function
      */
     public int getBitsPerSample() {
@@ -319,20 +273,6 @@ public class Function {
     }
 
     /**
-     * Gets the function decoding
-     */
-    public List<Double> getDecode() {
-        return decode;
-    }
-
-    /**
-     * Gets the function data stream
-     */
-    public StringBuffer getDataStream() {
-        return functionDataStream;
-    }
-
-    /**
      * Gets the function C0 value (color for gradient)
      */
     public float[] getCZero() {
@@ -351,20 +291,11 @@ public class Function {
         out.append("<<\n/FunctionType " + functionType + "\n");
         outputDomain(out, doubleFormatter);
         if (this.functionType == 0) {
-            outputSize(out, doubleFormatter);
             outputEncode(out, doubleFormatter);
             outputBitsPerSample(out);
             outputOrder(out);
             outputRange(out, doubleFormatter);
-            outputDecode(out, doubleFormatter);
-            if (functionDataStream != null) {
-                out.append("/Length " + (functionDataStream.length() + 1) + "\n");
-            }
-            outputFilter(out);
             out.append(">>");
-            if (functionDataStream != null) {
-                out.append("\nstream\n" + functionDataStream + "\nendstream");
-            }
         } else if (functionType == 2) {
             outputRange(out, doubleFormatter);
             outputCZero(out, doubleFormatter);
@@ -402,13 +333,7 @@ public class Function {
             out.append("\n>>");
         } else if (functionType == 4) {
             outputRange(out, doubleFormatter);
-            if (functionDataStream != null) {
-                out.append("/Length " + (functionDataStream.length() + 1) + "\n");
-            }
             out.append(">>");
-            if (functionDataStream != null) {
-                out.append("\nstream\n{ " + functionDataStream + " }\nendstream");
-            }
         }
         return out.toString();
     }
@@ -419,14 +344,6 @@ public class Function {
         p.append("\n");
     }
 
-    private void outputSize(StringBuilder out, DoubleFormatter doubleFormatter) {
-        if (size != null) {
-            out.append("/Size ");
-            GradientMaker.outputDoubles(out, doubleFormatter, size);
-            out.append("\n");
-        }
-    }
-
     private void outputBitsPerSample(StringBuilder out) {
         out.append("/BitsPerSample " + bitsPerSample + "\n");
     }
@@ -451,30 +368,6 @@ public class Function {
         out.append("\n");
     }
 
-    private void outputDecode(StringBuilder out, DoubleFormatter doubleFormatter) {
-        if (decode != null) {
-            out.append("/Decode ");
-            GradientMaker.outputDoubles(out, doubleFormatter, decode);
-            out.append("\n");
-        }
-    }
-
-    private void outputFilter(StringBuilder out) {
-        if (filter != null) {
-            int size = filter.size();
-            out.append("/Filter ");
-            if (size == 1) {
-                out.append("/" + filter.get(0) + "\n");
-            } else {
-                out.append("[ ");
-                for (int i = 0; i < size; i++) {
-                    out.append("/" + filter.get(0) + " ");
-                }
-                out.append("]\n");
-            }
-        }
-    }
-
     private void outputCZero(StringBuilder out, DoubleFormatter doubleFormatter) {
         if (cZero != null) {
             out.append("/C0 [ ");

Modified: xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/GradientMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/GradientMaker.java?rev=1611778&r1=1611777&r2=1611778&view=diff
==============================================================================
--- xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/GradientMaker.java (original)
+++ xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/GradientMaker.java Fri Jul 18 19:31:41 2014
@@ -47,10 +47,10 @@ public final class GradientMaker {
         Point2D startPoint = gp.getStartPoint();
         Point2D endPoint = gp.getEndPoint();
         List<Double> coords = new java.util.ArrayList<Double>(4);
-        coords.add(new Double(startPoint.getX()));
-        coords.add(new Double(startPoint.getY()));
-        coords.add(new Double(endPoint.getX()));
-        coords.add(new Double(endPoint.getY()));
+        coords.add(Double.valueOf(startPoint.getX()));
+        coords.add(Double.valueOf(startPoint.getY()));
+        coords.add(Double.valueOf(endPoint.getX()));
+        coords.add(Double.valueOf(endPoint.getY()));
         return makeGradient(gp, coords, baseTransform, transform);
     }
 

Modified: xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Shading.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Shading.java?rev=1611778&r1=1611777&r2=1611778&view=diff
==============================================================================
--- xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Shading.java (original)
+++ xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/Shading.java Fri Jul 18 19:31:41 2014
@@ -58,31 +58,6 @@ public class Shading {
     private final Function function;
 
     /**
-     * Optional: A List specifying the clipping rectangle
-     */
-    private final List<Double> bbox;
-
-    /**
-     * Optional for Type 1: A transformation matrix
-     */
-    private final List<Double> matrix;
-
-    /**
-     * The background color. Since shading is opaque,
-     * this is very rarely used.
-     */
-    private final List<Double> background;
-
-    /**
-     * Required for Type 4,5,6, and 7: Array of Doubles which specifies
-     * how to decode coordinate and color component values.
-     * Each type has a differing number of decode array members, so check
-     * the spec.
-     * Page 303 in PDF Spec 1.3
-     */
-    private final List<Double> decode;
-
-    /**
      * Required for Type 2+3: An Array of two boolean values specifying
      * whether to extend the start and end colors past the start
      * and end points, respectively.
@@ -128,14 +103,10 @@ public class Shading {
             List<Double> coords, Function function) {
         this.shadingType = shadingType;
         this.colorSpace = colorSpace;
-        this.background = null;
-        this.bbox = null;
         this.antiAlias = false;
         this.coords = coords;
         this.function = function;
         this.extend = Arrays.asList(true, true);
-        this.matrix = null;
-        this.decode = null;
         this.bitsPerCoordinate = 0;
         this.bitsPerFlag = 0;
         this.bitsPerComponent = 0;
@@ -158,22 +129,6 @@ public class Shading {
         return function;
     }
 
-    public List<Double> getBBox() {
-        return bbox;
-    }
-
-    public List<Double> getMatrix() {
-        return matrix;
-    }
-
-    public List<Double> getBackground() {
-        return background;
-    }
-
-    public List<Double> getDecode() {
-        return decode;
-    }
-
     public List<Boolean> getExtend() {
         return extend;
     }
@@ -204,18 +159,6 @@ public class Shading {
             out.append("/ColorSpace /" + colorSpace.getName() + "\n");
         }
 
-        if (background != null) {
-            out.append("/Background ");
-            GradientMaker.outputDoubles(out, doubleFormatter, background);
-            out.append("\n");
-        }
-
-        if (bbox != null) {
-            out.append("/BBox");
-            GradientMaker.outputDoubles(out, doubleFormatter, bbox);
-            out.append("\n");
-        }
-
         if (antiAlias) {
             out.append("/AntiAlias " + antiAlias + "\n");
         }
@@ -243,11 +186,6 @@ public class Shading {
 
     private void outputShadingType1(StringBuilder out, DoubleFormatter doubleFormatter,
             Shading.FunctionRenderer functionRenderer) {
-        if (matrix != null) {
-            out.append("/Matrix ");
-            GradientMaker.outputDoubles(out, doubleFormatter, matrix);
-            out.append("\n");
-        }
         outputFunction(out, functionRenderer);
     }
 
@@ -289,12 +227,6 @@ public class Shading {
             out.append("/BitsPerFlag 2 \n");
         }
 
-        if (decode != null) {
-            out.append("/Decode ");
-            GradientMaker.outputDoubles(out, doubleFormatter, decode);
-            out.append("\n");
-        }
-
         outputFunction(out, functionRenderer);
     }
 
@@ -312,12 +244,6 @@ public class Shading {
             out.append("/BitsPerComponent 1 \n");
         }
 
-        if (decode != null) {
-            out.append("/Decode ");
-            GradientMaker.outputDoubles(out, doubleFormatter, decode);
-            out.append("\n");
-        }
-
         outputFunction(out, functionRenderer);
 
         if (verticesPerRow > 0) {



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