Top Description Fields Constructors Methods
org.apache.pdfbox.preflight.graphic

public Class StandardColorSpaceHelper

extends Object
implements ColorSpaceHelper
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.preflight.graphic.ColorSpaceHelper
Known Direct Subclasses
org.apache.pdfbox.preflight.graphic.DeviceColorSpaceHelper, org.apache.pdfbox.preflight.graphic.NoPatternColorSpaceHelper
Imports
java.awt.color.ICC_Profile, java.io.IOException, .InputStream, java.util.Map, .Objects, org.apache.pdfbox.cos.COSArray, .COSBase, .COSInteger, .COSName, .COSNumber, .COSStream, org.apache.pdfbox.pdmodel.PDResources, org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace, .PDDeviceN, .PDDeviceNAttributes, .PDDeviceNProcess, .PDICCBased, .PDIndexed, .PDSeparation, org.apache.pdfbox.preflight.PreflightConfiguration, .PreflightContext, .PreflightPath, .ValidationResult.ValidationError, org.apache.pdfbox.preflight.exception.ValidationException

This class doesn't define restrictions on ColorSpace. It checks only the consistency of the Color space with the DestOutputIntent.

Field Summary

Modifier and TypeField and Description
protected PreflightContext
context

The context which contains useful information to process the validation.

protected ICCProfileWrapper
iccpw

The ICCProfile contained in the DestOutputIntent

protected PDColorSpace
pdcs

High level object which represents the colors space to check.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected final void
processAllColorSpace(PDColorSpace
the color space object to check.
colorSpace
)

Method called by the validate method.

protected void
processCalibratedColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is a calibrated color (CalGray, CalRGB, Lab).

protected void
processCYMKColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is DeviceCYMK.

protected boolean

Returns:

true if the default colorspace is a right one, false otherwise.
processDefaultColorSpace
(PDColorSpace colorSpace)

Look up in the closest PDResources objects if there are a default ColorSpace.

protected void
processDeviceNColorSpace(PDColorSpace
the color space object to check.
colorSpace
)

Method called by the processAllColorSpace if the ColorSpace to check is DeviceN.

protected void
processGrayColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is DeviceGray.

protected void
processICCBasedColorSpace(PDColorSpace
the color space object to check.
colorSpace
)

Method called by the processAllColorSpace if the ColorSpace to check is a ICCBased color space.

protected void
processIndexedColorSpace(PDColorSpace
the color space object to check.
colorSpace
)

Method called by the processAllColorSpace if the ColorSpace to check is Indexed.

protected void
processPatternColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is a Pattern.

protected void
processRGBColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is DeviceRGB.

protected void
processSeparationColorSpace(PDColorSpace
the color space object to check.
colorSpace
)

Method called by the processAllColorSpace if the ColorSpace to check is Separation.

public final void
validate()

Implements org.apache.pdfbox.preflight.graphic.ColorSpaceHelper.validate.

Process the ColorSpace validation.

private void
private boolean
private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
protected PreflightContext context

The context which contains useful information to process the validation.

iccpwback to summary
protected ICCProfileWrapper iccpw

The ICCProfile contained in the DestOutputIntent

pdcsback to summary
protected PDColorSpace pdcs

High level object which represents the colors space to check.

Constructor Detail

StandardColorSpaceHelperback to summary
protected StandardColorSpaceHelper(PreflightContext _context, PDColorSpace _cs)

Method Detail

processAllColorSpaceback to summary
protected final void processAllColorSpace(PDColorSpace colorSpace)

Method called by the validate method. According to the ColorSpace, a specific ColorSpace method is called.

Parameters
colorSpace:PDColorSpace

the color space object to check.

processCalibratedColorSpaceback to summary
protected void processCalibratedColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is a calibrated color (CalGray, CalRGB, Lab).

processCYMKColorSpaceback to summary
protected void processCYMKColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is DeviceCYMK.

processDefaultColorSpaceback to summary
protected boolean processDefaultColorSpace(PDColorSpace colorSpace)

Look up in the closest PDResources objects if there are a default ColorSpace. If there are, check that is a authorized ColorSpace.

Returns:boolean

true if the default colorspace is a right one, false otherwise.

processDeviceNColorSpaceback to summary
protected void processDeviceNColorSpace(PDColorSpace colorSpace)

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:PDColorSpace

the color space object to check.

processGrayColorSpaceback to summary
protected void processGrayColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is DeviceGray.

processICCBasedColorSpaceback to summary
protected void processICCBasedColorSpace(PDColorSpace colorSpace)

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:PDColorSpace

the color space object to check.

processIndexedColorSpaceback to summary
protected void processIndexedColorSpace(PDColorSpace colorSpace)

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:PDColorSpace

the color space object to check.

processPatternColorSpaceback to summary
protected void processPatternColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is a Pattern.

processRGBColorSpaceback to summary
protected void processRGBColorSpace(PDColorSpace colorSpace)

Method called by the processAllColorSpace if the ColorSpace to check is DeviceRGB.

processSeparationColorSpaceback to summary
protected void processSeparationColorSpace(PDColorSpace colorSpace)

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:PDColorSpace

the color space object to check.

validateback to summary
public final void validate() throws ValidationException

Implements org.apache.pdfbox.preflight.graphic.ColorSpaceHelper.validate.

Doc from org.apache.pdfbox.preflight.graphic.ColorSpaceHelper.validate.

Process the ColorSpace validation.

Annotations
@Override
validateICCProfileAlternateEntryback to summary
private void validateICCProfileAlternateEntry(PDICCBased iccBased, PDColorSpace alternateColorSpace)
validateICCProfileNEntryback to summary
private boolean validateICCProfileNEntry(COSStream stream, ICC_Profile iccp)
validateICCProfileVersionback to summary
private boolean validateICCProfileVersion(ICC_Profile iccp)