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 15:45:39 UTC
svn commit: r1611650 - in
/xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop:
pdf/PDFFactory.java pdf/PDFFunction.java render/gradient/Function.java
render/gradient/GradientMaker.java
Author: vhennebert
Date: Fri Jul 18 13:45:39 2014
New Revision: 1611650
URL: http://svn.apache.org/r1611650
Log:
Removed unused functionType parameter
Modified:
xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFactory.java
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/render/gradient/Function.java
xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/gradient/GradientMaker.java
Modified: xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFactory.java?rev=1611650&r1=1611649&r2=1611650&view=diff
==============================================================================
--- xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFactory.java (original)
+++ xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/pdf/PDFFactory.java Fri Jul 18 13:45:39 2014
@@ -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) {
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=1611650&r1=1611649&r2=1611650&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 13:45:39 2014
@@ -71,11 +71,10 @@ public class PDFFunction extends PDFObje
*
* This attribute is required.
* PDF Spec page 268
- * @param functionType The type of the function, which should be 2.
*/
- public PDFFunction(int functionType, List<Double> domain, List<Double> range, float[] cZero, float[] cOne,
- double interpolationExponentN) {
- this(new Function(functionType, domain, range, cZero, cOne, interpolationExponentN));
+ public PDFFunction(List<Double> domain, List<Double> range, float[] cZero, float[] cOne,
+ double interpolationExponentN) {
+ this(new Function(domain, range, cZero, cOne, interpolationExponentN));
}
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=1611650&r1=1611649&r2=1611650&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 13:45:39 2014
@@ -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<Double> domain, List<Double> range,
- float[] cZero, float[] cOne, double interpolationExponentN) {
+ public Function(List<Double> domain, List<Double> 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<Double> domain, List<Double> range,
- List<Function> functions, List<Double> bounds,
- List<Double> encode) {
+ public Function(List<Double> domain, List<Double> range, List<Function> functions,
+ List<Double> bounds, List<Double> encode) {
this(3, domain, range);
this.functions = functions;
this.bounds = bounds;
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=1611650&r1=1611649&r2=1611650&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 13:45:39 2014
@@ -86,7 +86,7 @@ public final class GradientMaker {
List<Function> 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;
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org