Interface OutputProfiler.ColorAction
-
- All Known Implementing Classes:
OutputProfiler.ProcessColorAction
- Enclosing class:
- OutputProfiler
public static interface OutputProfiler.ColorAction
An action that can beset
on an OutputProfiler to replace Colors. Note some methods were added to this interface in 2.26
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE_ANNOTATION
If this bit is set, the color being converted is in an annotation rather than on the page directlystatic int
TYPE_BITMAP
If this bit is set, the color being converted is part of a bitmap image Test withtype & (1<<TYPE_SHADING)
static int
TYPE_CALIBRATED
If this bit is set, the ColorSpace is considered to be device-independent, either directly (if a process ColorSpace) or indirectly (if a separation ColorSpace that references a device-indepdendent ColorSpace).static int
TYPE_INDEXED
If this bit is set, the color being converted is in an indexed color-space built on the supplied color-spacestatic int
TYPE_INLINE
static int
TYPE_PROCESS
If this bit is set, the color is a process ColorSpace - either RGB, CMYK or Grayscale.static int
TYPE_SEPARATION
static int
TYPE_SHADING
If this bit is set, the color being converted is part of a shading pattern Test withtype & (1<<TYPE_SHADING)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ColorSpace
changeColor(OutputProfiler profiler, ColorSpace cs, float[] src, float[] dst, boolean fill, int type)
Optionally converts a Color from one ColorSpace to another.ColorSpace
getDefaultBlendingColorSpace()
Return the ColorSpace that should be used for blending operations, or null if unknownColorSpace
getDeviceCMYK()
Return the CMYK ColorSpace that should be used as the "DeviceCMYK" space, or null if none is set.ColorSpace
getDeviceGray()
Return the Gray ColorSpace that should be used as the "DeviceGray" space, or null if none is set.ColorSpace
getDeviceRGB()
Return the RGB ColorSpace that should be used as the "DeviceRGB" space, or null if none is set.ColorSpace
getUsedIntentColorSpace()
Return the ColorSpace that's considered to be the ColorSpace of theOutputIntent
.
-
-
-
Field Detail
-
TYPE_CALIBRATED
static final int TYPE_CALIBRATED
If this bit is set, the ColorSpace is considered to be device-independent, either directly (if a process ColorSpace) or indirectly (if a separation ColorSpace that references a device-indepdendent ColorSpace). Colors of this type do not normally need conversion to be acceptable in PDF/A or PDF/X Test withtype & (1<<TYPE_CALIBRATED)
- See Also:
- Constant Field Values
-
TYPE_SEPARATION
static final int TYPE_SEPARATION
If this bit is set, the color is a separation ColorSpace - aDeviceN
orSpot
color. Test withtype & (1<<TYPE_SEPARATION)
- See Also:
- Constant Field Values
-
TYPE_PROCESS
static final int TYPE_PROCESS
If this bit is set, the color is a process ColorSpace - either RGB, CMYK or Grayscale. Test withtype & (1<<TYPE_PROCESS)
- See Also:
- Constant Field Values
-
TYPE_SHADING
static final int TYPE_SHADING
If this bit is set, the color being converted is part of a shading pattern Test withtype & (1<<TYPE_SHADING)
- Since:
- 2.24.2
- See Also:
- Constant Field Values
-
TYPE_BITMAP
static final int TYPE_BITMAP
If this bit is set, the color being converted is part of a bitmap image Test withtype & (1<<TYPE_SHADING)
- Since:
- 2.24.2
- See Also:
- Constant Field Values
-
TYPE_ANNOTATION
static final int TYPE_ANNOTATION
If this bit is set, the color being converted is in an annotation rather than on the page directly- See Also:
- Constant Field Values
-
TYPE_INLINE
static final int TYPE_INLINE
- See Also:
- Constant Field Values
-
TYPE_INDEXED
static final int TYPE_INDEXED
If this bit is set, the color being converted is in an indexed color-space built on the supplied color-space- Since:
- 2.28.4
- See Also:
- Constant Field Values
-
-
Method Detail
-
changeColor
ColorSpace changeColor(OutputProfiler profiler, ColorSpace cs, float[] src, float[] dst, boolean fill, int type)
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
. If "dst" is not null and this method returns null, subsequent calls to changeColor will be skipped. This optimization can be used when the ColorSpace of an image has been changed, but the components remain identical.This method must be consistent and return the same output for the same input parameters. It must also be quick, as it may be called millions of times during preflighting (as it must be called once for each pixel).
- Parameters:
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, #TYPE_SEPARATION, #TYPE_SHADING or #TYPE_BITMAP- Returns:
- the target ColorSpace or
null
for no change.
-
getDeviceRGB
ColorSpace getDeviceRGB()
Return the RGB ColorSpace that should be used as the "DeviceRGB" space, or null if none is set.- Since:
- 2.26
-
getDeviceCMYK
ColorSpace getDeviceCMYK()
Return the CMYK ColorSpace that should be used as the "DeviceCMYK" space, or null if none is set.- Since:
- 2.26
-
getDeviceGray
ColorSpace getDeviceGray()
Return the Gray ColorSpace that should be used as the "DeviceGray" space, or null if none is set.- Since:
- 2.26
-
getDefaultBlendingColorSpace
ColorSpace getDefaultBlendingColorSpace()
Return the ColorSpace that should be used for blending operations, or null if unknown- Since:
- 2.26
-
getUsedIntentColorSpace
ColorSpace getUsedIntentColorSpace()
Return the ColorSpace that's considered to be the ColorSpace of theOutputIntent
. This is typically the first ColorSpace from any OutputIntents on the OutputProfile supplied to the constructor. Returns null if none is set- Since:
- 2.26
-
-