Contents

Functions

cupsCMYKDelete()


Description

Delete a color separation.

Syntax

void
cupsCMYKDelete(
    cups_cmyk_t * cmyk);

Arguments

NameDescription
cmykColor separation

Returns

Nothing.

cupsCMYKDoBlack()


Description

Do a black separation...

Syntax

void
cupsCMYKDoBlack(
    const cups_cmyk_t * cmyk,
    const unsigned char * input,
    short * output,
    int num_pixels);

Arguments

NameDescription
cmykColor separation
inputInput grayscale pixels
outputOutput Device-N pixels
num_pixelsNumber of pixels

Returns

Nothing.

cupsCMYKDoCMYK()


Description

Do a CMYK separation...

Syntax

void
cupsCMYKDoCMYK(
    const cups_cmyk_t * cmyk,
    const unsigned char * input,
    short * output,
    int num_pixels);

Arguments

NameDescription
cmykColor separation
inputInput grayscale pixels
outputOutput Device-N pixels
num_pixelsNumber of pixels

Returns

Nothing.

cupsCMYKDoGray()


Description

Do a grayscale separation...

Syntax

void
cupsCMYKDoGray(
    const cups_cmyk_t * cmyk,
    const unsigned char * input,
    short * output,
    int num_pixels);

Arguments

NameDescription
cmykColor separation
inputInput grayscale pixels
outputOutput Device-N pixels
num_pixelsNumber of pixels

Returns

Nothing.

cupsCMYKDoRGB()


Description

Do an sRGB separation...

Syntax

void
cupsCMYKDoRGB(
    const cups_cmyk_t * cmyk,
    const unsigned char * input,
    short * output,
    int num_pixels);

Arguments

NameDescription
cmykColor separation
inputInput grayscale pixels
outputOutput Device-N pixels
num_pixelsNumber of pixels

Returns

Nothing.

cupsCMYKLoad()


Description

Load a CMYK color profile from PPD attributes.

Syntax

cups_cmyk_t *
cupsCMYKLoad(
    ppd_file_t * ppd,
    const char * colormodel,
    const char * media,
    const char * resolution);

Arguments

NameDescription
ppdPPD file
colormodelColorModel value
mediaMediaType value
resolutionResolution value

Returns

CMYK color separation

cupsCMYKNew()


Description

Create a new CMYK color separation.

Syntax

cups_cmyk_t *
cupsCMYKNew(
    int num_channels);

Arguments

NameDescription
num_channelsNumber of color components

Returns

New CMYK separation or NULL

cupsCMYKSetBlack()


Description

Set the transition range for CMY to black.

Syntax

void
cupsCMYKSetBlack(
    cups_cmyk_t * cmyk,
    float lower,
    float upper);

Arguments

NameDescription
cmykCMYK color separation
lowerNo black ink
upperOnly black ink

Returns

Nothing.

cupsCMYKSetCurve()


Description

Set a color transform curve using points.

Syntax

void
cupsCMYKSetCurve(
    cups_cmyk_t * cmyk,
    int channel,
    int num_xypoints,
    const float * xypoints);

Arguments

NameDescription
cmykCMYK color separation
channelColor channel
num_xypointsNumber of X,Y points
xypointsX,Y points

Returns

Nothing.

cupsCMYKSetGamma()


Description

Set a color transform curve using gamma and density.

Syntax

void
cupsCMYKSetGamma(
    cups_cmyk_t * cmyk,
    int channel,
    float gamval,
    float density);

Arguments

NameDescription
cmykCMYK color separation
channelInk channel
gamvalGamma correction
densityMaximum density

Returns

Nothing.

cupsCMYKSetInkLimit()


Description

Set the limit on the amount of ink.

Syntax

void
cupsCMYKSetInkLimit(
    cups_cmyk_t * cmyk,
    float limit);

Arguments

NameDescription
cmykCMYK color separation
limitLimit of ink

Returns

Nothing.

cupsCMYKSetLtDk()


Description

Set light/dark ink transforms.

Syntax

void
cupsCMYKSetLtDk(
    cups_cmyk_t * cmyk,
    int channel,
    float light,
    float dark);

Arguments

NameDescription
cmykCMYK color separation
channelDark ink channel (+1 for light)
lightLight ink only level
darkDark ink only level

Returns

Nothing.

cupsCheckBytes()


Description

Check to see if all bytes are zero.

Syntax

int
cupsCheckBytes(
    const unsigned char * bytes,
    int length);

Arguments

NameDescription
bytesBytes to check
lengthNumber of bytes to check

