Example of a PostScript device type to implement named color lookup. This example is unusual in that it is split into two files. More...
#include "hhrsdk.h"
Functions | |
static void | lab_tint (float *color, int32 num_channels, float tint) |
static void | xyzD50_tint (float *color, int32 num_channels, float tint) |
Variables | |
static ncdev_color_t | color_table_CMYK [] |
static ncdev_color_t | color_table_CMYKOGV [] |
static ncdev_color_t | color_table_LabD50 [] |
static ncdev_color_t | color_table_XYZD50 [] |
static ncdev_color_t | color_table_None [] |
struct { | |
const uint8 * devicename | |
int32 devicenamelen | |
ncdev_details_t details | |
} | namedcolor_devices [] |
Example of a PostScript device type to implement named color lookup. This example is unusual in that it is split into two files.
The namedcolorlookup.c file (this file) contains the device specific named color data and C functions for optional tint transforms. It should be rewritten for each device.
The namedcolordev.c file is in skinkit. It contains boilerplate code for a PostScript device that acts as the intermediary between the RIP and the namedcolor data and tint transform functions. It accesses the data in this file using the namedcolor_find_device() and device iterator functions.
There may be many named color device instances. This example supports five instances for CMYK, CMYKOGV, Lab, XYX, and None. These devices are instantiated in SW/Sys/ExtraDevices. The test namedcolor resources that make use of them are in SW/NamedColor/Examples.
|
static |
Tint transform function for Lab colorspace. This is quite simplistic, it does not take gamut boundaries into account.
It is very important that this tint function produce white when tint is 0.0f, and that it doesn't change the solid values when tint is 1.0f. The implementation here is a C equivalent of the PostScript:
|
static |
Tint transform function for XYZ colorspace. This is quite simplistic, it does not take gamut boundaries into account.
The implementation here scales in Lab along with the necessary conversion between XYZ<->Lab.
|
static |
Example pre-defined CMYK color table.
|
static |
Example pre-defined CMYKOGV color table.
|
static |
Example pre-defined Lab D50 color table.
|
static |
Example pre-defined None color table.
|
static |
Example pre-defined XYZ D50 color table.
ncdev_details_t details |
Device details.
const uint8* devicename |
Name of device instance, e.g. 'namedcolorCMYK'. Not null-terminated.
int32 devicenamelen |
Length of 'devicename'.
struct { ... } namedcolor_devices[] |
The details of the supported namedcolor device instances with their color spaces and tables.