Table of Contents

Class CmykColorHelper

Namespace
Aspose.Imaging
Assembly
Aspose.Imaging.dll

Helper methods to work with CMYK color presented as a signed 32-bit integer value. Provides the similar API as the 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 CmykColor struct.

public static class CmykColorHelper
Inheritance
CmykColorHelper
Inherited Members

Methods

FromComponents(int, int, int, int)

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

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

Parameters

cyan int

The cyan component. Valid values are 0 through 255.

magenta int

The magenta component. Valid values are 0 through 255.

yellow int

The yellow component. Valid values are 0 through 255.

black int

The black component. Valid values are 0 through 255.

Returns

int

The CMYK color presented as a 32-bit integer value.

GetC(int)

Gets the cyan component value.

public static int GetC(int cmyk)

Parameters

cmyk int

The CMYK color presented as a 32-bit integer value.

Returns

int

The cyan component value.

GetK(int)

Gets the black component value.

public static int GetK(int cmyk)

Parameters

cmyk int

The CMYK color presented as a 32-bit integer value.

Returns

int

The black component value.

GetM(int)

Gets the magenta component value.

public static int GetM(int cmyk)

Parameters

cmyk int

The CMYK color presented as a 32-bit integer value.

Returns

int

The magenta component value.

GetY(int)

Gets the yellow component value.

public static int GetY(int cmyk)

Parameters

cmyk int

The CMYK color presented as a 32-bit integer value.

Returns

int

The yellow component value.

ToArgb(int)

The conversion from CMYK color to ARGB color.

public static Color ToArgb(int cmykPixel)

Parameters

cmykPixel int

The CMYK color presented as a 32-bit integer value.

Returns

Color

The ARGB color.

ToArgb(int[])

The conversion from CMYK colors to ARGB colors.

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

Parameters

cmykPixels int[]

The CMYK colors presented as 32-bit integer values.

Returns

Color[]

The ARGB colors.

ToArgb32(int[])

The conversion from CMYK colors to ARGB colors.

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

Parameters

cmykPixels int[]

The CMYK colors presented as 32-bit integer values.

Returns

int[]

The ARGB colors presented as 32-bit integer values.

ToArgbIcc(int)

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

public static Color ToArgbIcc(int cmykPixel)

Parameters

cmykPixel int

The CMYK color presented as a 32-bit integer value.

Returns

Color

The ARGB color.

ToArgbIcc(int, Stream, Stream)

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

public static Color ToArgbIcc(int cmykPixel, Stream cmykIccStream, Stream rgbIccStream)

Parameters

cmykPixel int

The CMYK color presented as a 32-bit integer value.

cmykIccStream Stream

The stream containing CMYK Icc profile.

rgbIccStream Stream

The stream containing RGB Icc profile.

Returns

Color

The ARGB color.

ToArgbIcc(int[])

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

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

Parameters

cmykPixels int[]

The CMYK pixels presented as 32-bit integer values.

Returns

Color[]

The ARGB colors.

ToArgbIcc(int[], Stream, Stream)

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

public static Color[] ToArgbIcc(int[] cmykPixels, Stream cmykIccStream, Stream rgbIccStream)

Parameters

cmykPixels int[]

The CMYK colors presented as 32-bit integer values.

cmykIccStream Stream

The stream containing CMYK Icc profile.

rgbIccStream Stream

The stream containing RGB Icc profile.

Returns

Color[]

The ARGB colors.

ToCmyk(Color)

The conversion from ARGB color to CMYK color.

public static int ToCmyk(Color pixel)

Parameters

pixel Color

The ARGB color.

Returns

int

The CMYK color presented as a 32-bit integer value.

ToCmyk(Color[])

The conversion from ARGB colors to CMYK colors.

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

Parameters

pixels Color[]

The ARGB colors.

Returns

int[]

The CMYK colors presented as 32-bit integer values.

ToCmyk(int)

The conversion from ARGB color to CMYK color.

public static int ToCmyk(int argbPixel)

Parameters

argbPixel int

The ARGB color presented as a 32-bit integer value.

Returns

int

The CMYK color presented as a 32-bit integer value.

ToCmyk(int[])

The conversion from ARGB colors to CMYK colors.

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

Parameters

argbPixels int[]

The ARGB colors presented as 32-bit integer values.

Returns

int[]

The CMYK colors presented as 32-bit integer values.

ToCmykBytes(int[], int, int)

Converts ARGB to CMYK.

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

Parameters

argbPixels int[]

The RGB colors presented as 32-bit integer values.

startIndex int

The start index of RGB color.

length int

The number of RGB pixels to convert.

Returns

byte[]

The CMYK colors presented as a byte array.

ToCmykIcc(Color)

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

public static int ToCmykIcc(Color pixel)

Parameters

pixel Color

The ARGB color.

Returns

int

The CMYK color presented as a 32-bit integer value.

ToCmykIcc(Color, Stream, Stream)

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

public static int ToCmykIcc(Color pixel, Stream rgbIccStream, Stream cmykIccStream)

Parameters

pixel Color

The ARGB color.

rgbIccStream Stream

