Class PDFDeviceCMYK

  • All Implemented Interfaces:
    java.io.Serializable

    public class PDFDeviceCMYK
    extends java.awt.color.ColorSpace
    This is an implementation of the DeviceCMYK colorspace as defined in the pdf spec. Note that there is a CMYK colorspace profile available from Sun in the JAICMM package, but there are several problems with it. First and foremost, it doesn't generate colors that are consistent with Acrobat. Secondly, it is enormous, at 1/2 meg.

    The cmyk->rgb conversion is trivial. rgb->cmyk, however, can be arbitrarily complex as custom black-generation and undercolor-removal functions can be specified in the graphics state.

    The spec defines the rgb->cmyk conversion like this : UCR(x) = undercolor-removal function BG(x) = black-generation function k = min(1-red, 1-green, 1-blue) cyan = min(1, max(0, 1-red-UCR(k))) magenta = min(1, max(0, 1-green-UCR(k))) yellow = min(1, max(0, 1-blue-UCR(k))) black = min(1, max(0, BG(k)))

    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.awt.color.ColorSpace

        CS_CIEXYZ, CS_GRAY, CS_LINEAR_RGB, CS_PYCC, CS_sRGB, TYPE_2CLR, TYPE_3CLR, TYPE_4CLR, TYPE_5CLR, TYPE_6CLR, TYPE_7CLR, TYPE_8CLR, TYPE_9CLR, TYPE_ACLR, TYPE_BCLR, TYPE_CCLR, TYPE_CMY, TYPE_CMYK, TYPE_DCLR, TYPE_ECLR, TYPE_FCLR, TYPE_GRAY, TYPE_HLS, TYPE_HSV, TYPE_Lab, TYPE_Luv, TYPE_RGB, TYPE_XYZ, TYPE_YCbCr, TYPE_Yxy
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float[] fromCIEXYZ​(float[] colorvalue)  
      float[] fromRGB​(float[] rgbvalue)  
      float[] toCIEXYZ​(float[] colorvalue)  
      float[] toRGB​(float[] colorvalue)  
      • Methods inherited from class java.awt.color.ColorSpace

        getInstance, getMaxValue, getMinValue, getName, getNumComponents, getType, isCS_sRGB
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PDFDeviceCMYK

        public PDFDeviceCMYK()
      • PDFDeviceCMYK

        public PDFDeviceCMYK​(int type,
                             int numcomponents)
    • Method Detail

      • toRGB

        public float[] toRGB​(float[] colorvalue)
        Specified by:
        toRGB in class java.awt.color.ColorSpace
      • fromRGB

        public float[] fromRGB​(float[] rgbvalue)
        Specified by:
        fromRGB in class java.awt.color.ColorSpace
      • toCIEXYZ

        public float[] toCIEXYZ​(float[] colorvalue)
        Specified by:
        toCIEXYZ in class java.awt.color.ColorSpace
      • fromCIEXYZ

        public float[] fromCIEXYZ​(float[] colorvalue)
        Specified by:
        fromCIEXYZ in class java.awt.color.ColorSpace