Returns

1 if they match

cupsCheckValue()


Description

Check to see if all bytes match the given value.

Syntax

int
cupsCheckValue(
    const unsigned char * bytes,
    int length,
    const unsigned char value);

Arguments

NameDescription
bytesBytes to check
lengthNumber of bytes to check
valueValue to check

Returns

1 if they match

cupsDitherDelete()


Description

Free a dithering buffer. Returns 0 on success, -1 on failure.

Syntax

void
cupsDitherDelete(
    cups_dither_t * d);

Arguments

NameDescription
dDithering buffer

Returns

Nothing.

cupsDitherLine()


Description

Dither a line of pixels...

Syntax

void
cupsDitherLine(
    cups_dither_t * d,
    const cups_lut_t * lut,
    const short * data,
    int num_channels,
    unsigned char * p);

Arguments

NameDescription
dDither data
lutLookup table
dataSeparation data
num_channelsNumber of components
pPixels

Returns

Nothing.

cupsDitherNew()


Description

Create an error-diffusion dithering buffer.

Syntax

cups_dither_t *
cupsDitherNew(
    int width);

Arguments

NameDescription
widthWidth of output in pixels

Returns

New state array

cupsFindAttr()


Description

Find a PPD attribute based on the colormodel, media, and resolution.

Syntax

ppd_attr_t *
cupsFindAttr(
    ppd_file_t * ppd,
    const char * name,
    const char * colormodel,
    const char * media,
    const char * resolution,
    char * spec,
    int specsize);

Arguments

NameDescription
ppdPPD file
nameAttribute name
colormodelColor model
mediaMedia type
resolutionResolution
specFinal selection string
specsizeSize of string buffer

Returns

Matching attribute or NULL

cupsLutDelete()


Description

Free the memory used by a lookup table.

Syntax

void
cupsLutDelete(
    cups_lut_t * lut);

Arguments

NameDescription
lutLookup table to free

Returns

Nothing.

cupsLutLoad()


Description

Load a LUT from a PPD file.

Syntax

cups_lut_t *
cupsLutLoad(
    ppd_file_t * ppd,
    const char * colormodel,
    const char * media,
    const char * resolution,
    const char * ink);

Arguments

NameDescription
ppdPPD file
colormodelColor model
mediaMedia type
resolutionResolution
inkInk name

Returns

New lookup table

cupsLutNew()


Description

Make a lookup table from a list of pixel values. Returns a pointer to the lookup table on success, NULL on failure.

Syntax

cups_lut_t *
cupsLutNew(
    int num_values,
    const float * values);

Arguments

NameDescription
num_valuesNumber of values
valuesLookup table values

Returns

New lookup table

cupsPackHorizontal()


Description

Pack pixels horizontally...

Syntax

void
cupsPackHorizontal(
    const unsigned char * ipixels,
    unsigned char * obytes,
    int width,
    const unsigned char clearto,
    const int step);

Arguments

NameDescription
ipixelsInput pixels
obytesOutput bytes
widthNumber of pixels
cleartoInitial value of bytes
stepStep value between pixels

Returns

Nothing.

cupsPackHorizontal2()


Description

Pack 2-bit pixels horizontally...

Syntax

void
cupsPackHorizontal2(
    const unsigned char * ipixels,
    unsigned char * obytes,
    int width,
    const int step);

Arguments

NameDescription
ipixelsInput pixels
obytesOutput bytes
widthNumber of pixels
stepStepping value

Returns

Nothing.

cupsPackHorizontalBit()


Description

Pack pixels horizontally by bit...

Syntax

void
cupsPackHorizontalBit(
    const unsigned char * ipixels,
    unsigned char * obytes,
    int width,
    const unsigned char clearto,
    const unsigned char bit);

Arguments

NameDescription
ipixelsInput pixels
obytesOutput bytes
widthNumber of pixels
cleartoInitial value of bytes
bitBit to check

Returns

Nothing.

cupsPackVertical()


Description

Pack pixels vertically...

Syntax

void
cupsPackVertical(
    const unsigned char * ipixels,
    unsigned char * obytes,
    int width,
    const unsigned char bit,
    const int step);

Arguments

NameDescription
ipixelsInput pixels
obytesOutput bytes
widthNumber of input pixels
bitOutput bit
stepNumber of bytes between columns

Returns

Nothing.

cupsRGBDelete()


Description

Delete a color separation.

Syntax

void
cupsRGBDelete(
    cups_rgb_t * rgbptr);

Arguments

NameDescription
rgbptrColor separation

Returns

Nothing.

