CmykColorHelper

Inheritance: java.lang.Object

public final class CmykColorHelper

Hilfsmethoden zur Arbeit mit CMYK-Farben, die als vorzeichenbehafteter 32‑Bit‑Integerwert dargestellt werden. Bietet eine ähnliche API wie die Struktur CmykColor. Sie ist leichter, weil die CMYK‑Farbe nur als Int32 und nicht als Struktur mit internen Feldern dargestellt wird. Bitte verwenden Sie nach Möglichkeit die statischen Methoden dieser Klasse anstelle der veralteten Struktur CmykColor.

Methoden

MethodeBeschreibung
getC(int cmyk)Gibt den Cyan‑Komponentenwert zurück.
getM(int cmyk)Gibt den Magenta‑Komponentenwert zurück.
getY(int cmyk)Gibt den Gelb‑Komponentenwert zurück.
getK(int cmyk)Gibt den Schwarz‑Komponentenwert zurück.
fromComponents(int cyan, int magenta, int yellow, int black)Erstellt CMYK aus 32‑Bit‑Cyan-, Magenta-, Gelb- und Schwarzwerten.
toCmyk(int[] argbPixels)Die Umwandlung von ARGB-Farben zu CMYK-Farben.
toCmykBytes(int[] argbPixels, int startIndex, int length)Konvertiert ARGB zu CMYK.
toCmykaBytes(int[] argbPixels, int startIndex, int length)Konvertiert ARGB zu CMYKA (mit Transparenz).
toCmyk(int argbPixel)Die Umwandlung von ARGB-Farbe zu CMYK-Farbe.
toCmyk(Color pixel)Die Umwandlung von ARGB-Farbe zu CMYK-Farbe.
toCmyk(Color[] pixels)Die Umwandlung von ARGB-Farben zu CMYK-Farben.
toArgb(int[] cmykPixels)Die Umwandlung von CMYK-Farben zu ARGB-Farben.
toArgb(int cmykPixel)Die Umwandlung von CMYK-Farbe zu ARGB-Farbe.
toArgb32(int[] cmykPixels)Die Umwandlung von CMYK-Farben zu ARGB-Farben.
toArgb32(int[] cmykPixels, boolean reuseArray)Führt die Umwandlung von CMYK-Farben zu ARGB-Farben durch und speichert sie im selben Array, wenn reuseArray wahr ist.
toArgbIcc(int[] cmykPixels)Die Umwandlung von CMYK-Farben zu ARGB-Farben mittels Icc-Konvertierung mit Standardprofilen.
toArgbIcc(int[] cmykPixels, InputStream cmykIccStream, InputStream rgbIccStream)Die Umwandlung von CMYK-Farben zu ARGB-Farben mittels Icc-Konvertierung mit benutzerdefinierten Profilen.
toArgbIcc(int cmykPixel)Die Umwandlung von CMYK-Farbe zu ARGB-Farbe mittels Icc-Konvertierung mit Standardprofilen.
toArgbIcc(int cmykPixel, InputStream cmykIccStream, InputStream rgbIccStream)Die Umwandlung von CMYK-Farbe zu ARGB-Farbe mittels Icc-Konvertierung mit benutzerdefiniertem Profil.
toCmykIcc(Color[] pixels, InputStream rgbIccStream, InputStream cmykIccStream)Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit benutzerdefinierten Profilen.
toCmykIcc(int[] pixels, InputStream rgbIccStream, InputStream cmykIccStream)Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit benutzerdefinierten Profilen.
toCmykIccBytes(int[] pixels, int startIndex, int length, InputStream rgbIccStream, InputStream cmykIccStream)Konvertiert RGB zu CMYK mit benutzerdefinierten ICC-Profilen.
toCmykIccBytes(int[] pixels, int startIndex, int length, byte[] cmykBytes, int cmykOffset, InputStream rgbIccStream, InputStream cmykIccStream)Konvertiert RGB zu CMYK mit benutzerdefinierten ICC-Profilen.
toCmykaIccBytes(int[] pixels, int startIndex, int length, byte[] cmykBytes, int cmykOffset, InputStream rgbIccStream, InputStream cmykIccStream)Konvertiert RGB zu CMYKA (mit Alpha) mit benutzerdefinierten ICC-Profilen.
toPsdCmykIcc(int[] pixels, InputStream rgbIccStream, InputStream cmykIccStream)Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit benutzerdefinierten Profilen.
toCmykaIccBytes(int[] pixels, int startIndex, int length, InputStream rgbIccStream, InputStream cmykIccStream)Konvertiert RGB zu CMYKA (mit Alpha) mit benutzerdefinierten ICC-Profilen.
toCmykIcc(Color[] pixels)Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit Standardprofilen.
toCmykIcc(int[] pixels)Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit Standardprofilen.
toPsdCmykIcc(int[] pixels)Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit Standardprofilen.
toCmykIcc(Color pixel)Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit Standardprofilen.
toCmykIcc(int argb)Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit Standardprofilen.
toPsdCmykIcc(int argb)Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit Standardprofilen.
toCmykIcc(Color pixel, InputStream rgbIccStream, InputStream cmykIccStream)Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit benutzerdefinierten Profilen.
toCmykIcc(int argb, InputStream rgbIccStream, InputStream cmykIccStream)Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit benutzerdefinierten Profilen.
toPsdCmykIcc(int pixel, InputStream rgbIccStream, InputStream cmykIccStream)Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit benutzerdefinierten Profilen.

getC(int cmyk)

public static int getC(int cmyk)

Gibt den Cyan‑Komponentenwert zurück.

