diff options
author | Jan Stockenius <jan@ghostscript.com> | 1998-08-23 04:47:43 +0000 |
---|---|---|
committer | Jan Stockenius <jan@ghostscript.com> | 1998-08-23 04:47:43 +0000 |
commit | bfad7740ce0bd4a9002dbc36f5647d742645c0ce (patch) | |
tree | d1cb85840509e1c356afe39bab914e7bba440a2c /pcl/pccsbase.c | |
parent | 2e4f92ba231ce324c47f3c924585cc8c8cff229b (diff) |
Modified to keep a copy of the special "white" color
space. Previously, this was kept in pcpatrn.c, which was not ideal
from a modularity point of view. As part of the change, an
initialization routine, pcl_cs_base_init, has been added.
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@322 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pcl/pccsbase.c')
-rw-r--r-- | pcl/pccsbase.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/pcl/pccsbase.c b/pcl/pccsbase.c index e3f94d2aa..db1a54d72 100644 --- a/pcl/pccsbase.c +++ b/pcl/pccsbase.c @@ -35,6 +35,9 @@ /* GC routines */ private_st_cs_base_t(); +/* a special "white" color space */ +private pcl_cs_base_t * pwhite_cs; + /* * Handle min/max values for device-independent color spaces. @@ -1115,7 +1118,13 @@ pcl_cs_base_build_white_cspace( gs_memory_t * pmem ) { - return alloc_base_cspace(ppbase, pcl_cspace_White, pmem); + int code = 0; + + if (pwhite_cs == 0) + code = alloc_base_cspace(&pwhite_cs, pcl_cspace_White, pmem); + if (code >= 0) + pcl_cs_base_copy_from(*ppbase, pwhite_cs); + return code; } /* @@ -1130,7 +1139,7 @@ pcl_cs_base_build_white_cspace( * * Returns > 0 if the update changed the color space, 0 if the update did not * change the color space, and < 0 in the event of an error. If the base color - * space was updated, the current PCL indexed color space (which includes this + * Space was updated, the current PCL indexed color space (which includes this * color space as a base color space) must also be updated. */ int @@ -1202,3 +1211,13 @@ pcl_cs_base_install( { return gs_setcolorspace(pcs->pgs, (*ppbase)->pcspace); } + +/* + * One-time initialization routine. This exists only to handle possible non- + * initialization of BSS. + */ + void +pcl_cs_base_init(void) +{ + pwhite_cs = 0; +} |