From 0a7069adaeb48754ad2ff8ec22d3ec45e57b614a Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 18 Jul 2014 13:45:39 +0000 Subject: [PATCH] Removed unused functionType parameter git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1611650 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/pdf/PDFFactory.java | 29 ++++++++----------- src/java/org/apache/fop/pdf/PDFFunction.java | 7 ++--- .../apache/fop/render/gradient/Function.java | 12 +++----- .../fop/render/gradient/GradientMaker.java | 4 +-- 4 files changed, 21 insertions(+), 31 deletions(-) diff --git a/src/java/org/apache/fop/pdf/PDFFactory.java b/src/java/org/apache/fop/pdf/PDFFactory.java index adbe8a52e..ef1f1849f 100644 --- a/src/java/org/apache/fop/pdf/PDFFactory.java +++ b/src/java/org/apache/fop/pdf/PDFFactory.java @@ -243,36 +243,31 @@ public class PDFFactory { /** * make a type Exponential interpolation function * (for shading usually) - * - * @param theDomain List objects of Double objects. + * @param domain List objects of Double objects. * This is the domain of the function. * See page 264 of the PDF 1.3 Spec. - * @param theRange List of Doubles that is the Range of the function. + * @param range List of Doubles that is the Range of the function. * See page 264 of the PDF 1.3 Spec. - * @param theCZero This is a vector of Double objects which defines the function result + * @param cZero This is a vector of Double objects which defines the function result * when x=0. * * This attribute is optional. * It's described on page 268 of the PDF 1.3 spec. - * @param theCOne This is a vector of Double objects which defines the function result + * @param cOne This is a vector of Double objects which defines the function result * when x=1. * * This attribute is optional. * It's described on page 268 of the PDF 1.3 spec. - * @param theInterpolationExponentN This is the inerpolation exponent. + * @param interpolationExponentN This is the inerpolation exponent. * * This attribute is required. * PDF Spec page 268 - * @param theFunctionType The type of the function, which should be 2. + * * @return the PDF function that was created */ - public PDFFunction makeFunction(int theFunctionType, List theDomain, - List theRange, float[] theCZero, - float[] theCOne, - double theInterpolationExponentN) { // type 2 - PDFFunction function = new PDFFunction(theFunctionType, theDomain, - theRange, theCZero, theCOne, - theInterpolationExponentN); + public PDFFunction makeFunction(List domain, List range, float[] cZero, float[] cOne, + double interpolationExponentN) { + PDFFunction function = new PDFFunction(domain, range, cZero, cOne, interpolationExponentN); function = registerFunction(function); return function; } @@ -1330,11 +1325,11 @@ public class PDFFactory { String colorName = ncs.getColorName(); final Double zero = new Double(0d); final Double one = new Double(1d); - List theDomain = Arrays.asList(new Double[] {zero, one}); - List theRange = Arrays.asList(new Double[] {zero, one, zero, one, zero, one}); + List domain = Arrays.asList(new Double[] {zero, one}); + List range = Arrays.asList(new Double[] {zero, one, zero, one, zero, one}); float[] cZero = new float[] {1f, 1f, 1f}; float[] cOne = ncs.getRGBColor().getColorComponents(null); - PDFFunction tintFunction = makeFunction(2, theDomain, theRange, cZero, cOne, 1.0d); + PDFFunction tintFunction = makeFunction(domain, range, cZero, cOne, 1.0d); PDFSeparationColorSpace cs = new PDFSeparationColorSpace(colorName, tintFunction); getDocument().registerObject(cs); if (res != null) { diff --git a/src/java/org/apache/fop/pdf/PDFFunction.java b/src/java/org/apache/fop/pdf/PDFFunction.java index f84c52609..fd860b08c 100644 --- a/src/java/org/apache/fop/pdf/PDFFunction.java +++ b/src/java/org/apache/fop/pdf/PDFFunction.java @@ -71,11 +71,10 @@ public class PDFFunction extends PDFObject { * * This attribute is required. * PDF Spec page 268 - * @param functionType The type of the function, which should be 2. */ - public PDFFunction(int functionType, List domain, List range, float[] cZero, float[] cOne, - double interpolationExponentN) { - this(new Function(functionType, domain, range, cZero, cOne, interpolationExponentN)); + public PDFFunction(List domain, List range, float[] cZero, float[] cOne, + double interpolationExponentN) { + this(new Function(domain, range, cZero, cOne, interpolationExponentN)); } diff --git a/src/java/org/apache/fop/render/gradient/Function.java b/src/java/org/apache/fop/render/gradient/Function.java index 2ac095819..2baa87820 100644 --- a/src/java/org/apache/fop/render/gradient/Function.java +++ b/src/java/org/apache/fop/render/gradient/Function.java @@ -149,7 +149,6 @@ public class Function { * * Use null for an optional object parameter if you choose not to use it. * For optional int parameters, pass the default. - * @param functionType The type of the function, which should be 2. * @param domain List objects of Double objects. * This is the domain of the function. * See page 264 of the PDF 1.3 Spec. @@ -170,8 +169,8 @@ public class Function { * This attribute is required. * PDF Spec page 268 */ - public Function(int functionType, List domain, List range, - float[] cZero, float[] cOne, double interpolationExponentN) { + public Function(List domain, List range, float[] cZero, float[] cOne, + double interpolationExponentN) { this(2, domain, range); this.cZero = cZero; this.cOne = cOne; @@ -183,8 +182,6 @@ public class Function { * * Use null for an optional object parameter if you choose not to use it. * For optional int parameters, pass the default. - * @param functionType This is the function type. It should be 3, - * for a stitching function. * @param domain List objects of Double objects. * This is the domain of the function. * See page 264 of the PDF 1.3 Spec. @@ -212,9 +209,8 @@ public class Function { * * See page 270 in the PDF 1.3 spec. */ - public Function(int functionType, List domain, List range, - List functions, List bounds, - List encode) { + public Function(List domain, List range, List functions, + List bounds, List encode) { this(3, domain, range); this.functions = functions; this.bounds = bounds; diff --git a/src/java/org/apache/fop/render/gradient/GradientMaker.java b/src/java/org/apache/fop/render/gradient/GradientMaker.java index 7c6b5c27d..d8307c300 100644 --- a/src/java/org/apache/fop/render/gradient/GradientMaker.java +++ b/src/java/org/apache/fop/render/gradient/GradientMaker.java @@ -86,7 +86,7 @@ public final class GradientMaker { List functions = makeFunctions(gradient); // Gradients are currently restricted to sRGB PDFDeviceColorSpace colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB); - Function function = new Function(3, null, null, functions, bounds, null); + Function function = new Function(null, null, functions, bounds, null); int shadingType = gradient instanceof LinearGradientPaint ? 2 : 3; Shading shading = new Shading(shadingType, colorSpace, coords, function); return new Pattern(2, shading, matrix); @@ -134,7 +134,7 @@ public final class GradientMaker { Color nextColor = colors.get(currentPosition + 1); float[] c0 = currentColor.getColorComponents(null); float[] c1 = nextColor.getColorComponents(null); - Function function = new Function(2, null, null, c0, c1, 1.0); + Function function = new Function(null, null, c0, c1, 1.0); functions.add(function); } return functions; -- 2.39.5