Delete a color separation.
void
cupsCMYKDelete(
cups_cmyk_t * cmyk);
| Name | Description |
|---|---|
| cmyk | Color separation |
Nothing.
Do a black separation...
void
cupsCMYKDoBlack(
const cups_cmyk_t * cmyk,
const unsigned char * input,
short * output,
int num_pixels);
| Name | Description |
|---|---|
| cmyk | Color separation |
| input | Input grayscale pixels |
| output | Output Device-N pixels |
| num_pixels | Number of pixels |
Nothing.
Do a CMYK separation...
void
cupsCMYKDoCMYK(
const cups_cmyk_t * cmyk,
const unsigned char * input,
short * output,
int num_pixels);
| Name | Description |
|---|---|
| cmyk | Color separation |
| input | Input grayscale pixels |
| output | Output Device-N pixels |
| num_pixels | Number of pixels |
Nothing.
Do a grayscale separation...
void
cupsCMYKDoGray(
const cups_cmyk_t * cmyk,
const unsigned char * input,
short * output,
int num_pixels);
| Name | Description |
|---|---|
| cmyk | Color separation |
| input | Input grayscale pixels |
| output | Output Device-N pixels |
| num_pixels | Number of pixels |
Nothing.
Do an sRGB separation...
void
cupsCMYKDoRGB(
const cups_cmyk_t * cmyk,
const unsigned char * input,
short * output,
int num_pixels);
| Name | Description |
|---|---|
| cmyk | Color separation |
| input | Input grayscale pixels |
| output | Output Device-N pixels |
| num_pixels | Number of pixels |
Nothing.
Load a CMYK color profile from PPD attributes.
cups_cmyk_t *
cupsCMYKLoad(
ppd_file_t * ppd,
const char * colormodel,
const char * media,
const char * resolution);
| Name | Description |
|---|---|
| ppd | PPD file |
| colormodel | ColorModel value |
| media | MediaType value |
| resolution | Resolution value |
CMYK color separation
Create a new CMYK color separation.
cups_cmyk_t *
cupsCMYKNew(
int num_channels);
| Name | Description |
|---|---|
| num_channels | Number of color components |
New CMYK separation or NULL
Set the transition range for CMY to black.
void
cupsCMYKSetBlack(
cups_cmyk_t * cmyk,
float lower,
float upper);
| Name | Description |
|---|---|
| cmyk | CMYK color separation |
| lower | No black ink |
| upper | Only black ink |
Nothing.
Set a color transform curve using points.
void
cupsCMYKSetCurve(
cups_cmyk_t * cmyk,
int channel,
int num_xypoints,
const float * xypoints);
| Name | Description |
|---|---|
| cmyk | CMYK color separation |
| channel | Color channel |
| num_xypoints | Number of X,Y points |
| xypoints | X,Y points |
Nothing.
Set a color transform curve using gamma and density.
void
cupsCMYKSetGamma(
cups_cmyk_t * cmyk,
int channel,
float gamval,
float density);
| Name | Description |
|---|---|
| cmyk | CMYK color separation |
| channel | Ink channel |
| gamval | Gamma correction |
| density | Maximum density |
Nothing.
Set the limit on the amount of ink.
void
cupsCMYKSetInkLimit(
cups_cmyk_t * cmyk,
float limit);
| Name | Description |
|---|---|
| cmyk | CMYK color separation |
| limit | Limit of ink |
Nothing.
Set light/dark ink transforms.
void
cupsCMYKSetLtDk(
cups_cmyk_t * cmyk,
int channel,
float light,
float dark);
| Name | Description |
|---|---|
| cmyk | CMYK color separation |
| channel | Dark ink channel (+1 for light) |
| light | Light ink only level |
| dark | Dark ink only level |
Nothing.
Check to see if all bytes are zero.
int
cupsCheckBytes(
const unsigned char * bytes,
int length);
| Name | Description |
|---|---|
| bytes | Bytes to check |
| length | Number of bytes to check |
1 if they match
Check to see if all bytes match the given value.
int
cupsCheckValue(
const unsigned char * bytes,
int length,
const unsigned char value);
| Name | Description |
|---|---|
| bytes | Bytes to check |
| length | Number of bytes to check |
| value | Value to check |
1 if they match
Free a dithering buffer. Returns 0 on success, -1 on failure.
void
cupsDitherDelete(
cups_dither_t * d);
| Name | Description |
|---|---|
| d | Dithering buffer |
Nothing.
Dither a line of pixels...
void
cupsDitherLine(
cups_dither_t * d,
const cups_lut_t * lut,
const short * data,
int num_channels,
unsigned char * p);
| Name | Description |
|---|---|
| d | Dither data |
| lut | Lookup table |
| data | Separation data |
| num_channels | Number of components |
| p | Pixels |
Nothing.
Create an error-diffusion dithering buffer.
cups_dither_t *
cupsDitherNew(
int width);
| Name | Description |
|---|---|
| width | Width of output in pixels |
New state array
Find a PPD attribute based on the colormodel, media, and resolution.
ppd_attr_t *
cupsFindAttr(
ppd_file_t * ppd,
const char * name,
const char * colormodel,
const char * media,
const char * resolution,
char * spec,
int specsize);
| Name | Description |
|---|---|
| ppd | PPD file |
| name | Attribute name |
| colormodel | Color model |
| media | Media type |
| resolution | Resolution |
| spec | Final selection string |
| specsize | Size of string buffer |
Matching attribute or NULL
Free the memory used by a lookup table.
void
cupsLutDelete(
cups_lut_t * lut);
| Name | Description |
|---|---|
| lut | Lookup table to free |
Nothing.
Load a LUT from a PPD file.
cups_lut_t *
cupsLutLoad(
ppd_file_t * ppd,
const char * colormodel,
const char * media,
const char * resolution,
const char * ink);
| Name | Description |
|---|---|
| ppd | PPD file |
| colormodel | Color model |
| media | Media type |
| resolution | Resolution |
| ink | Ink name |
New lookup table
Make a lookup table from a list of pixel values. Returns a pointer to the lookup table on success, NULL on failure.
cups_lut_t *
cupsLutNew(
int num_values,
const float * values);
| Name | Description |
|---|---|
| num_values | Number of values |
| values | Lookup table values |
New lookup table
Pack pixels horizontally...
void
cupsPackHorizontal(
const unsigned char * ipixels,
unsigned char * obytes,
int width,
const unsigned char clearto,
const int step);
| Name | Description |
|---|---|
| ipixels | Input pixels |
| obytes | Output bytes |
| width | Number of pixels |
| clearto | Initial value of bytes |
| step | Step value between pixels |
Nothing.
Pack 2-bit pixels horizontally...
void
cupsPackHorizontal2(
const unsigned char * ipixels,
unsigned char * obytes,
int width,
const int step);
| Name | Description |
|---|---|
| ipixels | Input pixels |
| obytes | Output bytes |
| width | Number of pixels |
| step | Stepping value |
Nothing.
Pack pixels horizontally by bit...
void
cupsPackHorizontalBit(
const unsigned char * ipixels,
unsigned char * obytes,
int width,
const unsigned char clearto,
const unsigned char bit);
| Name | Description |
|---|---|
| ipixels | Input pixels |
| obytes | Output bytes |
| width | Number of pixels |
| clearto | Initial value of bytes |
| bit | Bit to check |
Nothing.
Pack pixels vertically...
void
cupsPackVertical(
const unsigned char * ipixels,
unsigned char * obytes,
int width,
const unsigned char bit,
const int step);
| Name | Description |
|---|---|
| ipixels | Input pixels |
| obytes | Output bytes |
| width | Number of input pixels |
| bit | Output bit |
| step | Number of bytes between columns |
Nothing.
Delete a color separation.
void
cupsRGBDelete(
cups_rgb_t * rgbptr);
| Name | Description |
|---|---|
| rgbptr | Color separation |
Nothing.
Do a grayscale separation...
void
cupsRGBDoGray(
cups_rgb_t * rgbptr,
const unsigned char * input,
unsigned char * output,
int num_pixels);
| Name | Description |
|---|---|
| rgbptr | Color separation |
| input | Input grayscale pixels |
| output | Output Device-N pixels |
| num_pixels | Number of pixels |
Nothing.
Do a RGB separation...
void
cupsRGBDoRGB(
cups_rgb_t * rgbptr,
const unsigned char * input,
unsigned char * output,
int num_pixels);
| Name | Description |
|---|---|
| rgbptr | Color separation |
| input | Input RGB pixels |
| output | Output Device-N pixels |
| num_pixels | Number of pixels |
Nothing.
Load a RGB color profile from a PPD file.
cups_rgb_t *
cupsRGBLoad(
ppd_file_t * ppd,
const char * colormodel,
const char * media,
const char * resolution);
| Name | Description |
|---|---|
| ppd | PPD file |
| colormodel | Color model |
| media | Media type |
| resolution | Resolution |
New color profile
Create a new RGB color separation.
cups_rgb_t *
cupsRGBNew(
int num_samples,
cups_sample_t * samples,
int cube_size,
int num_channels);
| Name | Description |
|---|---|
| num_samples | Number of samples |
| samples | Samples |
| cube_size | Size of LUT cube |
| num_channels | Number of color components |
New color separation or NULL
Simple CMYK lookup table
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;
};
| Name | Description |
|---|---|
| black_lut[256] | Black generation LUT |
| channels[CUPS_MAX_CHAN] | Lookup tables |
| color_lut[256] | Color removal LUT |
| ink_limit | Ink limit |
| num_channels | Number of components |
Dithering State
struct cups_dither_s
{
int errors[96];
int row;
int width;
};
| Name | Description |
|---|---|
| errors[96] | Error values |
| row | Current row |
| width | Width of buffer |
Lookup Table for Dithering
struct cups_lut_s
{
int error;
short intensity;
short pixel;
};
| Name | Description |
|---|---|
| error | Error from desired value |
| intensity | Adjusted intensity |
| pixel | Output pixel value |
Color separation lookup table
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];
};
| Name | Description |
|---|---|
| black[CUPS_MAX_RGB] | Cached black (sRGB = 0,0,0) |
| cache_init | Are cached values initialized? |
| colors | 4-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_size | Size of color cube (2-N) on a side |
| num_channels | Number of colors per sample |
| white[CUPS_MAX_RGB] | Cached white (sRGB = 255,255,255) |
Color sample point
struct cups_sample_s
{
unsigned char colors[CUPS_MAX_RGB];
unsigned char rgb[3];
};
| Name | Description |
|---|---|
| colors[CUPS_MAX_RGB] | Color values |
| rgb[3] | sRGB values |
Simple CMYK lookup table
typedef struct cups_cmyk_s cups_cmyk_t;
Dithering State
typedef struct cups_dither_s cups_dither_t;
Lookup Table for Dithering
typedef struct cups_lut_s cups_lut_t;
Color separation lookup table
typedef struct cups_rgb_s cups_rgb_t;
Color sample point
typedef struct cups_sample_s cups_sample_t;
sRGB gamma lookup table (inverted)
extern const unsigned char cups_scmy_lut[256];
sRGB gamma lookup table
extern const unsigned char cups_srgb_lut[256];