public static class OutputProfiler.ProcessColorAction extends Object implements OutputProfiler.ColorAction
ProcessColorAction
class is an implementation of OutputProfiler.ColorAction
which will convert any process colors into the specified ColorSpace. This may optionally include
Calibrated colors. Seperation colors (i.e. those from a SpotColorSpace
or DeviceNColorSpace
)
will be replaced with an identical color, but with their fallback
ColorSpace mapped to the new ColorSpace if required.TYPE_CALIBRATED, TYPE_PROCESS, TYPE_SEPARATION
Constructor and Description |
---|
ProcessColorAction(ColorSpace process)
Create a new
ProcessColorAction |
ProcessColorAction(ColorSpace process,
boolean calibrated)
Create a new
ProcessColorAction and call setAllowCalibrated(boolean) |
ProcessColorAction(OutputProfile target)
Create a new
ProcessColorAction that will
convert process colors to the ColorSpace specified in the supplied OutputProfile's
Output Intent. |
Modifier and Type | Method and Description |
---|---|
ColorSpace |
changeColor(OutputProfiler profiler,
ColorSpace cs,
float[] src,
float[] dst,
boolean fill,
int type)
Optionally converts a Color from one ColorSpace to another.
|
void |
setAllowCalibrated(boolean allow)
Determines how process colors in a calibrated ColorSpace are modified.
|
void |
setRenderingIntent(OutputProfiler.RenderingIntent intent)
Set the rendering intent, to control how out-of-gamut colors are converted.
|
public ProcessColorAction(ColorSpace process)
ProcessColorAction
process
- the process ColorSpace to convert colors topublic ProcessColorAction(ColorSpace process, boolean calibrated)
ProcessColorAction
and call setAllowCalibrated(boolean)
process
- the process ColorSpace to convert colors tocalibrated
- the value to pass into setAllowCalibrated(boolean)
public ProcessColorAction(OutputProfile target)
Create a new ProcessColorAction
that will
convert process colors to the ColorSpace specified in the supplied OutputProfile's
Output Intent. This is the intended display condition for the PDF, and is
a required part of the OutputProfile for PDF/A and PDF/X.
Here's an example showing how to use this constructor to simplify conversion of a PDF to a PDF/A document with all uncalibrated colors converted to the Output Intent specifed in the profile.
OutputProfiler profiler = new OutputProfiler(new PDFParser(pdf)); OutputProfile profile = profiler.getProfile(); ICC_Profile icc = ICC_Profile.getInstance("US_Web_Coated_SWOP.icm"); OutputProfile target = new OutputProfile(OutputProfile.PDFA1b_2005, "http://www.color.org", null, icc); profiler.setColorAction(new OutputProfiler.ProcessColorAction(target)); profiler.apply(target);
target
- the OutputProfile to retrieve the Output Intent from. This should be a PDF/X or
PDF/A OutputProfile, and must have an Output Intent profile set on it.OutputProfile.setOutputIntent(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.awt.color.ICC_Profile)
,
OutputProfile.getOutputIntentDestinationProfile(java.lang.String)
public void setAllowCalibrated(boolean allow)
allow
- whether calibrated process colors should remain unchangedpublic void setRenderingIntent(OutputProfiler.RenderingIntent intent)
Perceptual
, and other values may not be supported
depending on the ColorSpace. If not, the process will fall back to Perceptualintent
- the rendering intent for color conversionpublic ColorSpace changeColor(OutputProfiler profiler, ColorSpace cs, float[] src, float[] dst, boolean fill, int type)
OutputProfiler.ColorAction
Optionally converts a Color from one ColorSpace to another.
If the source Color is to be converted, this method should return the ColorSpace it will be converted to, and populate the dst array with the new color components if dst is not null. If dst is null, it is sufficient to just return the target ColorSpace (which may be the same as the source ColorSpace, for example if the Colors are simply being retinted).
If no change is to be made, this method should return null
.
This method must be consistant and return the same output for the same input paramters. It must also be quick, as it may be called millions of times during preflighting (as it must be called once for each pixel).
changeColor
in interface OutputProfiler.ColorAction
profiler
- the OutputProfiler this action is being run oncs
- the source ColorSpacesrc
- the source Color componentsdst
- if not null, should be updated with the target Color componentsfill
- true if the Color will be used for filling, false if for strokingtype
- the type of ColorSpace, which will be a bitmask possibly including one or more of #TYPE_PROCESS, #TYPE_CALIBRATED or #TYPE_SEPARATIONnull
for no change.Copyright © 2001-2017 Big Faceless Organization