org.foray.common
Class ColorSpaceCMYK

java.lang.Object
  extended by java.awt.color.ColorSpace
      extended by org.foray.common.ColorSpaceCMYK
All Implemented Interfaces:
Serializable

public final class ColorSpaceCMYK
extends ColorSpace

A ColorSpace implementation for CMYK.

See Also:
Serialized Form

Field Summary
protected static float BLACK_FACTOR
          A magic number used in the conversion of CMYK to RGB.
static byte CYAN_COMPONENT_INDEX
          Constant indicating the index for the cyan component of the image.
static byte KEY_COMPONENT_INDEX
          Constant indicating the index for the key (black) component of the image.
static byte MAGENTA_COMPONENT_INDEX
          Constant indicating the index for the magenta component of the image.
protected static int MINIMUM_RGB_COMPONENTS
          Constant indicating the minimum number of channels in an RGB color.
static byte QTY_CMYK_COMPONENTS
          Constant indicating the number of channels in a CMYK image, that is, 4.
static byte YELLOW_COMPONENT_INDEX
          Constant indicating the index for the yellow component of the image.
 
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
 float[] fromCIEXYZ(float[] colorvalue)
           
 float[] fromRGB(float[] rgbvalue)
           
static Color makeColor(float cyan, float magenta, float yellow, float black)
          Factory method that creates a Color instance for a given set of inputs.
static ColorSpaceCMYK theInstance()
          Returns the singleton instance of this class.
 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
 

Field Detail

QTY_CMYK_COMPONENTS

public static final byte QTY_CMYK_COMPONENTS
Constant indicating the number of channels in a CMYK image, that is, 4.

See Also:
Constant Field Values

CYAN_COMPONENT_INDEX

public static final byte CYAN_COMPONENT_INDEX
Constant indicating the index for the cyan component of the image.

See Also:
Constant Field Values

MAGENTA_COMPONENT_INDEX

public static final byte MAGENTA_COMPONENT_INDEX
Constant indicating the index for the magenta component of the image.

See Also:
Constant Field Values

YELLOW_COMPONENT_INDEX

public static final byte YELLOW_COMPONENT_INDEX
Constant indicating the index for the yellow component of the image.

See Also:
Constant Field Values

KEY_COMPONENT_INDEX

public static final byte KEY_COMPONENT_INDEX
Constant indicating the index for the key (black) component of the image.

See Also:
Constant Field Values

BLACK_FACTOR

protected static final float BLACK_FACTOR
A magic number used in the conversion of CMYK to RGB. We do not know the origin of the value.

See Also:
Constant Field Values

MINIMUM_RGB_COMPONENTS

protected static final int MINIMUM_RGB_COMPONENTS
Constant indicating the minimum number of channels in an RGB color.

See Also:
Constant Field Values
Method Detail

toRGB

public float[] toRGB(float[] colorvalue)
Specified by:
toRGB in class ColorSpace

fromRGB

public float[] fromRGB(float[] rgbvalue)
Specified by:
fromRGB in class ColorSpace

toCIEXYZ

public float[] toCIEXYZ(float[] colorvalue)
Specified by:
toCIEXYZ in class ColorSpace

fromCIEXYZ

public float[] fromCIEXYZ(float[] colorvalue)
Specified by:
fromCIEXYZ in class ColorSpace

theInstance

public static ColorSpaceCMYK theInstance()
Returns the singleton instance of this class.

Returns:
The singleton instance of this class.

makeColor

public static Color makeColor(float cyan,
                              float magenta,
                              float yellow,
                              float black)
Factory method that creates a Color instance for a given set of inputs.

Parameters:
cyan - The cyan component of the color.
magenta - The magenta component of the color.
yellow - The yellow component of the color.
black - The black component of the color.
Returns:
The CMYK color.


Copyright © 2017. All rights reserved.