Class DeviceNColorSpace

    • Method Detail

      • getName

        public String getName​(int comp)
        Returns the name of the specified component
        Overrides:
        getName in class ColorSpace
        Parameters:
        comp - the component index
        Returns:
        the name of the component at the specified index
        Since:
        2.11.26
      • getNumComponents

        public int getNumComponents()
        Returns the number of components of this ColorSpace.
        Overrides:
        getNumComponents in class ColorSpace
        Returns:
        the number of components in this ColorSpace
      • getFallbackColorSpace

        public ColorSpace getFallbackColorSpace()
        Get the ColorSpace which defines the "fallback" color, which must be a process ColorSpace (i.e. RGB, CMYK etc)
      • getComponentColorSpace

        public SpotColorSpace getComponentColorSpace​(int comp)
        Get the Component ColorSpace for an individual spot color in the ColorSpace, or null if this color is a process color
        Parameters:
        comp - the component index
        Since:
        2.24.3
      • isAdditive

        public boolean isAdditive()
        Return true if this ColorSpace is additive (like RGB), as opposed to subtractive (like CMYK). DeviceN spaces are intended for print so will almost always be subtractive, but its possible to subvert this.
      • getColor

        public Color getColor​(float[] comps,
                              float alpha)
      • toFallback

        public float[] toFallback​(float[] input)
        Convert the color components in this color to the components in the fallback ColorSpace
        Parameters:
        input - the array of components in this ColorSpace
        Returns:
        the array of components in the fallback ColorSpace
      • toRGB

        public float[] toRGB​(float[] colorvalue)

        Transforms a color value assumed to be in this ColorSpace into a value in the default CS_sRGB color space. Calls toRGB on the fallback colorspace.

        Specified by:
        toRGB in class ColorSpace
        Parameters:
        colorvalue - a float array with length of at least the number of components in this ColorSpace
        Returns:
        a float array of length 3
      • toCIEXYZ

        public float[] toCIEXYZ​(float[] colorvalue)

        Transforms a color value assumed to be in this ColorSpace into the CIEXYZ values. Calls toCIEXYZ on the fallback colorspace.

        Specified by:
        toCIEXYZ in class ColorSpace
        Parameters:
        colorvalue - a float array with length of at least the number of components in this ColorSpace
        Returns:
        a float array of length 3
      • fromRGB

        public float[] fromRGB​(float[] rgb)

        Theoretically transforms a color value assumed to be in the sRGB ColorSpace into values in this ColorSpace. In practice this can't easily be done and isn't useful, so throws an UnsupportedOperationException.

        Specified by:
        fromRGB in class ColorSpace
        Parameters:
        rgb - a float array with length of at least 3
      • fromCIEXYZ

        public float[] fromCIEXYZ​(float[] xyz)

        Theoretically transforms a color value assumed to be in the XYZ ColorSpace into values in this ColorSpace. In practice this can't easily be done and isn't useful, so throws an UnsupportedOperationException.

        Specified by:
        fromCIEXYZ in class ColorSpace
        Parameters:
        xyz - a float array with length of at least 3
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • remap

        public DeviceNColorSpace remap​(ColorSpace newfallback)
        Attempt to convert this DeviceNColorSpace to an equavalent one, but with a different fallback ColorSpace. The equivalent space will be as close as possible to the original, but may not be identical, as colors may be out of gamut. For some DeviceN spaces this process may not be possible - spaces are remapped with a lookup table function requiring mn samples where n is the number of inks
        Since:
        2.17.1