Class PDSeparation

All Implemented Interfaces:
COSObjectable

public class PDSeparation extends PDSpecialColorSpace
A Separation color space used to specify either additional colorants or for isolating the control of individual colour components of a device colour space for a subtractive device. When such a space is the current colour space, the current colour shall be a single-component value, called a tint, that controls the given colorant or colour components only.
Author:
Ben Litchfield, John Hewson
  • Constructor Details

    • PDSeparation

      public PDSeparation()
      Creates a new Separation color space.
    • PDSeparation

      public PDSeparation(COSArray separation) throws IOException
      Creates a new Separation color space from a PDF color space array.
      Parameters:
      separation - an array containing all separation information.
      Throws:
      IOException - if the color space or the function could not be created.
  • Method Details

    • getName

      public String getName()
      Description copied from class: PDColorSpace
      Returns the name of the color space.
      Specified by:
      getName in class PDColorSpace
      Returns:
      the name of the color space
    • getNumberOfComponents

      public int getNumberOfComponents()
      Description copied from class: PDColorSpace
      Returns the number of components in this color space
      Specified by:
      getNumberOfComponents in class PDColorSpace
      Returns:
      the number of components in this color space
    • getDefaultDecode

      public float[] getDefaultDecode(int bitsPerComponent)
      Description copied from class: PDColorSpace
      Returns the default decode array for this color space.
      Specified by:
      getDefaultDecode in class PDColorSpace
      Parameters:
      bitsPerComponent - the number of bits per component.
      Returns:
      the default decode array
    • getInitialColor

      public PDColor getInitialColor()
      Description copied from class: PDColorSpace
      Returns the initial color value for this color space.
      Specified by:
      getInitialColor in class PDColorSpace
      Returns:
      the initial color value for this color space
    • toRGB

      public float[] toRGB(float[] value) throws IOException
      Description copied from class: PDColorSpace
      Returns the RGB equivalent of the given color value.
      Specified by:
      toRGB in class PDColorSpace
      Parameters:
      value - a color value with component values between 0 and 1
      Returns:
      an array of R,G,B value between 0 and 255
      Throws:
      IOException - if the color conversion fails
    • toRGBImage

      public BufferedImage toRGBImage(WritableRaster raster) throws IOException
      Description copied from class: PDColorSpace
      Returns the (A)RGB equivalent of the given raster.
      Specified by:
      toRGBImage in class PDColorSpace
      Parameters:
      raster - the source raster
      Returns:
      an (A)RGB buffered image
      Throws:
      IOException - if the color conversion fails
    • tintTransform

      protected void tintTransform(float[] samples, int[] alt) throws IOException
      Throws:
      IOException
    • toRawImage

      public BufferedImage toRawImage(WritableRaster raster)
      Description copied from class: PDColorSpace
      Returns the image in this colorspace or null. No conversion is performed. For special colorspaces like PDSeparation the image is returned in the gray colorspace. For undefined colorspaces like DeviceCMYK/DeviceRGB and DeviceGray null is returned. You can always fallback to PDColorSpace.toRGBImage(WritableRaster) if this returns null.
      Specified by:
      toRawImage in class PDColorSpace
      Parameters:
      raster - the source raster
      Returns:
      an buffered image in this colorspace. Or null if it is not possible to extract that image with the original colorspace without conversion.
    • getAlternateColorSpace

      public PDColorSpace getAlternateColorSpace()
      Returns the colorant name.
      Returns:
      the name of the colorant
    • getColorantName

      public String getColorantName()
      Returns the colorant name.
      Returns:
      the name of the colorant
    • setColorantName

      public void setColorantName(String name)
      Sets the colorant name.
      Parameters:
      name - the name of the colorant
    • setAlternateColorSpace

      public void setAlternateColorSpace(PDColorSpace colorSpace)
      Sets the alternate color space.
      Parameters:
      colorSpace - The alternate color space.
    • setTintTransform

      public void setTintTransform(PDFunction tint)
      Sets the tint transform function.
      Parameters:
      tint - the tint transform function
    • toString

      public String toString()
      Overrides:
      toString in class Object