Class StandardColorSpaceHelper
java.lang.Object
org.apache.pdfbox.preflight.graphic.StandardColorSpaceHelper
- All Implemented Interfaces:
ColorSpaceHelper
- Direct Known Subclasses:
DeviceColorSpaceHelper,NoPatternColorSpaceHelper
This class doesn't define restrictions on ColorSpace. It checks only the consistency of the Color space with the
DestOutputIntent.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PreflightContextThe context which contains useful information to process the validation.protected ICCProfileWrapperThe ICCProfile contained in the DestOutputIntentprotected PDColorSpaceHigh level object which represents the colors space to check. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStandardColorSpaceHelper(PreflightContext _context, PDColorSpace _cs) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidprocessAllColorSpace(PDColorSpace colorSpace) Method called by the validate method.protected voidprocessCalibratedColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is a calibrated color (CalGray, CalRGB, Lab).protected voidprocessCYMKColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is DeviceCYMK.protected booleanprocessDefaultColorSpace(PDColorSpace colorSpace) Look up in the closest PDResources objects if there are a default ColorSpace.protected voidprocessDeviceNColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is DeviceN.protected voidprocessGrayColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is DeviceGray.protected voidprocessICCBasedColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is a ICCBased color space.protected voidprocessIndexedColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is Indexed.protected voidprocessPatternColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is a Pattern.protected voidprocessRGBColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is DeviceRGB.protected voidprocessSeparationColorSpace(PDColorSpace colorSpace) Method called by the processAllColorSpace if the ColorSpace to check is Separation.final voidvalidate()Process the ColorSpace validation.private voidvalidateICCProfileAlternateEntry(PDICCBased iccBased, PDColorSpace alternateColorSpace) private booleanvalidateICCProfileNEntry(COSStream stream, ICC_Profile iccp) private boolean
-
Field Details
-
context
The context which contains useful information to process the validation. -
iccpw
The ICCProfile contained in the DestOutputIntent -
pdcs
High level object which represents the colors space to check.
-
-
Constructor Details
-
StandardColorSpaceHelper
-
-
Method Details
-
validate
Description copied from interface:ColorSpaceHelperProcess the ColorSpace validation.- Specified by:
validatein interfaceColorSpaceHelper- Throws:
ValidationException
-
processAllColorSpace
Method called by the validate method. According to the ColorSpace, a specific ColorSpace method is called.- Parameters:
colorSpace- the color space object to check.
-
processRGBColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is DeviceRGB. -
processCYMKColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is DeviceCYMK. -
processPatternColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is a Pattern.- Parameters:
colorSpace-
-
processGrayColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is DeviceGray. -
processCalibratedColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is a calibrated color (CalGray, CalRGB, Lab).- Parameters:
colorSpace-
-
processICCBasedColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is a ICCBased color space. Because this kind of ColorSpace can have alternate color space, the processAllColorSpace is called to check this alternate color space. (Pattern is forbidden as Alternate Color Space)- Parameters:
colorSpace- the color space object to check.
-
processDeviceNColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is DeviceN. Because this kind of ColorSpace can have alternate color space, the processAllColorSpace is called to check this alternate color space. (There are no restrictions on the Alternate Color space)- Parameters:
colorSpace- the color space object to check.
-
processIndexedColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is Indexed. Because this kind of ColorSpace can have a Base color space, the processAllColorSpace is called to check this base color space. (Indexed and Pattern can't be a Base color space)- Parameters:
colorSpace- the color space object to check.
-
processSeparationColorSpace
Method called by the processAllColorSpace if the ColorSpace to check is Separation. Because this kind of ColorSpace can have an alternate color space, the processAllColorSpace is called to check this alternate color space. (Indexed, Separation, DeviceN and Pattern can't be a Base color space)- Parameters:
colorSpace- the color space object to check.
-
processDefaultColorSpace
Look up in the closest PDResources objects if there are a default ColorSpace. If there are, check that is a authorized ColorSpace.- Parameters:
colorSpace-- Returns:
- true if the default colorspace is a right one, false otherwise.
-
validateICCProfileVersion
-
validateICCProfileNEntry
-
validateICCProfileAlternateEntry
private void validateICCProfileAlternateEntry(PDICCBased iccBased, PDColorSpace alternateColorSpace)
-