Parameters:

ParameterTypBeschreibung
cmykintDie CMYK-Farbe dargestellt als 32‑Bit‑Ganzzahlwert.

Returns: int – Der Cyan‑Komponentenwert.

Example: The following example shows how to convert RGB colors to their CMYK counterparts without applying ICC profiles.

com.aspose.imaging.Color[] rgbColors = new com.aspose.imaging.Color[]
        {
                com.aspose.imaging.Color.getRed(),
                com.aspose.imaging.Color.getGreen(),
                com.aspose.imaging.Color.getBlue(),
        };

System.out.println("Convert RGB to CMYK without using ICC profiles.");
for (com.aspose.imaging.Color rgbColor : rgbColors) {
    int cmyk = com.aspose.imaging.CmykColorHelper.toCmyk(rgbColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

    System.out.printf("RGB(@%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere RGB zu CMYK ohne ICC-Profile zu verwenden.
//RGB(255,0,0)        => CMYK(0,255,255,0)
//RGB(0,128,0)        => CMYK(255,0,255,127)
//RGB(0,0,255)        => CMYK(255,255,0,0)

getM(int cmyk)

public static int getM(int cmyk)

Gibt den Magenta‑Komponentenwert zurück.

Parameters:

ParameterTypBeschreibung
cmykintDie CMYK-Farbe dargestellt als 32‑Bit‑Ganzzahlwert.

Returns: int - Der Magenta‑Komponentenwert.

Example: The following example shows how to convert RGB colors to their CMYK counterparts without applying ICC profiles.

com.aspose.imaging.Color[] rgbColors = new com.aspose.imaging.Color[]
        {
                com.aspose.imaging.Color.getRed(),
                com.aspose.imaging.Color.getGreen(),
                com.aspose.imaging.Color.getBlue(),
        };

System.out.println("Convert RGB to CMYK without using ICC profiles.");
for (com.aspose.imaging.Color rgbColor : rgbColors) {
    int cmyk = com.aspose.imaging.CmykColorHelper.toCmyk(rgbColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

    System.out.printf("RGB(@%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere RGB zu CMYK ohne ICC-Profile zu verwenden.
//RGB(255,0,0)        => CMYK(0,255,255,0)
//RGB(0,128,0)        => CMYK(255,0,255,127)
//RGB(0,0,255)        => CMYK(255,255,0,0)

getY(int cmyk)

public static int getY(int cmyk)

Gibt den Gelb‑Komponentenwert zurück.

Parameters:

ParameterTypBeschreibung
cmykintDie CMYK-Farbe dargestellt als 32‑Bit‑Ganzzahlwert.

Returns: int - Der Gelb‑Komponentenwert.

Example: The following example shows how to convert RGB colors to their CMYK counterparts without applying ICC profiles.

com.aspose.imaging.Color[] rgbColors = new com.aspose.imaging.Color[]
        {
                com.aspose.imaging.Color.getRed(),
                com.aspose.imaging.Color.getGreen(),
                com.aspose.imaging.Color.getBlue(),
        };

System.out.println("Convert RGB to CMYK without using ICC profiles.");
for (com.aspose.imaging.Color rgbColor : rgbColors) {
    int cmyk = com.aspose.imaging.CmykColorHelper.toCmyk(rgbColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

    System.out.printf("RGB(@%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere RGB zu CMYK ohne ICC-Profile zu verwenden.
//RGB(255,0,0)        => CMYK(0,255,255,0)
//RGB(0,128,0)        => CMYK(255,0,255,127)
//RGB(0,0,255)        => CMYK(255,255,0,0)

getK(int cmyk)

public static int getK(int cmyk)

Gibt den Schwarz‑Komponentenwert zurück.

Parameters:

ParameterTypBeschreibung
cmykintDie CMYK-Farbe dargestellt als 32‑Bit‑Ganzzahlwert.

Returns: int - Der Schwarz‑Komponentenwert.

Example: The following example shows how to convert RGB colors to their CMYK counterparts without applying ICC profiles.

com.aspose.imaging.Color[] rgbColors = new com.aspose.imaging.Color[]
        {
                com.aspose.imaging.Color.getRed(),
                com.aspose.imaging.Color.getGreen(),
                com.aspose.imaging.Color.getBlue(),
        };

System.out.println("Convert RGB to CMYK without using ICC profiles.");
for (com.aspose.imaging.Color rgbColor : rgbColors) {
    int cmyk = com.aspose.imaging.CmykColorHelper.toCmyk(rgbColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

    System.out.printf("RGB(@%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere RGB zu CMYK ohne ICC-Profile zu verwenden.
//RGB(255,0,0)        => CMYK(0,255,255,0)
//RGB(0,128,0)        => CMYK(255,0,255,127)
//RGB(0,0,255)        => CMYK(255,255,0,0)

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

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

Erstellt CMYK aus 32‑Bit‑Cyan-, Magenta-, Gelb- und Schwarzwerten.

Parameters:

ParameterTypBeschreibung
CyanintDie Cyan‑Komponente. Gültige Werte sind 0 bis 255.
MagentaintDie Magenta‑Komponente. Gültige Werte sind 0 bis 255.
GelbintDie Gelb‑Komponente. Gültige Werte sind 0 bis 255.
SchwarzintDie Schwarz‑Komponente. Gültige Werte sind 0 bis 255.

Returns: int - Die CMYK‑Farbe, dargestellt als 32‑Bit‑Ganzzahlwert.

Example: The following example shows how to convert CMYK colors to their RGB counterparts in a fast manner following straightforward formulas without using ICC profiles.

int[] cmykColors = new int[]
        {
                com.aspose.imaging.CmykColorHelper.fromComponents(255, 0, 0, 0),   // Cyan
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 255, 0, 0),   // Magenta
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 0, 255, 0),   // Yellow
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 0, 0, 255),   // Black
        };

System.out.println("Convert CMYK to RGB without using ICC profiles.");
for (int cmykColor : cmykColors) {
    com.aspose.imaging.Color rgbColor = com.aspose.imaging.CmykColorHelper.toArgb(cmykColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmykColor);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmykColor);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmykColor);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmykColor);

    System.out.printf("CMYK(%s,%s,%s,%s)\t\t=> RGB(%s,%s,%s)\r\n", c, m, y, k, rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, (int) rgbColor.getB() & 0xff);
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere CMYK zu RGB ohne Verwendung von ICC‑Profilen.
//CMYK(255,0,0,0)        => RGB(0,255,255)
//CMYK(0,255,0,0)        => RGB(255,0,255)
//CMYK(0,0,255,0)        => RGB(255,255,0)
//CMYK(0,0,0,255)        => RGB(0,0,0)

toCmyk(int[] argbPixels)

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

Die Umwandlung von ARGB-Farben zu CMYK-Farben.

Parameters:

ParameterTypBeschreibung
argbPixelsint[]Die ARGB‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.

Returns: int[] - Die CMYK‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.

toCmykBytes(int[] argbPixels, int startIndex, int length)

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

Konvertiert ARGB zu CMYK.

Parameters:

ParameterTypBeschreibung
argbPixelsint[]Die RGB‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.
startIndexintDer Startindex der RGB‑Farbe.
lengthintDie Anzahl der zu konvertierenden RGB‑Pixel.

Returns: byte[] - Die CMYK-Farben, dargestellt als Byte-Array.

toCmykaBytes(int[] argbPixels, int startIndex, int length)

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

Konvertiert ARGB zu CMYKA (mit Transparenz).

Parameters:

ParameterTypBeschreibung
argbPixelsint[]Die RGB‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.
startIndexintDer Startindex der RGB‑Farbe.
lengthintDie Anzahl der zu konvertierenden RGB‑Pixel.

Returns: byte[] - Die CMYK-Farben, dargestellt als Byte-Array.

toCmyk(int argbPixel)

public static int toCmyk(int argbPixel)

Die Umwandlung von ARGB-Farbe zu CMYK-Farbe.

Parameters:

ParameterTypBeschreibung
argbPixelintDie ARGB-Farbe, dargestellt als 32-Bit-Ganzzahlwert.

Returns: int - Die CMYK‑Farbe, dargestellt als 32‑Bit‑Ganzzahlwert.

toCmyk(Color pixel)

public static int toCmyk(Color pixel)

Die Umwandlung von ARGB-Farbe zu CMYK-Farbe.

Parameters:

ParameterTypBeschreibung
pixelColorDie ARGB-Farbe.

Returns: int - Die CMYK‑Farbe, dargestellt als 32‑Bit‑Ganzzahlwert.

Example: The following example shows how to convert RGB colors to their CMYK counterparts without applying ICC profiles.

com.aspose.imaging.Color[] rgbColors = new com.aspose.imaging.Color[]
        {
                com.aspose.imaging.Color.getRed(),
                com.aspose.imaging.Color.getGreen(),
                com.aspose.imaging.Color.getBlue(),
        };

System.out.println("Convert RGB to CMYK without using ICC profiles.");
for (com.aspose.imaging.Color rgbColor : rgbColors) {
    int cmyk = com.aspose.imaging.CmykColorHelper.toCmyk(rgbColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

    System.out.printf("RGB(@%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere RGB zu CMYK ohne ICC-Profile zu verwenden.
//RGB(255,0,0)        => CMYK(0,255,255,0)
//RGB(0,128,0)        => CMYK(255,0,255,127)
//RGB(0,0,255)        => CMYK(255,255,0,0)

toCmyk(Color[] pixels)

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

Die Umwandlung von ARGB-Farben zu CMYK-Farben.

Parameters:

ParameterTypBeschreibung
pixelsColor[]Die ARGB-Farben.

Returns: int[] - Die CMYK‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.

toArgb(int[] cmykPixels)

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

Die Umwandlung von CMYK-Farben zu ARGB-Farben.

Parameters:

ParameterTypBeschreibung
cmykPixelsint[]Die CMYK-Farben, dargestellt als 32-Bit-Ganzzahlwerte.

Returns: com.aspose.imaging.Color[] - Die ARGB-Farben.

toArgb(int cmykPixel)

public static Color toArgb(int cmykPixel)

Die Umwandlung von CMYK-Farbe zu ARGB-Farbe.

Parameters:

ParameterTypBeschreibung
cmykPixelintDie CMYK-Farbe dargestellt als 32‑Bit‑Ganzzahlwert.

Returns: Color - The ARGB color.

Example: The following example shows how to convert CMYK colors to their RGB counterparts in a fast manner following straightforward formulas without using ICC profiles.

int[] cmykColors = new int[]
        {
                com.aspose.imaging.CmykColorHelper.fromComponents(255, 0, 0, 0),   // Cyan
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 255, 0, 0),   // Magenta
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 0, 255, 0),   // Yellow
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 0, 0, 255),   // Black
        };

System.out.println("Convert CMYK to RGB without using ICC profiles.");
for (int cmykColor : cmykColors) {
    com.aspose.imaging.Color rgbColor = com.aspose.imaging.CmykColorHelper.toArgb(cmykColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmykColor);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmykColor);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmykColor);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmykColor);

    System.out.printf("CMYK(%s,%s,%s,%s)\t\t=> RGB(%s,%s,%s)\r\n", c, m, y, k, rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, (int) rgbColor.getB() & 0xff);
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere CMYK zu RGB ohne Verwendung von ICC‑Profilen.
//CMYK(255,0,0,0)        => RGB(0,255,255)
//CMYK(0,255,0,0)        => RGB(255,0,255)
//CMYK(0,0,255,0)        => RGB(255,255,0)
//CMYK(0,0,0,255)        => RGB(0,0,0)

toArgb32(int[] cmykPixels)

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

Die Umwandlung von CMYK-Farben zu ARGB-Farben.

Parameters:

ParameterTypBeschreibung
cmykPixelsint[]Die CMYK-Farben, dargestellt als 32-Bit-Ganzzahlwerte.

Returns: int[] - Die ARGB-Farben, dargestellt als 32-Bit-Ganzzahlwerte.

toArgb32(int[] cmykPixels, boolean reuseArray)

public static int[] toArgb32(int[] cmykPixels, boolean reuseArray)

Führt die Umwandlung von CMYK-Farben zu ARGB-Farben durch und speichert sie im selben Array, wenn reuseArray true ist. Andernfalls wird ein neues Array alloziert.

Parameters:

ParameterTypBeschreibung
cmykPixelsint[]Die CMYK-Farben, dargestellt als 32-Bit-Ganzzahlwerte.
reuseArraybooleanwenn true wird das Eingabe-Array cmykPixels mit neuen Werten neu befüllt und zurückgegeben; andernfalls wird ein neues Array alloziert und zurückgegeben.

Returns: int[] - Das neu alloziierte Array oder cmykPixels, gefüllt mit ARGB-Farben, dargestellt als 32-Bit-Ganzzahlwerte.

toArgbIcc(int[] cmykPixels)

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

Die Umwandlung von CMYK-Farben zu ARGB-Farben mittels Icc-Konvertierung mit Standardprofilen.

Parameters:

ParameterTypBeschreibung
cmykPixelsint[]Die CMYK-Pixel, dargestellt als 32-Bit-Ganzzahlwerte.

Returns: com.aspose.imaging.Color[] - Die ARGB-Farben.

toArgbIcc(int[] cmykPixels, InputStream cmykIccStream, InputStream rgbIccStream)

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

Die Umwandlung von CMYK-Farben zu ARGB-Farben mittels Icc-Konvertierung mit benutzerdefinierten Profilen.

Parameters:

ParameterTypBeschreibung
cmykPixelsint[]Die CMYK-Farben, dargestellt als 32-Bit-Ganzzahlwerte.
cmykIccStreamjava.io.InputStreamDer Stream, der das CMYK-ICC-Profil enthält.
rgbIccStreamjava.io.InputStreamDer Stream, der das RGB-ICC-Profil enthält.

Returns: com.aspose.imaging.Color[] - Die ARGB-Farben.

toArgbIcc(int cmykPixel)

public static Color toArgbIcc(int cmykPixel)

Die Umwandlung von CMYK-Farbe zu ARGB-Farbe mittels Icc-Konvertierung mit Standardprofilen.

Parameters:

ParameterTypBeschreibung
cmykPixelintDie CMYK-Farbe dargestellt als 32‑Bit‑Ganzzahlwert.

Returns: Color - The ARGB color.

Example: The following example shows how to convert CMYK colors to their RGB counterparts using ICC profiles.

int[] cmykColors = new int[]
        {
                com.aspose.imaging.CmykColorHelper.fromComponents(255, 0, 0, 0),   // Cyan
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 255, 0, 0),   // Magenta
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 0, 255, 0),   // Yellow
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 0, 0, 255),   // Black
        };

System.out.println("Convert CMYK to RGB using default ICC profiles.");
for (int cmykColor : cmykColors) {
    com.aspose.imaging.Color rgbColor = com.aspose.imaging.CmykColorHelper.toArgbIcc(cmykColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmykColor);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmykColor);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmykColor);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmykColor);

    System.out.printf("CMYK(%s,%s,%s,%s)\t\t=> RGB(%s,%s,%s)\r\n", c, m, y, k, rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff);
}

