Packages

 

com.aspose.imaging

Interfaces

Classes

com.aspose.imaging

Class CmykColorHelper



  • public final class CmykColorHelper
    extends Object

    Helper methods to work with CMYK color presented as a signed 32-bit integer value. Provides the similar API as the com.aspose.imaging.CmykColor struct. It's more lightweight because CMYK color is presented just as Int32 rather than structure with internal fields. Please prefer to use static methods of this class when possible instead of the deprecated com.aspose.imaging.CmykColor struct.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static int fromComponents(int cyan, int magenta, int yellow, int black)
      Creates CMYK from a 32-bit cyan, magenta, yellow and black values.
      static int getC(int cmyk)
      Gets the cyan component value.
      static int getK(int cmyk)
      Gets the black component value.
      static int getM(int cmyk)
      Gets the magenta component value.
      static int getY(int cmyk)
      Gets the yellow component value.
      static Color toArgb(int cmykPixel)
      The conversion from CMYK color to ARGB color.
      static Color[] toArgb(int[] cmykPixels)
      The conversion from CMYK colors to ARGB colors.
      static int[] toArgb32(int[] cmykPixels)
      The conversion from CMYK colors to ARGB colors.
      static Color toArgbIcc(int cmykPixel)
      The conversion from CMYK color to ARGB Color using Icc conversion with default profiles.
      static Color[] toArgbIcc(int[] cmykPixels)
      The conversion from CMYK colors to ARGB colors using Icc conversion with default profiles.
      static Color[] toArgbIcc(int[] cmykPixels, InputStream cmykIccStream, InputStream rgbIccStream)
      The conversion from CMYK colors to ARGB colors using Icc conversion with custom profiles.
      static Color toArgbIcc(int cmykPixel, InputStream cmykIccStream, InputStream rgbIccStream)
      The conversion from CMYK color to ARGB color using Icc conversion with custom profile.
      static int toCmyk(Color pixel)
      The conversion from ARGB color to CMYK color.
      static int[] toCmyk(Color[] pixels)
      The conversion from ARGB colors to CMYK colors.
      static int toCmyk(int argbPixel)
      The conversion from ARGB color to CMYK color.
      static int[] toCmyk(int[] argbPixels)
      The conversion from ARGB colors to CMYK colors.
      static byte[] toCmykBytes(int[] argbPixels, int startIndex, int length)
      Converts RGB to CMYK.
      static int toCmykIcc(Color pixel)
      The conversion from ARGB color to CMYK color using Icc conversion with default profiles.
      static int[] toCmykIcc(Color[] pixels)
      The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.
      static int[] toCmykIcc(Color[] pixels, InputStream rgbIccStream, InputStream cmykIccStream)
      The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.
      static int toCmykIcc(Color pixel, InputStream rgbIccStream, InputStream cmykIccStream)
      The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.
      static byte[] toCmykIccBytes(int[] pixels, int startIndex, int length, InputStream rgbIccStream, InputStream cmykIccStream)
      Converts RGB to CMYK using custom ICC profiles.
    • Method Detail

      • getC

        public static int getC(int cmyk)

        Gets the cyan component value.

        Parameters:
        cmyk - The CMYK color presented as a 32-bit integer value.
        Returns:
        The cyan component value.
      • getM

        public static int getM(int cmyk)

        Gets the magenta component value.

        Parameters:
        cmyk - The CMYK color presented as a 32-bit integer value.
        Returns:
        The magenta component value.
      • getY

        public static int getY(int cmyk)

        Gets the yellow component value.

        Parameters:
        cmyk - The CMYK color presented as a 32-bit integer value.
        Returns:
        The yellow component value.
      • getK

        public static int getK(int cmyk)

        Gets the black component value.

        Parameters:
        cmyk - The CMYK color presented as a 32-bit integer value.
        Returns:
        The black component value.
      • fromComponents

        public static int fromComponents(int cyan,
                                         int magenta,
                                         int yellow,
                                         int black)

        Creates CMYK from a 32-bit cyan, magenta, yellow and black values.

        Parameters:
        cyan - The cyan component. Valid values are 0 through 255.
        magenta - The magenta component. Valid values are 0 through 255.
        yellow - The yellow component. Valid values are 0 through 255.
        black - The black component. Valid values are 0 through 255.
        Returns:
        The CMYK color presented as a 32-bit integer value.
      • toCmyk

        public static int[] toCmyk(int[] argbPixels)

        The conversion from ARGB colors to CMYK colors.

        Parameters:
        argbPixels - The ARGB colors presented as 32-bit integer values.
        Returns:
        The CMYK colors presented as 32-bit integer values.
      • toCmykBytes

        public static byte[] toCmykBytes(int[] argbPixels,
                                         int startIndex,
                                         int length)

        Converts RGB to CMYK.

        Parameters:
        argbPixels - The RGB colors presented as 32-bit integer values.
        startIndex - The start index of RGB color.
        length - The number of RGB pixels to convert.
        Returns:
        The CMYK colors presented as a byte array.
      • toCmyk

        public static int toCmyk(int argbPixel)

        The conversion from ARGB color to CMYK color.

        Parameters:
        argbPixel - The ARGB color presented as a 32-bit integer value.
        Returns:
        The CMYK color presented as a 32-bit integer value.
      • toCmyk

        public static int toCmyk(Color pixel)

        The conversion from ARGB color to CMYK color.

        Parameters:
        pixel - The ARGB color.
        Returns:
        The CMYK color presented as a 32-bit integer value.
      • toCmyk

        public static int[] toCmyk(Color[] pixels)

        The conversion from ARGB colors to CMYK colors.

        Parameters:
        pixels - The ARGB colors.
        Returns:
        The CMYK colors presented as 32-bit integer values.
      • toArgb

        public static Color[] toArgb(int[] cmykPixels)

        The conversion from CMYK colors to ARGB colors.

        Parameters:
        cmykPixels - The CMYK colors presented as 32-bit integer values.
        Returns:
        The ARGB colors.
      • toArgb

        public static Color toArgb(int cmykPixel)

        The conversion from CMYK color to ARGB color.

        Parameters:
        cmykPixel - The CMYK color presented as a 32-bit integer value.
        Returns:
        The ARGB color.
      • toArgb32

        public static int[] toArgb32(int[] cmykPixels)

        The conversion from CMYK colors to ARGB colors.

        Parameters:
        cmykPixels - The CMYK colors presented as 32-bit integer values.
        Returns:
        The ARGB colors presented as 32-bit integer values.
      • toArgbIcc

        public static Color[] toArgbIcc(int[] cmykPixels)

        The conversion from CMYK colors to ARGB colors using Icc conversion with default profiles.

        Parameters:
        cmykPixels - The CMYK pixels presented as 32-bit integer values.
        Returns:
        The ARGB colors.
      • toArgbIcc

        public static Color[] toArgbIcc(int[] cmykPixels,
                                        InputStream cmykIccStream,
                                        InputStream rgbIccStream)

        The conversion from CMYK colors to ARGB colors using Icc conversion with custom profiles.

        Parameters:
        cmykPixels - The CMYK colors presented as 32-bit integer values.
        cmykIccStream - The stream containing CMYK Icc profile.
        rgbIccStream - The stream containing RGB Icc profile.
        Returns:
        The ARGB colors.
      • toArgbIcc

        public static Color toArgbIcc(int cmykPixel)

        The conversion from CMYK color to ARGB Color using Icc conversion with default profiles.

        Parameters:
        cmykPixel - The CMYK color presented as a 32-bit integer value.
        Returns:
        The ARGB color.
      • toArgbIcc

        public static Color toArgbIcc(int cmykPixel,
                                      InputStream cmykIccStream,
                                      InputStream rgbIccStream)

        The conversion from CMYK color to ARGB color using Icc conversion with custom profile.

        Parameters:
        cmykPixel - The CMYK color presented as a 32-bit integer value.
        cmykIccStream - The stream containing CMYK Icc profile.
        rgbIccStream - The stream containing RGB Icc profile.
        Returns:
        The ARGB color.
      • toCmykIcc

        public static int[] toCmykIcc(Color[] pixels,
                                      InputStream rgbIccStream,
                                      InputStream cmykIccStream)

        The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles.

        Parameters:
        pixels - The ARGB colors.
        rgbIccStream - The stream containing RGB Icc profile.
        cmykIccStream - The stream containing CMYK Icc profile.
        Returns:
        The CMYK colors presented as 32-bit integer values.
      • toCmykIccBytes

        public static byte[] toCmykIccBytes(int[] pixels,
                                            int startIndex,
                                            int length,
                                            InputStream rgbIccStream,
                                            InputStream cmykIccStream)

        Converts RGB to CMYK using custom ICC profiles.

        Parameters:
        pixels - The RGB colors presented as 32-bit integer values.
        startIndex - The start index of RGB color.
        length - The number of RGB pixels to convert.
        rgbIccStream - The RGB profile stream.
        cmykIccStream - The CMYK profile stream.
        Returns:
        The CMYK colors presented as a byte array.
      • toCmykIcc

        public static int[] toCmykIcc(Color[] pixels)

        The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles.

        Parameters:
        pixels - The ARGB colors.
        Returns:
        The CMYK colors presented as 32-bit integer values.
      • toCmykIcc

        public static int toCmykIcc(Color pixel)

        The conversion from ARGB color to CMYK color using Icc conversion with default profiles.

        Parameters:
        pixel - The ARGB color.
        Returns:
        The CMYK color presented as a 32-bit integer value.
      • toCmykIcc

        public static int toCmykIcc(Color pixel,
                                    InputStream rgbIccStream,
                                    InputStream cmykIccStream)

        The conversion from ARGB color to CMYK color using Icc conversion with custom profiles.

        Parameters:
        pixel - The ARGB color.
        rgbIccStream - The stream containing RGB Icc profile.
        cmykIccStream - The stream containing CMYK Icc profile.
        Returns:
        The CMYK color presented as a 32-bit integer value.