Class PDLab

  • All Implemented Interfaces:
    COSObjectable

    public final class PDLab
    extends PDCIEDictionaryBasedColorSpace
    A Lab colour space is a CIE-based ABC colour space with two transformation stages.
    Author:
    Ben Litchfield, John Hewson
    • Constructor Detail

      • PDLab

        public PDLab()
        Creates a new Lab color space.
      • PDLab

        public PDLab​(COSArray lab)
        Creates a new Lab color space from a PDF array.
        Parameters:
        lab - the color space array
    • Method Detail

      • getName

        public java.lang.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
      • toRGBImage

        public java.awt.image.BufferedImage toRGBImage​(java.awt.image.WritableRaster raster)
                                                throws java.io.IOException
        Description copied from class: PDColorSpace
        Returns the (A)RGB equivalent of the given raster.
        Overrides:
        toRGBImage in class PDCIEBasedColorSpace
        Parameters:
        raster - the source raster
        Returns:
        an (A)RGB buffered image
        Throws:
        java.io.IOException - if the color conversion fails
      • toRGB

        public float[] toRGB​(float[] value)
        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
      • 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
      • getARange

        public PDRange getARange()
        This will get the valid range for the "a" component. If none is found then the default will be returned, which is -100..100.
        Returns:
        the "a" range.
      • getBRange

        public PDRange getBRange()
        This will get the valid range for the "b" component. If none is found then the default will be returned, which is -100..100.
        Returns:
        the "b" range.
      • setARange

        public void setARange​(PDRange range)
        This will set the a range for the "a" component.
        Parameters:
        range - the new range for the "a" component, or null if defaults (-100..100) are to be set.
      • setBRange

        public void setBRange​(PDRange range)
        This will set the "b" range for this color space.
        Parameters:
        range - the new range for the "b" component, or null if defaults (-100..100) are to be set.