pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1707337 - in /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic: ColorSpaces.java DeviceColorSpaceHelper.java StandardColorSpaceHelper.java
Date Wed, 07 Oct 2015 16:52:58 GMT
Author: tilman
Date: Wed Oct  7 16:52:57 2015
New Revision: 1707337

URL: http://svn.apache.org/viewvc?rev=1707337&view=rev
Log:
PDFBOX-3003: rename enum ColorSpaces to match actual names

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java?rev=1707337&r1=1707336&r2=1707337&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/ColorSpaces.java
Wed Oct  7 16:52:57 2015
@@ -23,15 +23,14 @@ package org.apache.pdfbox.preflight.grap
 
 /**
  * This enum makes ColorSpaces validation easier. Labels represent ColorSpace names as defined
in the
- * "PDF Reference 1.4". Enum entries with the "_SHORT" suffix are used to represent color
spaces (DeviceGray, DeviceRGB,
- * DeviceCMYK and Indexed) using the InlinedImage notation.
+ * "PDF Reference 1.4".
  */
 public enum ColorSpaces
 {
 
-    Lab("Lab"), CalRGB("CalRGB"), CalGray("CalGray"), DeviceN("DeviceN"), Indexed("Indexed"),
Indexed_SHORT("I"), Pattern(
-            "Pattern"), ICCBased("ICCBased"), DeviceRGB("DeviceRGB"), DeviceRGB_SHORT("RGB"),
DeviceGray("DeviceGray"), DeviceGray_SHORT(
-            "G"), DeviceCMYK("DeviceCMYK"), DeviceCMYK_SHORT("CMYK"), Separation("Separation");
+    Lab("Lab"), CalRGB("CalRGB"), CalGray("CalGray"), DeviceN("DeviceN"), Indexed("Indexed"),
I("I"), 
+    Pattern("Pattern"), ICCBased("ICCBased"), DeviceRGB("DeviceRGB"), RGB("RGB"), DeviceGray("DeviceGray"),

+    G("G"), DeviceCMYK("DeviceCMYK"), CMYK("CMYK"), Separation("Separation");
 
     /**
      * Name of the ColorSpace

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java?rev=1707337&r1=1707336&r2=1707337&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
Wed Oct  7 16:52:57 2015
@@ -77,7 +77,7 @@ public class DeviceColorSpaceHelper exte
         switch (colorSpaces)
         {
         case Indexed:
-        case Indexed_SHORT:
+        case I:
         case Pattern:
             context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_FORBIDDEN,
colorSpaces
                     .getLabel() + " ColorSpace is forbidden"));

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java?rev=1707337&r1=1707336&r2=1707337&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
Wed Oct  7 16:52:57 2015
@@ -106,11 +106,11 @@ public class StandardColorSpaceHelper im
         switch (cs)
         {
         case DeviceRGB:
-        case DeviceRGB_SHORT:
+        case RGB:
             processRGBColorSpace(colorSpace);
             break;
         case DeviceCMYK:
-        case DeviceCMYK_SHORT:
+        case CMYK:
             processCYMKColorSpace(colorSpace);
             break;
         case CalRGB:
@@ -119,7 +119,7 @@ public class StandardColorSpaceHelper im
             processCalibratedColorSpace(colorSpace);
             break;
         case DeviceGray:
-        case DeviceGray_SHORT:
+        case G:
             processGrayColorSpace(colorSpace);
             break;
         case ICCBased:
@@ -129,7 +129,7 @@ public class StandardColorSpaceHelper im
             processDeviceNColorSpace(colorSpace);
             break;
         case Indexed:
-        case Indexed_SHORT:
+        case I:
             processIndexedColorSpace(colorSpace);
             break;
         case Separation:
@@ -342,7 +342,7 @@ public class StandardColorSpaceHelper im
         PDIndexed indexed = (PDIndexed) colorSpace;
         PDColorSpace based = indexed.getBaseColorSpace();
         ColorSpaces cs = ColorSpaces.valueOf(based.getName());
-        if (cs == ColorSpaces.Indexed || cs == ColorSpaces.Indexed_SHORT)
+        if (cs == ColorSpaces.Indexed || cs == ColorSpaces.I)
         {
             context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_INDEXED,
                     "Indexed color space can't be used as Base color space"));
@@ -380,7 +380,7 @@ public class StandardColorSpaceHelper im
                 case DeviceN:
                 case Pattern:
                 case Indexed:
-                case Indexed_SHORT:
+                case I:
                     context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_ALTERNATE,
acs
                             .getLabel() + " color space can't be used as alternate color
space"));
                     break;



Mime
View raw message