You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/06/26 17:49:45 UTC

svn commit: r1834454 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/PDFunctionType3.java

Author: tilman
Date: Tue Jun 26 17:49:45 2018
New Revision: 1834454

URL: http://svn.apache.org/viewvc?rev=1834454&view=rev
Log:
PDFBOX-4253: cache bounds values

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/PDFunctionType3.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/PDFunctionType3.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/PDFunctionType3.java?rev=1834454&r1=1834453&r2=1834454&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/PDFunctionType3.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/PDFunctionType3.java Tue Jun 26 17:49:45 2018
@@ -34,6 +34,7 @@ public class PDFunctionType3 extends PDF
     private COSArray encode = null;
     private COSArray bounds = null;
     private PDFunction[] functionsArray = null;
+    private float[] boundsValues = null;
     
     /**
      * Constructor.
@@ -88,7 +89,10 @@ public class PDFunctionType3 extends PDF
         }
         else 
         {
-            float[] boundsValues = getBounds().toFloatArray();
+            if (boundsValues == null)
+            {
+                boundsValues = getBounds().toFloatArray();
+            }
             int boundsSize = boundsValues.length;
             // create a combined array containing the domain and the bounds values
             // domain.min, bounds[0], bounds[1], ...., bounds[boundsSize-1], domain.max