// Geben Sie Ihren Pfad zu benutzerdefinierten RGB- und CMYK-ICC-Profilen an.
String dir = "c:\\temp\\iccprofiles\\";

System.out.println("Convert CMYK to RGB using custom ICC profiles.");
// Lesen Sie alle Bytes aus ICC-Dateien in den Speicher, um die Möglichkeit zu haben, den Eingabe-Profil-Stream zurückzusetzen, bevor toCmykIcc aufgerufen wird.
byte[] rgbProfileBytes;
java.io.RandomAccessFile rgbProfile = new java.io.RandomAccessFile(dir + "eciRGB_v2.icc", "r");
try {
    rgbProfileBytes = new byte[(int) rgbProfile.length()];
    rgbProfile.readFully(rgbProfileBytes);
} finally {
    rgbProfile.close();
}

byte[] cmykProfileBytes;
java.io.RandomAccessFile cmykProfile = new java.io.RandomAccessFile(dir + "ISOcoated_v2_FullGamut4.icc", "r");
try {
    cmykProfileBytes = new byte[(int) cmykProfile.length()];
    cmykProfile.readFully(cmykProfileBytes);
} finally {
    cmykProfile.close();
}

java.io.InputStream rgbProfileStream = new java.io.ByteArrayInputStream(rgbProfileBytes);
java.io.InputStream cmykProfileStream = new java.io.ByteArrayInputStream(cmykProfileBytes);
try {
    for (int cmykColor : cmykColors) {
        com.aspose.imaging.Color rgbColor = com.aspose.imaging.CmykColorHelper.toArgbIcc(cmykColor);
        int c = com.aspose.imaging.CmykColorHelper.getC(cmykColor);
        int m = com.aspose.imaging.CmykColorHelper.getM(cmykColor);
        int y = com.aspose.imaging.CmykColorHelper.getY(cmykColor);
        int k = com.aspose.imaging.CmykColorHelper.getK(cmykColor);

        System.out.printf("CMYK(%s,%s,%s,%s)\t\t=> RGB(%s,%s,%s)\r\n", c, m, y, k, rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff);
    }
} finally {
    cmykProfileStream.close();
    rgbProfileStream.close();
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertieren Sie CMYK zu RGB unter Verwendung der Standard-ICC-Profile.
//CMYK(255,0,0,0)        => RGB(46,188,220)
//CMYK(0,255,0,0)        => RGB(231,52,142)
//CMYK(0,0,255,0)        => RGB(244,253,63)
//CMYK(0,0,0,255)        => RGB(21,21,21)
//Konvertiere CMYK nach RGB mit benutzerdefinierten ICC-Profilen.
//CMYK(255,0,0,0)        => RGB(46,188,220)
//CMYK(0,255,0,0)        => RGB(231,52,142)
//(0,0,255,0)            => RGB(244,253,63)
//CMYK(0,0,0,255)        => RGB(21,21,21)

toArgbIcc(int cmykPixel, InputStream cmykIccStream, InputStream rgbIccStream)

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

Die Umwandlung von CMYK-Farbe zu ARGB-Farbe mittels Icc-Konvertierung mit benutzerdefiniertem Profil.

Parameters:

ParameterTypBeschreibung
cmykPixelintDie CMYK-Farbe dargestellt als 32‑Bit‑Ganzzahlwert.
cmykIccStreamjava.io.InputStreamDer Stream, der das CMYK-ICC-Profil enthält.
rgbIccStreamjava.io.InputStreamDer Stream, der das RGB-ICC-Profil enthält.

Returns: Color - The ARGB color.

Example: The following example shows how to convert CMYK colors to their RGB counterparts using ICC profiles.

int[] cmykColors = new int[]
        {
                com.aspose.imaging.CmykColorHelper.fromComponents(255, 0, 0, 0),   // Cyan
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 255, 0, 0),   // Magenta
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 0, 255, 0),   // Yellow
                com.aspose.imaging.CmykColorHelper.fromComponents(0, 0, 0, 255),   // Black
        };