The stream containing RGB Icc profile.

cmykIccStream Stream

The stream containing CMYK Icc profile.

Returns

int

The CMYK color presented as a 32-bit integer value.

ToCmykIcc(Color[])

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

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

Parameters

pixels Color[]

The ARGB colors.

Returns

int[]

The CMYK colors presented as 32-bit integer values.

ToCmykIcc(Color[], Stream, Stream)

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

public static int[] ToCmykIcc(Color[] pixels, Stream rgbIccStream, Stream cmykIccStream)

Parameters

pixels Color[]

The ARGB colors.

rgbIccStream Stream

The stream containing RGB Icc profile.

cmykIccStream Stream

The stream containing CMYK Icc profile.

Returns

int[]

The CMYK colors presented as 32-bit integer values.

ToCmykIcc(int)

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

public static int ToCmykIcc(int argb)

Parameters

argb int

The ARGB color.

Returns

int

The CMYK color presented as a 32-bit integer value.

ToCmykIcc(int, Stream, Stream)

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

public static int ToCmykIcc(int argb, Stream rgbIccStream, Stream cmykIccStream)

Parameters

argb int

The ARGB color.

rgbIccStream Stream

The stream containing RGB Icc profile.

cmykIccStream Stream

The stream containing CMYK Icc profile.

Returns

int

The CMYK color presented as a 32-bit integer value.

ToCmykIcc(int[])

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

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

Parameters

pixels int[]

The ARGB colors.

Returns

int[]

The CMYK colors presented as 32-bit integer values.

ToCmykIcc(int[], Stream, Stream)

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

public static int[] ToCmykIcc(int[] pixels, Stream rgbIccStream, Stream cmykIccStream)

Parameters

pixels int[]

The ARGB colors.

rgbIccStream Stream

The stream containing RGB Icc profile.

cmykIccStream Stream

The stream containing CMYK Icc profile.

Returns

int[]

The CMYK colors presented as 32-bit integer values.

ToCmykIccBytes(int[], int, int, Stream, Stream)

Converts RGB to CMYK using custom ICC profiles.

public static byte[] ToCmykIccBytes(int[] pixels, int startIndex, int length, Stream rgbIccStream, Stream cmykIccStream)

Parameters

pixels int[]

The RGB colors presented as 32-bit integer values.

startIndex int

The start index of RGB color.

length int

The number of RGB pixels to convert.

rgbIccStream Stream

The RGB profile stream.

cmykIccStream Stream

The CMYK profile stream.

Returns

byte[]

The CMYK colors presented as a byte array.

ToCmykaBytes(int[], int, int)

Converts ARGB to CMYKA (with transparency).

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

Parameters

argbPixels int[]

The RGB colors presented as 32-bit integer values.

startIndex int

The start index of RGB color.

length int

The number of RGB pixels to convert.

Returns

byte[]

The CMYK colors presented as a byte array.

ToCmykaIccBytes(int[], int, int, Stream, Stream)

Converts RGB to CMYKA (with alpha) using custom ICC profiles.

public static byte[] ToCmykaIccBytes(int[] pixels, int startIndex, int length, Stream rgbIccStream, Stream cmykIccStream)

Parameters

pixels int[]

The RGB colors presented as 32-bit integer values.

startIndex int

The start index of RGB color.

length int

The number of RGB pixels to convert.

rgbIccStream Stream

The RGB profile stream.

cmykIccStream Stream

The CMYK profile stream.

Returns

byte[]

The CMYK colors presented as a byte array.

ToPsdCmykIcc(int)

The conversion from ARGB color to CMYK color using Icc conversion with default profiles. Uses PSD CMYK format KCMY byte order with inverted channel values.

public static int ToPsdCmykIcc(int argb)

Parameters

argb int

The ARGB color.

Returns

int

The CMYK color presented as a 32-bit integer value in KCMY byte order with inverted channel values.

ToPsdCmykIcc(int, Stream, Stream)

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

public static int ToPsdCmykIcc(int pixel, Stream rgbIccStream, Stream cmykIccStream)

Parameters

pixel int

The ARGB color.

rgbIccStream Stream

The stream containing RGB Icc profile.

cmykIccStream Stream

The stream containing CMYK Icc profile.

Returns

int

The CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..

ToPsdCmykIcc(int[])

The conversion from ARGB colors to CMYK colors using Icc conversion with default profiles. Uses PSD CMYK format KCMY byte order with inverted channel values.

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

Parameters

pixels int[]

The ARGB colors.

Returns

int[]

The CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..

ToPsdCmykIcc(int[], Stream, Stream)

The conversion from ARGB colors to CMYK colors using Icc conversion with custom profiles. Uses PSD CMYK format KCMY byte order with inverted channel values.

public static int[] ToPsdCmykIcc(int[] pixels, Stream rgbIccStream, Stream cmykIccStream)

Parameters

pixels int[]

The ARGB colors.

rgbIccStream Stream

The stream containing RGB Icc profile.

cmykIccStream Stream

The stream containing CMYK Icc profile.

Returns

int[]

The CMYK colors presented as 32-bit integer values in KCMY byte order with inverted channel values..