org.faceless.pdf2

## Interface OutputProfiler.ColorAction

- All Known Implementing Classes:
    OutputProfiler.ProcessColorAction
  Enclosing class:
    OutputProfiler

      public static interface OutputProfiler.ColorAction

  An action that can be `set` on an OutputProfiler to replace Colors.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `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_PROCESS` If this bit is set, the color is a process ColorSpace - either RGB, CMYK or Grayscale.
    `static int` | `TYPE_SEPARATION` If this bit is set, the color is a separation ColorSpace - a `DeviceN` or `Spot` color.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    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.

- - ### 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 with `type & (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 - a `DeviceN` or `Spot` color. Test with `type & (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 with `type & (1<<TYPE_PROCESS)`
      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`.

      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).

      Parameters:
        `profiler` - the OutputProfiler this action is being run on
        `cs` - the source ColorSpace
        `src` - the source Color components
        `dst` - if not null, should be updated with the target Color components
        `fill` - true if the Color will be used for filling, false if for stroking
        `type` - the type of ColorSpace, which will be a bitmask possibly including one or more of #TYPE_PROCESS, #TYPE_CALIBRATED or #TYPE_SEPARATION
      Returns:
        the target ColorSpace or `null` for no change.

Copyright © 2001-2015 Big Faceless Organization