System.out.println("Convert CMYK to RGB using default ICC profiles.");
for (int cmykColor : cmykColors) {
    com.aspose.imaging.Color rgbColor = com.aspose.imaging.CmykColorHelper.toArgbIcc(cmykColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmykColor);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmykColor);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmykColor);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmykColor);

    System.out.printf("CMYK(%s,%s,%s,%s)\t\t=> RGB(%s,%s,%s)\r\n", c, m, y, k, rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff);
}

// Geben Sie Ihren Pfad zu benutzerdefinierten RGB- und CMYK-ICC-Profilen an.
String dir = "c:\\temp\\iccprofiles\\";

System.out.println("Convert CMYK to RGB using custom ICC profiles.");
// Lesen Sie alle Bytes aus ICC-Dateien in den Speicher, um die Möglichkeit zu haben, den Eingabe-Profil-Stream zurückzusetzen, bevor toCmykIcc aufgerufen wird.
byte[] rgbProfileBytes;
java.io.RandomAccessFile rgbProfile = new java.io.RandomAccessFile(dir + "eciRGB_v2.icc", "r");
try {
    rgbProfileBytes = new byte[(int) rgbProfile.length()];
    rgbProfile.readFully(rgbProfileBytes);
} finally {
    rgbProfile.close();
}