cupsRGBDoGray()


Description

Do a grayscale separation...

Syntax

void
cupsRGBDoGray(
    cups_rgb_t * rgbptr,
    const unsigned char * input,
    unsigned char * output,
    int num_pixels);

Arguments

NameDescription
rgbptrColor separation
inputInput grayscale pixels
outputOutput Device-N pixels
num_pixelsNumber of pixels

Returns

Nothing.

cupsRGBDoRGB()


Description

Do a RGB separation...

Syntax

void
cupsRGBDoRGB(
    cups_rgb_t * rgbptr,
    const unsigned char * input,
    unsigned char * output,
    int num_pixels);

Arguments

NameDescription
rgbptrColor separation
inputInput RGB pixels
outputOutput Device-N pixels
num_pixelsNumber of pixels

Returns

Nothing.

cupsRGBLoad()


Description

Load a RGB color profile from a PPD file.

Syntax

cups_rgb_t *
cupsRGBLoad(
    ppd_file_t * ppd,
    const char * colormodel,
    const char * media,
    const char * resolution);

Arguments

NameDescription
ppdPPD file
colormodelColor model
mediaMedia type
resolutionResolution

Returns

New color profile

cupsRGBNew()


Description

Create a new RGB color separation.

Syntax

cups_rgb_t *
cupsRGBNew(
    int num_samples,
    cups_sample_t * samples,
    int cube_size,
    int num_channels);

Arguments

NameDescription
num_samplesNumber of samples
samplesSamples
cube_sizeSize of LUT cube
num_channelsNumber of color components

Returns

New color separation or NULL

Structures

cups_cmyk_s


Description

Simple CMYK lookup table

Definition

struct cups_cmyk_s
{
  unsigned char black_lut[256];
  short * channels[CUPS_MAX_CHAN];
  unsigned char color_lut[256];
  int ink_limit;
  int num_channels;
};

Members

NameDescription
black_lut[256]Black generation LUT
channels[CUPS_MAX_CHAN]Lookup tables
color_lut[256]Color removal LUT
ink_limitInk limit
num_channelsNumber of components

cups_dither_s


Description

Dithering State

Definition

struct cups_dither_s
{
  int errors[96];
  int row;
  int width;
};

Members

NameDescription
errors[96]Error values
rowCurrent row
widthWidth of buffer

cups_lut_s


Description

Lookup Table for Dithering

Definition

struct cups_lut_s
{
  int error;
  short intensity;
  short pixel;
};

Members

NameDescription
errorError from desired value
intensityAdjusted intensity
pixelOutput pixel value

cups_rgb_s


Description

Color separation lookup table

Definition

struct cups_rgb_s
{
  unsigned char black[CUPS_MAX_RGB];
  int cache_init;
  unsigned char **** colors;
  int cube_index[256];
  int cube_mult[256];
  int cube_size;
  int num_channels;
  unsigned char white[CUPS_MAX_RGB];
};

Members

NameDescription
black[CUPS_MAX_RGB]Cached black (sRGB = 0,0,0)
cache_initAre cached values initialized?
colors4-D array of sample values
cube_index[256]Index into cube for a given sRGB value
cube_mult[256]Multiplier value for a given sRGB value
cube_sizeSize of color cube (2-N) on a side
num_channelsNumber of colors per sample
white[CUPS_MAX_RGB]Cached white (sRGB = 255,255,255)

cups_sample_s


Description

Color sample point

Definition

struct cups_sample_s
{
  unsigned char colors[CUPS_MAX_RGB];
  unsigned char rgb[3];
};

Members

NameDescription
colors[CUPS_MAX_RGB]Color values
rgb[3]sRGB values

Types

cups_cmyk_t


Description

Simple CMYK lookup table

Definition

typedef struct cups_cmyk_s cups_cmyk_t;

cups_dither_t


Description

Dithering State

Definition

typedef struct cups_dither_s cups_dither_t;

cups_lut_t


Description

Lookup Table for Dithering

Definition

typedef struct cups_lut_s cups_lut_t;

cups_rgb_t


Description

Color separation lookup table

Definition

typedef struct cups_rgb_s cups_rgb_t;

cups_sample_t


Description

Color sample point

Definition

typedef struct cups_sample_s cups_sample_t;

Variables

cups_scmy_lut[256]


Description

sRGB gamma lookup table (inverted)

Definition

extern const unsigned char cups_scmy_lut[256];

cups_srgb_lut[256]


Description

sRGB gamma lookup table

Definition

extern const unsigned char cups_srgb_lut[256];