diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2011-01-14 16:56:47 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2011-01-14 16:56:47 +0000 |
commit | 017bc00f27b5065b0b7c8c83a4da9647cb234f6f (patch) | |
tree | 0ffbb063c89d202463ab5a3a5e37c4e935d1e3dd /gs/contrib | |
parent | f3429e2147409bc9b282bb8e0a16b1db04376ee9 (diff) |
Changes to the Unix configure based builds to tidy up specifying
subsets of output devices.
Some devices were always being included regardless of the options
given to configure, resolved by tidying up the macro expansions
in Makefile.in done by the configure script.
Also the page device and clist device are effectively required by
all configurations, so those are now included in the core build.
Finally, the contrib/gomni.c driver relied on two functions in
base/gdevbmpc.c which is an optional driver, so configuring
the Omni driver to be built it, and bmp16 not would result
in undefined symbols. contrib/gomni.c now has its own
equivalents of those functions.
The bbox device remains as the ultimate "fallback" device.
Bug 689546
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@12025 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/contrib')
-rw-r--r-- | gs/contrib/gomni.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/gs/contrib/gomni.c b/gs/contrib/gomni.c index 028d62576..8405cfa7c 100644 --- a/gs/contrib/gomni.c +++ b/gs/contrib/gomni.c @@ -346,6 +346,36 @@ gx_device_omni far_data gs_omni_device = /* ------------------------------------------------------*/ /* ------------------------------------------------------*/ +/* Colour mapping code copied from gdevbmpc.c to ensure that + * this driver does not depend on on other, optional source + * files. + */ + +/* Map a r-g-b color to a color index. */ +static gx_color_index +omni_map_16m_rgb_color(gx_device * dev, const gx_color_value cv[]) +{ + + gx_color_value r, g, b; + r = cv[0]; g = cv[1]; b = cv[2]; + return gx_color_value_to_byte(r) + + ((uint) gx_color_value_to_byte(g) << 8) + + ((ulong) gx_color_value_to_byte(b) << 16); +} + +/* Map a color index to a r-g-b color. */ +static int +omni_map_16m_color_rgb(gx_device * dev, gx_color_index color, + gx_color_value prgb[3]) +{ + prgb[2] = gx_color_value_from_byte(color >> 16); + prgb[1] = gx_color_value_from_byte((color >> 8) & 0xff); + prgb[0] = gx_color_value_from_byte(color & 0xff); + return 0; +} + +/* ------------------------------------------------------*/ + /* Generic routine to send the page to the printer. */ static int PrintPageMultiple (gx_device *pDev, int iCopies, int flush) @@ -437,8 +467,8 @@ OpenDevice (gx_device *pdev /* Driver instance to open */) { if (fDebugOutput) dprintf("Remapping color pointers\n"); - set_dev_proc(pdev, map_rgb_color, bmp_map_16m_rgb_color); - set_dev_proc(pdev, map_color_rgb, bmp_map_16m_color_rgb); + set_dev_proc(pdev, map_rgb_color, omni_map_16m_rgb_color); + set_dev_proc(pdev, map_color_rgb, omni_map_16m_color_rgb); } if (pDev->iSync) |