byte[] cmykProfileBytes;
java.io.RandomAccessFile cmykProfile = new java.io.RandomAccessFile(dir + "ISOcoated_v2_FullGamut4.icc", "r");
try {
    cmykProfileBytes = new byte[(int) cmykProfile.length()];
    cmykProfile.readFully(cmykProfileBytes);
} finally {
    cmykProfile.close();
}

java.io.InputStream rgbProfileStream = new java.io.ByteArrayInputStream(rgbProfileBytes);
java.io.InputStream cmykProfileStream = new java.io.ByteArrayInputStream(cmykProfileBytes);
try {
    for (int cmykColor : cmykColors) {
        com.aspose.imaging.Color rgbColor = com.aspose.imaging.CmykColorHelper.toArgbIcc(cmykColor);
        int c = com.aspose.imaging.CmykColorHelper.getC(cmykColor);
        int m = com.aspose.imaging.CmykColorHelper.getM(cmykColor);
        int y = com.aspose.imaging.CmykColorHelper.getY(cmykColor);
        int k = com.aspose.imaging.CmykColorHelper.getK(cmykColor);

        System.out.printf("CMYK(%s,%s,%s,%s)\t\t=> RGB(%s,%s,%s)\r\n", c, m, y, k, rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff);
    }
} finally {
    cmykProfileStream.close();
    rgbProfileStream.close();
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertieren Sie CMYK zu RGB unter Verwendung der Standard-ICC-Profile.
//CMYK(255,0,0,0)        => RGB(46,188,220)
//CMYK(0,255,0,0)        => RGB(231,52,142)
//CMYK(0,0,255,0)        => RGB(244,253,63)
//CMYK(0,0,0,255)        => RGB(21,21,21)
//Konvertiere CMYK nach RGB mit benutzerdefinierten ICC-Profilen.
//CMYK(255,0,0,0)        => RGB(46,188,220)
//CMYK(0,255,0,0)        => RGB(231,52,142)
//(0,0,255,0)            => RGB(244,253,63)
//CMYK(0,0,0,255)        => RGB(21,21,21)

toCmykIcc(Color[] pixels, InputStream rgbIccStream, InputStream cmykIccStream)

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

Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit benutzerdefinierten Profilen.

Parameters:

ParameterTypBeschreibung
pixelsColor[]Die ARGB-Farben.
rgbIccStreamjava.io.InputStreamDer Stream, der das RGB-ICC-Profil enthält.
cmykIccStreamjava.io.InputStreamDer Stream, der das CMYK-ICC-Profil enthält.

Returns: int[] - Die CMYK‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.

toCmykIcc(int[] pixels, InputStream rgbIccStream, InputStream cmykIccStream)

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

Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit benutzerdefinierten Profilen.

Parameters:

ParameterTypBeschreibung
Pixelint[]Die ARGB-Farben.
rgbIccStreamjava.io.InputStreamDer Stream, der das RGB-ICC-Profil enthält.
cmykIccStreamjava.io.InputStreamDer Stream, der das CMYK-ICC-Profil enthält.

Returns: int[] - Die CMYK‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.

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

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

Konvertiert RGB zu CMYK mit benutzerdefinierten ICC-Profilen.

Parameters:

ParameterTypBeschreibung
Pixelint[]Die RGB‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.
startIndexintDer Startindex der RGB‑Farbe.
lengthintDie Anzahl der zu konvertierenden RGB‑Pixel.
rgbIccStreamjava.io.InputStreamDer RGB-Profil-Stream.
cmykIccStreamjava.io.InputStreamDer CMYK-Profil-Stream.

Returns: byte[] - Die CMYK-Farben, dargestellt als Byte-Array.

toCmykIccBytes(int[] pixels, int startIndex, int length, byte[] cmykBytes, int cmykOffset, InputStream rgbIccStream, InputStream cmykIccStream)

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

Konvertiert RGB zu CMYK mit benutzerdefinierten ICC-Profilen.

Parameters:

ParameterTypBeschreibung
Pixelint[]Die RGB‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.
startIndexintDer Startindex der RGB‑Farbe.
lengthintDie Anzahl der zu konvertierenden RGB‑Pixel.
cmykBytesbyte[]Die Cmyk-Bytes.
cmykOffsetintDer cmykBytes-Offset.
rgbIccStreamjava.io.InputStreamDer RGB-Profil-Stream.
cmykIccStreamjava.io.InputStreamDer CMYK-Profil-Stream.

Returns: byte[] - Die CMYK-Farben, dargestellt als Byte-Array.

toCmykaIccBytes(int[] pixels, int startIndex, int length, byte[] cmykBytes, int cmykOffset, InputStream rgbIccStream, InputStream cmykIccStream)

public static byte[] toCmykaIccBytes(int[] pixels, int startIndex, int length, byte[] cmykBytes, int cmykOffset, InputStream rgbIccStream, InputStream cmykIccStream)

Konvertiert RGB zu CMYKA (mit Alpha) mit benutzerdefinierten ICC-Profilen.

Parameters:

ParameterTypBeschreibung
Pixelint[]Die RGB‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.
startIndexintDer Startindex der RGB‑Farbe.
lengthintDie Anzahl der zu konvertierenden RGB‑Pixel.
cmykBytesbyte[]Die Cmyk-Bytes.
cmykOffsetintDer cmykBytes-Offset.
rgbIccStreamjava.io.InputStreamDer RGB-Profil-Stream.
cmykIccStreamjava.io.InputStreamDer CMYK-Profil-Stream.

Returns: byte[] - Die CMYK-Farben, dargestellt als Byte-Array.

toPsdCmykIcc(int[] pixels, InputStream rgbIccStream, InputStream cmykIccStream)

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

Die Konvertierung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit benutzerdefinierten Profilen. Verwendet das PSD-CMYK-Format KCMY-Byte-Reihenfolge mit invertierten Kanalwerten.

Parameters:

ParameterTypBeschreibung
Pixelint[]Die ARGB-Farben.
rgbIccStreamjava.io.InputStreamDer Stream, der das RGB-ICC-Profil enthält.
cmykIccStreamjava.io.InputStreamDer Stream, der das CMYK-ICC-Profil enthält.

Returns: int[] - Die CMYK-Farben dargestellt als 32‑Bit‑Ganzzahlen im KCMY‑Byte‑Reihenfolge mit invertierten Kanalwerten.

toCmykaIccBytes(int[] pixels, int startIndex, int length, InputStream rgbIccStream, InputStream cmykIccStream)

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

Konvertiert RGB zu CMYKA (mit Alpha) mit benutzerdefinierten ICC-Profilen.

Parameters:

ParameterTypBeschreibung
Pixelint[]Die RGB‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.
startIndexintDer Startindex der RGB‑Farbe.
lengthintDie Anzahl der zu konvertierenden RGB‑Pixel.
rgbIccStreamjava.io.InputStreamDer RGB-Profil-Stream.
cmykIccStreamjava.io.InputStreamDer CMYK-Profil-Stream.

Returns: byte[] - Die CMYK-Farben, dargestellt als Byte-Array.

toCmykIcc(Color[] pixels)

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

Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit Standardprofilen.

Parameters:

ParameterTypBeschreibung
pixelsColor[]Die ARGB-Farben.

Returns: int[] - Die CMYK‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.

toCmykIcc(int[] pixels)

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

Die Umwandlung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit Standardprofilen.

Parameters:

ParameterTypBeschreibung
Pixelint[]Die ARGB-Farben.

Returns: int[] - Die CMYK‑Farben, dargestellt als 32‑Bit‑Ganzzahlwerte.

toPsdCmykIcc(int[] pixels)

public static int[] toPsdCmykIcc(int[] pixels)

Die Konvertierung von ARGB-Farben zu CMYK-Farben mittels Icc-Konvertierung mit Standardprofilen. Verwendet das PSD-CMYK-Format KCMY-Byte-Reihenfolge mit invertierten Kanalwerten.

Parameters:

ParameterTypBeschreibung
Pixelint[]Die ARGB-Farben.

Returns: int[] - Die CMYK-Farben dargestellt als 32‑Bit‑Ganzzahlen im KCMY‑Byte‑Reihenfolge mit invertierten Kanalwerten.

toCmykIcc(Color pixel)

public static int toCmykIcc(Color pixel)

Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit Standardprofilen.

Parameters:

ParameterTypBeschreibung
pixelColorDie ARGB-Farbe.

Returns: int - Die CMYK‑Farbe, dargestellt als 32‑Bit‑Ganzzahlwert.

Example: The following example shows how to convert RGB colors to their CMYK counterparts using ICC profiles.

com.aspose.imaging.Color[] rgbColors = new com.aspose.imaging.Color[]
        {
                com.aspose.imaging.Color.getRed(),
                com.aspose.imaging.Color.getGreen(),
                com.aspose.imaging.Color.getBlue(),
        };

System.out.println("Convert RGB to CMYK using default ICC profiles.");
for (com.aspose.imaging.Color rgbColor : rgbColors) {
    int cmyk = com.aspose.imaging.CmykColorHelper.toCmykIcc(rgbColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

    System.out.printf("RGB(%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
}

// Geben Sie den Pfad zu den RGB- und CMYK-ICC-Profilen an.
String dir = "c:\\temp\\iccprofiles\\";

System.out.println("Convert RGB to CMYK using custom ICC profiles.");

// Lesen Sie alle Bytes aus ICC-Dateien in den Speicher, um die Möglichkeit zu haben, den Eingabe-Profil-Stream zurückzusetzen, bevor toCmykIcc aufgerufen wird.
byte[] rgbProfileBytes;
java.io.RandomAccessFile rgbProfile = new java.io.RandomAccessFile(dir + "eciRGB_v2.icc", "r");
try {
    rgbProfileBytes = new byte[(int) rgbProfile.length()];
    rgbProfile.readFully(rgbProfileBytes);
} finally {
    rgbProfile.close();
}

byte[] cmykProfileBytes;
java.io.RandomAccessFile cmykProfile = new java.io.RandomAccessFile(dir + "ISOcoated_v2_FullGamut4.icc", "r");
try {
    cmykProfileBytes = new byte[(int) cmykProfile.length()];
    cmykProfile.readFully(cmykProfileBytes);
} finally {
    cmykProfile.close();
}

java.io.InputStream rgbProfileStream = new java.io.ByteArrayInputStream(rgbProfileBytes);
java.io.InputStream cmykProfileStream = new java.io.ByteArrayInputStream(cmykProfileBytes);
try {
    for (com.aspose.imaging.Color rgbColor : rgbColors) {

        int cmyk = com.aspose.imaging.CmykColorHelper.toCmykIcc(rgbColor, rgbProfileStream, cmykProfileStream);
        int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
        int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
        int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
        int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

        System.out.printf("RGB(%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
    }
} finally {
    cmykProfileStream.close();
    rgbProfileStream.close();
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere RGB nach CMYK mit Standard-ICC-Profilen.
//RGB(255,0,0)        => CMYK(0,254,249,15)
//RGB(0,128,0)        => CMYK(247,21,254,85)
//RGB(0,0,255)        => CMYK(254,195,0,134)
//Konvertiere RGB nach CMYK mit benutzerdefinierten ICC-Profilen.
//RGB(255,0,0)        => CMYK(0,207,219,0)
//RGB(0,128,0)        => CMYK(238,16,254,80)
//RGB(0,0,255)        => CMYK(242,182,0,0)

toCmykIcc(int argb)

public static int toCmykIcc(int argb)

Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit Standardprofilen.

Parameters:

ParameterTypBeschreibung
argbintDie ARGB-Farbe.

Returns: int - Die CMYK‑Farbe, dargestellt als 32‑Bit‑Ganzzahlwert.

toPsdCmykIcc(int argb)

public static int toPsdCmykIcc(int argb)

Die Konvertierung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit Standardprofilen. Verwendet das PSD-CMYK-Format KCMY-Byte-Reihenfolge mit invertierten Kanalwerten.

Parameters:

ParameterTypBeschreibung
argbintDie ARGB-Farbe.

Returns: int - Die CMYK-Farbe wird als 32‑Bit‑Ganzzahlwert in KCMY-Byte‑Reihenfolge mit invertierten Kanalwerten dargestellt.

toCmykIcc(Color pixel, InputStream rgbIccStream, InputStream cmykIccStream)

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

Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit benutzerdefinierten Profilen.

Parameters:

ParameterTypBeschreibung
pixelColorDie ARGB-Farbe.
rgbIccStreamjava.io.InputStreamDer Stream, der das RGB-ICC-Profil enthält.
cmykIccStreamjava.io.InputStreamDer Stream, der das CMYK-ICC-Profil enthält.

Returns: int - Die CMYK‑Farbe, dargestellt als 32‑Bit‑Ganzzahlwert.

Example: The following example shows how to convert RGB colors to their CMYK counterparts using ICC profiles.

com.aspose.imaging.Color[] rgbColors = new com.aspose.imaging.Color[]
        {
                com.aspose.imaging.Color.getRed(),
                com.aspose.imaging.Color.getGreen(),
                com.aspose.imaging.Color.getBlue(),
        };

System.out.println("Convert RGB to CMYK using default ICC profiles.");
for (com.aspose.imaging.Color rgbColor : rgbColors) {
    int cmyk = com.aspose.imaging.CmykColorHelper.toCmykIcc(rgbColor);
    int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
    int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
    int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
    int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

    System.out.printf("RGB(%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
}

// Geben Sie den Pfad zu den RGB- und CMYK-ICC-Profilen an.
String dir = "c:\\temp\\iccprofiles\\";

System.out.println("Convert RGB to CMYK using custom ICC profiles.");

// Lesen Sie alle Bytes aus ICC-Dateien in den Speicher, um die Möglichkeit zu haben, den Eingabe-Profil-Stream zurückzusetzen, bevor toCmykIcc aufgerufen wird.
byte[] rgbProfileBytes;
java.io.RandomAccessFile rgbProfile = new java.io.RandomAccessFile(dir + "eciRGB_v2.icc", "r");
try {
    rgbProfileBytes = new byte[(int) rgbProfile.length()];
    rgbProfile.readFully(rgbProfileBytes);
} finally {
    rgbProfile.close();
}

byte[] cmykProfileBytes;
java.io.RandomAccessFile cmykProfile = new java.io.RandomAccessFile(dir + "ISOcoated_v2_FullGamut4.icc", "r");
try {
    cmykProfileBytes = new byte[(int) cmykProfile.length()];
    cmykProfile.readFully(cmykProfileBytes);
} finally {
    cmykProfile.close();
}

java.io.InputStream rgbProfileStream = new java.io.ByteArrayInputStream(rgbProfileBytes);
java.io.InputStream cmykProfileStream = new java.io.ByteArrayInputStream(cmykProfileBytes);
try {
    for (com.aspose.imaging.Color rgbColor : rgbColors) {

        int cmyk = com.aspose.imaging.CmykColorHelper.toCmykIcc(rgbColor, rgbProfileStream, cmykProfileStream);
        int c = com.aspose.imaging.CmykColorHelper.getC(cmyk);
        int m = com.aspose.imaging.CmykColorHelper.getM(cmyk);
        int y = com.aspose.imaging.CmykColorHelper.getY(cmyk);
        int k = com.aspose.imaging.CmykColorHelper.getK(cmyk);

        System.out.printf("RGB(%s,%s,%s)\t\t=> CMYK(%s,%s,%s,%s)\r\n", rgbColor.getR() & 0xff, rgbColor.getG() & 0xff, rgbColor.getB() & 0xff, c, m, y, k);
    }
} finally {
    cmykProfileStream.close();
    rgbProfileStream.close();
}

//Die Ausgabe sieht folgendermaßen aus:
//Konvertiere RGB nach CMYK mit Standard-ICC-Profilen.
//RGB(255,0,0)        => CMYK(0,254,249,15)
//RGB(0,128,0)        => CMYK(247,21,254,85)
//RGB(0,0,255)        => CMYK(254,195,0,134)
//Konvertiere RGB nach CMYK mit benutzerdefinierten ICC-Profilen.
//RGB(255,0,0)        => CMYK(0,207,219,0)
//RGB(0,128,0)        => CMYK(238,16,254,80)
//RGB(0,0,255)        => CMYK(242,182,0,0)

toCmykIcc(int argb, InputStream rgbIccStream, InputStream cmykIccStream)

public static int toCmykIcc(int argb, InputStream rgbIccStream, InputStream cmykIccStream)

Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit benutzerdefinierten Profilen.

Parameters:

ParameterTypBeschreibung
argbintDie ARGB-Farbe.
rgbIccStreamjava.io.InputStreamDer Stream, der das RGB-ICC-Profil enthält.
cmykIccStreamjava.io.InputStreamDer Stream, der das CMYK-ICC-Profil enthält.

Returns: int - Die CMYK‑Farbe, dargestellt als 32‑Bit‑Ganzzahlwert.

toPsdCmykIcc(int pixel, InputStream rgbIccStream, InputStream cmykIccStream)

public static int toPsdCmykIcc(int pixel, InputStream rgbIccStream, InputStream cmykIccStream)

Die Umwandlung von ARGB-Farbe zu CMYK-Farbe mittels Icc-Konvertierung mit benutzerdefinierten Profilen.

Parameters:

ParameterTypBeschreibung
PixelintDie ARGB-Farbe.
rgbIccStreamjava.io.InputStreamDer Stream, der das RGB-ICC-Profil enthält.
cmykIccStreamjava.io.InputStreamDer Stream, der das CMYK-ICC-Profil enthält.

Returns: int - Die CMYK-Farben werden als 32‑Bit‑Ganzzahlwerte in KCMY-Byte‑Reihenfolge mit invertierten Kanalwerten dargestellt.