summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2016-02-24 12:50:47 +0000
committerChris Liddell <chris.liddell@artifex.com>2016-06-06 15:25:53 +0100
commit45dcf097558e880a76f569dd8d6c678f6ed186ce (patch)
treea6053769310375ff63efd5e493e8562d410e0112 /base
parent41d8d83a77ee6ea12109dde7b72dedc61cca01a3 (diff)
downloadghostpdl-45dcf097558e880a76f569dd8d6c678f6ed186ce.tar.gz
Make gs_imager_state == gs_state.
Change how gstate initialisation is done: Previously we relied on the imager state being a subset of the gstate (thus assigning an imager state to a graphics state over wrote to the entries common to both, and didn't overwrite any already set graphics state specific entries). Making the imager and graphics states the same means that approach doesn't work, so this changes it to initialise the entries individually. Renames gsistate.c->gsgstate.c and gxistate.h->gxgstate.h Cleanup and fix the gs_state gc stuff. Uses different check for pre/post clist pdf14 device Previously, the code used "is_gstate" in the imager/graphics state object to determine if the code was being called pre or post clist (post clist would only ever have had an imager_state so is_gstate = false). With no imager state any more, that test would no longer work (and I am dubious about whether it was really safe, anyway). Other places check for the presence of a clist reader device in the pdf14 device structure - so use that here too. Adds initial (NULL) value for show_gstate pointer in gs_state. Removes the now pointless macro for the contents of the graphics state Changes function names that had "imager" to use "gstate" Removes the redundant 'is_state' flag Cleans up gs_(g)state_putdeviceparams(): Previously we had to similar routines: one took a graphics state, and used the device from the graphics state, the other took an imager state and the device as an explicit parameter. With the removal of the imager state, "merge" those two functions Replaces gs_state with gs_gstate It makes for less confusion as it really is a g(raphics)state
Diffstat (limited to 'base')
-rw-r--r--base/gdevabuf.c5
-rw-r--r--base/gdevbbox.c46
-rw-r--r--base/gdevddrw.c26
-rw-r--r--base/gdevdevn.c10
-rw-r--r--base/gdevdevn.h2
-rw-r--r--base/gdevdflt.c38
-rw-r--r--base/gdevflp.c68
-rw-r--r--base/gdevmpla.c6
-rw-r--r--base/gdevmplt.c6
-rw-r--r--base/gdevnfwd.c46
-rw-r--r--base/gdevoflt.c32
-rw-r--r--base/gdevp14.c924
-rw-r--r--base/gdevp14.h14
-rw-r--r--base/gdevplnx.c114
-rw-r--r--base/gdevsclass.c88
-rw-r--r--base/gdevvec.c120
-rw-r--r--base/gdevvec.h24
-rw-r--r--base/gsalpha.c4
-rw-r--r--base/gsalpha.h4
-rw-r--r--base/gsalphac.c2
-rw-r--r--base/gscdevn.c80
-rw-r--r--base/gscdevn.h6
-rw-r--r--base/gschar.c12
-rw-r--r--base/gschar.h12
-rw-r--r--base/gscicach.c8
-rw-r--r--base/gscicach.h2
-rw-r--r--base/gscie.c83
-rw-r--r--base/gscie.h16
-rw-r--r--base/gsciemap.c164
-rw-r--r--base/gsclipsr.c4
-rw-r--r--base/gsclipsr.h4
-rw-r--r--base/gscolor.c20
-rw-r--r--base/gscolor.h16
-rw-r--r--base/gscolor1.c24
-rw-r--r--base/gscolor1.h22
-rw-r--r--base/gscolor2.c38
-rw-r--r--base/gscolor2.h18
-rw-r--r--base/gscolor3.c8
-rw-r--r--base/gscolor3.h6
-rw-r--r--base/gscoord.c52
-rw-r--r--base/gscoord.h46
-rw-r--r--base/gscpixel.c10
-rw-r--r--base/gscscie.c10
-rw-r--r--base/gscsepr.c56
-rw-r--r--base/gscsepr.h2
-rw-r--r--base/gscspace.c78
-rw-r--r--base/gscspace.h10
-rw-r--r--base/gscssub.c10
-rw-r--r--base/gscssub.h10
-rw-r--r--base/gsdevice.c51
-rw-r--r--base/gsdevice.h36
-rw-r--r--base/gsdfilt.c6
-rw-r--r--base/gsdfilt.h14
-rw-r--r--base/gsdps.c12
-rw-r--r--base/gsdps.h8
-rw-r--r--base/gsdps1.c20
-rw-r--r--base/gsequivc.c38
-rw-r--r--base/gsequivc.h6
-rw-r--r--base/gsfont.c10
-rw-r--r--base/gsfont.h10
-rw-r--r--base/gsgstate.c254
-rw-r--r--base/gshsb.c4
-rw-r--r--base/gshsb.h4
-rw-r--r--base/gsht.c192
-rw-r--r--base/gsht.h8
-rw-r--r--base/gsht1.c30
-rw-r--r--base/gsht1.h12
-rw-r--r--base/gshtscr.c8
-rw-r--r--base/gshtx.c6
-rw-r--r--base/gshtx.h8
-rw-r--r--base/gsicc.c60
-rw-r--r--base/gsicc_cache.c66
-rw-r--r--base/gsicc_cache.h12
-rw-r--r--base/gsicc_cms.h4
-rw-r--r--base/gsicc_create.c98
-rw-r--r--base/gsicc_create.h2
-rw-r--r--base/gsicc_manage.c79
-rw-r--r--base/gsicc_manage.h44
-rw-r--r--base/gsicc_nocm.c54
-rw-r--r--base/gsicc_profilecache.c4
-rw-r--r--base/gsicc_profilecache.h4
-rw-r--r--base/gsicc_replacecm.c12
-rw-r--r--base/gsimage.c18
-rw-r--r--base/gsimage.h10
-rw-r--r--base/gsimpath.c4
-rw-r--r--base/gsiparm2.h2
-rw-r--r--base/gsistate.c247
-rw-r--r--base/gslib.c54
-rw-r--r--base/gsline.c82
-rw-r--r--base/gsline.h74
-rw-r--r--base/gsnamecl.c20
-rw-r--r--base/gsnamecl.h64
-rw-r--r--base/gsncdummy.c124
-rw-r--r--base/gsovrc.c10
-rw-r--r--base/gspaint.c43
-rw-r--r--base/gspaint.h12
-rw-r--r--base/gspath.c75
-rw-r--r--base/gspath.h60
-rw-r--r--base/gspath1.c70
-rw-r--r--base/gspath2.h10
-rw-r--r--base/gspcolor.c26
-rw-r--r--base/gspcolor.h10
-rw-r--r--base/gsptype1.c89
-rw-r--r--base/gsptype1.h12
-rw-r--r--base/gsptype2.c26
-rw-r--r--base/gsptype2.h2
-rw-r--r--base/gsrefct.h6
-rw-r--r--base/gsrop.c16
-rw-r--r--base/gsrop.h16
-rw-r--r--base/gsshade.c12
-rw-r--r--base/gsshade.h8
-rw-r--r--base/gsstate.c245
-rw-r--r--base/gsstate.h74
-rw-r--r--base/gsstype.h2
-rw-r--r--base/gstext.c56
-rw-r--r--base/gstext.h48
-rw-r--r--base/gstrans.c147
-rw-r--r--base/gstrans.h50
-rw-r--r--base/gstype1.c6
-rw-r--r--base/gstype1.h4
-rw-r--r--base/gstype2.c10
-rw-r--r--base/gstype42.c11
-rw-r--r--base/gx.h11
-rw-r--r--base/gxacpath.c16
-rw-r--r--base/gxblend.h4
-rw-r--r--base/gxblend1.c14
-rw-r--r--base/gxccache.c2
-rw-r--r--base/gxcdevn.h4
-rw-r--r--base/gxchar.c74
-rw-r--r--base/gxchar.h8
-rw-r--r--base/gxchrout.c16
-rw-r--r--base/gxchrout.h10
-rw-r--r--base/gxcht.c20
-rw-r--r--base/gxcie.h24
-rw-r--r--base/gxcldev.h4
-rw-r--r--base/gxclimag.c164
-rw-r--r--base/gxclip.c18
-rw-r--r--base/gxclip.h2
-rw-r--r--base/gxclip2.c2
-rw-r--r--base/gxclipm.c2
-rw-r--r--base/gxclist.c17
-rw-r--r--base/gxclist.h12
-rw-r--r--base/gxclpath.c150
-rw-r--r--base/gxclpath.h8
-rw-r--r--base/gxclrast.c290
-rw-r--r--base/gxclrect.c4
-rw-r--r--base/gxcmap.c347
-rw-r--r--base/gxcmap.h62
-rw-r--r--base/gxcomp.h14
-rw-r--r--base/gxcoord.h4
-rw-r--r--base/gxcpath.c27
-rw-r--r--base/gxcspace.h30
-rw-r--r--base/gxdcconv.c20
-rw-r--r--base/gxdcconv.h8
-rw-r--r--base/gxdcolor.c26
-rw-r--r--base/gxdcolor.h30
-rw-r--r--base/gxdevcli.h66
-rw-r--r--base/gxdevice.h6
-rw-r--r--base/gxdevmem.h2
-rw-r--r--base/gxdht.h4
-rw-r--r--base/gxdhtserial.c4
-rw-r--r--base/gxdhtserial.h8
-rw-r--r--base/gxfapi.c39
-rw-r--r--base/gxfapi.h10
-rw-r--r--base/gxfcache.h6
-rw-r--r--base/gxfill.c32
-rw-r--r--base/gxfont.h2
-rw-r--r--base/gxfont42.h2
-rw-r--r--base/gxgstate.h507
-rw-r--r--base/gxhintn.c3
-rw-r--r--base/gxhldevc.c33
-rw-r--r--base/gxhldevc.h28
-rw-r--r--base/gxht.c26
-rw-r--r--base/gxht.h4
-rw-r--r--base/gxht_thresh.c28
-rw-r--r--base/gxi12bit.c38
-rw-r--r--base/gxi16bit.c2
-rw-r--r--base/gxicolor.c40
-rw-r--r--base/gxifast.c6
-rw-r--r--base/gximag3x.c26
-rw-r--r--base/gximag3x.h4
-rw-r--r--base/gximage.c2
-rw-r--r--base/gximage.h8
-rw-r--r--base/gximage1.c4
-rw-r--r--base/gximage2.c14
-rw-r--r--base/gximage3.c20
-rw-r--r--base/gximage3.h4
-rw-r--r--base/gximage4.c4
-rw-r--r--base/gximono.c36
-rw-r--r--base/gxiparam.h2
-rw-r--r--base/gxipixel.c38
-rw-r--r--base/gxiscale.c42
-rw-r--r--base/gxistate.h340
-rw-r--r--base/gxp1impl.h2
-rw-r--r--base/gxpaint.c22
-rw-r--r--base/gxpaint.h36
-rw-r--r--base/gxpath.h40
-rw-r--r--base/gxpcmap.c91
-rw-r--r--base/gxpcolor.h26
-rw-r--r--base/gxpcopy.c10
-rw-r--r--base/gxpdash.c18
-rw-r--r--base/gxshade.c41
-rw-r--r--base/gxshade.h6
-rw-r--r--base/gxshade1.c60
-rw-r--r--base/gxshade4.c30
-rw-r--r--base/gxshade4.h2
-rw-r--r--base/gxshade6.c76
-rw-r--r--base/gxstate.h46
-rw-r--r--base/gxstroke.c212
-rw-r--r--base/gxtext.h6
-rw-r--r--base/gxttfb.c10
-rw-r--r--base/gxtype1.c28
-rw-r--r--base/gxtype1.h2
-rw-r--r--base/gzacpath.h2
-rw-r--r--base/gzht.h26
-rw-r--r--base/gzline.h2
-rw-r--r--base/gzstate.h150
-rw-r--r--base/lib.mak106
218 files changed, 4651 insertions, 4720 deletions
diff --git a/base/gdevabuf.c b/base/gdevabuf.c
index 91a1a37a9..737318a9f 100644
--- a/base/gdevabuf.c
+++ b/base/gdevabuf.c
@@ -432,7 +432,7 @@ mem_abuf_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
/* Fill a rectangle. */
static int
mem_abuf_fill_rectangle_hl_color(gx_device * dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis,
+ const gs_gstate *pgs,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
@@ -442,6 +442,7 @@ mem_abuf_fill_rectangle_hl_color(gx_device * dev, const gs_fixed_rect *rect,
int y = fixed2int(rect->p.y);
int w = fixed2int(rect->q.x) - x;
int h = fixed2int(rect->q.y) - y;
+ (void)pgs;
x -= mdev->mapped_x;
fit_fill_xy(dev, x, y, w, h);
@@ -480,7 +481,7 @@ mem_abuf_get_clipping_box(gx_device * dev, gs_fixed_rect * pbox)
* We should do alpha buffering iff this value is >1.
*/
int
-alpha_buffer_bits(gs_state * pgs)
+alpha_buffer_bits(gs_gstate * pgs)
{
gx_device *dev;
diff --git a/base/gdevbbox.c b/base/gdevbbox.c
index 0a9ea7146..81fa40e91 100644
--- a/base/gdevbbox.c
+++ b/base/gdevbbox.c
@@ -24,7 +24,7 @@
#include "gdevbbox.h"
#include "gxdcolor.h" /* for gx_device_black/white */
#include "gxiparam.h" /* for image source size */
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpaint.h"
#include "gxpath.h"
#include "gxcpath.h"
@@ -803,7 +803,7 @@ bbox_draw_thin_line(gx_device * dev,
(pbox)->q.x += (adj).x, (pbox)->q.y += (adj).y)
static int
-bbox_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
+bbox_fill_path(gx_device * dev, const gs_gstate * pgs, gx_path * ppath,
const gx_fill_params * params, const gx_device_color * pdevc,
const gx_clip_path * pcpath)
{
@@ -839,15 +839,15 @@ bbox_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
* on the target.
*/
if (BBOX_IN_RECT(bdev, &ibox))
- return fill_path(tdev, pis, ppath, params, pdevc, pcpath);
+ return fill_path(tdev, pgs, ppath, params, pdevc, pcpath);
/*
* If the target uses the default algorithm, just draw on the
* bbox device.
*/
if (tdev != 0 && fill_path == gx_default_fill_path)
- return fill_path(dev, pis, ppath, params, pdevc, pcpath);
+ return fill_path(dev, pgs, ppath, params, pdevc, pcpath);
/* Draw on the target now. */
- code = fill_path(tdev, pis, ppath, params, pdevc, pcpath);
+ code = fill_path(tdev, pgs, ppath, params, pdevc, pcpath);
if (code < 0)
return code;
if (pcpath != NULL &&
@@ -862,18 +862,18 @@ bbox_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
set_nonclient_dev_color(&devc, bdev->black); /* any non-white color will do */
bdev->target = NULL;
- code = gx_default_fill_path(dev, pis, ppath, params, &devc, pcpath);
+ code = gx_default_fill_path(dev, pgs, ppath, params, &devc, pcpath);
bdev->target = tdev;
} else { /* Just use the path bounding box. */
BBOX_ADD_RECT(bdev, ibox.p.x, ibox.p.y, ibox.q.x, ibox.q.y);
}
return code;
} else
- return fill_path(tdev, pis, ppath, params, pdevc, pcpath);
+ return fill_path(tdev, pgs, ppath, params, pdevc, pcpath);
}
static int
-bbox_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
+bbox_stroke_path(gx_device * dev, const gs_gstate * pgs, gx_path * ppath,
const gx_stroke_params * params,
const gx_drawing_color * pdevc, const gx_clip_path * pcpath)
{
@@ -882,14 +882,14 @@ bbox_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
/* Skip the call if there is no target. */
int code =
(tdev == 0 ? 0 :
- dev_proc(tdev, stroke_path)(tdev, pis, ppath, params, pdevc, pcpath));
+ dev_proc(tdev, stroke_path)(tdev, pgs, ppath, params, pdevc, pcpath));
if (!GX_DC_IS_TRANSPARENT(pdevc, bdev)) {
gs_fixed_rect ibox;
gs_fixed_point expand;
int ibox_valid = 0;
- if (gx_stroke_path_expansion(pis, ppath, &expand) == 0 &&
+ if (gx_stroke_path_expansion(pgs, ppath, &expand) == 0 &&
gx_path_bbox(ppath, &ibox) >= 0
) {
/* The fast result is exact. */
@@ -907,7 +907,7 @@ bbox_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
set_nonclient_dev_color(&devc, bdev->black); /* any non-white color will do */
bdev->target = NULL;
- gx_default_stroke_path(dev, pis, ppath, params, &devc, pcpath);
+ gx_default_stroke_path(dev, pgs, ppath, params, &devc, pcpath);
bdev->target = tdev;
} else {
/* Just use the path bounding box. */
@@ -977,7 +977,7 @@ static const gx_image_enum_procs_t bbox_image_enum_procs = {
};
static int
-bbox_image_begin(const gs_imager_state * pis, const gs_matrix * pmat,
+bbox_image_begin(const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_clip_path * pcpath, gs_memory_t * memory,
bbox_image_enum ** ppbe)
@@ -987,7 +987,7 @@ bbox_image_begin(const gs_imager_state * pis, const gs_matrix * pmat,
bbox_image_enum *pbe;
if (pmat == 0)
- pmat = &ctm_only(pis);
+ pmat = &ctm_only(pgs);
if ((code = gs_matrix_invert(&pic->ImageMatrix, &mat)) < 0 ||
(code = gs_matrix_multiply(&mat, pmat, &mat)) < 0
)
@@ -1006,7 +1006,7 @@ bbox_image_begin(const gs_imager_state * pis, const gs_matrix * pmat,
pbe->y = prect->p.y, pbe->height = prect->q.y - prect->p.y;
} else {
gs_int_point size;
- int code = (*pic->type->source_size) (pis, pic, &size);
+ int code = (*pic->type->source_size) (pgs, pic, &size);
if (code < 0) {
gs_free_object(memory, pbe, "bbox_image_begin");
@@ -1033,7 +1033,7 @@ bbox_image_copy_target_info(bbox_image_enum * pbe)
static int
bbox_begin_typed_image(gx_device * dev,
- const gs_imager_state * pis, const gs_matrix * pmat,
+ const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath,
@@ -1041,7 +1041,7 @@ bbox_begin_typed_image(gx_device * dev,
{
bbox_image_enum *pbe;
int code =
- bbox_image_begin(pis, pmat, pic, prect, pcpath, memory, &pbe);
+ bbox_image_begin(pgs, pmat, pic, prect, pcpath, memory, &pbe);
if (code < 0)
return code;
@@ -1062,7 +1062,7 @@ bbox_begin_typed_image(gx_device * dev,
begin_typed_image = dev_proc(tdev, begin_typed_image);
}
code = (*begin_typed_image)
- (tdev, pis, pmat, pic, prect, pdcolor, pcpath, memory,
+ (tdev, pgs, pmat, pic, prect, pdcolor, pcpath, memory,
&pbe->target_info);
if (code) {
bbox_image_end_image((gx_image_enum_common_t *)pbe, false);
@@ -1215,7 +1215,7 @@ static const gx_device_bbox_procs_t box_procs_forward = {
static int
bbox_create_compositor(gx_device * dev,
gx_device ** pcdev, const gs_composite_t * pcte,
- gs_imager_state * pis, gs_memory_t * memory, gx_device *cindev)
+ gs_gstate * pgs, gs_memory_t * memory, gx_device *cindev)
{
gx_device_bbox *const bdev = (gx_device_bbox *) dev;
gx_device *target = bdev->target;
@@ -1237,7 +1237,7 @@ bbox_create_compositor(gx_device * dev,
gx_device *temp_cdev;
gx_device_bbox *bbcdev;
int code = (*dev_proc(target, create_compositor))
- (target, &temp_cdev, pcte, pis, memory, cindev);
+ (target, &temp_cdev, pcte, pgs, memory, cindev);
/* If the target did not create a new compositor then we are done. */
if (code < 0 || target == temp_cdev) {
@@ -1263,14 +1263,14 @@ bbox_create_compositor(gx_device * dev,
/* ------ Text imaging ------ */
static int
-bbox_text_begin(gx_device * dev, gs_imager_state * pis,
+bbox_text_begin(gx_device * dev, gs_gstate * pgs,
const gs_text_params_t * text, gs_font * font,
gx_path * path, const gx_device_color * pdcolor,
const gx_clip_path * pcpath,
gs_memory_t * memory, gs_text_enum_t ** ppenum)
{
gx_device_bbox *const bdev = (gx_device_bbox *) dev;
- int code = gx_default_text_begin(dev, pis, text, font, path, pdcolor,
+ int code = gx_default_text_begin(dev, pgs, text, font, path, pdcolor,
pcpath, memory, ppenum);
if (code >=0 && bdev->target != NULL) {
@@ -1283,7 +1283,7 @@ bbox_text_begin(gx_device * dev, gs_imager_state * pis,
/* --------------- fillpage ------------------- */
-int bbox_fillpage(gx_device *dev, gs_imager_state * pis, gx_device_color *pdevc)
+int bbox_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
{
/* Call the target's proc, but don't account the size. */
gx_device_bbox *const bdev = (gx_device_bbox *) dev;
@@ -1292,5 +1292,5 @@ int bbox_fillpage(gx_device *dev, gs_imager_state * pis, gx_device_color *pdevc)
BBOX_INIT_BOX(bdev);
if (tdev == NULL)
return 0;
- return dev_proc(tdev, fillpage)(tdev, pis, pdevc);
+ return dev_proc(tdev, fillpage)(tdev, pgs, pdevc);
}
diff --git a/base/gdevddrw.c b/base/gdevddrw.c
index df03b430d..97ba6706c 100644
--- a/base/gdevddrw.c
+++ b/base/gdevddrw.c
@@ -26,7 +26,7 @@
#include "gxdcolor.h"
#include "gxdevice.h"
#include "gxiparam.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxhldevc.h"
#include "gdevddrw.h"
#include "vdtrace.h"
@@ -992,7 +992,7 @@ RELOC_PTRS_END
*/
static int
gx_no_begin_image(gx_device * dev,
- const gs_imager_state * pis, const gs_image_t * pim,
+ const gs_gstate * pgs, const gs_image_t * pim,
gs_image_format_t format, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * memory, gx_image_enum_common_t ** pinfo)
@@ -1001,7 +1001,7 @@ gx_no_begin_image(gx_device * dev,
}
int
gx_default_begin_image(gx_device * dev,
- const gs_imager_state * pis, const gs_image_t * pim,
+ const gs_gstate * pgs, const gs_image_t * pim,
gs_image_format_t format, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * memory, gx_image_enum_common_t ** pinfo)
@@ -1027,7 +1027,7 @@ gx_default_begin_image(gx_device * dev,
ptim = &image;
}
code = (*dev_proc(dev, begin_typed_image))
- (dev, pis, NULL, (const gs_image_common_t *)ptim, prect, pdcolor,
+ (dev, pgs, NULL, (const gs_image_common_t *)ptim, prect, pdcolor,
pcpath, memory, pinfo);
set_dev_proc(dev, begin_image, save_begin_image);
return code;
@@ -1035,26 +1035,26 @@ gx_default_begin_image(gx_device * dev,
int
gx_default_begin_typed_image(gx_device * dev,
- const gs_imager_state * pis, const gs_matrix * pmat,
+ const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * memory, gx_image_enum_common_t ** pinfo)
{
/* Processing an image object operation */
- if (pis != NULL) /* Null can happen when generating image3 mask */
+ if (pgs != NULL) /* Null can happen when generating image3 mask */
dev_proc(dev, set_graphics_type_tag)(dev, GS_IMAGE_TAG);
- /* If this is an ImageType 1 image using the imager's CTM,
+ /* If this is an ImageType 1 image using the gs_gstate's CTM,
* defer to begin_image.
*/
if (pic->type->begin_typed_image == gx_begin_image1) {
const gs_image_t *pim = (const gs_image_t *)pic;
if (pmat == 0 ||
- (pis != 0 && !gs_matrix_compare(pmat, &ctm_only(pis)))
+ (pgs != 0 && !gs_matrix_compare(pmat, &ctm_only(pgs)))
) {
int code = (*dev_proc(dev, begin_image))
- (dev, pis, pim, pim->format, prect, pdcolor,
+ (dev, pgs, pim, pim->format, prect, pdcolor,
pcpath, memory, pinfo);
if (code >= 0)
@@ -1062,7 +1062,7 @@ gx_default_begin_typed_image(gx_device * dev,
}
}
return (*pic->type->begin_typed_image)
- (dev, pis, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
+ (dev, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
}
/* Backward compatibility for obsolete driver procedures. */
@@ -1092,9 +1092,9 @@ gx_default_end_image(gx_device *dev, gx_image_enum_common_t * info,
}
int
-gx_default_fillpage(gx_device *dev, gs_imager_state * pis, gx_device_color *pdevc)
+gx_default_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
{
- bool hl_color_available = gx_hld_is_hl_color_available(pis, pdevc);
+ bool hl_color_available = gx_hld_is_hl_color_available(pgs, pdevc);
int code = 0;
/* Fill the page directly, ignoring clipping. */
@@ -1106,7 +1106,7 @@ gx_default_fillpage(gx_device *dev, gs_imager_state * pis, gx_device_color *pdev
rect.q.x = int2fixed(dev->width);
rect.q.y = int2fixed(dev->height);
code = dev_proc(dev, fill_rectangle_hl_color)(dev,
- &rect, (const gs_imager_state *)pis, pdevc, NULL);
+ &rect, (const gs_gstate *)pgs, pdevc, NULL);
}
if (!hl_color_available || code == gs_error_rangecheck)
code = gx_fill_rectangle_device_rop(0, 0, dev->width, dev->height, pdevc, dev, lop_default);
diff --git a/base/gdevdevn.c b/base/gdevdevn.c
index f781670c8..2617d3cea 100644
--- a/base/gdevdevn.c
+++ b/base/gdevdevn.c
@@ -51,14 +51,14 @@ gray_cs_to_devn_cm(gx_device * dev, int * map, frac gray, frac out[])
/* Convert an RGB color space to DeviceN colorants. */
void
rgb_cs_to_devn_cm(gx_device * dev, int * map,
- const gs_imager_state *pis, frac r, frac g, frac b, frac out[])
+ const gs_gstate *pgs, frac r, frac g, frac b, frac out[])
{
int i = dev->color_info.num_components - 1;
frac cmyk[4];
for(; i >= 0; i--) /* Clear colors */
out[i] = frac_0;
- color_rgb_to_cmyk(r, g, b, pis, cmyk, dev->memory);
+ color_rgb_to_cmyk(r, g, b, pgs, cmyk, dev->memory);
if ((i = map[0]) != GX_DEVICE_COLOR_MAX_COMPONENTS)
out[i] = cmyk[0];
if ((i = map[1]) != GX_DEVICE_COLOR_MAX_COMPONENTS)
@@ -1034,12 +1034,12 @@ gray_cs_to_spotcmyk_cm(gx_device * dev, frac gray, frac out[])
}
static void
-rgb_cs_to_spotcmyk_cm(gx_device * dev, const gs_imager_state *pis,
+rgb_cs_to_spotcmyk_cm(gx_device * dev, const gs_gstate *pgs,
frac r, frac g, frac b, frac out[])
{
int * map = ((gx_devn_prn_device *) dev)->devn_params.separation_order_map;
- rgb_cs_to_devn_cm(dev, map, pis, r, g, b, out);
+ rgb_cs_to_devn_cm(dev, map, pgs, r, g, b, out);
}
static void
@@ -1138,7 +1138,7 @@ gx_devn_prn_ret_devn_params(gx_device * dev)
* Device proc for updating the equivalent CMYK color for spot colors.
*/
int
-gx_devn_prn_update_spot_equivalent_colors(gx_device *dev, const gs_state * pgs)
+gx_devn_prn_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs)
{
gx_devn_prn_device *pdev = (gx_devn_prn_device *)dev;
diff --git a/base/gdevdevn.h b/base/gdevdevn.h
index 80b0ab80d..ad12e2714 100644
--- a/base/gdevdevn.h
+++ b/base/gdevdevn.h
@@ -134,7 +134,7 @@ extern fixed_colorant_name DeviceCMYKComponents[];
void gray_cs_to_devn_cm(gx_device * dev, int * map, frac gray, frac out[]);
void rgb_cs_to_devn_cm(gx_device * dev, int * map,
- const gs_imager_state *pis, frac r, frac g, frac b, frac out[]);
+ const gs_gstate *pgs, frac r, frac g, frac b, frac out[]);
void cmyk_cs_to_devn_cm(gx_device * dev, const int * map,
frac c, frac m, frac y, frac k, frac out[]);
diff --git a/base/gdevdflt.c b/base/gdevdflt.c
index 8596775b4..8644f75de 100644
--- a/base/gdevdflt.c
+++ b/base/gdevdflt.c
@@ -26,7 +26,7 @@
#include "gxdevsop.h"
#include "gdevp14.h" /* Needed to patch up the procs after compositor creation */
#include "gstrans.h" /* For gs_pdf14trans_t */
-#include "gxistate.h" /* for gs_image_state_s */
+#include "gxgstate.h" /* for gs_image_state_s */
/* defined in gsdpram.c */
@@ -838,7 +838,7 @@ gx_get_largest_clipping_box(gx_device * dev, gs_fixed_rect * pbox)
int
gx_no_create_compositor(gx_device * dev, gx_device ** pcdev,
const gs_composite_t * pcte,
- gs_imager_state * pis, gs_memory_t * memory,
+ gs_gstate * pgs, gs_memory_t * memory,
gx_device *cdev)
{
return_error(gs_error_unknownerror); /* not implemented */
@@ -846,16 +846,16 @@ gx_no_create_compositor(gx_device * dev, gx_device ** pcdev,
int
gx_default_create_compositor(gx_device * dev, gx_device ** pcdev,
const gs_composite_t * pcte,
- gs_imager_state * pis, gs_memory_t * memory,
+ gs_gstate * pgs, gs_memory_t * memory,
gx_device *cdev)
{
return pcte->type->procs.create_default_compositor
- (pcte, pcdev, dev, pis, memory);
+ (pcte, pcdev, dev, pgs, memory);
}
int
gx_null_create_compositor(gx_device * dev, gx_device ** pcdev,
const gs_composite_t * pcte,
- gs_imager_state * pis, gs_memory_t * memory,
+ gs_gstate * pgs, gs_memory_t * memory,
gx_device *cdev)
{
*pcdev = dev;
@@ -866,7 +866,7 @@ gx_null_create_compositor(gx_device * dev, gx_device ** pcdev,
* Default handler for creating a compositor device when writing the clist. */
int
gx_default_composite_clist_write_update(const gs_composite_t *pcte, gx_device * dev,
- gx_device ** pcdev, gs_imager_state * pis, gs_memory_t * mem)
+ gx_device ** pcdev, gs_gstate * pgs, gs_memory_t * mem)
{
*pcdev = dev; /* Do nothing -> return the same device */
return 0;
@@ -874,7 +874,7 @@ gx_default_composite_clist_write_update(const gs_composite_t *pcte, gx_device *
/* Default handler for adjusting a compositor's CTM. */
int
-gx_default_composite_adjust_ctm(gs_composite_t *pcte, int x0, int y0, gs_imager_state *pis)
+gx_default_composite_adjust_ctm(gs_composite_t *pcte, int x0, int y0, gs_gstate *pgs)
{
return 0;
}
@@ -903,7 +903,7 @@ gx_default_composite_is_friendly(const gs_composite_t *this, byte cmd0, byte cmd
*/
int
gx_default_composite_clist_read_update(gs_composite_t *pxcte, gx_device * cdev,
- gx_device * tdev, gs_imager_state * pis, gs_memory_t * mem)
+ gx_device * tdev, gs_gstate * pgs, gs_memory_t * mem)
{
return 0; /* Do nothing */
}
@@ -972,7 +972,7 @@ gx_default_dev_spec_op(gx_device *pdev, int dev_spec_op, void *data, int size)
int
gx_default_fill_rectangle_hl_color(gx_device *pdev,
const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
return_error(gs_error_rangecheck);
@@ -991,7 +991,7 @@ gx_default_include_color_space(gx_device *pdev, gs_color_space *cspace,
* src/gsequivc.c.
*/
int
-gx_default_update_spot_equivalent_colors(gx_device *pdev, const gs_state * pgs)
+gx_default_update_spot_equivalent_colors(gx_device *pdev, const gs_gstate * pgs)
{
return 0;
}
@@ -1041,19 +1041,19 @@ gx_default_process_page(gx_device *dev, gx_process_page_options_t *options)
/* ---------------- Default per-instance procedures ---------------- */
int
-gx_default_install(gx_device * dev, gs_state * pgs)
+gx_default_install(gx_device * dev, gs_gstate * pgs)
{
return 0;
}
int
-gx_default_begin_page(gx_device * dev, gs_state * pgs)
+gx_default_begin_page(gx_device * dev, gs_gstate * pgs)
{
return 0;
}
int
-gx_default_end_page(gx_device * dev, int reason, gs_state * pgs)
+gx_default_end_page(gx_device * dev, int reason, gs_gstate * pgs)
{
return (reason != 2 ? 1 : 0);
}
@@ -1443,7 +1443,7 @@ int gx_update_from_subclass(gx_device *dev)
}
int gx_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte,
- gs_imager_state *pis, gs_memory_t *memory, gx_device *cdev)
+ gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev)
{
pdf14_clist_device *p14dev;
generic_subclass_data *psubclass_data;
@@ -1472,13 +1472,13 @@ int gx_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const gs_co
p14dev->target->child->procs.get_color_mapping_procs = p14dev->saved_target_get_color_mapping_procs;
p14dev->target->child->procs.get_color_comp_index = p14dev->saved_target_get_color_comp_index;
- pis->get_cmap_procs = p14dev->save_get_cmap_procs;
- gx_set_cmap_procs(pis, p14dev->target);
+ pgs->get_cmap_procs = p14dev->save_get_cmap_procs;
+ gx_set_cmap_procs(pgs, p14dev->target);
subclass_device = p14dev->target;
p14dev->target = p14dev->target->child;
- code = dev->procs.create_compositor(dev, pcdev, pcte, pis, memory, cdev);
+ code = dev->procs.create_compositor(dev, pcdev, pcte, pgs, memory, cdev);
p14dev->target = subclass_device;
@@ -1486,11 +1486,11 @@ int gx_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const gs_co
}
break;
default:
- code = dev->procs.create_compositor(dev, pcdev, pcte, pis, memory, cdev);
+ code = dev->procs.create_compositor(dev, pcdev, pcte, pgs, memory, cdev);
break;
}
} else {
- code = dev->procs.create_compositor(dev, pcdev, pcte, pis, memory, cdev);
+ code = dev->procs.create_compositor(dev, pcdev, pcte, pgs, memory, cdev);
}
dev->procs.create_compositor = gx_subclass_create_compositor;
return code;
diff --git a/base/gdevflp.c b/base/gdevflp.c
index e542eaad0..7fda06925 100644
--- a/base/gdevflp.c
+++ b/base/gdevflp.c
@@ -38,7 +38,7 @@
#include "gsdevice.h" /* requires gsmatrix.h */
#include "gxdcolor.h" /* for gx_device_black/white */
#include "gxiparam.h" /* for image source size */
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpaint.h"
#include "gxpath.h"
#include "gxcpath.h"
@@ -562,7 +562,7 @@ int flp_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, g
return 0;
}
-int flp_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath,
+int flp_fill_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
const gx_fill_params *params,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
@@ -571,12 +571,12 @@ int flp_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath,
if (code < 0)
return code;
if (!code)
- return default_subclass_fill_path(dev, pis, ppath, params, pdcolor, pcpath);
+ return default_subclass_fill_path(dev, pgs, ppath, params, pdcolor, pcpath);
return 0;
}
-int flp_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath,
+int flp_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
const gx_stroke_params *params,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
@@ -585,7 +585,7 @@ int flp_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath,
if (code < 0)
return code;
if (!code)
- return default_subclass_stroke_path(dev, pis, ppath, params, pdcolor, pcpath);
+ return default_subclass_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath);
return 0;
}
@@ -659,7 +659,7 @@ int flp_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy
return 0;
}
-int flp_begin_image(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim,
+int flp_begin_image(gx_device *dev, const gs_gstate *pgs, const gs_image_t *pim,
gs_image_format_t format, const gs_int_rect *prect,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
@@ -669,7 +669,7 @@ int flp_begin_image(gx_device *dev, const gs_imager_state *pis, const gs_image_t
if (code < 0)
return code;
if (!code)
- return default_subclass_begin_image(dev, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo);
+ return default_subclass_begin_image(dev, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo);
return 0;
}
@@ -765,7 +765,7 @@ static const gx_image_enum_procs_t flp_image_enum_procs = {
flp_image_end_image
};
-int flp_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat,
+int flp_begin_typed_image(gx_device *dev, const gs_gstate *pgs, const gs_matrix *pmat,
const gs_image_common_t *pic, const gs_int_rect *prect,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
@@ -778,7 +778,7 @@ int flp_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_m
if (code < 0)
return code;
if (!code)
- return default_subclass_begin_typed_image(dev, pis, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
+ return default_subclass_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
if (pic->type->index == 1) {
const gs_image_t *pim1 = (const gs_image_t *)pic;
@@ -819,14 +819,14 @@ int flp_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect,
}
int flp_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte,
- gs_imager_state *pis, gs_memory_t *memory, gx_device *cdev)
+ gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_create_compositor(dev, pcdev, pcte, pis, memory, cdev);
+ return default_subclass_create_compositor(dev, pcdev, pcte, pgs, memory, cdev);
return 0;
}
@@ -894,7 +894,7 @@ static const gs_text_enum_procs_t flp_text_procs = {
* in which case we create a text enumerator with our dummy procedures, or we are leaving it
* up to the device, in which case we simply pass on the 'begin' method to the device.
*/
-int flp_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text,
+int flp_text_begin(gx_device *dev, gs_gstate *pgs, const gs_text_params_t *text,
gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gs_text_enum_t **ppte)
{
@@ -906,24 +906,24 @@ int flp_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t
* secondly because op_show_restore executes an unconditional grestore, assuming
* that a gsave has been done simply *because* its a tringwidth operation !
*/
- if (dev->DisablePageHandler || ((text->operation & TEXT_DO_NONE) && (text->operation & TEXT_RETURN_WIDTH) && pis->text_rendering_mode != 3))
+ if (dev->DisablePageHandler || ((text->operation & TEXT_DO_NONE) && (text->operation & TEXT_RETURN_WIDTH) && pgs->text_rendering_mode != 3))
/* Note that the high level devices *must* be given the opportunity to 'see' the
* stringwidth operation, or they won;t be able to cache the glyphs properly.
* So always pass stringwidth operations to the child.
*/
- return default_subclass_text_begin(dev, pis, text, font, path, pdcolor, pcpath, memory, ppte);
+ return default_subclass_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_text_begin(dev, pis, text, font, path, pdcolor, pcpath, memory, ppte);
+ return default_subclass_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
rc_alloc_struct_1(penum, flp_text_enum_t, &st_flp_text_enum, memory,
return_error(gs_error_VMerror), "gdev_flp_text_begin");
penum->rc.free = rc_free_text_enum;
code = gs_text_enum_init((gs_text_enum_t *)penum, &flp_text_procs,
- dev, pis, text, font, path, pdcolor, pcpath, memory);
+ dev, pgs, text, font, path, pdcolor, pcpath, memory);
if (code < 0) {
gs_free_object(memory, penum, "gdev_flp_text_begin");
return code;
@@ -934,63 +934,63 @@ int flp_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t
}
int flp_begin_transparency_group(gx_device *dev, const gs_transparency_group_params_t *ptgp,
- const gs_rect *pbbox, gs_imager_state *pis, gs_memory_t *mem)
+ const gs_rect *pbbox, gs_gstate *pgs, gs_memory_t *mem)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_begin_transparency_group(dev, ptgp, pbbox, pis, mem);
+ return default_subclass_begin_transparency_group(dev, ptgp, pbbox, pgs, mem);
return 0;
}
-int flp_end_transparency_group(gx_device *dev, gs_imager_state *pis)
+int flp_end_transparency_group(gx_device *dev, gs_gstate *pgs)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_end_transparency_group(dev, pis);
+ return default_subclass_end_transparency_group(dev, pgs);
return 0;
}
int flp_begin_transparency_mask(gx_device *dev, const gx_transparency_mask_params_t *ptmp,
- const gs_rect *pbbox, gs_imager_state *pis, gs_memory_t *mem)
+ const gs_rect *pbbox, gs_gstate *pgs, gs_memory_t *mem)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_begin_transparency_mask(dev, ptmp, pbbox, pis, mem);
+ return default_subclass_begin_transparency_mask(dev, ptmp, pbbox, pgs, mem);
return 0;
}
-int flp_end_transparency_mask(gx_device *dev, gs_imager_state *pis)
+int flp_end_transparency_mask(gx_device *dev, gs_gstate *pgs)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_end_transparency_mask(dev, pis);
+ return default_subclass_end_transparency_mask(dev, pgs);
return 0;
}
-int flp_discard_transparency_layer(gx_device *dev, gs_imager_state *pis)
+int flp_discard_transparency_layer(gx_device *dev, gs_gstate *pgs)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_discard_transparency_layer(dev, pis);
+ return default_subclass_discard_transparency_layer(dev, pgs);
return 0;
}
@@ -1009,14 +1009,14 @@ int flp_pattern_manage(gx_device *dev, gx_bitmap_id id,
}
int flp_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_fill_rectangle_hl_color(dev, rect, pis, pdcolor, pcpath);
+ return default_subclass_fill_rectangle_hl_color(dev, rect, pgs, pdcolor, pcpath);
return 0;
}
@@ -1065,38 +1065,38 @@ int flp_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *fa,
return 0;
}
-int flp_fillpage(gx_device *dev, gs_imager_state * pis, gx_device_color *pdevc)
+int flp_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_fillpage(dev, pis, pdevc);
+ return default_subclass_fillpage(dev, pgs, pdevc);
return 0;
}
-int flp_push_transparency_state(gx_device *dev, gs_imager_state *pis)
+int flp_push_transparency_state(gx_device *dev, gs_gstate *pgs)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_push_transparency_state(dev, pis);
+ return default_subclass_push_transparency_state(dev, pgs);
return 0;
}
-int flp_pop_transparency_state(gx_device *dev, gs_imager_state *pis)
+int flp_pop_transparency_state(gx_device *dev, gs_gstate *pgs)
{
int code = SkipPage(dev);
if (code < 0)
return code;
if (!code)
- return default_subclass_pop_transparency_state(dev, pis);
+ return default_subclass_pop_transparency_state(dev, pgs);
return 0;
}
diff --git a/base/gdevmpla.c b/base/gdevmpla.c
index ebef855f7..9800e8719 100644
--- a/base/gdevmpla.c
+++ b/base/gdevmpla.c
@@ -238,7 +238,7 @@ mem_planar_put_image(gx_device *pdev, const byte *buffer, int num_chan, int xsta
devices. (e.g. tiffsep, psdcmyk) */
static int
mem_planar_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_memory * const mdev = (gx_device_memory *)dev;
@@ -1058,7 +1058,7 @@ planar_cmyk4bit_strip_copy_rop(gx_device_memory * mdev,
byte lmask, rmask;
rop_proc cproc, mproc, yproc;
int dbit;
- int cscolor, mscolor, yscolor, kscolor;
+ int cscolor = 0, mscolor = 0, yscolor = 0, kscolor = 0;
int ctcolor = 0, mtcolor = 0, ytcolor = 0, ktcolor = 0;
int constant_s = 0;
@@ -2019,7 +2019,7 @@ mem_planar_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect,
gs_get_bits_params_t * params,
gs_int_rect ** unread)
{
- /* This duplicates most of mem_get_bits_rectangle. Tant pis. */
+ /* This duplicates most of mem_get_bits_rectangle. Tant pgs. */
gx_device_memory * const mdev = (gx_device_memory *)dev;
gs_get_bits_options_t options = params->options;
int x = prect->p.x, w = prect->q.x - x, y = prect->p.y, h = prect->q.y - y;
diff --git a/base/gdevmplt.c b/base/gdevmplt.c
index 178130975..0eed10ed7 100644
--- a/base/gdevmplt.c
+++ b/base/gdevmplt.c
@@ -30,7 +30,7 @@
#include "gsdevice.h" /* requires gsmatrix.h */
#include "gxdcolor.h" /* for gx_device_black/white */
#include "gxiparam.h" /* for image source size */
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpaint.h"
#include "gxpath.h"
#include "gxcpath.h"
@@ -181,7 +181,7 @@ pcl_gray_cs_to_cm(gx_device * dev, frac gray, frac out[])
}
static void
-pcl_rgb_cs_to_cm(gx_device * dev, const gs_imager_state * pis, frac r, frac g,
+pcl_rgb_cs_to_cm(gx_device * dev, const gs_gstate * pgs, frac r, frac g,
frac b, frac out[])
{
pcl_mono_palette_subclass_data *psubclass_data;
@@ -197,7 +197,7 @@ pcl_rgb_cs_to_cm(gx_device * dev, const gs_imager_state * pis, frac r, frac g,
psubclass_data = dev->subclass_data;
gray = color_rgb_to_gray(r, g, b, NULL);
- psubclass_data->device_cm_procs->map_rgb(dev, pis, gray, gray, gray, out);
+ psubclass_data->device_cm_procs->map_rgb(dev, pgs, gray, gray, gray, out);
} else
return;
}
diff --git a/base/gdevnfwd.c b/base/gdevnfwd.c
index b42103015..cf4a027e1 100644
--- a/base/gdevnfwd.c
+++ b/base/gdevnfwd.c
@@ -416,7 +416,7 @@ gx_forward_copy_rop(gx_device * dev,
}
int
-gx_forward_fill_path(gx_device * dev, const gs_imager_state * pis,
+gx_forward_fill_path(gx_device * dev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath)
@@ -427,11 +427,11 @@ gx_forward_fill_path(gx_device * dev, const gs_imager_state * pis,
(tdev == 0 ? (tdev = dev, gx_default_fill_path) :
dev_proc(tdev, fill_path));
- return proc(tdev, pis, ppath, params, pdcolor, pcpath);
+ return proc(tdev, pgs, ppath, params, pdcolor, pcpath);
}
int
-gx_forward_stroke_path(gx_device * dev, const gs_imager_state * pis,
+gx_forward_stroke_path(gx_device * dev, const gs_gstate * pgs,
gx_path * ppath, const gx_stroke_params * params,
const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath)
@@ -442,7 +442,7 @@ gx_forward_stroke_path(gx_device * dev, const gs_imager_state * pis,
(tdev == 0 ? (tdev = dev, gx_default_stroke_path) :
dev_proc(tdev, stroke_path));
- return proc(tdev, pis, ppath, params, pdcolor, pcpath);
+ return proc(tdev, pgs, ppath, params, pdcolor, pcpath);
}
int
@@ -524,7 +524,7 @@ gx_forward_draw_thin_line(gx_device * dev,
int
gx_forward_begin_image(gx_device * dev,
- const gs_imager_state * pis, const gs_image_t * pim,
+ const gs_gstate * pgs, const gs_image_t * pim,
gs_image_format_t format, const gs_int_rect * prect,
const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath,
@@ -536,7 +536,7 @@ gx_forward_begin_image(gx_device * dev,
(tdev == 0 ? (tdev = dev, gx_default_begin_image) :
dev_proc(tdev, begin_image));
- return proc(tdev, pis, pim, format, prect, pdcolor, pcpath,
+ return proc(tdev, pgs, pim, format, prect, pdcolor, pcpath,
memory, pinfo);
}
@@ -635,7 +635,7 @@ gx_forward_get_clipping_box(gx_device * dev, gs_fixed_rect * pbox)
}
int
-gx_forward_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
+gx_forward_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
const gs_matrix * pmat,
const gs_image_common_t * pim,
const gs_int_rect * prect,
@@ -650,7 +650,7 @@ gx_forward_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
(tdev == 0 ? (tdev = dev, gx_default_begin_typed_image) :
dev_proc(tdev, begin_typed_image));
- return proc(tdev, pis, pmat, pim, prect, pdcolor, pcpath,
+ return proc(tdev, pgs, pmat, pim, prect, pdcolor, pcpath,
memory, pinfo);
}
@@ -689,7 +689,7 @@ gx_forward_get_hardware_params(gx_device * dev, gs_param_list * plist)
}
int
-gx_forward_text_begin(gx_device * dev, gs_imager_state * pis,
+gx_forward_text_begin(gx_device * dev, gs_gstate * pgs,
const gs_text_params_t * text, gs_font * font,
gx_path * path, const gx_device_color * pdcolor,
const gx_clip_path * pcpath, gs_memory_t * memory,
@@ -701,7 +701,7 @@ gx_forward_text_begin(gx_device * dev, gs_imager_state * pis,
(tdev == 0 ? (tdev = dev, gx_default_text_begin) :
dev_proc(tdev, text_begin));
- return proc(tdev, pis, text, font, path, pdcolor, pcpath,
+ return proc(tdev, pgs, text, font, path, pdcolor, pcpath,
memory, ppenum);
}
@@ -732,7 +732,7 @@ fwd_map_gray_cs(gx_device * dev, frac gray, frac out[])
* We need to forward the color mapping to the target device.
*/
static void
-fwd_map_rgb_cs(gx_device * dev, const gs_imager_state *pis,
+fwd_map_rgb_cs(gx_device * dev, const gs_gstate *pgs,
frac r, frac g, frac b, frac out[])
{
gx_device_forward * const fdev = (gx_device_forward *)dev;
@@ -745,9 +745,9 @@ fwd_map_rgb_cs(gx_device * dev, const gs_imager_state *pis,
if (tdev == 0 || dev_proc(tdev, get_color_mapping_procs) == 0 ||
pprocs == 0 ||
pprocs->map_rgb == 0)
- rgb_cs_to_rgb_cm(tdev, pis, r, g, b, out); /* if all else fails */
+ rgb_cs_to_rgb_cm(tdev, pgs, r, g, b, out); /* if all else fails */
else
- map_rgb_subclass(pprocs, tdev, pis, r, g, b, out);
+ map_rgb_subclass(pprocs, tdev, pgs, r, g, b, out);
}
/*
@@ -858,7 +858,7 @@ gx_forward_dev_spec_op(gx_device * dev, int dev_spec_op, void *data, int size)
int
gx_forward_fill_rectangle_hl_color(gx_device *dev,
const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_forward * const fdev = (gx_device_forward *)dev;
@@ -870,7 +870,7 @@ gx_forward_fill_rectangle_hl_color(gx_device *dev,
return_error(gs_error_rangecheck);
else
return dev_proc(tdev, fill_rectangle_hl_color)(tdev, rect,
- pis, pdcolor, pcpath);
+ pgs, pdcolor, pcpath);
}
int
@@ -946,7 +946,7 @@ gx_forward_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *
}
int
-gx_forward_update_spot_equivalent_colors(gx_device *dev, const gs_state * pgs)
+gx_forward_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs)
{
gx_device_forward * const fdev = (gx_device_forward *)dev;
gx_device *tdev = fdev->target;
@@ -969,20 +969,20 @@ gx_forward_ret_devn_params(gx_device *dev)
}
int
-gx_forward_fillpage(gx_device *dev, gs_imager_state * pis, gx_device_color *pdevc)
+gx_forward_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
{
gx_device_forward * const fdev = (gx_device_forward *)dev;
gx_device *tdev = fdev->target;
dev_proc_fillpage((*proc)) =
(tdev == 0 ? (tdev = dev, gx_default_fillpage) :
dev_proc(tdev, fillpage));
- return proc(tdev, pis, pdevc);
+ return proc(tdev, pgs, pdevc);
}
int
gx_forward_create_compositor(gx_device * dev, gx_device ** pcdev,
const gs_composite_t * pcte,
- gs_imager_state * pis, gs_memory_t * memory,
+ gs_gstate * pgs, gs_memory_t * memory,
gx_device *cdev)
{
gx_device_forward * const fdev = (gx_device_forward *)dev;
@@ -990,9 +990,9 @@ gx_forward_create_compositor(gx_device * dev, gx_device ** pcdev,
int code;
if (tdev == 0)
- return gx_no_create_compositor(dev, pcdev, pcte, pis, memory, cdev);
+ return gx_no_create_compositor(dev, pcdev, pcte, pgs, memory, cdev);
/* else do the compositor action */
- code = dev_proc(tdev, create_compositor)(tdev, pcdev, pcte, pis, memory, cdev);
+ code = dev_proc(tdev, create_compositor)(tdev, pcdev, pcte, pgs, memory, cdev);
/* the compositor may have changed color_info. Pick up the new value */
dev->color_info = tdev->color_info;
return code;
@@ -1210,14 +1210,14 @@ null_copy_rop(gx_device * dev,
return 0;
}
static int
-null_fill_path(gx_device * dev, const gs_imager_state * pis,
+null_fill_path(gx_device * dev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath)
{
return 0;
}
static int
-null_stroke_path(gx_device * dev, const gs_imager_state * pis,
+null_stroke_path(gx_device * dev, const gs_gstate * pgs,
gx_path * ppath, const gx_stroke_params * params,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath)
{
diff --git a/base/gdevoflt.c b/base/gdevoflt.c
index 05b8d7177..c7e4f449b 100644
--- a/base/gdevoflt.c
+++ b/base/gdevoflt.c
@@ -23,7 +23,7 @@
#include "gsdevice.h" /* requires gsmatrix.h */
#include "gxdcolor.h" /* for gx_device_black/white */
#include "gxiparam.h" /* for image source size */
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpaint.h"
#include "gxpath.h"
#include "gxcpath.h"
@@ -202,21 +202,21 @@ int obj_filter_draw_line(gx_device *dev, int x0, int y0, int x1, int y1, gx_colo
return 0;
}
-int obj_filter_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath,
+int obj_filter_fill_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
const gx_fill_params *params,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
if ((dev->ObjectFilter & FILTERVECTOR) == 0)
- return default_subclass_fill_path(dev, pis, ppath, params, pdcolor, pcpath);
+ return default_subclass_fill_path(dev, pgs, ppath, params, pdcolor, pcpath);
return 0;
}
-int obj_filter_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath,
+int obj_filter_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
const gx_stroke_params *params,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
if ((dev->ObjectFilter & FILTERVECTOR) == 0)
- return default_subclass_stroke_path(dev, pis, ppath, params, pdcolor, pcpath);
+ return default_subclass_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath);
return 0;
}
@@ -264,13 +264,13 @@ int obj_filter_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, f
return 0;
}
-int obj_filter_begin_image(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim,
+int obj_filter_begin_image(gx_device *dev, const gs_gstate *pgs, const gs_image_t *pim,
gs_image_format_t format, const gs_int_rect *prect,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
{
if ((dev->ObjectFilter & FILTERIMAGE) == 0)
- return default_subclass_begin_image(dev, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo);
+ return default_subclass_begin_image(dev, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo);
return 0;
}
@@ -345,7 +345,7 @@ static const gx_image_enum_procs_t obj_filter_image_enum_procs = {
obj_filter_image_end_image
};
-int obj_filter_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat,
+int obj_filter_begin_typed_image(gx_device *dev, const gs_gstate *pgs, const gs_matrix *pmat,
const gs_image_common_t *pic, const gs_int_rect *prect,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
@@ -355,7 +355,7 @@ int obj_filter_begin_typed_image(gx_device *dev, const gs_imager_state *pis, con
int num_components;
if ((dev->ObjectFilter & FILTERIMAGE) == 0)
- return default_subclass_begin_typed_image(dev, pis, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
+ return default_subclass_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
if (pic->type->index == 1) {
const gs_image_t *pim1 = (const gs_image_t *)pic;
@@ -445,7 +445,7 @@ static const gs_text_enum_procs_t obj_filter_text_procs = {
* in which case we create a text enumerator with our dummy procedures, or we are leaving it
* up to the device, in which case we simply pass on the 'begin' method to the device.
*/
-int obj_filter_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text,
+int obj_filter_text_begin(gx_device *dev, gs_gstate *pgs, const gs_text_params_t *text,
gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gs_text_enum_t **ppte)
{
@@ -457,21 +457,21 @@ int obj_filter_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_pa
* secondly because op_show_restore executes an unconditional grestore, assuming
* that a gsave has been done simply *because* its a tringwidth operation !
*/
- if ((text->operation & TEXT_DO_NONE) && (text->operation & TEXT_RETURN_WIDTH) && pis->text_rendering_mode != 3)
+ if ((text->operation & TEXT_DO_NONE) && (text->operation & TEXT_RETURN_WIDTH) && pgs->text_rendering_mode != 3)
/* Note that the high level devices *must* be given the opportunity to 'see' the
* stringwidth operation, or they won;t be able to cache the glyphs properly.
* So always pass stringwidth operations to the child.
*/
- return default_subclass_text_begin(dev, pis, text, font, path, pdcolor, pcpath, memory, ppte);
+ return default_subclass_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
if ((dev->ObjectFilter & FILTERTEXT) == 0)
- return default_subclass_text_begin(dev, pis, text, font, path, pdcolor, pcpath, memory, ppte);
+ return default_subclass_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
rc_alloc_struct_1(penum, obj_filter_text_enum_t, &st_obj_filter_text_enum, memory,
return_error(gs_error_VMerror), "gdev_obj_filter_text_begin");
penum->rc.free = rc_free_text_enum;
code = gs_text_enum_init((gs_text_enum_t *)penum, &obj_filter_text_procs,
- dev, pis, text, font, path, pdcolor, pcpath, memory);
+ dev, pgs, text, font, path, pdcolor, pcpath, memory);
if (code < 0) {
gs_free_object(memory, penum, "gdev_obj_filter_text_begin");
return code;
@@ -482,10 +482,10 @@ int obj_filter_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_pa
}
int obj_filter_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
if ((dev->ObjectFilter & FILTERVECTOR) == 0)
- return default_subclass_fill_rectangle_hl_color(dev, rect, pis, pdcolor, pcpath);
+ return default_subclass_fill_rectangle_hl_color(dev, rect, pgs, pdcolor, pcpath);
return 0;
}
diff --git a/base/gdevp14.c b/base/gdevp14.c
index b16614042..9162a2b14 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -23,7 +23,7 @@
#include "gxdevice.h"
#include "gsdevice.h"
#include "gsstruct.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxdcolor.h"
#include "gxiparam.h"
#include "gstparam.h"
@@ -72,15 +72,15 @@ unsigned int clist_band_count = 0;
/* Static prototypes */
/* Used for filling rects when we are doing a fill with a pattern that
has transparency */
-static int pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
+static int pdf14_tile_pattern_fill(gx_device * pdev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_device_color * pdevc, const gx_clip_path * pcpath);
static pdf14_mask_t *pdf14_mask_element_new(gs_memory_t *memory);
static void pdf14_free_smask_color(pdf14_device * pdev);
static int compute_group_device_int_rect(pdf14_device *pdev, gs_int_rect *rect,
- const gs_rect *pbbox, gs_imager_state *pis);
+ const gs_rect *pbbox, gs_gstate *pgs);
static int pdf14_clist_update_params(pdf14_clist_device * pdev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
bool crop_blend_params,
gs_pdf14trans_params_t *group_params);
static int pdf14_mark_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
@@ -96,8 +96,8 @@ static int pdf14_copy_alpha_color(gx_device * dev, const byte * data, int data_x
int depth, bool devn);
/* Functions for dealing with soft mask color */
-static int pdf14_decrement_smask_color(gs_imager_state * pis, gx_device * dev);
-static int pdf14_increment_smask_color(gs_imager_state * pis, gx_device * dev);
+static int pdf14_decrement_smask_color(gs_gstate * pgs, gx_device * dev);
+static int pdf14_increment_smask_color(gs_gstate * pgs, gx_device * dev);
/*
* We chose the blending color space based upon the process color model of the
@@ -115,14 +115,14 @@ static int pdf14_increment_smask_color(gs_imager_state * pis, gx_device * dev);
/* Forward prototypes */
void pdf14_cmyk_cs_to_cmyk_cm(gx_device *, frac, frac, frac, frac, frac *);
-static int gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis,
+static int gs_pdf14_device_push(gs_memory_t *mem, gs_gstate * pgs,
gx_device ** pdev, gx_device * target,
const gs_pdf14trans_t * pdf14pct);
-static int gs_pdf14_clist_device_push(gs_memory_t * mem, gs_imager_state * pis,
+static int gs_pdf14_clist_device_push(gs_memory_t * mem, gs_gstate * pgs,
gx_device ** pdev, gx_device * target,
const gs_pdf14trans_t * pdf14pct);
static int pdf14_tile_pattern_fill(gx_device * pdev,
- const gs_imager_state * pis, gx_path * ppath,
+ const gs_gstate * pgs, gx_path * ppath,
const gx_fill_params * params,
const gx_device_color * pdevc, const gx_clip_path * pcpath);
static pdf14_mask_t * pdf14_mask_element_new(gs_memory_t * memory);
@@ -196,9 +196,9 @@ static dev_proc_copy_alpha_hl_color(pdf14_copy_alpha_hl_color);
static dev_proc_discard_transparency_layer(pdf14_discard_trans_layer);
static const gx_color_map_procs *
- pdf14_get_cmap_procs(const gs_imager_state *, const gx_device *);
+ pdf14_get_cmap_procs(const gs_gstate *, const gx_device *);
static const gx_color_map_procs *
- pdf14_get_cmap_procs_group(const gs_imager_state *, const gx_device *);
+ pdf14_get_cmap_procs_group(const gs_gstate *, const gx_device *);
#define XSIZE (int)(8.5 * X_DPI) /* 8.5 x 11 inch page, by default */
#define YSIZE (int)(11 * Y_DPI)
@@ -313,30 +313,30 @@ gs_private_st_composite_use_final(st_pdf14_device, pdf14_device, "pdf14_device",
pdf14_device_enum_ptrs, pdf14_device_reloc_ptrs,
pdf14_device_finalize);
-static int pdf14_put_image(gx_device * dev, gs_imager_state * pis,
+static int pdf14_put_image(gx_device * dev, gs_gstate * pgs,
gx_device * target);
-static int pdf14_cmykspot_put_image(gx_device * dev, gs_imager_state * pis,
+static int pdf14_cmykspot_put_image(gx_device * dev, gs_gstate * pgs,
gx_device * target);
-static int pdf14_custom_put_image(gx_device * dev, gs_imager_state * pis,
+static int pdf14_custom_put_image(gx_device * dev, gs_gstate * pgs,
gx_device * target);
/* Used to alter device color mapping procs based upon group or softmask color space */
static int pdf14_update_device_color_procs(gx_device *dev,
gs_transparency_color_t group_color, int64_t icc_hashcode,
- gs_imager_state *pis, cmm_profile_t *iccprofile);
+ gs_gstate *pgs, cmm_profile_t *iccprofile);
/* Used to alter device color mapping procs based upon group or softmask color space */
/* Uses color procs stack so that it can be used with clist writer */
static int
pdf14_update_device_color_procs_push_c(gx_device *dev,
gs_transparency_color_t group_color, int64_t icc_hashcode,
- gs_imager_state *pis, cmm_profile_t *iccprofile);
+ gs_gstate *pgs, cmm_profile_t *iccprofile);
static int
-pdf14_update_device_color_procs_pop_c(gx_device *dev,gs_imager_state *pis);
+pdf14_update_device_color_procs_pop_c(gx_device *dev,gs_gstate *pgs);
-static void pdf14_push_parent_color(gx_device *dev, const gs_imager_state *pis);
-static void pdf14_pop_parent_color(gx_device *dev, const gs_imager_state *pis);
+static void pdf14_push_parent_color(gx_device *dev, const gs_gstate *pgs);
+static void pdf14_pop_parent_color(gx_device *dev, const gs_gstate *pgs);
static const pdf14_procs_t gray_pdf14_procs = {
pdf14_unpack_additive,
@@ -822,7 +822,7 @@ pdf14_push_transparency_group(pdf14_ctx *ctx, gs_int_rect *rect, bool isolated,
gs_blend_mode_t blend_mode, bool idle, uint mask_id,
int numcomps, bool cm_back_drop,
cmm_profile_t *group_profile,
- cmm_profile_t *tos_profile, gs_imager_state *pis,
+ cmm_profile_t *tos_profile, gs_gstate *pgs,
gx_device *dev)
{
pdf14_buf *tos = ctx->stack;
@@ -880,7 +880,7 @@ pdf14_push_transparency_group(pdf14_ctx *ctx, gs_int_rect *rect, bool isolated,
/* We must have an non-isolated group with a mismatch in color spaces.
In this case, we can't just copy the buffer but must CM it */
pdf14_preserve_backdrop_cm(buf, group_profile, tos, tos_profile,
- ctx->memory, pis, dev, false);
+ ctx->memory, pgs, dev, false);
}
}
}
@@ -932,7 +932,7 @@ pdf14_push_transparency_group(pdf14_ctx *ctx, gs_int_rect *rect, bool isolated,
/* We must have an non-isolated group with a mismatch in color spaces.
In this case, we can't just copy the buffer but must CM it */
pdf14_preserve_backdrop_cm(buf, group_profile, check,
- prev_knockout_profile, ctx->memory, pis,
+ prev_knockout_profile, ctx->memory, pgs,
dev, false);
}
memcpy(buf->backdrop, buf->data, buf->planestride * buf->n_chan);
@@ -960,7 +960,7 @@ pdf14_push_transparency_group(pdf14_ctx *ctx, gs_int_rect *rect, bool isolated,
}
static int
-pdf14_pop_transparency_group(gs_imager_state *pis, pdf14_ctx *ctx,
+pdf14_pop_transparency_group(gs_gstate *pgs, pdf14_ctx *ctx,
const pdf14_nonseparable_blending_procs_t * pblend_procs,
int curr_num_color_comp, cmm_profile_t *curr_icc_profile, gx_device *dev)
{
@@ -1071,13 +1071,13 @@ pdf14_pop_transparency_group(gs_imager_state *pis, pdf14_ctx *ctx,
rendering_params.rendering_intent = gsPERCEPTUAL;
rendering_params.cmm = gsCMM_DEFAULT;
/* Request the ICC link for the transform that we will need to use */
- /* Note that if pis is NULL we assume the same color space. This
+ /* Note that if pgs is NULL we assume the same color space. This
is due to a call to pop the group from fill_mask when filling
with a mask with transparency. In that case, the parent
and the child will have the same color space anyway */
- icc_link = gsicc_get_link_profile(pis, dev, curr_icc_profile,
+ icc_link = gsicc_get_link_profile(pgs, dev, curr_icc_profile,
nos->parent_color_info_procs->icc_profile,
- &rendering_params, pis->memory, false);
+ &rendering_params, pgs->memory, false);
if (icc_link != NULL) {
/* if problem with link we will do non-ICC approach */
nonicc_conversion = false;
@@ -1299,7 +1299,7 @@ static void pdf14_free_mask_stack(pdf14_ctx *ctx, gs_memory_t *memory)
}
static int
-pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_imager_state *pis, gx_device *dev)
+pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_gstate *pgs, gx_device *dev)
{
pdf14_buf *tos = ctx->stack;
byte *new_data_buf;
@@ -1446,8 +1446,8 @@ pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_imager_state *pis, gx_device *dev
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
rendering_params.rendering_intent = gsPERCEPTUAL;
rendering_params.cmm = gsCMM_DEFAULT;
- icc_link = gsicc_get_link_profile(pis, dev, des_profile,
- src_profile, &rendering_params, pis->memory, false);
+ icc_link = gsicc_get_link_profile(pgs, dev, des_profile,
+ src_profile, &rendering_params, pgs->memory, false);
smask_icc(dev, tos->rect.q.y - tos->rect.p.y,
tos->rect.q.x - tos->rect.p.x,tos->n_chan,
tos->rowstride, tos->planestride,
@@ -1497,7 +1497,7 @@ pdf14_mask_element_new(gs_memory_t *memory)
}
static int
-pdf14_push_transparency_state(gx_device *dev, gs_imager_state *pis)
+pdf14_push_transparency_state(gx_device *dev, gs_gstate *pgs)
{
/* We need to push the current soft mask. We need to
be able to recover it if we draw a new one and
@@ -1526,7 +1526,7 @@ pdf14_push_transparency_state(gx_device *dev, gs_imager_state *pis)
}
static int
-pdf14_pop_transparency_state(gx_device *dev, gs_imager_state *pis)
+pdf14_pop_transparency_state(gx_device *dev, gs_gstate *pgs)
{
/* Pop the soft mask. It is no longer needed. Likely due to
a Q that has occurred. */
@@ -1706,7 +1706,7 @@ pdf14_get_buffer_information(const gx_device * dev,
* Return code: negative on error.
**/
static int
-pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
+pdf14_put_image(gx_device * dev, gs_gstate * pgs, gx_device * target)
{
const pdf14_device * pdev = (pdf14_device *)dev;
int code;
@@ -1816,7 +1816,7 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
/*
* Set color space in preparation for sending an image.
*/
- code = gs_cspace_build_ICC(&pcs, NULL, pis->memory);
+ code = gs_cspace_build_ICC(&pcs, NULL, pgs->memory);
if (pcs == NULL)
return_error(gs_error_VMerror);
if (code < 0)
@@ -1843,17 +1843,17 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
image.Width = width;
image.Height = height;
image.BitsPerComponent = 8;
- ctm_only_writable(pis).xx = (float)width;
- ctm_only_writable(pis).xy = 0;
- ctm_only_writable(pis).yx = 0;
- ctm_only_writable(pis).yy = (float)height;
- ctm_only_writable(pis).tx = (float)rect.p.x;
- ctm_only_writable(pis).ty = (float)rect.p.y;
+ ctm_only_writable(pgs).xx = (float)width;
+ ctm_only_writable(pgs).xy = 0;
+ ctm_only_writable(pgs).yx = 0;
+ ctm_only_writable(pgs).yy = (float)height;
+ ctm_only_writable(pgs).tx = (float)rect.p.x;
+ ctm_only_writable(pgs).ty = (float)rect.p.y;
code = dev_proc(target, begin_typed_image) (target,
- pis, NULL,
+ pgs, NULL,
(gs_image_common_t *)&image,
NULL, NULL, NULL,
- pis->memory, &info);
+ pgs->memory, &info);
if (code < 0) {
rc_decrement_only_cs(pcs, "pdf14_put_image");
return code;
@@ -1905,7 +1905,7 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
/**
* pdf14_cmykspot_put_image: Put rendered image to target device.
* @pdev: The PDF 1.4 rendering device.
- * @pis: State for image draw operation.
+ * @pgs: State for image draw operation.
* @target: The target device.
*
* Puts the rendered image in @pdev's buffer to @target. This is called
@@ -1914,7 +1914,7 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
* Return code: negative on error.
**/
static int
-pdf14_cmykspot_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
+pdf14_cmykspot_put_image(gx_device * dev, gs_gstate * pgs, gx_device * target)
{
pdf14_device * pdev = (pdf14_device *)dev;
pdf14_buf *buf = pdev->ctx->stack;
@@ -1956,7 +1956,7 @@ pdf14_cmykspot_put_image(gx_device * dev, gs_imager_state * pis, gx_device * tar
/**
* pdf14_custom_put_image: Put rendered image to target device.
* @pdev: The PDF 1.4 rendering device.
- * @pis: State for image draw operation.
+ * @pgs: State for image draw operation.
* @target: The target device.
*
* Puts the rendered image in @pdev's buffer to @target. This is called
@@ -1965,7 +1965,7 @@ pdf14_cmykspot_put_image(gx_device * dev, gs_imager_state * pis, gx_device * tar
* Return code: negative on error.
**/
static int
-pdf14_custom_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
+pdf14_custom_put_image(gx_device * dev, gs_gstate * pgs, gx_device * target)
{
pdf14_device * pdev = (pdf14_device *)dev;
pdf14_buf *buf = pdev->ctx->stack;
@@ -2047,7 +2047,7 @@ pdf14_close(gx_device *dev)
stop while in the middle of doing something with the PDF14 device. We need
to clean up and end this in a graceful manner */
static int
-pdf14_discard_trans_layer(gx_device *dev, gs_imager_state * pis)
+pdf14_discard_trans_layer(gx_device *dev, gs_gstate * pgs)
{
pdf14_device *pdev = (pdf14_device *)dev;
/* The things that need to be cleaned up */
@@ -2058,14 +2058,14 @@ pdf14_discard_trans_layer(gx_device *dev, gs_imager_state * pis)
/* Free up the smask color */
if (smaskcolor != NULL) {
smaskcolor->ref_count = 1;
- pdf14_decrement_smask_color(pis, dev);
+ pdf14_decrement_smask_color(pgs, dev);
pdev->smaskcolor = NULL;
}
/* Free up the nested color procs and decrement the profiles */
if (group_procs != NULL) {
while (group_procs->previous != NULL)
- pdf14_pop_parent_color(dev, pis);
+ pdf14_pop_parent_color(dev, pgs);
gs_free_object(dev->memory, group_procs, "pdf14_discard_trans_layer");
pdev->trans_group_parent_cmap_procs = NULL;
}
@@ -2229,24 +2229,24 @@ pdf14_put_params(gx_device * dev, gs_param_list * plist)
* by pdf14_fill_rectangle.
*/
static void
-pdf14_set_marking_params(gx_device *dev, const gs_imager_state *pis)
+pdf14_set_marking_params(gx_device *dev, const gs_gstate *pgs)
{
pdf14_device * pdev = (pdf14_device *)dev;
- pdev->opacity = pis->opacity.alpha;
- pdev->shape = pis->shape.alpha;
- pdev->alpha = pis->opacity.alpha * pis->shape.alpha;
- pdev->blend_mode = pis->blend_mode;
- pdev->overprint = pis->overprint;
- pdev->overprint_mode = pis->overprint_mode;
+ pdev->opacity = pgs->opacity.alpha;
+ pdev->shape = pgs->shape.alpha;
+ pdev->alpha = pgs->opacity.alpha * pgs->shape.alpha;
+ pdev->blend_mode = pgs->blend_mode;
+ pdev->overprint = pgs->overprint;
+ pdev->overprint_mode = pgs->overprint_mode;
if_debug3m('v', dev->memory,
"[v]set_marking_params, opacity = %g, shape = %g, bm = %d\n",
- pdev->opacity, pdev->shape, pis->blend_mode);
+ pdev->opacity, pdev->shape, pgs->blend_mode);
}
static void
-update_lop_for_pdf14(gs_imager_state *pis, const gx_drawing_color *pdcolor)
+update_lop_for_pdf14(gs_gstate *pgs, const gx_drawing_color *pdcolor)
{
bool hastrans = false;
@@ -2267,31 +2267,30 @@ update_lop_for_pdf14(gs_imager_state *pis, const gx_drawing_color *pdcolor)
}
}
/* The only idempotent blend modes are Normal, Darken and Lighten */
- if ((pis->alpha != 0xFFFF) ||
- (pis->blend_mode != BLEND_MODE_Normal && pis->blend_mode != BLEND_MODE_Darken && pis->blend_mode != BLEND_MODE_Lighten) ||
- (pis->opacity.alpha != 1.0) ||
- (pis->shape.alpha != 1.0) ||
+ if ((pgs->alpha != 0xFFFF) ||
+ (pgs->blend_mode != BLEND_MODE_Normal && pgs->blend_mode != BLEND_MODE_Darken && pgs->blend_mode != BLEND_MODE_Lighten) ||
+ (pgs->opacity.alpha != 1.0) ||
+ (pgs->shape.alpha != 1.0) ||
(hastrans))
{
/*
* The blend operations are not idempotent. Force non-idempotent
* filling and stroking operations.
*/
- pis->log_op |= lop_pdf14;
+ pgs->log_op |= lop_pdf14;
}
}
static int
-pdf14_fill_path(gx_device *dev, const gs_imager_state *pis,
+pdf14_fill_path(gx_device *dev, const gs_gstate *pgs,
gx_path *ppath, const gx_fill_params *params,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
- gs_imager_state new_is = *pis;
+ gs_gstate new_pgs = *pgs;
int code;
gs_pattern2_instance_t *pinst = NULL;
- new_is.is_gstate = false;
if (pdcolor == NULL)
return_error(gs_error_unknownerror); /* color must be defined */
if (gx_dc_is_pattern1_color(pdcolor)){
@@ -2335,10 +2334,10 @@ pdf14_fill_path(gx_device *dev, const gs_imager_state *pis,
}
}
#endif
- code = pdf14_tile_pattern_fill(dev, &new_is, ppath,
+ code = pdf14_tile_pattern_fill(dev, &new_pgs, ppath,
params, pdcolor, pcpath);
- new_is.trans_device = NULL;
- new_is.has_transparency = false;
+ new_pgs.trans_device = NULL;
+ new_pgs.has_transparency = false;
return code;
}
}
@@ -2350,13 +2349,13 @@ pdf14_fill_path(gx_device *dev, const gs_imager_state *pis,
by the pdf14 clist writer device. */
pinst->saved->trans_device = dev;
}
- update_lop_for_pdf14(&new_is, pdcolor);
- pdf14_set_marking_params(dev, pis);
- new_is.trans_device = dev;
- new_is.has_transparency = true;
- code = gx_default_fill_path(dev, &new_is, ppath, params, pdcolor, pcpath);
- new_is.trans_device = NULL;
- new_is.has_transparency = false;
+ update_lop_for_pdf14(&new_pgs, pdcolor);
+ pdf14_set_marking_params(dev, pgs);
+ new_pgs.trans_device = dev;
+ new_pgs.has_transparency = true;
+ code = gx_default_fill_path(dev, &new_pgs, ppath, params, pdcolor, pcpath);
+ new_pgs.trans_device = NULL;
+ new_pgs.has_transparency = false;
if (pinst != NULL){
pinst->saved->trans_device = NULL;
}
@@ -2364,18 +2363,16 @@ pdf14_fill_path(gx_device *dev, const gs_imager_state *pis,
}
static int
-pdf14_stroke_path(gx_device *dev, const gs_imager_state *pis,
+pdf14_stroke_path(gx_device *dev, const gs_gstate *pgs,
gx_path *ppath, const gx_stroke_params *params,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
- gs_imager_state new_is = *pis;
+ gs_gstate new_pgs = *pgs;
- new_is.is_gstate = false;
-
- update_lop_for_pdf14(&new_is, pdcolor);
- pdf14_set_marking_params(dev, pis);
- return gx_default_stroke_path(dev, &new_is, ppath, params, pdcolor,
+ update_lop_for_pdf14(&new_pgs, pdcolor);
+ pdf14_set_marking_params(dev, pgs);
+ return gx_default_stroke_path(dev, &new_pgs, ppath, params, pdcolor,
pcpath);
}
@@ -2682,13 +2679,13 @@ pdf14_fill_mask(gx_device * orig_dev,
/* Used for filling rects when we are doing a fill with a pattern that
has transparency */
static int
-pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
+pdf14_tile_pattern_fill(gx_device * pdev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_device_color * pdevc,
const gx_clip_path * pcpath)
{
int code;
- gs_imager_state *pis_noconst = (gs_imager_state *)pis; /* Break const. */
+ gs_gstate *pgs_noconst = (gs_gstate *)pgs; /* Break const. */
gs_fixed_rect clip_box;
gs_fixed_rect outer_box;
pdf14_device * p14dev = (pdf14_device *)pdev;
@@ -2715,7 +2712,7 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
if (code < 0)
return code;
code = gx_cpath_intersect_with_params(&cpath_intersection, ppath,
- params->rule, pis_noconst, params);
+ params->rule, pgs_noconst, params);
if (code < 0)
return code;
/* One (common) case worth optimising for is where we have a pattern that
@@ -2750,7 +2747,7 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
int2fixed(ptile->ttrans->rect.q.x),
int2fixed(ptile->ttrans->rect.q.y));
code = gx_cpath_intersect(&cpath_intersection, &path_ttrans,
- params->rule, pis_noconst);
+ params->rule, pgs_noconst);
}
}
/* Now let us push a transparency group into which we are
@@ -2779,7 +2776,7 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
blend_mode = ptile->blending_mode;
code = pdf14_push_transparency_group(p14dev->ctx, &rect, 1, 0, 255,255,
blend_mode, 0, 0, n_chan_tile-1,
- false, NULL, NULL, pis_noconst,
+ false, NULL, NULL, pgs_noconst,
pdev);
if (code < 0)
return code;
@@ -2798,7 +2795,7 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
/* Now lets go through the rect list and fill with the pattern */
/* First get the buffer that we will be filling */
if (ptile->cdev == NULL) {
- fill_trans_buffer = new_pattern_trans_buff(pis->memory);
+ fill_trans_buffer = new_pattern_trans_buff(pgs->memory);
pdf14_get_buffer_information(pdev, fill_trans_buffer, NULL, false);
/* Based upon if the tiles overlap pick the type of rect fill that we will
want to use */
@@ -2815,7 +2812,7 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
if (cpath_intersection.rect_list->list.head != NULL){
curr_clip_rect = cpath_intersection.rect_list->list.head->next;
for( k = 0; k< cpath_intersection.rect_list->list.count; k++){
- if_debug5m('v', pis->memory,
+ if_debug5m('v', pgs->memory,
"[v]pdf14_tile_pattern_fill, (%d, %d), %d x %d pat_id %d \n",
curr_clip_rect->xmin, curr_clip_rect->ymin,
curr_clip_rect->xmax-curr_clip_rect->xmin,
@@ -2827,7 +2824,7 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
}
} else if (cpath_intersection.rect_list->list.count == 1) {
/* The case when there is just a single rect */
- if_debug5m('v', pis->memory,
+ if_debug5m('v', pgs->memory,
"[v]pdf14_tile_pattern_fill, (%d, %d), %d x %d pat_id %d \n",
cpath_intersection.rect_list->list.single.xmin,
cpath_intersection.rect_list->list.single.ymin,
@@ -2860,12 +2857,12 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_imager_state * pis,
}
/* free our buffer object */
if (fill_trans_buffer != NULL) {
- gs_free_object(pis->memory, fill_trans_buffer, "pdf14_tile_pattern_fill");
+ gs_free_object(pgs->memory, fill_trans_buffer, "pdf14_tile_pattern_fill");
ptile->ttrans->fill_trans_buffer = NULL; /* Avoid GC issues */
}
/* pop our transparency group which will force the blending.
This was all needed for Bug 693498 */
- code = pdf14_pop_transparency_group(pis_noconst, p14dev->ctx,
+ code = pdf14_pop_transparency_group(pgs_noconst, p14dev->ctx,
p14dev->blend_procs,
p14dev->color_info.num_components,
p14dev->icc_struct->device_profile[0],
@@ -2895,7 +2892,7 @@ pdf14_pattern_trans_render(gx_image_enum * penum, const byte * buffer, int data_
{
int code;
pdf14_device * p14dev;
- const gs_imager_state * pis = penum->pis;
+ const gs_gstate * pgs = penum->pgs;
gx_device_color * pdcolor = (penum->icolor1);
gx_color_tile *ptile = pdcolor->colors.pattern.p_tile;
@@ -2906,12 +2903,14 @@ pdf14_pattern_trans_render(gx_image_enum * penum, const byte * buffer, int data_
/* On our final time through here, go ahead and pop the transparency
group and reset the procs in the device color. And free the fill
trans buffer object */
- if ( h == 0 && ptile->trans_group_popped == false) {
- if (pis->is_gstate) {
+ if (h == 0 && ptile->trans_group_popped == false) {
+ p14dev = find_pdf14_device(dev);
+
+ if (p14dev->pclist_device == NULL) {
/* Used if we are on clist writing phase. Would only
occur if we somehow failed in high level clist
image writing */
- code = gs_end_transparency_group((gs_state *) pis);
+ code = gs_end_transparency_group((gs_gstate *) pgs);
} else {
/* Used if we are on clist reading phase. If we had high level
image in clist */
@@ -2920,8 +2919,6 @@ pdf14_pattern_trans_render(gx_image_enum * penum, const byte * buffer, int data_
if (code < 0)
return code;
- p14dev = find_pdf14_device(dev);
-
if_debug2m('?', p14dev->ctx->memory,
"[?] Popping trans group pattern fill, uid = %ld id = %ld \n",
ptile->uid.id, ptile->id);
@@ -2930,7 +2927,7 @@ pdf14_pattern_trans_render(gx_image_enum * penum, const byte * buffer, int data_
(gx_device *) p14dev);
}
pdcolor->colors.pattern.p_tile->trans_group_popped = true;
- gs_free_object(pis->memory, ptile->ttrans->fill_trans_buffer,
+ gs_free_object(pgs->memory, ptile->ttrans->fill_trans_buffer,
"pdf14_pattern_trans_render");
ptile->ttrans->fill_trans_buffer = NULL; /* Avoid GC issues */
}
@@ -2941,7 +2938,7 @@ pdf14_pattern_trans_render(gx_image_enum * penum, const byte * buffer, int data_
with a pattern that has transparency. It is used by pdf14_begin_type_image
and pdf14_clist_begin_type_image */
static int
-pdf14_patt_trans_image_fill(gx_device * dev, const gs_imager_state * pis,
+pdf14_patt_trans_image_fill(gx_device * dev, const gs_gstate * pgs,
const gs_matrix *pmat, const gs_image_common_t *pic,
const gs_int_rect * prect,
const gx_drawing_color * pdcolor,
@@ -2970,8 +2967,8 @@ pdf14_patt_trans_image_fill(gx_device * dev, const gs_imager_state * pis,
ptile->ttrans->is_additive = false;
}
/* Set the blending mode in the ptile based upon the current
- setting in the imager state */
- ptile->blending_mode = pis->blend_mode;
+ setting in the gs_gstate */
+ ptile->blending_mode = pgs->blend_mode;
/* Based upon if the tiles overlap pick the type of rect
fill that we will want to use */
if (ptile->has_overlap) {
@@ -2984,7 +2981,7 @@ pdf14_patt_trans_image_fill(gx_device * dev, const gs_imager_state * pis,
/* Set the procs so that we use the proper filling method. */
gx_set_pattern_procs_trans((gx_device_color*) pdcolor);
/* Let the imaging stuff get set up */
- code = gx_default_begin_typed_image(dev, pis, pmat, pic,
+ code = gx_default_begin_typed_image(dev, pgs, pmat, pic,
prect, pdcolor,pcpath, mem, pinfo);
if (code < 0)
return code;
@@ -2999,9 +2996,9 @@ pdf14_patt_trans_image_fill(gx_device * dev, const gs_imager_state * pis,
&bbox_out);
if (code < 0)
return code;
- /* That in turn will get hit by the matrix in the imager state */
+ /* That in turn will get hit by the matrix in the gs_gstate */
code = compute_group_device_int_rect(p14dev, &group_rect,
- &bbox_out, (gs_imager_state *)pis);
+ &bbox_out, (gs_gstate *)pgs);
if (code < 0)
return code;
if (!(pim->Width == 0 || pim->Height == 0)) {
@@ -3009,12 +3006,12 @@ pdf14_patt_trans_image_fill(gx_device * dev, const gs_imager_state * pis,
"[v*] Pushing trans group patt_trans_image_fill, uid = %ld id = %ld \n",
ptile->uid.id, ptile->id);
code = pdf14_push_transparency_group(p14dev->ctx, &group_rect, 1, 0, 255,255,
- pis->blend_mode, 0, 0,
+ pgs->blend_mode, 0, 0,
ptile->ttrans->n_chan-1, false, NULL,
- NULL, (gs_imager_state *)pis, dev);
+ NULL, (gs_gstate *)pgs, dev);
/* Set up the output buffer information now that we have
pushed the group */
- fill_trans_buffer = new_pattern_trans_buff(pis->memory);
+ fill_trans_buffer = new_pattern_trans_buff(pgs->memory);
pdf14_get_buffer_information(dev, fill_trans_buffer, NULL, false);
/* Store this in the appropriate place in pdcolor. This
is released later in pdf14_pattern_trans_render when
@@ -3032,7 +3029,7 @@ pdf14_patt_trans_image_fill(gx_device * dev, const gs_imager_state * pis,
}
static int
-pdf14_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
+pdf14_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
const gs_matrix *pmat, const gs_image_common_t *pic,
const gs_int_rect * prect,
const gx_drawing_color * pdcolor,
@@ -3057,7 +3054,7 @@ pdf14_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
Detect setting of begin_image to gx_no_begin_image.
(final recursive call) */
if (dev->procs.begin_image != gx_default_begin_image) {
- code = pdf14_patt_trans_image_fill(dev, pis, pmat, pic,
+ code = pdf14_patt_trans_image_fill(dev, pgs, pmat, pic,
prect, pdcolor, pcpath, mem,
pinfo);
return code;
@@ -3065,33 +3062,33 @@ pdf14_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
}
}
}
- pdf14_set_marking_params(dev, pis);
- return gx_default_begin_typed_image(dev, pis, pmat, pic, prect, pdcolor,
+ pdf14_set_marking_params(dev, pgs);
+ return gx_default_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor,
pcpath, mem, pinfo);
}
static void
-pdf14_set_params(gs_imager_state * pis, gx_device * dev,
+pdf14_set_params(gs_gstate * pgs, gx_device * dev,
const gs_pdf14trans_params_t * pparams)
{
pdf14_device * p14dev = (pdf14_device *)dev;
if_debug0m('v', dev->memory, "[v]pdf14_set_params\n");
if (pparams->changed & PDF14_SET_BLEND_MODE)
- pis->blend_mode = pparams->blend_mode;
+ pgs->blend_mode = pparams->blend_mode;
if (pparams->changed & PDF14_SET_TEXT_KNOCKOUT)
- pis->text_knockout = pparams->text_knockout;
+ pgs->text_knockout = pparams->text_knockout;
if (pparams->changed & PDF14_SET_SHAPE_ALPHA)
- pis->shape.alpha = pparams->shape.alpha;
+ pgs->shape.alpha = pparams->shape.alpha;
if (pparams->changed & PDF14_SET_OPACITY_ALPHA)
- pis->opacity.alpha = pparams->opacity.alpha;
+ pgs->opacity.alpha = pparams->opacity.alpha;
if (pparams->changed & PDF14_SET_OVERPRINT)
- pis->overprint = pparams->overprint;
+ pgs->overprint = pparams->overprint;
if (pparams->changed & PDF14_SET_OVERPRINT_MODE)
- pis->overprint_mode = pparams->overprint_mode;
+ pgs->overprint_mode = pparams->overprint_mode;
if (pparams->changed & PDF14_SET_OVERPRINT_BLEND)
p14dev->blendspot = pparams->blendspot;
- pdf14_set_marking_params(dev, pis);
+ pdf14_set_marking_params(dev, pgs);
}
/*
@@ -3250,7 +3247,7 @@ pdf14_determine_default_blend_cs(gx_device * pdev)
*/
static int
get_pdf14_device_proto(gx_device * dev, pdf14_device ** pdevproto,
- pdf14_device * ptempdevproto, gs_imager_state * pis,
+ pdf14_device * ptempdevproto, gs_gstate * pgs,
const gs_pdf14trans_t * pdf14pct)
{
pdf14_default_colorspace_t dev_cs =
@@ -3383,7 +3380,7 @@ pdf14_ok_to_optimize(gx_device *dev)
* again.
*/
static int
-pdf14_recreate_device(gs_memory_t *mem, gs_imager_state * pis,
+pdf14_recreate_device(gs_memory_t *mem, gs_gstate * pgs,
gx_device * dev, const gs_pdf14trans_t * pdf14pct)
{
pdf14_device * pdev = (pdf14_device *)dev;
@@ -3400,7 +3397,7 @@ pdf14_recreate_device(gs_memory_t *mem, gs_imager_state * pis,
* color related info and the device procs to match the prototype.
*/
code = get_pdf14_device_proto(target, &dev_proto,
- &temp_dev_proto, pis, pdf14pct);
+ &temp_dev_proto, pgs, pdf14pct);
if (code < 0)
return code;
pdev->color_info = dev_proto->color_info;
@@ -3424,7 +3421,7 @@ pdf14_recreate_device(gs_memory_t *mem, gs_imager_state * pis,
* create compositor request.
*/
static int
-gx_update_pdf14_compositor(gx_device * pdev, gs_imager_state * pis,
+gx_update_pdf14_compositor(gx_device * pdev, gs_gstate * pgs,
const gs_pdf14trans_t * pdf14pct, gs_memory_t * mem )
{
pdf14_device *p14dev = (pdf14_device *)pdev;
@@ -3439,13 +3436,13 @@ gx_update_pdf14_compositor(gx_device * pdev, gs_imager_state * pis,
if (!(params.is_pattern)) {
p14dev->blend_mode = 0;
p14dev->opacity = p14dev->shape = 0.0;
- pdf14_recreate_device(mem, pis, pdev, pdf14pct);
+ pdf14_recreate_device(mem, pgs, pdev, pdf14pct);
}
break;
case PDF14_ABORT_DEVICE:
/* Something has gone very wrong. Let transparency device clean up
what ever it has allocated and then we are shutting it down */
- code = gx_abort_trans_device(pis, pdev);
+ code = gx_abort_trans_device(pgs, pdev);
if (p14dev->free_devicen) {
devn_free_params(pdev);
}
@@ -3456,19 +3453,18 @@ gx_update_pdf14_compositor(gx_device * pdev, gs_imager_state * pis,
if (!(params.is_pattern)) {
if_debug0m('v', pdev->memory,
"[v]gx_update_pdf14_compositor(PDF14_POP_DEVICE)\n");
- pis->get_cmap_procs = p14dev->save_get_cmap_procs;
- gx_set_cmap_procs(pis, p14dev->target);
+ pgs->get_cmap_procs = p14dev->save_get_cmap_procs;
+ gx_set_cmap_procs(pgs, p14dev->target);
/* Send image out raster data to output device */
{
/* Make a copy so we can change the ROP */
- gs_imager_state new_is = *pis;
- new_is.is_gstate = false;
+ gs_gstate new_pgs = *pgs;
- /* We don't use the imager state log_op since this is for the */
+ /* We don't use the gs_gstate log_op since this is for the */
/* clist playback. Putting the image (band in the case of the */
/* clist) only needs to use the default ROP to copy the data */
- new_is.log_op = rop3_default;
- code = p14dev->pdf14_procs->put_image(pdev, &new_is, p14dev->target);
+ new_pgs.log_op = rop3_default;
+ code = p14dev->pdf14_procs->put_image(pdev, &new_pgs, p14dev->target);
}
/* Before we disable the device release any deviceN structures.
free_devicen is set if the pdf14 device had inherited its
@@ -3482,31 +3478,31 @@ gx_update_pdf14_compositor(gx_device * pdev, gs_imager_state * pis,
}
break;
case PDF14_BEGIN_TRANS_GROUP:
- code = gx_begin_transparency_group(pis, pdev, &params);
+ code = gx_begin_transparency_group(pgs, pdev, &params);
break;
case PDF14_END_TRANS_GROUP:
- code = gx_end_transparency_group(pis, pdev);
+ code = gx_end_transparency_group(pgs, pdev);
break;
case PDF14_BEGIN_TRANS_MASK:
- code = gx_begin_transparency_mask(pis, pdev, &params);
+ code = gx_begin_transparency_mask(pgs, pdev, &params);
break;
case PDF14_END_TRANS_MASK:
- code = gx_end_transparency_mask(pis, pdev, &params);
+ code = gx_end_transparency_mask(pgs, pdev, &params);
break;
case PDF14_SET_BLEND_PARAMS:
- pdf14_set_params(pis, pdev, &pdf14pct->params);
+ pdf14_set_params(pgs, pdev, &pdf14pct->params);
break;
case PDF14_PUSH_TRANS_STATE:
- code = gx_push_transparency_state(pis, pdev);
+ code = gx_push_transparency_state(pgs, pdev);
break;
case PDF14_POP_TRANS_STATE:
- code = gx_pop_transparency_state(pis, pdev);
+ code = gx_pop_transparency_state(pgs, pdev);
break;
case PDF14_PUSH_SMASK_COLOR:
- code = pdf14_increment_smask_color(pis, pdev);
+ code = pdf14_increment_smask_color(pgs, pdev);
break;
case PDF14_POP_SMASK_COLOR:
- code = pdf14_decrement_smask_color(pis, pdev);
+ code = pdf14_decrement_smask_color(pgs, pdev);
break;
}
return code;
@@ -3522,7 +3518,7 @@ gx_update_pdf14_compositor(gx_device * pdev, gs_imager_state * pis,
*/
static int
pdf14_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
- const gs_composite_t * pct, gs_imager_state * pis,
+ const gs_composite_t * pct, gs_gstate * pgs,
gs_memory_t * mem, gx_device *cdev)
{
pdf14_device *pdev = (pdf14_device *)dev;
@@ -3535,10 +3531,10 @@ pdf14_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
const gs_pdf14trans_t * pdf14pct = (const gs_pdf14trans_t *) pct;
if (pdf14pct->params.pdf14_op == PDF14_PUSH_DEVICE)
- return gx_update_pdf14_compositor(dev, pis, pdf14pct, mem);
+ return gx_update_pdf14_compositor(dev, pgs, pdf14pct, mem);
return 0;
}
- code = dev_proc(tdev, create_compositor)(tdev, &ndev, pct, pis, mem, cdev);
+ code = dev_proc(tdev, create_compositor)(tdev, &ndev, pct, pgs, mem, cdev);
if (code < 0)
return code;
gx_device_set_target((gx_device_forward *)pdev, ndev);
@@ -3552,7 +3548,7 @@ pdf14_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
*/
static int
pdf14_create_compositor(gx_device * dev, gx_device * * pcdev,
- const gs_composite_t * pct, gs_imager_state * pis,
+ const gs_composite_t * pct, gs_gstate * pgs,
gs_memory_t * mem, gx_device *cdev)
{
pdf14_device *p14dev = (pdf14_device *)dev;
@@ -3564,7 +3560,7 @@ pdf14_create_compositor(gx_device * dev, gx_device * * pcdev,
groups. We want this propogated through all the pdf14 functions. Store
a pointer to it in the pdf14 device */
p14dev->pclist_device = cdev;
- return gx_update_pdf14_compositor(dev, pis, pdf14pct, mem);
+ return gx_update_pdf14_compositor(dev, pgs, pdf14pct, mem);
} else if (gs_is_overprint_compositor(pct)) {
/* If we had an overprint compositer action, then the
color components that were drawn should be updated.
@@ -3584,11 +3580,11 @@ pdf14_create_compositor(gx_device * dev, gx_device * * pcdev,
*pcdev = dev;
return 0;
} else
- return gx_no_create_compositor(dev, pcdev, pct, pis, mem, cdev);
+ return gx_no_create_compositor(dev, pcdev, pct, pgs, mem, cdev);
}
static int
-pdf14_text_begin(gx_device * dev, gs_imager_state * pis,
+pdf14_text_begin(gx_device * dev, gs_gstate * pgs,
const gs_text_params_t * text, gs_font * font,
gx_path * path, const gx_device_color * pdcolor,
const gx_clip_path * pcpath, gs_memory_t * memory,
@@ -3598,8 +3594,8 @@ pdf14_text_begin(gx_device * dev, gs_imager_state * pis,
gs_text_enum_t *penum;
if_debug0m('v', memory, "[v]pdf14_text_begin\n");
- pdf14_set_marking_params(dev, pis);
- code = gx_default_text_begin(dev, pis, text, font, path, pdcolor, pcpath,
+ pdf14_set_marking_params(dev, pgs);
+ code = gx_default_text_begin(dev, pgs, text, font, path, pdcolor, pcpath,
memory, &penum);
if (code < 0)
return code;
@@ -3735,7 +3731,7 @@ pdf14_copy_planes(gx_device * dev, const byte * data, int data_x, int raster,
static int
pdf14_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
pdf14_device *pdev = (pdf14_device *)dev;
@@ -3791,9 +3787,9 @@ pdf14_compute_group_device_int_rect(const gs_matrix *ctm,
static int
compute_group_device_int_rect(pdf14_device *pdev, gs_int_rect *rect,
- const gs_rect *pbbox, gs_imager_state *pis)
+ const gs_rect *pbbox, gs_gstate *pgs)
{
- int code = pdf14_compute_group_device_int_rect(&ctm_only(pis), pbbox, rect);
+ int code = pdf14_compute_group_device_int_rect(&ctm_only(pgs), pbbox, rect);
if (code < 0)
return code;
@@ -3810,10 +3806,10 @@ static int
pdf14_begin_transparency_group(gx_device *dev,
const gs_transparency_group_params_t *ptgp,
const gs_rect *pbbox,
- gs_imager_state *pis, gs_memory_t *mem)
+ gs_gstate *pgs, gs_memory_t *mem)
{
pdf14_device *pdev = (pdf14_device *)dev;
- double alpha = pis->opacity.alpha * pis->shape.alpha;
+ double alpha = pgs->opacity.alpha * pgs->shape.alpha;
gs_int_rect rect;
int code;
bool isolated = ptgp->Isolated;
@@ -3836,12 +3832,12 @@ pdf14_begin_transparency_group(gx_device *dev,
/* If the target device supports separations, then we should should NOT create
the group. The exception to this rule would be if we just popped a
transparency mask */
- code = compute_group_device_int_rect(pdev, &rect, pbbox, pis);
+ code = compute_group_device_int_rect(pdev, &rect, pbbox, pgs);
if (code < 0)
return code;
if_debug4m('v', pdev->memory,
"[v]pdf14_begin_transparency_group, I = %d, K = %d, alpha = %g, bm = %d\n",
- ptgp->Isolated, ptgp->Knockout, alpha, pis->blend_mode);
+ ptgp->Isolated, ptgp->Knockout, alpha, pgs->blend_mode);
/* If the group color is unknown then use the current device profile. Note
that if we have a sep device there may not be a profile */
if (ptgp->group_color == UNKNOWN){
@@ -3897,7 +3893,7 @@ pdf14_begin_transparency_group(gx_device *dev,
}
}
code = pdf14_update_device_color_procs(dev, group_color, ptgp->icc_hashcode,
- pis, group_profile);
+ pgs, group_profile);
if_debug0m('v', dev->memory,
"[v]Transparency group color space update\n");
} else {
@@ -3910,11 +3906,11 @@ pdf14_begin_transparency_group(gx_device *dev,
return code;
code = pdf14_push_transparency_group(pdev->ctx, &rect, isolated, ptgp->Knockout,
(byte)floor (255 * alpha + 0.5),
- (byte)floor (255 * pis->shape.alpha + 0.5),
- pis->blend_mode, ptgp->idle,
+ (byte)floor (255 * pgs->shape.alpha + 0.5),
+ pgs->blend_mode, ptgp->idle,
ptgp->mask_id, group_color_numcomps,
cm_back_drop, group_profile, tos_profile,
- pis, dev);
+ pgs, dev);
if (new_icc)
rc_decrement(group_profile, "pdf14_begin_transparency_group");
return code;
@@ -3922,7 +3918,7 @@ pdf14_begin_transparency_group(gx_device *dev,
static int
pdf14_end_transparency_group(gx_device *dev,
- gs_imager_state *pis)
+ gs_gstate *pgs)
{
pdf14_device *pdev = (pdf14_device *)dev;
int code;
@@ -3942,7 +3938,7 @@ pdf14_end_transparency_group(gx_device *dev,
vd_set_scale(0.01);
vd_set_origin(0, 0);
vd_erase(RGB(192, 192, 192));
- code = pdf14_pop_transparency_group(pis, pdev->ctx, pdev->blend_procs,
+ code = pdf14_pop_transparency_group(pgs, pdev->ctx, pdev->blend_procs,
pdev->color_info.num_components, group_profile,
(gx_device *) pdev);
#ifdef DEBUG
@@ -3954,8 +3950,8 @@ pdf14_end_transparency_group(gx_device *dev,
parent_color = pdev->ctx->stack->parent_color_info_procs;
if (!(parent_color->parent_color_mapping_procs == NULL &&
parent_color->parent_color_comp_index == NULL)) {
- pis->get_cmap_procs = parent_color->get_cmap_procs;
- gx_set_cmap_procs(pis, dev);
+ pgs->get_cmap_procs = parent_color->get_cmap_procs;
+ gx_set_cmap_procs(pgs, dev);
pdev->procs.get_color_mapping_procs =
parent_color->parent_color_mapping_procs;
pdev->procs.get_color_comp_index =
@@ -3991,7 +3987,7 @@ pdf14_end_transparency_group(gx_device *dev,
static int
pdf14_update_device_color_procs(gx_device *dev,
gs_transparency_color_t group_color,
- int64_t icc_hashcode, gs_imager_state *pis,
+ int64_t icc_hashcode, gs_gstate *pgs,
cmm_profile_t *iccprofile)
{
pdf14_device *pdevproto = NULL;
@@ -4139,7 +4135,7 @@ pdf14_update_device_color_procs(gx_device *dev,
pdev->color_info.num_components,new_num_comps);
/* Save the old information */
- parent_color_info->get_cmap_procs = pis->get_cmap_procs;
+ parent_color_info->get_cmap_procs = pgs->get_cmap_procs;
parent_color_info->parent_color_mapping_procs =
pdev->procs.get_color_mapping_procs;
parent_color_info->parent_color_comp_index =
@@ -4169,8 +4165,8 @@ pdf14_update_device_color_procs(gx_device *dev,
/* Set new information */
/* If we are in a soft mask and we are using compressed color
encoding, then go ahead and update the encoder and decoder. */
- pis->get_cmap_procs = pdf14_get_cmap_procs_group;
- gx_set_cmap_procs(pis, dev);
+ pgs->get_cmap_procs = pdf14_get_cmap_procs_group;
+ gx_set_cmap_procs(pgs, dev);
pdev->procs.get_color_mapping_procs =
pdevproto->static_procs->get_color_mapping_procs;
pdev->procs.get_color_comp_index =
@@ -4208,7 +4204,7 @@ pdf14_update_device_color_procs(gx_device *dev,
static int
pdf14_update_device_color_procs_push_c(gx_device *dev,
gs_transparency_color_t group_color, int64_t icc_hashcode,
- gs_imager_state *pis, cmm_profile_t *icc_profile)
+ gs_gstate *pgs, cmm_profile_t *icc_profile)
{
pdf14_device *pdevproto;
pdf14_device *pdev = (pdf14_device *)dev;
@@ -4350,8 +4346,8 @@ pdf14_update_device_color_procs_push_c(gx_device *dev,
"[v]pdf14_update_device_color_procs_push_c,num_components_old = %d num_components_new = %d\n",
pdev->color_info.num_components,new_num_comps);
/* Set new information in the device */
- pis->get_cmap_procs = pdf14_get_cmap_procs_group;
- gx_set_cmap_procs(pis, dev);
+ pgs->get_cmap_procs = pdf14_get_cmap_procs_group;
+ gx_set_cmap_procs(pgs, dev);
pdev->procs.get_color_mapping_procs =
pdevproto->static_procs->get_color_mapping_procs;
pdev->procs.get_color_comp_index =
@@ -4395,7 +4391,7 @@ pdf14_update_device_color_procs_push_c(gx_device *dev,
}
static int
-pdf14_update_device_color_procs_pop_c(gx_device *dev,gs_imager_state *pis)
+pdf14_update_device_color_procs_pop_c(gx_device *dev,gs_gstate *pgs)
{
pdf14_device *pdev = (pdf14_device *)dev;
@@ -4409,8 +4405,8 @@ pdf14_update_device_color_procs_pop_c(gx_device *dev,gs_imager_state *pis)
if_debug2m('v', pdev->memory,
"[v]pdf14_update_device_color_procs_pop_c,num_components_old = %d num_components_new = %d\n",
pdev->color_info.num_components,parent_color->num_components);
- pis->get_cmap_procs = parent_color->get_cmap_procs;
- gx_set_cmap_procs(pis, dev);
+ pgs->get_cmap_procs = parent_color->get_cmap_procs;
+ gx_set_cmap_procs(pgs, dev);
pdev->procs.get_color_mapping_procs = parent_color->parent_color_mapping_procs;
pdev->procs.get_color_comp_index = parent_color->parent_color_comp_index;
pdev->color_info.polarity = parent_color->polarity;
@@ -4426,7 +4422,7 @@ pdf14_update_device_color_procs_pop_c(gx_device *dev,gs_imager_state *pis)
GX_DEVICE_COLOR_MAX_COMPONENTS);
memcpy(&(pdev->color_info.comp_shift),&(parent_color->comp_shift),
GX_DEVICE_COLOR_MAX_COMPONENTS);
- /* clist writer fill rect has no access to imager state */
+ /* clist writer fill rect has no access to gs_gstate */
/* and it forwards the target device. this information */
/* is passed along to use in this case */
cldev->clist_color_info.depth = pdev->color_info.depth;
@@ -4458,7 +4454,7 @@ pdf14_update_device_color_procs_pop_c(gx_device *dev,gs_imager_state *pis)
must be outside the nested ctx structures to allow the nesting for the clist
writer */
static void
-pdf14_push_parent_color(gx_device *dev, const gs_imager_state *pis)
+pdf14_push_parent_color(gx_device *dev, const gs_gstate *pgs)
{
pdf14_device *pdev = (pdf14_device *)dev;
pdf14_parent_color_t *new_parent_color;
@@ -4478,7 +4474,7 @@ pdf14_push_parent_color(gx_device *dev, const gs_imager_state *pis)
/* Reassign new one to dev */
pdev->trans_group_parent_cmap_procs = new_parent_color;
/* Initialize with values */
- new_parent_color->get_cmap_procs = pis->get_cmap_procs;
+ new_parent_color->get_cmap_procs = pgs->get_cmap_procs;
new_parent_color->parent_color_mapping_procs =
pdev->procs.get_color_mapping_procs;
new_parent_color->parent_color_comp_index =
@@ -4510,7 +4506,7 @@ pdf14_push_parent_color(gx_device *dev, const gs_imager_state *pis)
must be outside the nested ctx structures to allow the nesting for the
clist writer */
static void
-pdf14_pop_parent_color(gx_device *dev, const gs_imager_state *pis)
+pdf14_pop_parent_color(gx_device *dev, const gs_gstate *pgs)
{
pdf14_device *pdev = (pdf14_device *)dev;
pdf14_parent_color_t *old_parent_color_info = pdev->trans_group_parent_cmap_procs;
@@ -4529,7 +4525,7 @@ static int
pdf14_begin_transparency_mask(gx_device *dev,
const gx_transparency_mask_params_t *ptmp,
const gs_rect *pbbox,
- gs_imager_state *pis, gs_memory_t *mem)
+ gs_gstate *pgs, gs_memory_t *mem)
{
pdf14_device *pdev = (pdf14_device *)dev;
byte bg_alpha = 0; /* By default the background alpha (area outside mask) is zero */
@@ -4555,7 +4551,7 @@ pdf14_begin_transparency_mask(gx_device *dev,
"pdf14_begin_transparency_mask");
if (transfer_fn == NULL)
return_error(gs_error_VMerror);
- code = compute_group_device_int_rect(pdev, &rect, pbbox, pis);
+ code = compute_group_device_int_rect(pdev, &rect, pbbox, pgs);
if (code < 0)
return code;
/* If we have background components the background alpha may be nonzero */
@@ -4597,7 +4593,7 @@ pdf14_begin_transparency_mask(gx_device *dev,
/* Always update the color mapping procs. Otherwise we end up
fowarding to the target device. */
code = pdf14_update_device_color_procs(dev, group_color, ptmp->icc_hashcode,
- pis, ptmp->iccprofile);
+ pgs, ptmp->iccprofile);
if (code < 0)
return code;
/* Note that the soft mask always follows the group color requirements even
@@ -4612,14 +4608,14 @@ pdf14_begin_transparency_mask(gx_device *dev,
}
static int
-pdf14_end_transparency_mask(gx_device *dev, gs_imager_state *pis)
+pdf14_end_transparency_mask(gx_device *dev, gs_gstate *pgs)
{
pdf14_device *pdev = (pdf14_device *)dev;
pdf14_parent_color_t *parent_color;
int ok;
if_debug0m('v', dev->memory, "pdf14_end_transparency_mask\n");
- ok = pdf14_pop_transparency_mask(pdev->ctx, pis, dev);
+ ok = pdf14_pop_transparency_mask(pdev->ctx, pgs, dev);
#ifdef DEBUG
pdf14_debug_mask_stack_state(pdev->ctx);
#endif
@@ -4630,8 +4626,8 @@ pdf14_end_transparency_mask(gx_device *dev, gs_imager_state *pis)
parent_color = pdev->ctx->stack->parent_color_info_procs;
if (!(parent_color->parent_color_mapping_procs == NULL &&
parent_color->parent_color_comp_index == NULL)) {
- pis->get_cmap_procs = parent_color->get_cmap_procs;
- gx_set_cmap_procs(pis, dev);
+ pgs->get_cmap_procs = parent_color->get_cmap_procs;
+ gx_set_cmap_procs(pgs, dev);
pdev->procs.get_color_mapping_procs = parent_color->parent_color_mapping_procs;
pdev->procs.get_color_comp_index = parent_color->parent_color_comp_index;
pdev->color_info.polarity = parent_color->polarity;
@@ -5079,7 +5075,7 @@ map_components_to_colorants(const frac * pcc,
}
static void
-pdf14_cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_imager_state * pis,
+pdf14_cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
int i,ncomps;
@@ -5089,8 +5085,8 @@ pdf14_cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_imager_state *
gx_device *trans_device;
/* If trans device is set, we need to use its procs. */
- if (pis->trans_device != NULL){
- trans_device = pis->trans_device;
+ if (pgs->trans_device != NULL){
+ trans_device = pgs->trans_device;
} else {
trans_device = dev;
}
@@ -5098,7 +5094,7 @@ pdf14_cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_imager_state *
/* map to the color model */
dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_gray(trans_device, gray, cm_comps);
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
/* encode as a color index */
color = dev_proc(trans_device, encode_color)(trans_device, cv);
/* check if the encoding was successful; we presume failure is rare */
@@ -5108,7 +5104,7 @@ pdf14_cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_imager_state *
static void
pdf14_cmap_rgb_direct(frac r, frac g, frac b, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
int i,ncomps;
frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
@@ -5117,16 +5113,16 @@ pdf14_cmap_rgb_direct(frac r, frac g, frac b, gx_device_color * pdc,
gx_device *trans_device;
/* If trans device is set, we need to use its procs. */
- if (pis->trans_device != NULL){
- trans_device = pis->trans_device;
+ if (pgs->trans_device != NULL){
+ trans_device = pgs->trans_device;
} else {
trans_device = dev;
}
ncomps = trans_device->color_info.num_components;
/* map to the color model */
- dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pis, r, g, b, cm_comps);
+ dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pgs, r, g, b, cm_comps);
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
/* encode as a color index */
color = dev_proc(trans_device, encode_color)(trans_device, cv);
/* check if the encoding was successful; we presume failure is rare */
@@ -5136,7 +5132,7 @@ pdf14_cmap_rgb_direct(frac r, frac g, frac b, gx_device_color * pdc,
static void
pdf14_cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select,
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select,
const gs_color_space *pcs)
{
int i,ncomps;
@@ -5146,8 +5142,8 @@ pdf14_cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
gx_device *trans_device;
/* If trans device is set, we need to use its procs. */
- if (pis->trans_device != NULL){
- trans_device = pis->trans_device;
+ if (pgs->trans_device != NULL){
+ trans_device = pgs->trans_device;
} else {
trans_device = dev;
}
@@ -5155,7 +5151,7 @@ pdf14_cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
/* map to the color model */
dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_cmyk(trans_device, c, m, y, k, cm_comps);
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
/* if output device supports devn, we need to make sure we send it the
proper color type */
if (dev_proc(trans_device, dev_spec_op)(trans_device, gxdso_supports_devn, NULL, 0)) {
@@ -5174,7 +5170,7 @@ pdf14_cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
/* color mapping for when we have an smask or a isolated transparency group with
another color space */
static void
-pdf14_cmap_gray_direct_group(frac gray, gx_device_color * pdc, const gs_imager_state * pis,
+pdf14_cmap_gray_direct_group(frac gray, gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
int i, ncomps = dev->color_info.num_components;
@@ -5190,8 +5186,8 @@ pdf14_cmap_gray_direct_group(frac gray, gx_device_color * pdc, const gs_imager_s
and we use the operators defined by the transparency device
to do the job.
*/
- if (pis->trans_device != NULL){
- trans_device = pis->trans_device;
+ if (pgs->trans_device != NULL){
+ trans_device = pgs->trans_device;
} else {
trans_device = dev;
}
@@ -5199,7 +5195,7 @@ pdf14_cmap_gray_direct_group(frac gray, gx_device_color * pdc, const gs_imager_s
/* If we are doing concretization of colors in an SMask or isolated group
then just return the color as is */
if (ncomps == 1 ) {
- cv[0] = frac2cv(gx_map_color_frac(pis, gray, effective_transfer[0]));
+ cv[0] = frac2cv(gx_map_color_frac(pgs, gray, effective_transfer[0]));
/* encode as a color index */
color = dev_proc(trans_device, encode_color)(trans_device, cv);
/* check if the encoding was successful; we presume failure is rare */
@@ -5209,7 +5205,7 @@ pdf14_cmap_gray_direct_group(frac gray, gx_device_color * pdc, const gs_imager_s
/* map to the color model */
dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_gray(trans_device, gray, cm_comps);
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
/* encode as a color index */
color = dev_proc(trans_device, encode_color)(trans_device, cv);
/* check if the encoding was successful; we presume failure is rare */
@@ -5222,7 +5218,7 @@ pdf14_cmap_gray_direct_group(frac gray, gx_device_color * pdc, const gs_imager_s
another color space */
static void
pdf14_cmap_rgb_direct_group(frac r, frac g, frac b, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
int i, ncomps = dev->color_info.num_components;
frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
@@ -5234,16 +5230,16 @@ pdf14_cmap_rgb_direct_group(frac r, frac g, frac b, gx_device_color * pdc,
defined by the transparency group and we use the operators defined by
the transparency device to do the job.
*/
- if (pis->trans_device != NULL){
- trans_device = pis->trans_device;
+ if (pgs->trans_device != NULL){
+ trans_device = pgs->trans_device;
} else {
trans_device = dev;
}
ncomps = trans_device->color_info.num_components;
/* map to the device color model */
- dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pis, r, g, b, cm_comps);
+ dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pgs, r, g, b, cm_comps);
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
/* encode as a color index */
color = dev_proc(trans_device, encode_color)(trans_device, cv);
/* check if the encoding was successful; we presume failure is rare */
@@ -5254,7 +5250,7 @@ pdf14_cmap_rgb_direct_group(frac r, frac g, frac b, gx_device_color * pdc,
/* color mapping for when we have an smask or a isolated transparency group with another color space */
static void
pdf14_cmap_cmyk_direct_group(frac c, frac m, frac y, frac k, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select,
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select,
const gs_color_space *pcs)
{
int i, ncomps = dev->color_info.num_components;
@@ -5268,8 +5264,8 @@ pdf14_cmap_cmyk_direct_group(frac c, frac m, frac y, frac k, gx_device_color * p
defined by the transparency group and we use the operators defined by
the transparency device to do the job.
*/
- if (pis->trans_device != NULL){
- trans_device = pis->trans_device;
+ if (pgs->trans_device != NULL){
+ trans_device = pgs->trans_device;
} else {
trans_device = dev;
}
@@ -5277,7 +5273,7 @@ pdf14_cmap_cmyk_direct_group(frac c, frac m, frac y, frac k, gx_device_color * p
/* map to the color model */
dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_cmyk(trans_device, c, m, y, k, cm_comps);
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
color = dev_proc(trans_device, encode_color)(trans_device, cv);
if (color != gx_no_color_index)
color_set_pure(pdc, color);
@@ -5285,7 +5281,7 @@ pdf14_cmap_cmyk_direct_group(frac c, frac m, frac y, frac k, gx_device_color * p
static void
pdf14_cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
int i, ncomps;
frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
@@ -5297,14 +5293,14 @@ pdf14_cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color
target device. If this occurs we actually need to get to the color
space defined by the transparency group and we use the operators
defined by the transparency device to do the job. */
- if (pis->trans_device != NULL){
- trans_device = pis->trans_device;
+ if (pgs->trans_device != NULL){
+ trans_device = pgs->trans_device;
} else {
trans_device = dev;
}
ncomps = trans_device->color_info.num_components;
/* map to the color model */
- dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pis, r, g, b, cm_comps);
+ dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pgs, r, g, b, cm_comps);
/* pre-multiply to account for the alpha weighting */
if (alpha != frac_1) {
#ifdef PREMULTIPLY_TOWARDS_WHITE
@@ -5317,7 +5313,7 @@ pdf14_cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color
}
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
color = dev_proc(trans_device, encode_color)(trans_device, cv);
/* check if the encoding was successful; we presume failure is rare */
if (color != gx_no_color_index)
@@ -5325,7 +5321,7 @@ pdf14_cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color
}
static void
-pdf14_cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state * pis,
+pdf14_cmap_separation_direct(frac all, gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
int i, ncomps = dev->color_info.num_components;
@@ -5335,7 +5331,7 @@ pdf14_cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_st
gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
gx_color_index color;
- if (pis->color_component_map.sep_type == SEP_ALL) {
+ if (pgs->color_component_map.sep_type == SEP_ALL) {
/*
* Invert the photometric interpretation for additive
* color spaces because separations are always subtractive.
@@ -5343,21 +5339,21 @@ pdf14_cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_st
if (additive)
comp_value = frac_1 - comp_value;
/* Use the "all" value for all components */
- i = pis->color_component_map.num_colorants - 1;
+ i = pgs->color_component_map.num_colorants - 1;
for (; i >= 0; i--)
cm_comps[i] = comp_value;
}
else {
/* map to the color model */
- map_components_to_colorants(&comp_value, &(pis->color_component_map), cm_comps);
+ map_components_to_colorants(&comp_value, &(pgs->color_component_map), cm_comps);
}
/* apply the transfer function(s); convert to color values */
if (additive)
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
else
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(frac_1 - gx_map_color_frac(pis, (frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
+ cv[i] = frac2cv(frac_1 - gx_map_color_frac(pgs, (frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
/* if output device supports devn, we need to make sure we send it the
proper color type */
@@ -5376,7 +5372,7 @@ pdf14_cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_st
static void
pdf14_cmap_devicen_direct(const frac * pcc,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
int i, ncomps = dev->color_info.num_components;
@@ -5390,21 +5386,21 @@ pdf14_cmap_devicen_direct(const frac * pcc,
space defined by the transparency group and we use the operators
defined by the transparency device to do the job.
*/
- if (pis->trans_device != NULL){
- trans_device = pis->trans_device;
+ if (pgs->trans_device != NULL){
+ trans_device = pgs->trans_device;
} else {
trans_device = dev;
}
ncomps = trans_device->color_info.num_components;
/* map to the color model */
- map_components_to_colorants(pcc, &(pis->color_component_map), cm_comps);;
+ map_components_to_colorants(pcc, &(pgs->color_component_map), cm_comps);;
/* apply the transfer function(s); convert to color values */
if (trans_device->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis, cm_comps[i], effective_transfer[i]));
+ cv[i] = frac2cv(gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]));
else
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(frac_1 - gx_map_color_frac(pis, (frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
+ cv[i] = frac2cv(frac_1 - gx_map_color_frac(pgs, (frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
/* if output device supports devn, we need to make sure we send it the
proper color type */
if (dev_proc(trans_device, dev_spec_op)(trans_device, gxdso_supports_devn, NULL, 0)) {
@@ -5421,20 +5417,20 @@ pdf14_cmap_devicen_direct(const frac * pcc,
}
static bool
-pdf14_cmap_is_halftoned(const gs_imager_state * pis, gx_device * dev)
+pdf14_cmap_is_halftoned(const gs_gstate * pgs, gx_device * dev)
{
return false;
}
static const gx_color_map_procs *
-pdf14_get_cmap_procs(const gs_imager_state *pis, const gx_device * dev)
+pdf14_get_cmap_procs(const gs_gstate *pgs, const gx_device * dev)
{
/* The pdf14 marking device itself is always continuous tone. */
return &pdf14_cmap_many;
}
static const gx_color_map_procs *
-pdf14_get_cmap_procs_group(const gs_imager_state *pis, const gx_device * dev)
+pdf14_get_cmap_procs_group(const gs_gstate *pgs, const gx_device * dev)
{
/* The pdf14 marking device itself is always continuous tone. */
return &pdf14_cmap_many_group;
@@ -5487,7 +5483,7 @@ gs_pdf14_device_color_mon_set(gx_device *pdev, bool monitoring)
}
int
-gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis,
+gs_pdf14_device_push(gs_memory_t *mem, gs_gstate * pgs,
gx_device ** pdev, gx_device * target, const gs_pdf14trans_t * pdf14pct)
{
pdf14_device * dev_proto;
@@ -5535,7 +5531,7 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis,
if_debug0m('v', mem, "[v]gs_pdf14_device_push\n");
code = get_pdf14_device_proto(target, &dev_proto,
- &temp_dev_proto, pis, pdf14pct);
+ &temp_dev_proto, pgs, pdf14pct);
if (code < 0)
return code;
code = gs_copydevice((gx_device **) &p14dev,
@@ -5552,10 +5548,10 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis,
CIELAB. Need to check that we have a default profile, which
will not be the case if we are coming from the clist reader */
if ((icc_profile->data_cs == gsCIELAB || icc_profile->islab)
- && pis->icc_manager->default_rgb != NULL) {
+ && pgs->icc_manager->default_rgb != NULL) {
p14dev->icc_struct->device_profile[0] =
- pis->icc_manager->default_rgb;
- rc_increment(pis->icc_manager->default_rgb);
+ pgs->icc_manager->default_rgb;
+ rc_increment(pgs->icc_manager->default_rgb);
}
/* The number of color planes should not exceed that of the target */
if (p14dev->color_info.num_components > target->color_info.num_components)
@@ -5576,9 +5572,9 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis,
}
check_device_separable((gx_device *)p14dev);
gx_device_fill_in_procs((gx_device *)p14dev);
- p14dev->save_get_cmap_procs = pis->get_cmap_procs;
- pis->get_cmap_procs = pdf14_get_cmap_procs;
- gx_set_cmap_procs(pis, (gx_device *)p14dev);
+ p14dev->save_get_cmap_procs = pgs->get_cmap_procs;
+ pgs->get_cmap_procs = pdf14_get_cmap_procs;
+ gx_set_cmap_procs(pgs, (gx_device *)p14dev);
/* Components shift, etc have to be based upon 8 bit */
for (k = 0; k < p14dev->color_info.num_components; k++) {
p14dev->color_info.comp_bits[k] = 8;
@@ -5592,7 +5588,7 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis,
}
code = dev_proc((gx_device *) p14dev, open_device) ((gx_device *) p14dev);
*pdev = (gx_device *) p14dev;
- pdf14_set_marking_params((gx_device *)p14dev, pis);
+ pdf14_set_marking_params((gx_device *)p14dev, pgs);
p14dev->blendspot = false;
p14dev->trans_group_parent_cmap_procs = NULL;
/* In case we have alphabits set */
@@ -5658,12 +5654,12 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis,
/* Do the initial fillpage into the pdf14-accum device we just created */
dev_proc(new_target, set_graphics_type_tag)(new_target, GS_PATH_TAG);
if ((code = gx_remap_concrete_DGray(&pconc_white,
- gs_currentcolorspace_inline((gs_state *)pis),
- &pdcolor, pis, new_target, gs_color_select_all)) < 0)
+ gs_currentcolorspace_inline((gs_gstate *)pgs),
+ &pdcolor, pgs, new_target, gs_color_select_all)) < 0)
goto no_clist_accum;
- (*dev_proc(new_target, fillpage))(new_target, pis, &pdcolor);
- code = clist_create_compositor(new_target, pdev, (gs_composite_t *)pdf14pct, pis, mem, NULL);
+ (*dev_proc(new_target, fillpage))(new_target, pgs, &pdcolor);
+ code = clist_create_compositor(new_target, pdev, (gs_composite_t *)pdf14pct, pgs, mem, NULL);
if (code < 0)
goto no_clist_accum;
@@ -5718,7 +5714,7 @@ static const char * pdf14_opcode_names[] = PDF14_OPCODE_NAMES;
static inline int
c_pdf14trans_write_ctm(byte **ppbuf, const gs_pdf14trans_params_t *pparams)
{
- /* Note: We can't skip writing CTM if it is equal to pis->ctm,
+ /* Note: We can't skip writing CTM if it is equal to pgs->ctm,
because clist writer may skip this command for some bands.
For a better result we need individual CTM for each band.
*/
@@ -6115,17 +6111,17 @@ c_pdf14trans_read(gs_composite_t * * ppct, const byte * data,
* Adjust the compositor's CTM.
*/
static int
-c_pdf14trans_adjust_ctm(gs_composite_t * pct0, int x0, int y0, gs_imager_state *pis)
+c_pdf14trans_adjust_ctm(gs_composite_t * pct0, int x0, int y0, gs_gstate *pgs)
{
gs_pdf14trans_t *pct = (gs_pdf14trans_t *)pct0;
gs_matrix mat = pct->params.ctm;
- if_debug6m('L', pis->memory, " [%g %g %g %g %g %g]\n",
+ if_debug6m('L', pgs->memory, " [%g %g %g %g %g %g]\n",
mat.xx, mat.xy, mat.yx, mat.yy,
mat.tx, mat.ty);
mat.tx -= x0;
mat.ty -= y0;
- gs_imager_setmatrix(pis, &mat);
+ gs_gstate_setmatrix(pgs, &mat);
return 0;
}
@@ -6137,7 +6133,7 @@ c_pdf14trans_adjust_ctm(gs_composite_t * pct0, int x0, int y0, gs_imager_state *
*/
static int
c_pdf14trans_create_default_compositor(const gs_composite_t * pct,
- gx_device ** pp14dev, gx_device * tdev, gs_imager_state * pis,
+ gx_device ** pp14dev, gx_device * tdev, gs_gstate * pgs,
gs_memory_t * mem)
{
const gs_pdf14trans_t * pdf14pct = (const gs_pdf14trans_t *) pct;
@@ -6151,7 +6147,7 @@ c_pdf14trans_create_default_compositor(const gs_composite_t * pct,
*/
switch (pdf14pct->params.pdf14_op) {
case PDF14_PUSH_DEVICE:
- code = gs_pdf14_device_push(mem, pis, &p14dev, tdev, pdf14pct);
+ code = gs_pdf14_device_push(mem, pgs, &p14dev, tdev, pdf14pct);
*pp14dev = p14dev;
break;
default:
@@ -6402,21 +6398,21 @@ gs_create_pdf14trans(
* Send a PDF 1.4 transparency compositor action to the specified device.
*/
int
-send_pdf14trans(gs_imager_state * pis, gx_device * dev,
+send_pdf14trans(gs_gstate * pgs, gx_device * dev,
gx_device * * pcdev, gs_pdf14trans_params_t * pparams, gs_memory_t * mem)
{
gs_composite_t * pct = NULL;
int code;
- pparams->ctm = ctm_only(pis);
+ pparams->ctm = ctm_only(pgs);
code = gs_create_pdf14trans(&pct, pparams, mem);
if (code < 0)
return code;
- code = dev_proc(dev, create_compositor) (dev, pcdev, pct, pis, mem, NULL);
+ code = dev_proc(dev, create_compositor) (dev, pcdev, pct, pgs, mem, NULL);
if (code == gs_error_handled)
code = 0;
- gs_free_object(pis->memory, pct, "send_pdf14trans");
+ gs_free_object(pgs->memory, pct, "send_pdf14trans");
return code;
}
@@ -6635,7 +6631,7 @@ const pdf14_clist_device pdf14_clist_custom_device = {
*/
static int
get_pdf14_clist_device_proto(gx_device * dev, pdf14_clist_device ** pdevproto,
- pdf14_clist_device * ptempdevproto, gs_imager_state * pis,
+ pdf14_clist_device * ptempdevproto, gs_gstate * pgs,
const gs_pdf14trans_t * pdf14pct)
{
pdf14_default_colorspace_t dev_cs =
@@ -6723,7 +6719,7 @@ get_pdf14_clist_device_proto(gx_device * dev, pdf14_clist_device ** pdevproto,
}
static int
-pdf14_create_clist_device(gs_memory_t *mem, gs_imager_state * pis,
+pdf14_create_clist_device(gs_memory_t *mem, gs_gstate * pgs,
gx_device ** ppdev, gx_device * target,
const gs_pdf14trans_t * pdf14pct)
{
@@ -6741,9 +6737,9 @@ pdf14_create_clist_device(gs_memory_t *mem, gs_imager_state * pis,
return code;
gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &target_profile,
&render_cond);
- if_debug0m('v', pis->memory, "[v]pdf14_create_clist_device\n");
+ if_debug0m('v', pgs->memory, "[v]pdf14_create_clist_device\n");
code = get_pdf14_clist_device_proto(target, &dev_proto,
- &temp_dev_proto, pis, pdf14pct);
+ &temp_dev_proto, pgs, pdf14pct);
if (code < 0)
return code;
code = gs_copydevice((gx_device **) &pdev,
@@ -6785,7 +6781,7 @@ pdf14_create_clist_device(gs_memory_t *mem, gs_imager_state * pis,
CIELAB */
if (target_profile->data_cs == gsCIELAB || target_profile->islab) {
rc_assign(pdev->icc_struct->device_profile[0],
- pis->icc_manager->default_rgb, "pdf14_create_clist_device");
+ pgs->icc_manager->default_rgb, "pdf14_create_clist_device");
}
pdev->my_encode_color = pdev->procs.encode_color;
pdev->my_decode_color = pdev->procs.decode_color;
@@ -6804,13 +6800,13 @@ pdf14_create_clist_device(gs_memory_t *mem, gs_imager_state * pis,
* routine implements that action.
*/
static int
-pdf14_disable_clist_device(gs_memory_t *mem, gs_imager_state * pis,
+pdf14_disable_clist_device(gs_memory_t *mem, gs_gstate * pgs,
gx_device * dev)
{
gx_device_forward * pdev = (gx_device_forward *)dev;
gx_device * target = pdev->target;
- if_debug0m('v', pis->memory, "[v]pdf14_disable_clist_device\n");
+ if_debug0m('v', pgs->memory, "[v]pdf14_disable_clist_device\n");
/*
* To disable the action of this device, we forward all device
@@ -6831,7 +6827,7 @@ pdf14_disable_clist_device(gs_memory_t *mem, gs_imager_state * pis,
* again.
*/
static int
-pdf14_recreate_clist_device(gs_memory_t *mem, gs_imager_state * pis,
+pdf14_recreate_clist_device(gs_memory_t *mem, gs_gstate * pgs,
gx_device * dev, const gs_pdf14trans_t * pdf14pct)
{
pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
@@ -6840,13 +6836,13 @@ pdf14_recreate_clist_device(gs_memory_t *mem, gs_imager_state * pis,
pdf14_clist_device temp_dev_proto;
int code;
- if_debug0m('v', pis->memory, "[v]pdf14_recreate_clist_device\n");
+ if_debug0m('v', pgs->memory, "[v]pdf14_recreate_clist_device\n");
/*
* We will not use the entire prototype device but we will set the
* color related info to match the prototype.
*/
code = get_pdf14_clist_device_proto(target, &dev_proto,
- &temp_dev_proto, pis, pdf14pct);
+ &temp_dev_proto, pgs, pdf14pct);
if (code < 0)
return code;
pdev->color_info = dev_proto->color_info;
@@ -6946,7 +6942,7 @@ pdf14_put_devn_params(gx_device * pdev, gs_devn_params * pdevn_params,
*/
static int
pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
- const gs_composite_t * pct, gs_imager_state * pis, gs_memory_t * mem,
+ const gs_composite_t * pct, gs_gstate * pgs, gs_memory_t * mem,
gx_device *cdev)
{
pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
@@ -6977,10 +6973,10 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
pdev->target->procs.get_color_comp_index =
pdev->procs.get_color_comp_index =
pdev->my_get_color_comp_index;
- pdev->save_get_cmap_procs = pis->get_cmap_procs;
- pis->get_cmap_procs = pdf14_get_cmap_procs;
- gx_set_cmap_procs(pis, dev);
- code = pdf14_recreate_clist_device(mem, pis, dev, pdf14pct);
+ pdev->save_get_cmap_procs = pgs->get_cmap_procs;
+ pgs->get_cmap_procs = pdf14_get_cmap_procs;
+ gx_set_cmap_procs(pgs, dev);
+ code = pdf14_recreate_clist_device(mem, pgs, dev, pdf14pct);
pdev->blend_mode = pdev->text_knockout = 0;
pdev->opacity = pdev->shape = 0.0;
if (code < 0)
@@ -6995,7 +6991,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
pctemp.type = &gs_composite_pdf14trans_no_clist_writer_type;
code = dev_proc(pdev->target, create_compositor)
- (pdev->target, pcdev, &pctemp, pis, mem, cdev);
+ (pdev->target, pcdev, &pctemp, pgs, mem, cdev);
*pcdev = dev;
return code;
}
@@ -7010,16 +7006,16 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
pdev->saved_target_get_color_mapping_procs;
pdev->target->procs.get_color_comp_index =
pdev->saved_target_get_color_comp_index;
- pis->get_cmap_procs = pdev->save_get_cmap_procs;
- gx_set_cmap_procs(pis, pdev->target);
+ pgs->get_cmap_procs = pdev->save_get_cmap_procs;
+ gx_set_cmap_procs(pgs, pdev->target);
gx_device_decache_colors(pdev->target);
/* Disable the PDF 1.4 compositor */
- pdf14_disable_clist_device(mem, pis, dev);
+ pdf14_disable_clist_device(mem, pgs, dev);
/*
* Make sure that the transfer funtions, etc. are current.
*/
code = cmd_put_color_mapping(
- (gx_device_clist_writer *)(pdev->target), pis);
+ (gx_device_clist_writer *)(pdev->target), pgs);
if (code < 0)
return code;
break;
@@ -7029,7 +7025,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
These need to be written out in the same bands as the group
information is written. Hence the passing of the dimensions
for the group. */
- code = pdf14_clist_update_params(pdev, pis, true,
+ code = pdf14_clist_update_params(pdev, pgs, true,
(gs_pdf14trans_params_t *)&(pdf14pct->params));
if (code < 0)
return code;
@@ -7041,7 +7037,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
the group color space. For simplicity, the list item is
created even if the color space did not change */
/* First store the current ones */
- pdf14_push_parent_color(dev, pis);
+ pdf14_push_parent_color(dev, pgs);
/* Now update the device procs. Not
if we have a sep target though */
sep_target = (strcmp(pdev->dname, "pdf14clistcustom") == 0) ||
@@ -7054,7 +7050,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
*/
code = pdf14_update_device_color_procs_push_c(dev,
pdf14pct->params.group_color,
- pdf14pct->params.icc_hash, pis,
+ pdf14pct->params.icc_hash, pgs,
pdf14pct->params.iccprofile);
if (code < 0)
return code;
@@ -7067,7 +7063,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
/* First store the current ones */
if (pdf14pct->params.subtype == TRANSPARENCY_MASK_None)
break;
- pdf14_push_parent_color(dev, pis);
+ pdf14_push_parent_color(dev, pgs);
/* If we are playing back from a clist, the iccprofile may need to be loaded */
if (pdf14pct->params.iccprofile == NULL) {
gs_pdf14trans_params_t *pparams_noconst = (gs_pdf14trans_params_t *)&(pdf14pct->params);
@@ -7089,7 +7085,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
/* Now update the device procs */
code = pdf14_update_device_color_procs_push_c(dev,
pdf14pct->params.group_color,
- pdf14pct->params.icc_hash, pis,
+ pdf14pct->params.icc_hash, pgs,
pdf14pct->params.iccprofile);
if (code < 0)
return code;
@@ -7108,12 +7104,12 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
(strcmp(pdev->dname, "pdf14clistcmykspot") == 0) ||
(dev_proc(dev, dev_spec_op)(dev, gxdso_supports_devn, NULL, 0));
if (!sep_target) {
- code = pdf14_update_device_color_procs_pop_c(dev,pis);
+ code = pdf14_update_device_color_procs_pop_c(dev,pgs);
}
else
code = 0;
/* We always do this push and pop */
- pdf14_pop_parent_color(dev, pis);
+ pdf14_pop_parent_color(dev, pgs);
if (code < 0)
return code;
break;
@@ -7121,9 +7117,9 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
/* We need to update the clist writer device procs based upon the
the group color space. */
/* First restore our procs */
- code = pdf14_update_device_color_procs_pop_c(dev,pis);
+ code = pdf14_update_device_color_procs_pop_c(dev,pgs);
/* Now pop the old one */
- pdf14_pop_parent_color(dev, pis);
+ pdf14_pop_parent_color(dev, pgs);
if (code < 0)
return code;
break;
@@ -7132,18 +7128,18 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
case PDF14_POP_TRANS_STATE:
break;
case PDF14_PUSH_SMASK_COLOR:
- code = pdf14_increment_smask_color(pis,dev);
+ code = pdf14_increment_smask_color(pgs,dev);
*pcdev = dev;
return code; /* Note, this are NOT put in the clist */
break;
case PDF14_POP_SMASK_COLOR:
- code = pdf14_decrement_smask_color(pis,dev);
+ code = pdf14_decrement_smask_color(pgs,dev);
*pcdev = dev;
return code; /* Note, this are NOT put in the clist */
break;
case PDF14_SET_BLEND_PARAMS:
/* If there is a change we go ahead and apply it to the target */
- code = pdf14_clist_update_params(pdev, pis, false,
+ code = pdf14_clist_update_params(pdev, pgs, false,
(gs_pdf14trans_params_t *)&(pdf14pct->params));
*pcdev = dev;
return code;
@@ -7155,7 +7151,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
}
}
code = dev_proc(pdev->target, create_compositor)
- (pdev->target, pcdev, pct, pis, mem, cdev);
+ (pdev->target, pcdev, pct, pgs, mem, cdev);
/* If we were accumulating into a pdf14-clist-accum device, */
/* we now have to render the page into it's target device */
if (is_pdf14_compositor && pdf14pct->params.pdf14_op == PDF14_POP_DEVICE &&
@@ -7177,7 +7173,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
/*
* Set color space in preparation for sending an image.
*/
- code = gs_cspace_build_ICC(&pcs, NULL, pis->memory);
+ code = gs_cspace_build_ICC(&pcs, NULL, pgs->memory);
if (linebuf == NULL || pcs == NULL)
goto put_accum_error;
@@ -7204,17 +7200,17 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
image.Width = pdev->width;
image.Height = pdev->height;
image.BitsPerComponent = 8;
- ctm_only_writable(pis).xx = (float)pdev->width;
- ctm_only_writable(pis).xy = 0;
- ctm_only_writable(pis).yx = 0;
- ctm_only_writable(pis).yy = (float)pdev->height;
- ctm_only_writable(pis).tx = 0.0;
- ctm_only_writable(pis).ty = 0.0;
+ ctm_only_writable(pgs).xx = (float)pdev->width;
+ ctm_only_writable(pgs).xy = 0;
+ ctm_only_writable(pgs).yx = 0;
+ ctm_only_writable(pgs).yy = (float)pdev->height;
+ ctm_only_writable(pgs).tx = 0.0;
+ ctm_only_writable(pgs).ty = 0.0;
code = dev_proc(target, begin_typed_image) (target,
- pis, NULL,
+ pgs, NULL,
(gs_image_common_t *)&image,
NULL, NULL, NULL,
- pis->memory, &info);
+ pgs->memory, &info);
if (code < 0)
goto put_accum_error;
for (y=0; y < tdev->height; y++) {
@@ -7258,7 +7254,7 @@ put_accum_error:
*/
static int
pdf14_clist_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
- const gs_composite_t * pct, gs_imager_state * pis,
+ const gs_composite_t * pct, gs_gstate * pgs,
gs_memory_t * mem, gx_device *cdev)
{
pdf14_device *pdev = (pdf14_device *)dev;
@@ -7271,10 +7267,10 @@ pdf14_clist_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
const gs_pdf14trans_t * pdf14pct = (const gs_pdf14trans_t *) pct;
if (pdf14pct->params.pdf14_op == PDF14_PUSH_DEVICE)
- return pdf14_clist_create_compositor(dev, &ndev, pct, pis, mem, cdev);
+ return pdf14_clist_create_compositor(dev, &ndev, pct, pgs, mem, cdev);
return 0;
}
- code = dev_proc(tdev, create_compositor)(tdev, &ndev, pct, pis, mem, cdev);
+ code = dev_proc(tdev, create_compositor)(tdev, &ndev, pct, pgs, mem, cdev);
if (code < 0)
return code;
gx_device_set_target((gx_device_forward *)pdev, ndev);
@@ -7286,7 +7282,7 @@ pdf14_clist_forward_create_compositor(gx_device * dev, gx_device * * pcdev,
* need to send them to the PDF 1.4 compositor on the output side of the clist.
*/
static int
-pdf14_clist_update_params(pdf14_clist_device * pdev, const gs_imager_state * pis,
+pdf14_clist_update_params(pdf14_clist_device * pdev, const gs_gstate * pgs,
bool crop_blend_params,
gs_pdf14trans_params_t *group_params)
{
@@ -7299,29 +7295,29 @@ pdf14_clist_update_params(pdf14_clist_device * pdev, const gs_imager_state * pis
params.crop_blend_params = crop_blend_params;
params.pdf14_op = PDF14_SET_BLEND_PARAMS;
- if (pis->blend_mode != pdev->blend_mode) {
+ if (pgs->blend_mode != pdev->blend_mode) {
changed |= PDF14_SET_BLEND_MODE;
- params.blend_mode = pdev->blend_mode = pis->blend_mode;
+ params.blend_mode = pdev->blend_mode = pgs->blend_mode;
}
- if (pis->text_knockout != pdev->text_knockout) {
+ if (pgs->text_knockout != pdev->text_knockout) {
changed |= PDF14_SET_TEXT_KNOCKOUT;
- params.text_knockout = pdev->text_knockout = pis->text_knockout;
+ params.text_knockout = pdev->text_knockout = pgs->text_knockout;
}
- if (pis->shape.alpha != pdev->shape) {
+ if (pgs->shape.alpha != pdev->shape) {
changed |= PDF14_SET_SHAPE_ALPHA;
- params.shape.alpha = pdev->shape = pis->shape.alpha;
+ params.shape.alpha = pdev->shape = pgs->shape.alpha;
}
- if (pis->opacity.alpha != pdev->opacity) {
+ if (pgs->opacity.alpha != pdev->opacity) {
changed |= PDF14_SET_OPACITY_ALPHA;
- params.opacity.alpha = pdev->opacity = pis->opacity.alpha;
+ params.opacity.alpha = pdev->opacity = pgs->opacity.alpha;
}
- if (pis->overprint != pdev->overprint) {
+ if (pgs->overprint != pdev->overprint) {
changed |= PDF14_SET_OVERPRINT;
- params.overprint = pdev->overprint = pis->overprint;
+ params.overprint = pdev->overprint = pgs->overprint;
}
- if (pis->overprint_mode != pdev->overprint_mode) {
+ if (pgs->overprint_mode != pdev->overprint_mode) {
changed |= PDF14_SET_OVERPRINT_MODE;
- params.overprint_mode = pdev->overprint_mode = pis->overprint_mode;
+ params.overprint_mode = pdev->overprint_mode = pgs->overprint_mode;
}
if (crop_blend_params) {
params.ctm = group_params->ctm;
@@ -7334,11 +7330,11 @@ pdf14_clist_update_params(pdf14_clist_device * pdev, const gs_imager_state * pis
need to often perform this operation when we are already starting to
do a compositor action */
if (changed != 0) {
- code = gs_create_pdf14trans(&pct_new, &params, pis->memory);
+ code = gs_create_pdf14trans(&pct_new, &params, pgs->memory);
if (code < 0) return code;
code = dev_proc(pdev->target, create_compositor)
- (pdev->target, &pcdev, pct_new, (gs_imager_state *)pis, pis->memory, NULL);
- gs_free_object(pis->memory, pct_new, "pdf14_clist_update_params");
+ (pdev->target, &pcdev, pct_new, (gs_gstate *)pgs, pgs->memory, NULL);
+ gs_free_object(pgs->memory, pct_new, "pdf14_clist_update_params");
}
return code;
}
@@ -7348,13 +7344,13 @@ pdf14_clist_update_params(pdf14_clist_device * pdev, const gs_imager_state * pis
* writing the clist.
*/
static int
-pdf14_clist_fill_path(gx_device *dev, const gs_imager_state *pis,
+pdf14_clist_fill_path(gx_device *dev, const gs_gstate *pgs,
gx_path *ppath, const gx_fill_params *params,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
- gs_imager_state new_is = *pis;
+ gs_gstate new_pgs = *pgs;
int code;
gs_pattern2_instance_t *pinst = NULL;
gx_device_forward * fdev = (gx_device_forward *)dev;
@@ -7362,8 +7358,6 @@ pdf14_clist_fill_path(gx_device *dev, const gs_imager_state *pis,
gsicc_rendering_param_t render_cond;
cmm_profile_t *icc_profile_fwd, *icc_profile_dev;
- new_is.is_gstate = false;
-
code = dev_proc(dev, get_profile)(dev, &dev_profile);
if (code < 0)
return code;
@@ -7379,10 +7373,10 @@ pdf14_clist_fill_path(gx_device *dev, const gs_imager_state *pis,
/*
* Ensure that that the PDF 1.4 reading compositor will have the current
* blending parameters. This is needed since the fill_rectangle routines
- * do not have access to the imager state. Thus we have to pass any
+ * do not have access to the gs_gstate. Thus we have to pass any
* changes explictly.
*/
- code = pdf14_clist_update_params(pdev, pis, false, NULL);
+ code = pdf14_clist_update_params(pdev, pgs, false, NULL);
if (code < 0)
return code;
/* If we are doing a shading fill and we are in a transparency group of a
@@ -7401,12 +7395,12 @@ pdf14_clist_fill_path(gx_device *dev, const gs_imager_state *pis,
clist writer device. */
pinst->saved->trans_device = dev;
}
- update_lop_for_pdf14(&new_is, pdcolor);
- new_is.trans_device = dev;
- new_is.has_transparency = true;
- code = gx_forward_fill_path(dev, &new_is, ppath, params, pdcolor, pcpath);
- new_is.trans_device = NULL;
- new_is.has_transparency = false;
+ update_lop_for_pdf14(&new_pgs, pdcolor);
+ new_pgs.trans_device = dev;
+ new_pgs.has_transparency = true;
+ code = gx_forward_fill_path(dev, &new_pgs, ppath, params, pdcolor, pcpath);
+ new_pgs.trans_device = NULL;
+ new_pgs.has_transparency = false;
if (pinst != NULL){
pinst->saved->trans_device = NULL;
}
@@ -7418,25 +7412,23 @@ pdf14_clist_fill_path(gx_device *dev, const gs_imager_state *pis,
* writing the clist.
*/
static int
-pdf14_clist_stroke_path(gx_device *dev, const gs_imager_state *pis,
+pdf14_clist_stroke_path(gx_device *dev, const gs_gstate *pgs,
gx_path *ppath, const gx_stroke_params *params,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
- gs_imager_state new_is = *pis;
+ gs_gstate new_pgs = *pgs;
int code;
gs_pattern2_instance_t *pinst = NULL;
- new_is.is_gstate = false;
-
/*
* Ensure that that the PDF 1.4 reading compositor will have the current
* blending parameters. This is needed since the fill_rectangle routines
- * do not have access to the imager state. Thus we have to pass any
+ * do not have access to the gs_gstate. Thus we have to pass any
* changes explictly.
*/
- code = pdf14_clist_update_params(pdev, pis, false, NULL);
+ code = pdf14_clist_update_params(pdev, pgs, false, NULL);
if (code < 0)
return code;
/* If we are doing a shading stroke and we are in a transparency group of a
@@ -7453,12 +7445,12 @@ pdf14_clist_stroke_path(gx_device *dev, const gs_imager_state *pis,
pinst->saved->trans_device = dev;
}
- update_lop_for_pdf14(&new_is, pdcolor);
- new_is.trans_device = dev;
- new_is.has_transparency = true;
- code = gx_forward_stroke_path(dev, &new_is, ppath, params, pdcolor, pcpath);
- new_is.trans_device = NULL;
- new_is.has_transparency = false;
+ update_lop_for_pdf14(&new_pgs, pdcolor);
+ new_pgs.trans_device = dev;
+ new_pgs.has_transparency = true;
+ code = gx_forward_stroke_path(dev, &new_pgs, ppath, params, pdcolor, pcpath);
+ new_pgs.trans_device = NULL;
+ new_pgs.has_transparency = false;
if (pinst != NULL){
pinst->saved->trans_device = NULL;
}
@@ -7470,7 +7462,7 @@ pdf14_clist_stroke_path(gx_device *dev, const gs_imager_state *pis,
* writing the clist.
*/
static int
-pdf14_clist_text_begin(gx_device * dev, gs_imager_state * pis,
+pdf14_clist_text_begin(gx_device * dev, gs_gstate * pgs,
const gs_text_params_t * text, gs_font * font,
gx_path * path, const gx_device_color * pdcolor,
const gx_clip_path * pcpath, gs_memory_t * memory,
@@ -7484,14 +7476,14 @@ pdf14_clist_text_begin(gx_device * dev, gs_imager_state * pis,
/*
* Ensure that that the PDF 1.4 reading compositor will have the current
* blending parameters. This is needed since the fill_rectangle routines
- * do not have access to the imager state. Thus we have to pass any
+ * do not have access to the gs_gstate. Thus we have to pass any
* changes explictly.
*/
- code = pdf14_clist_update_params(pdev, pis, false, NULL);
+ code = pdf14_clist_update_params(pdev, pgs, false, NULL);
if (code < 0)
return code;
/* Pass text_begin to the target */
- code = gx_forward_text_begin(dev, pis, text, font, path,
+ code = gx_forward_text_begin(dev, pgs, text, font, path,
pdcolor, pcpath, memory, &penum);
if (code < 0)
return code;
@@ -7501,7 +7493,7 @@ pdf14_clist_text_begin(gx_device * dev, gs_imager_state * pis,
static int
pdf14_clist_begin_image(gx_device * dev,
- const gs_imager_state * pis, const gs_image_t * pim,
+ const gs_gstate * pgs, const gs_image_t * pim,
gs_image_format_t format, const gs_int_rect * prect,
const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath,
@@ -7513,24 +7505,24 @@ pdf14_clist_begin_image(gx_device * dev,
/*
* Ensure that that the PDF 1.4 reading compositor will have the current
* blending parameters. This is needed since the fill_rectangle routines
- * do not have access to the imager state. Thus we have to pass any
+ * do not have access to the gs_gstate. Thus we have to pass any
* changes explictly.
*/
- code = pdf14_clist_update_params(pdev, pis, false, NULL);
+ code = pdf14_clist_update_params(pdev, pgs, false, NULL);
if (code < 0)
return code;
/* Pass image to the target */
- code = gx_forward_begin_image(dev, pis, pim, format, prect,
+ code = gx_forward_begin_image(dev, pgs, pim, format, prect,
pdcolor, pcpath, memory, pinfo);
if (code < 0)
- return gx_default_begin_image(dev, pis, pim, format, prect,
+ return gx_default_begin_image(dev, pgs, pim, format, prect,
pdcolor, pcpath, memory, pinfo);
else return code;
}
static int
-pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
+pdf14_clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
const gs_matrix *pmat, const gs_image_common_t *pic,
const gs_int_rect * prect,
const gx_drawing_color * pdcolor,
@@ -7539,7 +7531,7 @@ pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
{
pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
int code;
- gs_imager_state * pis_noconst = (gs_imager_state *)pis; /* Break 'const'. */
+ gs_gstate * pgs_noconst = (gs_gstate *)pgs; /* Break 'const'. */
const gs_image_t *pim = (const gs_image_t *)pic;
gx_image_enum *penum;
gx_color_tile *ptile;
@@ -7548,20 +7540,20 @@ pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
/*
* Ensure that that the PDF 1.4 reading compositor will have the current
* blending parameters. This is needed since the fill_rectangle routines
- * do not have access to the imager state. Thus we have to pass any
+ * do not have access to the gs_gstate. Thus we have to pass any
* changes explictly.
*/
- code = pdf14_clist_update_params(pdev, pis, false, NULL);
+ code = pdf14_clist_update_params(pdev, pgs, false, NULL);
if (code < 0)
return code;
/* Pass image to the target */
- /* Do a quick change to the imager state so that if we can return with -1 in
+ /* Do a quick change to the gs_gstate so that if we can return with -1 in
case the clist writer cannot handle this image itself. In such a case,
we want to make sure we dont use the target device. I don't necc. like
doing it this way. Probably need to go back and do something a bit
more elegant. */
- pis_noconst->has_transparency = true;
- pis_noconst->trans_device = dev;
+ pgs_noconst->has_transparency = true;
+ pgs_noconst->trans_device = dev;
/* If we are filling an image mask with a pattern that has a transparency
then we need to do some special handling */
@@ -7582,11 +7574,11 @@ pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
ptile->ttrans->is_additive = false;
}
/* Set the blending mode in the ptile based upon the current
- setting in the imager state */
- ptile->blending_mode = pis->blend_mode;
+ setting in the gs_gstate */
+ ptile->blending_mode = pgs->blend_mode;
/* Set the procs so that we use the proper filling method. */
/* Let the imaging stuff get set up */
- code = gx_default_begin_typed_image(dev, pis, pmat, pic,
+ code = gx_default_begin_typed_image(dev, pgs, pmat, pic,
prect, pdcolor,
pcpath, mem, pinfo);
if (code < 0)
@@ -7603,7 +7595,7 @@ pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
&bbox_out);
if (code < 0) return code;
/* Set up a compositor action for pushing the group */
- if_debug0m('v', pis->memory, "[v]Pushing special trans group for image\n");
+ if_debug0m('v', pgs->memory, "[v]Pushing special trans group for image\n");
tgp.Isolated = true;
tgp.Knockout = false;
tgp.mask_id = 0;
@@ -7614,13 +7606,13 @@ pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
tgp.group_color_numcomps = ptile->ttrans->n_chan-1;
tgp.ColorSpace = NULL;
/* This will handle the compositor command */
- gs_begin_transparency_group((gs_state *) pis_noconst, &tgp,
+ gs_begin_transparency_group((gs_gstate *) pgs_noconst, &tgp,
&bbox_out);
ptile->ttrans->image_render = penum->render;
penum->render = &pdf14_pattern_trans_render;
ptile->trans_group_popped = false;
- pis_noconst->has_transparency = false;
- pis_noconst->trans_device = NULL;
+ pgs_noconst->has_transparency = false;
+ pgs_noconst->trans_device = NULL;
return code;
}
}
@@ -7628,36 +7620,36 @@ pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
}
/* This basically tries high level images for clist. If that fails
then we do the default */
- code = gx_forward_begin_typed_image(dev, pis, pmat,
+ code = gx_forward_begin_typed_image(dev, pgs, pmat,
pic, prect, pdcolor, pcpath, mem, pinfo);
if (code < 0){
- code = gx_default_begin_typed_image(dev, pis, pmat, pic, prect,
+ code = gx_default_begin_typed_image(dev, pgs, pmat, pic, prect,
pdcolor, pcpath, mem, pinfo);
- pis_noconst->has_transparency = false;
- pis_noconst->trans_device = NULL;
+ pgs_noconst->has_transparency = false;
+ pgs_noconst->trans_device = NULL;
return code;
} else {
- pis_noconst->has_transparency = false;
- pis_noconst->trans_device = NULL;
+ pgs_noconst->has_transparency = false;
+ pgs_noconst->trans_device = NULL;
return code;
}
}
static int
-gs_pdf14_clist_device_push(gs_memory_t *mem, gs_imager_state *pis, gx_device **pcdev,
+gs_pdf14_clist_device_push(gs_memory_t *mem, gs_gstate *pgs, gx_device **pcdev,
gx_device *dev, const gs_pdf14trans_t *pdf14pct)
{
int code;
pdf14_clist_device *p14dev;
gx_device_clist_writer * const cdev = &((gx_device_clist *)dev)->writer;
- code = pdf14_create_clist_device(mem, pis, pcdev, dev, pdf14pct);
+ code = pdf14_create_clist_device(mem, pgs, pcdev, dev, pdf14pct);
/*
* Set the color_info of the clist device to match the compositing
* device. We will restore it when the compositor is popped.
* See pdf14_clist_create_compositor for the restore. Do the
- * same with the imager state's get_cmap_procs. We do not want
- * the imager state to use transfer functions on our color values.
+ * same with the gs_gstate's get_cmap_procs. We do not want
+ * the gs_gstate to use transfer functions on our color values.
* The transfer functions will be applied at the end after we
* have done our PDF 1.4 blend operations.
*/
@@ -7691,9 +7683,9 @@ gs_pdf14_clist_device_push(gs_memory_t *mem, gs_imager_state *pis, gx_device **p
dev->procs.get_color_comp_index =
p14dev->procs.get_color_comp_index =
p14dev->my_get_color_comp_index;
- p14dev->save_get_cmap_procs = pis->get_cmap_procs;
- pis->get_cmap_procs = pdf14_get_cmap_procs;
- gx_set_cmap_procs(pis, dev);
+ p14dev->save_get_cmap_procs = pgs->get_cmap_procs;
+ pgs->get_cmap_procs = pdf14_get_cmap_procs;
+ gx_set_cmap_procs(pgs, dev);
return code;
}
/*
@@ -7706,7 +7698,7 @@ gs_pdf14_clist_device_push(gs_memory_t *mem, gs_imager_state *pis, gx_device **p
*/
static int
c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
- gx_device ** pcdev, gs_imager_state * pis, gs_memory_t * mem)
+ gx_device ** pcdev, gs_gstate * pgs, gs_memory_t * mem)
{
gx_device_clist_writer * const cdev = &((gx_device_clist *)dev)->writer;
const gs_pdf14trans_t * pdf14pct = (const gs_pdf14trans_t *) pcte;
@@ -7715,7 +7707,7 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
/* We only handle the push/pop operations */
switch (pdf14pct->params.pdf14_op) {
case PDF14_PUSH_DEVICE:
- return gs_pdf14_clist_device_push(mem, pis, pcdev, dev, pdf14pct);
+ return gs_pdf14_clist_device_push(mem, pgs, pcdev, dev, pdf14pct);
case PDF14_POP_DEVICE:
# if 0 /* Disabled because pdf14_clist_create_compositor does so. */
@@ -7723,9 +7715,9 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
* Ensure that the tranfer functions, etc. are current before we
* dump our transparency image to the output device.
*/
- if (pis->dev_ht)
+ if (pgs->dev_ht)
code = cmd_put_halftone((gx_device_clist_writer *)
- (((pdf14_clist_device *)dev)->target), pis->dev_ht);
+ (((pdf14_clist_device *)dev)->target), pgs->dev_ht);
# else
code = 0;
# endif
@@ -7743,7 +7735,7 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
softmask group through which this transparency
group must be rendered. Store it now. */
pdf14pct_noconst->params.mask_id = cdev->mask_id;
- if_debug1m('v', pis->memory,
+ if_debug1m('v', pgs->memory,
"[v]c_pdf14trans_clist_write_update group mask_id=%d \n",
cdev->mask_id);
}
@@ -7763,7 +7755,7 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
pdf14pct_noconst = (gs_pdf14trans_t *) pcte;
pdf14pct_noconst->params.mask_id = cdev->mask_id;
- if_debug1m('v', pis->memory,
+ if_debug1m('v', pgs->memory,
"[v]c_pdf14trans_clist_write_update mask mask_id=%d \n",
cdev->mask_id);
}
@@ -7794,7 +7786,7 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
return code;
/* See c_pdf14trans_write, c_pdf14trans_adjust_ctm, and
apply_create_compositor. */
- code = gs_imager_setmatrix(&cdev->imager_state, &pdf14pct->params.ctm);
+ code = gs_gstate_setmatrix(&cdev->gs_gstate, &pdf14pct->params.ctm);
/* Wrote an extra ctm. */
cmd_clear_known(cdev, ctm_known);
@@ -7811,7 +7803,7 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
*/
static int
c_pdf14trans_clist_read_update(gs_composite_t * pcte, gx_device * cdev,
- gx_device * tdev, gs_imager_state * pis, gs_memory_t * mem)
+ gx_device * tdev, gs_gstate * pgs, gs_memory_t * mem)
{
pdf14_device * p14dev = (pdf14_device *)tdev;
gs_pdf14trans_t * pdf14pct = (gs_pdf14trans_t *) pcte;
@@ -8088,11 +8080,11 @@ pdf14_cmykspot_get_color_comp_index(gx_device * dev, const char * pname,
In such a case, we set the default color profiles to ones that ensure
proper soft mask rendering. */
static int
-pdf14_increment_smask_color(gs_imager_state * pis, gx_device * dev)
+pdf14_increment_smask_color(gs_gstate * pgs, gx_device * dev)
{
pdf14_device * pdev = (pdf14_device *) dev;
pdf14_smaskcolor_t *result;
- gsicc_smask_t *smask_profiles = pis->icc_manager->smask_profiles;
+ gsicc_smask_t *smask_profiles = pgs->icc_manager->smask_profiles;
int k;
/* See if we have profiles already in place. Note we also have to
@@ -8103,8 +8095,8 @@ pdf14_increment_smask_color(gs_imager_state * pis, gx_device * dev)
which also has a transparency mask. The state of the icc_manager
is that it already has done the swap and there is no need to fool
with any of this while dealing with the soft mask within the pattern */
- if (pdev->smaskcolor == NULL && pis->icc_manager->smask_profiles != NULL &&
- pis->icc_manager->smask_profiles->swapped) {
+ if (pdev->smaskcolor == NULL && pgs->icc_manager->smask_profiles != NULL &&
+ pgs->icc_manager->smask_profiles->swapped) {
return 0;
}
if (pdev->smaskcolor != NULL) {
@@ -8126,52 +8118,49 @@ pdf14_increment_smask_color(gs_imager_state * pis, gx_device * dev)
on the profiles for a well-formed PDF with clean soft mask groups.
The only issue could be if the graphic state is popped while we
are still within a softmask group. */
- result->profiles->smask_gray = pis->icc_manager->default_gray;
- result->profiles->smask_rgb = pis->icc_manager->default_rgb;
- result->profiles->smask_cmyk = pis->icc_manager->default_cmyk;
- pis->icc_manager->default_gray = smask_profiles->smask_gray;
- pis->icc_manager->default_rgb = smask_profiles->smask_rgb;
- pis->icc_manager->default_cmyk = smask_profiles->smask_cmyk;
- pis->icc_manager->smask_profiles->swapped = true;
- if_debug0m(gs_debug_flag_icc, pis->memory,
+ result->profiles->smask_gray = pgs->icc_manager->default_gray;
+ result->profiles->smask_rgb = pgs->icc_manager->default_rgb;
+ result->profiles->smask_cmyk = pgs->icc_manager->default_cmyk;
+ pgs->icc_manager->default_gray = smask_profiles->smask_gray;
+ pgs->icc_manager->default_rgb = smask_profiles->smask_rgb;
+ pgs->icc_manager->default_cmyk = smask_profiles->smask_cmyk;
+ pgs->icc_manager->smask_profiles->swapped = true;
+ if_debug0m(gs_debug_flag_icc, pgs->memory,
"[icc] Initial creation of smask color. Ref count 1\n");
pdev->smaskcolor->ref_count = 1;
/* We also need to update the profile that is currently in the
color spaces of the graphic state. Otherwise this can be
referenced, which will result in a mismatch. What we want to do
is see if it was the original default and only swap in that case. */
- if (pis->is_gstate) {
- gs_state *pgs = (gs_state*) pis;
- for (k = 0; k < 2; k++) {
- gs_color_space *pcs = pgs->color[k].color_space;
- cmm_profile_t *profile = pcs->cmm_icc_profile_data;
- if (profile != NULL) {
- switch(profile->data_cs) {
- case gsGRAY:
- if (profile->hashcode ==
- result->profiles->smask_gray->hashcode) {
- profile = pis->icc_manager->default_gray;
- }
- break;
- case gsRGB:
- if (profile->hashcode ==
- result->profiles->smask_rgb->hashcode) {
- profile = pis->icc_manager->default_rgb;
- }
- break;
- case gsCMYK:
- if (profile->hashcode ==
- result->profiles->smask_cmyk->hashcode) {
- profile = pis->icc_manager->default_cmyk;
- }
- break;
- default:
+ for (k = 0; k < 2; k++) {
+ gs_color_space *pcs = pgs->color[k].color_space;
+ cmm_profile_t *profile = pcs->cmm_icc_profile_data;
+ if (profile != NULL) {
+ switch(profile->data_cs) {
+ case gsGRAY:
+ if (profile->hashcode ==
+ result->profiles->smask_gray->hashcode) {
+ profile = pgs->icc_manager->default_gray;
+ }
+ break;
+ case gsRGB:
+ if (profile->hashcode ==
+ result->profiles->smask_rgb->hashcode) {
+ profile = pgs->icc_manager->default_rgb;
+ }
+ break;
+ case gsCMYK:
+ if (profile->hashcode ==
+ result->profiles->smask_cmyk->hashcode) {
+ profile = pgs->icc_manager->default_cmyk;
+ }
+ break;
+ default:
- break;
- }
- rc_assign(pcs->cmm_icc_profile_data, profile,
- "pdf14_increment_smask_color");
+ break;
}
+ rc_assign(pcs->cmm_icc_profile_data, profile,
+ "pdf14_increment_smask_color");
}
}
}
@@ -8179,64 +8168,61 @@ pdf14_increment_smask_color(gs_imager_state * pis, gx_device * dev)
}
static int
-pdf14_decrement_smask_color(gs_imager_state * pis, gx_device * dev)
+pdf14_decrement_smask_color(gs_gstate * pgs, gx_device * dev)
{
pdf14_device * pdev = (pdf14_device *) dev;
pdf14_smaskcolor_t *smaskcolor = pdev->smaskcolor;
- gsicc_manager_t *icc_manager = pis->icc_manager;
+ gsicc_manager_t *icc_manager = pgs->icc_manager;
int k;
/* See comment in pdf14_increment_smask_color to understand this one */
- if (pdev->smaskcolor == NULL && pis->icc_manager->smask_profiles != NULL &&
- pis->icc_manager->smask_profiles->swapped) {
+ if (pdev->smaskcolor == NULL && pgs->icc_manager->smask_profiles != NULL &&
+ pgs->icc_manager->smask_profiles->swapped) {
return 0;
}
if (smaskcolor != NULL) {
smaskcolor->ref_count--;
- if_debug1m(gs_debug_flag_icc, pis->memory,
+ if_debug1m(gs_debug_flag_icc, pgs->memory,
"[icc] Decrement smask color. Now %d\n",
smaskcolor->ref_count);
if (smaskcolor->ref_count == 0) {
- if_debug0m(gs_debug_flag_icc, pis->memory, "[icc] Reset smask color.\n");
+ if_debug0m(gs_debug_flag_icc, pgs->memory, "[icc] Reset smask color.\n");
/* Lets return the profiles and clean up */
/* First see if we need to "reset" the profiles that are in
the graphic state */
- if (pis->is_gstate) {
- gs_state *pgs = (gs_state*) pis;
- if_debug0m(gs_debug_flag_icc, pis->memory, "[icc] Reseting graphic state color spaces\n");
- for (k = 0; k < 2; k++) {
- gs_color_space *pcs = pgs->color[k].color_space;
- cmm_profile_t *profile = pcs->cmm_icc_profile_data;
- if (profile != NULL) {
- switch(profile->data_cs) {
- case gsGRAY:
- if (profile->hashcode ==
- pis->icc_manager->default_gray->hashcode) {
- profile =
- smaskcolor->profiles->smask_gray;
- }
- break;
- case gsRGB:
- if (profile->hashcode ==
- pis->icc_manager->default_rgb->hashcode) {
- profile =
- smaskcolor->profiles->smask_rgb;
- }
- break;
- case gsCMYK:
- if (profile->hashcode ==
- pis->icc_manager->default_cmyk->hashcode) {
- profile =
- smaskcolor->profiles->smask_cmyk;
- }
- break;
- default:
-
- break;
- }
- rc_assign(pcs->cmm_icc_profile_data, profile,
- "pdf14_decrement_smask_color");
+ if_debug0m(gs_debug_flag_icc, pgs->memory, "[icc] Reseting graphic state color spaces\n");
+ for (k = 0; k < 2; k++) {
+ gs_color_space *pcs = pgs->color[k].color_space;
+ cmm_profile_t *profile = pcs->cmm_icc_profile_data;
+ if (profile != NULL) {
+ switch(profile->data_cs) {
+ case gsGRAY:
+ if (profile->hashcode ==
+ pgs->icc_manager->default_gray->hashcode) {
+ profile =
+ smaskcolor->profiles->smask_gray;
+ }
+ break;
+ case gsRGB:
+ if (profile->hashcode ==
+ pgs->icc_manager->default_rgb->hashcode) {
+ profile =
+ smaskcolor->profiles->smask_rgb;
+ }
+ break;
+ case gsCMYK:
+ if (profile->hashcode ==
+ pgs->icc_manager->default_cmyk->hashcode) {
+ profile =
+ smaskcolor->profiles->smask_cmyk;
+ }
+ break;
+ default:
+
+ break;
}
+ rc_assign(pcs->cmm_icc_profile_data, profile,
+ "pdf14_decrement_smask_color");
}
}
diff --git a/base/gdevp14.h b/base/gdevp14.h
index ac461a61e..65247a63c 100644
--- a/base/gdevp14.h
+++ b/base/gdevp14.h
@@ -58,7 +58,7 @@ typedef struct {
* output device as an image.
*/
int (* put_image)(gx_device * dev,
- gs_imager_state * pis, gx_device * target);
+ gs_gstate * pgs, gx_device * target);
} pdf14_procs_s;
typedef pdf14_procs_s pdf14_procs_t;
@@ -111,7 +111,7 @@ struct pdf14_parent_color_s {
byte depth; /* used in clist writer cmd_put_color */
uint max_gray; /* Used to determine if device halftones */
uint max_color; /* Causes issues if these are not maintained */
- const gx_color_map_procs *(*get_cmap_procs)(const gs_imager_state *,
+ const gx_color_map_procs *(*get_cmap_procs)(const gs_gstate *,
const gx_device *);
const gx_cm_color_map_procs *(*parent_color_mapping_procs)(const gx_device *);
gx_color_index (*encode)(gx_device *, const gx_color_value value[]);
@@ -183,9 +183,9 @@ struct pdf14_ctx_s {
typedef struct gs_devn_params_s gs_devn_params;
#endif
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gx_device_DEFINED
@@ -228,7 +228,7 @@ typedef struct pdf14_device_s {
gx_color_index drawn_comps; /* Used for overprinting. Passed from overprint compositor */
gx_device * pclist_device;
bool free_devicen; /* Used to avoid freeing a deviceN parameter from target clist device */
- const gx_color_map_procs *(*save_get_cmap_procs)(const gs_imager_state *,
+ const gx_color_map_procs *(*save_get_cmap_procs)(const gs_gstate *,
const gx_device *);
gx_device_color_info saved_target_color_info;
dev_proc_encode_color(*saved_target_encode_color);
@@ -255,7 +255,7 @@ typedef struct pdf14_device_s pdf14_clist_device;
/*
* Send a PDF 1.4 transparency compositor action to the specified device.
*/
-int send_pdf14trans(gs_imager_state * pis, gx_device * dev,
+int send_pdf14trans(gs_gstate * pgs, gx_device * dev,
gx_device * * pcdev, gs_pdf14trans_params_t * pparams, gs_memory_t * mem);
/*
diff --git a/base/gdevplnx.c b/base/gdevplnx.c
index fc81fadcc..ff8d787d6 100644
--- a/base/gdevplnx.c
+++ b/base/gdevplnx.c
@@ -28,7 +28,7 @@
#include "gxdither.h"
#include "gxgetbit.h"
#include "gxiparam.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gdevplnx.h"
/* Define the size of the locally allocated bitmap buffers. */
@@ -560,14 +560,14 @@ plane_copy_alpha(gx_device *dev, const byte *data, int data_x,
static int
plane_fill_path(gx_device *dev,
- const gs_imager_state *pis, gx_path *ppath,
+ const gs_gstate *pgs, gx_path *ppath,
const gx_fill_params *params,
const gx_drawing_color *pdevc, const gx_clip_path *pcpath)
{
gx_device_plane_extract * const edev = (gx_device_plane_extract *)dev;
gx_device * const plane_dev = edev->plane_dev;
gs_logical_operation_t lop_orig =
- gs_current_logical_op((const gs_state *)pis);
+ gs_current_logical_op((const gs_gstate *)pgs);
gs_logical_operation_t lop = lop_orig;
gx_device_color dcolor;
@@ -575,32 +575,32 @@ plane_fill_path(gx_device *dev,
case REDUCE_SKIP:
return 0;
case REDUCE_DRAW: {
- gs_imager_state lopis;
- const gs_imager_state *pis_draw = pis;
+ gs_gstate lopgs;
+ const gs_gstate *pgs_draw = pgs;
if (lop != lop_orig) {
- lopis = *pis;
- gs_set_logical_op((gs_state *)&lopis, lop);
- pis_draw = &lopis;
+ lopgs = *pgs;
+ gs_set_logical_op((gs_gstate *)&lopgs, lop);
+ pgs_draw = &lopgs;
}
return dev_proc(plane_dev, fill_path)
- (plane_dev, pis_draw, ppath, params, &dcolor, pcpath);
+ (plane_dev, pgs_draw, ppath, params, &dcolor, pcpath);
}
default /*REDUCE_FAILED*/:
- return gx_default_fill_path(dev, pis, ppath, params, pdevc, pcpath);
+ return gx_default_fill_path(dev, pgs, ppath, params, pdevc, pcpath);
}
}
static int
plane_stroke_path(gx_device *dev,
- const gs_imager_state *pis, gx_path *ppath,
+ const gs_gstate *pgs, gx_path *ppath,
const gx_stroke_params *params,
const gx_drawing_color *pdevc, const gx_clip_path *pcpath)
{
gx_device_plane_extract * const edev = (gx_device_plane_extract *)dev;
gx_device * const plane_dev = edev->plane_dev;
gs_logical_operation_t lop_orig =
- gs_current_logical_op((const gs_state *)pis);
+ gs_current_logical_op((const gs_gstate *)pgs);
gs_logical_operation_t lop = lop_orig;
gx_device_color dcolor;
@@ -608,19 +608,19 @@ plane_stroke_path(gx_device *dev,
case REDUCE_SKIP:
return 0;
case REDUCE_DRAW: {
- gs_imager_state lopis;
- const gs_imager_state *pis_draw = pis;
+ gs_gstate lopgs;
+ const gs_gstate *pgs_draw = pgs;
if (lop != lop_orig) {
- lopis = *pis;
- gs_set_logical_op((gs_state *)&lopis, lop);
- pis_draw = &lopis;
+ lopgs = *pgs;
+ gs_set_logical_op((gs_gstate *)&lopgs, lop);
+ pgs_draw = &lopgs;
}
return dev_proc(plane_dev, stroke_path)
- (plane_dev, pis_draw, ppath, params, &dcolor, pcpath);
+ (plane_dev, pgs_draw, ppath, params, &dcolor, pcpath);
}
default /*REDUCE_FAILED*/:
- return gx_default_stroke_path(dev, pis, ppath, params, pdevc, pcpath);
+ return gx_default_stroke_path(dev, pgs, ppath, params, pdevc, pcpath);
}
}
@@ -843,85 +843,85 @@ plane_strip_copy_rop(gx_device *dev,
typedef struct plane_image_enum_s {
gx_image_enum_common;
gx_image_enum_common_t *info; /* plane device enumerator */
- const gs_imager_state *pis; /* original imager state */
- gs_imager_state *pis_image; /* modified imager state */
+ const gs_gstate *pgs; /* original gs_gstate */
+ gs_gstate *pgs_image; /* modified gs_gstate state */
} plane_image_enum_t;
gs_private_st_suffix_add3(st_plane_image_enum, plane_image_enum_t,
"plane_image_enum_t", plane_image_enum_enum_ptrs,
- plane_image_enum_reloc_ptrs, st_gx_image_enum_common, info, pis, pis_image);
+ plane_image_enum_reloc_ptrs, st_gx_image_enum_common, info, pgs, pgs_image);
/*
* Reduce drawing colors returned by color mapping. Note that these
* assume that the call of reduce_drawing_color will not fail:
* plane_begin_typed_image must ensure this.
*
- * In the imager state passed to these procedures, the client data is
+ * In the gs_gstate passed to these procedures, the client data is
* the plane_image_enum_t.
*/
static void
plane_cmap_gray(frac gray, gx_device_color * pdc,
- const gs_imager_state *pis_image, gx_device *dev, gs_color_select_t select)
+ const gs_gstate *pgs_image, gx_device *dev, gs_color_select_t select)
{
const plane_image_enum_t *ppie =
- (const plane_image_enum_t *)pis_image->client_data;
+ (const plane_image_enum_t *)pgs_image->client_data;
gx_device_plane_extract * const edev =
(gx_device_plane_extract *)ppie->dev;
- gs_logical_operation_t lop = gs_current_logical_op_inline(pis_image);
+ gs_logical_operation_t lop = gs_current_logical_op_inline(pgs_image);
gx_device_color dcolor;
- gx_remap_concrete_gray(gray, &dcolor, ppie->pis,
+ gx_remap_concrete_gray(gray, &dcolor, ppie->pgs,
(gx_device *)edev, select);
reduce_drawing_color(pdc, edev, &dcolor, &lop);
}
static void
plane_cmap_rgb(frac r, frac g, frac b, gx_device_color * pdc,
- const gs_imager_state *pis_image, gx_device *dev, gs_color_select_t select)
+ const gs_gstate *pgs_image, gx_device *dev, gs_color_select_t select)
{
const plane_image_enum_t *ppie =
- (const plane_image_enum_t *)pis_image->client_data;
+ (const plane_image_enum_t *)pgs_image->client_data;
gx_device_plane_extract * const edev =
(gx_device_plane_extract *)ppie->dev;
- gs_logical_operation_t lop = gs_current_logical_op_inline(pis_image);
+ gs_logical_operation_t lop = gs_current_logical_op_inline(pgs_image);
gx_device_color dcolor;
- gx_remap_concrete_rgb(r, g, b, &dcolor, ppie->pis,
+ gx_remap_concrete_rgb(r, g, b, &dcolor, ppie->pgs,
(gx_device *)edev, select);
reduce_drawing_color(pdc, edev, &dcolor, &lop);
}
static void
plane_cmap_cmyk(frac c, frac m, frac y, frac k, gx_device_color * pdc,
- const gs_imager_state *pis_image, gx_device *dev, gs_color_select_t select,
+ const gs_gstate *pgs_image, gx_device *dev, gs_color_select_t select,
const gs_color_space *source_pcs)
{
const plane_image_enum_t *ppie =
- (const plane_image_enum_t *)pis_image->client_data;
+ (const plane_image_enum_t *)pgs_image->client_data;
gx_device_plane_extract * const edev =
(gx_device_plane_extract *)ppie->dev;
- gs_logical_operation_t lop = gs_current_logical_op_inline(pis_image);
+ gs_logical_operation_t lop = gs_current_logical_op_inline(pgs_image);
gx_device_color dcolor;
- gx_remap_concrete_cmyk(c, m, y, k, &dcolor, ppie->pis,
+ gx_remap_concrete_cmyk(c, m, y, k, &dcolor, ppie->pgs,
(gx_device *)edev, select, NULL);
reduce_drawing_color(pdc, edev, &dcolor, &lop);
}
static void
plane_cmap_rgb_alpha(frac r, frac g, frac b, frac alpha, gx_device_color * pdc,
- const gs_imager_state *pis_image, gx_device *dev, gs_color_select_t select)
+ const gs_gstate *pgs_image, gx_device *dev, gs_color_select_t select)
{
const plane_image_enum_t *ppie =
- (const plane_image_enum_t *)pis_image->client_data;
+ (const plane_image_enum_t *)pgs_image->client_data;
gx_device_plane_extract * const edev =
(gx_device_plane_extract *)ppie->dev;
- gs_logical_operation_t lop = gs_current_logical_op_inline(pis_image);
+ gs_logical_operation_t lop = gs_current_logical_op_inline(pgs_image);
gx_device_color dcolor;
- gx_remap_concrete_rgb_alpha(r, g, b, alpha, &dcolor, ppie->pis,
+ gx_remap_concrete_rgb_alpha(r, g, b, alpha, &dcolor, ppie->pgs,
(gx_device *)edev, select);
reduce_drawing_color(pdc, edev, &dcolor, &lop);
}
static bool
-plane_cmap_is_halftoned(const gs_imager_state *pis_image, gx_device *dev)
+plane_cmap_is_halftoned(const gs_gstate *pgs_image, gx_device *dev)
{
return false;
}
@@ -931,7 +931,7 @@ static const gx_color_map_procs plane_color_map_procs = {
NULL, NULL, plane_cmap_is_halftoned
};
static const gx_color_map_procs *
-plane_get_cmap_procs(const gs_imager_state *pis, const gx_device *dev)
+plane_get_cmap_procs(const gs_gstate *pgs, const gx_device *dev)
{
return &plane_color_map_procs;
}
@@ -945,22 +945,22 @@ static const gx_image_enum_procs_t plane_image_enum_procs = {
static int
plane_begin_typed_image(gx_device * dev,
- const gs_imager_state * pis, const gs_matrix * pmat,
+ const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * memory, gx_image_enum_common_t ** pinfo)
{
/*
- * For images, we intercept the imager state's cmap_procs and apply
+ * For images, we intercept the gs_gstate's cmap_procs and apply
* reduce_drawing_color to the colors as they are returned to the image
* processing code. For reasons explained above, we can't do this in
* some cases of RasterOp that include transparency.
*/
gx_device_plane_extract * const edev = (gx_device_plane_extract *)dev;
- gs_logical_operation_t lop = gs_current_logical_op((const gs_state *)pis);
+ gs_logical_operation_t lop = gs_current_logical_op((const gs_gstate *)pgs);
const gs_pixel_image_t *pim;
plane_image_enum_t *info = 0;
- gs_imager_state *pis_image = 0;
+ gs_gstate *pgs_image = 0;
gx_device_color dcolor;
bool uses_color = false;
int code;
@@ -999,14 +999,14 @@ plane_begin_typed_image(gx_device * dev,
}
info = gs_alloc_struct(memory, plane_image_enum_t, &st_plane_image_enum,
"plane_image_begin_typed(info)");
- pis_image = gs_imager_state_copy(pis, memory);
- if (pis_image == 0 || info == 0)
+ pgs_image = gs_gstate_copy_temp(pgs, memory);
+ if (pgs_image == 0 || info == 0)
goto fail;
- *pis_image = *pis;
- pis_image->client_data = info;
- pis_image->get_cmap_procs = plane_get_cmap_procs;
+ *pgs_image = *pgs;
+ pgs_image->client_data = info;
+ pgs_image->get_cmap_procs = plane_get_cmap_procs;
code = dev_proc(edev->plane_dev, begin_typed_image)
- (edev->plane_dev, pis_image, pmat, pic, prect,
+ (edev->plane_dev, pgs_image, pmat, pic, prect,
&dcolor, pcpath, memory, &info->info);
if (code < 0)
goto fail;
@@ -1015,14 +1015,14 @@ plane_begin_typed_image(gx_device * dev,
info->dev = (gx_device *)edev;
info->id = gs_next_ids(memory, 1);
info->memory = memory;
- info->pis = pis;
- info->pis_image = pis_image;
+ info->pgs = pgs;
+ info->pgs_image = pgs_image;
*pinfo = (gx_image_enum_common_t *)info;
return code;
fail:
- gs_free_object(memory, pis_image, "plane_image_begin_typed(pis_image)");
+ gs_free_object(memory, pgs_image, "plane_image_begin_typed(pgs_image)");
gs_free_object(memory, info, "plane_image_begin_typed(info)");
- return gx_default_begin_typed_image(dev, pis, pmat, pic, prect,
+ return gx_default_begin_typed_image(dev, pgs, pmat, pic, prect,
pdcolor, pcpath, memory, pinfo);
}
@@ -1042,8 +1042,8 @@ plane_image_end_image(gx_image_enum_common_t * info, bool draw_last)
plane_image_enum_t * const ppie = (plane_image_enum_t *)info;
int code = gx_image_end(ppie->info, draw_last);
- gs_free_object(ppie->memory, ppie->pis_image,
- "plane_image_end_image(pis_image)");
+ gs_free_object(ppie->memory, ppie->pgs_image,
+ "plane_image_end_image(pgs_image)");
gx_image_free_enum(&info);
return code;
}
diff --git a/base/gdevsclass.c b/base/gdevsclass.c
index 6f5fa2e2f..2b51281f5 100644
--- a/base/gdevsclass.c
+++ b/base/gdevsclass.c
@@ -23,7 +23,7 @@
#include "gsdevice.h" /* requires gsmatrix.h */
#include "gxdcolor.h" /* for gx_device_black/white */
#include "gxiparam.h" /* for image source size */
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpaint.h"
#include "gxpath.h"
#include "gxcpath.h"
@@ -331,32 +331,32 @@ int default_subclass_copy_rop(gx_device *dev, const byte *sdata, int sourcex, ui
return 0;
}
-int default_subclass_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath,
+int default_subclass_fill_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
const gx_fill_params *params,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
if (dev->child) {
if (dev->child->procs.fill_path)
- return dev->child->procs.fill_path(dev->child, pis, ppath, params, pdcolor, pcpath);
+ return dev->child->procs.fill_path(dev->child, pgs, ppath, params, pdcolor, pcpath);
else
- return gx_default_fill_path(dev->child, pis, ppath, params, pdcolor, pcpath);
+ return gx_default_fill_path(dev->child, pgs, ppath, params, pdcolor, pcpath);
} else
- return gx_default_fill_path(dev, pis, ppath, params, pdcolor, pcpath);
+ return gx_default_fill_path(dev, pgs, ppath, params, pdcolor, pcpath);
return 0;
}
-int default_subclass_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath,
+int default_subclass_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
const gx_stroke_params *params,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
if (dev->child) {
if (dev->child->procs.stroke_path)
- return dev->child->procs.stroke_path(dev->child, pis, ppath, params, pdcolor, pcpath);
+ return dev->child->procs.stroke_path(dev->child, pgs, ppath, params, pdcolor, pcpath);
else
- return gx_default_stroke_path(dev->child, pis, ppath, params, pdcolor, pcpath);
+ return gx_default_stroke_path(dev->child, pgs, ppath, params, pdcolor, pcpath);
} else
- return gx_default_stroke_path(dev, pis, ppath, params, pdcolor, pcpath);
+ return gx_default_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath);
return 0;
}
@@ -429,18 +429,18 @@ int default_subclass_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed
return 0;
}
-int default_subclass_begin_image(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim,
+int default_subclass_begin_image(gx_device *dev, const gs_gstate *pgs, const gs_image_t *pim,
gs_image_format_t format, const gs_int_rect *prect,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
{
if (dev->child) {
if (dev->child->procs.begin_image)
- return dev->child->procs.begin_image(dev->child, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo);
+ return dev->child->procs.begin_image(dev->child, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo);
else
- return gx_default_begin_image(dev->child, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo);
+ return gx_default_begin_image(dev->child, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo);
} else
- return gx_default_begin_image(dev, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo);
+ return gx_default_begin_image(dev, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo);
return 0;
}
@@ -503,18 +503,18 @@ void default_subclass_get_clipping_box(gx_device *dev, gs_fixed_rect *pbox)
return;
}
-int default_subclass_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat,
+int default_subclass_begin_typed_image(gx_device *dev, const gs_gstate *pgs, const gs_matrix *pmat,
const gs_image_common_t *pic, const gs_int_rect *prect,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
{
if (dev->child) {
if (dev->child->procs.begin_typed_image)
- return dev->child->procs.begin_typed_image(dev->child, pis, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
+ return dev->child->procs.begin_typed_image(dev->child, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
else
- return gx_default_begin_typed_image(dev->child, pis, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
+ return gx_default_begin_typed_image(dev->child, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
} else
- return gx_default_begin_typed_image(dev, pis, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
+ return gx_default_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo);
return 0;
}
@@ -546,7 +546,7 @@ int default_subclass_map_color_rgb_alpha(gx_device *dev, gx_color_index color, g
}
int default_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte,
- gs_imager_state *pis, gs_memory_t *memory, gx_device *cdev)
+ gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev)
{
default_subclass_subclass_data *psubclass_data = dev->subclass_data;
int code;
@@ -556,7 +556,7 @@ int default_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const
* that we pass to access its own data (not unreasonably), so we need to make sure we pass in the
* child device. This has some follow on implications detailed below.
*/
- code = dev->child->procs.create_compositor(dev->child, pcdev, pcte, pis, memory, cdev);
+ code = dev->child->procs.create_compositor(dev->child, pcdev, pcte, pgs, memory, cdev);
if (code < 0)
return code;
@@ -617,17 +617,17 @@ int default_subclass_get_hardware_params(gx_device *dev, gs_param_list *plist)
return 0;
}
-int default_subclass_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text,
+int default_subclass_text_begin(gx_device *dev, gs_gstate *pgs, const gs_text_params_t *text,
gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *memory, gs_text_enum_t **ppte)
{
if (dev->child) {
if (dev->child->procs.text_begin)
- return dev->child->procs.text_begin(dev->child, pis, text, font, path, pdcolor, pcpath, memory, ppte);
+ return dev->child->procs.text_begin(dev->child, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
else
- return gx_default_text_begin(dev->child, pis, text, font, path, pdcolor, pcpath, memory, ppte);
+ return gx_default_text_begin(dev->child, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
} else
- return gx_default_text_begin(dev, pis, text, font, path, pdcolor, pcpath, memory, ppte);
+ return gx_default_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte);
return 0;
}
@@ -642,42 +642,42 @@ int default_subclass_finish_copydevice(gx_device *dev, const gx_device *from_dev
}
int default_subclass_begin_transparency_group(gx_device *dev, const gs_transparency_group_params_t *ptgp,
- const gs_rect *pbbox, gs_imager_state *pis, gs_memory_t *mem)
+ const gs_rect *pbbox, gs_gstate *pgs, gs_memory_t *mem)
{
if (dev->child && dev->child->procs.begin_transparency_group)
- return dev->child->procs.begin_transparency_group(dev->child, ptgp, pbbox, pis, mem);
+ return dev->child->procs.begin_transparency_group(dev->child, ptgp, pbbox, pgs, mem);
return 0;
}
-int default_subclass_end_transparency_group(gx_device *dev, gs_imager_state *pis)
+int default_subclass_end_transparency_group(gx_device *dev, gs_gstate *pgs)
{
if (dev->child && dev->child->procs.end_transparency_group)
- return dev->child->procs.end_transparency_group(dev->child, pis);
+ return dev->child->procs.end_transparency_group(dev->child, pgs);
return 0;
}
int default_subclass_begin_transparency_mask(gx_device *dev, const gx_transparency_mask_params_t *ptmp,
- const gs_rect *pbbox, gs_imager_state *pis, gs_memory_t *mem)
+ const gs_rect *pbbox, gs_gstate *pgs, gs_memory_t *mem)
{
if (dev->child && dev->child->procs.begin_transparency_mask)
- return dev->child->procs.begin_transparency_mask(dev->child, ptmp, pbbox, pis, mem);
+ return dev->child->procs.begin_transparency_mask(dev->child, ptmp, pbbox, pgs, mem);
return 0;
}
-int default_subclass_end_transparency_mask(gx_device *dev, gs_imager_state *pis)
+int default_subclass_end_transparency_mask(gx_device *dev, gs_gstate *pgs)
{
if (dev->child && dev->child->procs.end_transparency_mask)
- return dev->child->procs.end_transparency_mask(dev->child, pis);
+ return dev->child->procs.end_transparency_mask(dev->child, pgs);
return 0;
}
-int default_subclass_discard_transparency_layer(gx_device *dev, gs_imager_state *pis)
+int default_subclass_discard_transparency_layer(gx_device *dev, gs_gstate *pgs)
{
if (dev->child && dev->child->procs.discard_transparency_layer)
- return dev->child->procs.discard_transparency_layer(dev->child, pis);
+ return dev->child->procs.discard_transparency_layer(dev->child, pgs);
return 0;
}
@@ -742,10 +742,10 @@ int default_subclass_pattern_manage(gx_device *dev, gx_bitmap_id id,
}
int default_subclass_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
if (dev->child && dev->child->procs.fill_rectangle_hl_color)
- return dev->child->procs.fill_rectangle_hl_color(dev->child, rect, pis, pdcolor, pcpath);
+ return dev->child->procs.fill_rectangle_hl_color(dev->child, rect, pgs, pdcolor, pcpath);
else
return_error(gs_error_rangecheck);
@@ -807,7 +807,7 @@ int default_subclass_fill_linear_color_triangle(gx_device *dev, const gs_fill_at
return 0;
}
-int default_subclass_update_spot_equivalent_colors(gx_device *dev, const gs_state * pgs)
+int default_subclass_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs)
{
if (dev->child && dev->child->procs.update_spot_equivalent_colors)
return dev->child->procs.update_spot_equivalent_colors(dev->child, pgs);
@@ -823,31 +823,31 @@ gs_devn_params *default_subclass_ret_devn_params(gx_device *dev)
return 0;
}
-int default_subclass_fillpage(gx_device *dev, gs_imager_state * pis, gx_device_color *pdevc)
+int default_subclass_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
{
if (dev->child) {
if (dev->child->procs.fillpage)
- return dev->child->procs.fillpage(dev->child, pis, pdevc);
+ return dev->child->procs.fillpage(dev->child, pgs, pdevc);
else
- return gx_default_fillpage(dev->child, pis, pdevc);
+ return gx_default_fillpage(dev->child, pgs, pdevc);
} else
- return gx_default_fillpage(dev, pis, pdevc);
+ return gx_default_fillpage(dev, pgs, pdevc);
return 0;
}
-int default_subclass_push_transparency_state(gx_device *dev, gs_imager_state *pis)
+int default_subclass_push_transparency_state(gx_device *dev, gs_gstate *pgs)
{
if (dev->child && dev->child->procs.push_transparency_state)
- return dev->child->procs.push_transparency_state(dev->child, pis);
+ return dev->child->procs.push_transparency_state(dev->child, pgs);
return 0;
}
-int default_subclass_pop_transparency_state(gx_device *dev, gs_imager_state *pis)
+int default_subclass_pop_transparency_state(gx_device *dev, gs_gstate *pgs)
{
if (dev->child && dev->child->procs.push_transparency_state)
- return dev->child->procs.pop_transparency_state(dev->child, pis);
+ return dev->child->procs.pop_transparency_state(dev->child, pgs);
return 0;
}
diff --git a/base/gdevvec.c b/base/gdevvec.c
index 57fb421f5..2a4af84c6 100644
--- a/base/gdevvec.c
+++ b/base/gdevvec.c
@@ -256,8 +256,8 @@ gdev_vector_init(gx_device_vector * vdev)
void
gdev_vector_reset(gx_device_vector * vdev)
{
- static const gs_imager_state state_initial =
- {gs_imager_state_initial(1, false)};
+ static const gs_gstate state_initial =
+ {gs_gstate_initial(1.0)};
vdev->state = state_initial;
gx_hld_saved_color_init(&vdev->saved_fill_color);
@@ -384,22 +384,22 @@ gdev_vector_update_log_op(gx_device_vector * vdev, gs_logical_operation_t lop)
/* Update color (fill or stroke). */
static int
gdev_vector_update_color(gx_device_vector * vdev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_drawing_color * pdcolor,
gx_hl_saved_color *sc,
int (*setcolor) (gx_device_vector * vdev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_drawing_color * pdc))
{
gx_hl_saved_color temp;
int code;
- bool hl_color = (*vdev_proc(vdev, can_handle_hl_color)) (vdev, pis, pdcolor);
- const gs_imager_state *pis_for_hl_color = (hl_color ? pis : NULL);
+ bool hl_color = (*vdev_proc(vdev, can_handle_hl_color)) (vdev, pgs, pdcolor);
+ const gs_gstate *pgs_for_hl_color = (hl_color ? pgs : NULL);
- gx_hld_save_color(pis_for_hl_color, pdcolor, &temp);
+ gx_hld_save_color(pgs_for_hl_color, pdcolor, &temp);
if (gx_hld_saved_color_equal(&temp, sc))
return 0;
- code = (*setcolor) (vdev, pis_for_hl_color, pdcolor);
+ code = (*setcolor) (vdev, pgs_for_hl_color, pdcolor);
if (code < 0)
return code;
*sc = temp;
@@ -409,19 +409,19 @@ gdev_vector_update_color(gx_device_vector * vdev,
/* Update the fill color. */
int
gdev_vector_update_fill_color(gx_device_vector * vdev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_drawing_color * pdcolor)
{
- return gdev_vector_update_color(vdev, pis, pdcolor, &vdev->saved_fill_color,
+ return gdev_vector_update_color(vdev, pgs, pdcolor, &vdev->saved_fill_color,
vdev_proc(vdev, setfillcolor));
}
/* Update the state for filling a region. */
static int
-update_fill(gx_device_vector * vdev, const gs_imager_state * pis,
+update_fill(gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdcolor, gs_logical_operation_t lop)
{
- int code = gdev_vector_update_fill_color(vdev, pis, pdcolor);
+ int code = gdev_vector_update_fill_color(vdev, pgs, pdcolor);
if (code < 0)
return code;
@@ -430,7 +430,7 @@ update_fill(gx_device_vector * vdev, const gs_imager_state * pis,
/* Bring state up to date for filling. */
int
-gdev_vector_prepare_fill(gx_device_vector * vdev, const gs_imager_state * pis,
+gdev_vector_prepare_fill(gx_device_vector * vdev, const gs_gstate * pgs,
const gx_fill_params * params, const gx_drawing_color * pdcolor)
{
if (params->flatness != vdev->state.flatness) {
@@ -440,7 +440,7 @@ gdev_vector_prepare_fill(gx_device_vector * vdev, const gs_imager_state * pis,
return code;
vdev->state.flatness = params->flatness;
}
- return update_fill(vdev, pis, pdcolor, pis->log_op);
+ return update_fill(vdev, pgs, pdcolor, pgs->log_op);
}
/* Compare two dash patterns. */
@@ -458,20 +458,20 @@ dash_pattern_eq(const float *stored, const gx_dash_params * set, double scale)
/* Bring state up to date for stroking. */
int
gdev_vector_prepare_stroke(gx_device_vector * vdev,
- const gs_imager_state * pis, /* may be NULL */
+ const gs_gstate * pgs, /* may be NULL */
const gx_stroke_params * params, /* may be NULL */
const gx_drawing_color * pdcolor, /* may be NULL */
double scale)
{
- if (pis) {
- int pattern_size = pis->line_params.dash.pattern_size;
- float dash_offset = pis->line_params.dash.offset * scale;
- float half_width = pis->line_params.half_width * scale;
+ if (pgs) {
+ int pattern_size = pgs->line_params.dash.pattern_size;
+ float dash_offset = pgs->line_params.dash.offset * scale;
+ float half_width = pgs->line_params.half_width * scale;
if (dash_offset != vdev->state.line_params.dash.offset ||
pattern_size != vdev->state.line_params.dash.pattern_size ||
(pattern_size != 0 &&
- !dash_pattern_eq(vdev->dash_pattern, &pis->line_params.dash,
+ !dash_pattern_eq(vdev->dash_pattern, &pgs->line_params.dash,
scale))
) {
float *pattern;
@@ -479,7 +479,7 @@ gdev_vector_prepare_stroke(gx_device_vector * vdev,
pattern = (float *)gs_alloc_bytes(vdev->memory->stable_memory, pattern_size * sizeof(float), "vector allocate dash pattern");
for (i = 0; i < pattern_size; ++i)
- pattern[i] = pis->line_params.dash.pattern[i] * scale;
+ pattern[i] = pgs->line_params.dash.pattern[i] * scale;
code = (*vdev_proc(vdev, setdash))
(vdev, pattern, pattern_size, dash_offset);
if (code < 0)
@@ -500,33 +500,33 @@ gdev_vector_prepare_stroke(gx_device_vector * vdev,
return code;
vdev->state.line_params.half_width = half_width;
}
- if (pis->line_params.miter_limit != vdev->state.line_params.miter_limit) {
+ if (pgs->line_params.miter_limit != vdev->state.line_params.miter_limit) {
int code = (*vdev_proc(vdev, setmiterlimit))
- (vdev, pis->line_params.miter_limit);
+ (vdev, pgs->line_params.miter_limit);
if (code < 0)
return code;
gx_set_miter_limit(&vdev->state.line_params,
- pis->line_params.miter_limit);
+ pgs->line_params.miter_limit);
}
/* FIXME: Should cope with end_cap and dash_cap too */
- if (pis->line_params.start_cap != vdev->state.line_params.start_cap) {
+ if (pgs->line_params.start_cap != vdev->state.line_params.start_cap) {
int code = (*vdev_proc(vdev, setlinecap))
- (vdev, pis->line_params.start_cap);
+ (vdev, pgs->line_params.start_cap);
if (code < 0)
return code;
- vdev->state.line_params.start_cap = pis->line_params.start_cap;
+ vdev->state.line_params.start_cap = pgs->line_params.start_cap;
}
- if (pis->line_params.join != vdev->state.line_params.join) {
+ if (pgs->line_params.join != vdev->state.line_params.join) {
int code = (*vdev_proc(vdev, setlinejoin))
- (vdev, pis->line_params.join);
+ (vdev, pgs->line_params.join);
if (code < 0)
return code;
- vdev->state.line_params.join = pis->line_params.join;
+ vdev->state.line_params.join = pgs->line_params.join;
} {
- int code = gdev_vector_update_log_op(vdev, pis->log_op);
+ int code = gdev_vector_update_log_op(vdev, pgs->log_op);
if (code < 0)
return code;
@@ -542,7 +542,7 @@ gdev_vector_prepare_stroke(gx_device_vector * vdev,
}
}
if (pdcolor) {
- int code = gdev_vector_update_color(vdev, pis, pdcolor,
+ int code = gdev_vector_update_color(vdev, pgs, pdcolor,
&vdev->saved_stroke_color, vdev_proc(vdev, setstrokecolor));
if (code < 0)
@@ -559,7 +559,7 @@ gdev_vector_prepare_stroke(gx_device_vector * vdev,
*/
int
gdev_vector_stroke_scaling(const gx_device_vector *vdev,
- const gs_imager_state *pis,
+ const gs_gstate *pgs,
double *pscale, gs_matrix *pmat)
{
bool set_ctm = true;
@@ -575,16 +575,16 @@ gdev_vector_stroke_scaling(const gx_device_vector *vdev,
* do it before constructing the path, and inverse-transform all
* the coordinates.
*/
- if (is_xxyy(&pis->ctm)) {
- scale = fabs(pis->ctm.xx);
- set_ctm = fabs(pis->ctm.yy) != scale;
- } else if (is_xyyx(&pis->ctm)) {
- scale = fabs(pis->ctm.xy);
- set_ctm = fabs(pis->ctm.yx) != scale;
- } else if ((pis->ctm.xx == pis->ctm.yy && pis->ctm.xy == -pis->ctm.yx) ||
- (pis->ctm.xx == -pis->ctm.yy && pis->ctm.xy == pis->ctm.yx)
+ if (is_xxyy(&pgs->ctm)) {
+ scale = fabs(pgs->ctm.xx);
+ set_ctm = fabs(pgs->ctm.yy) != scale;
+ } else if (is_xyyx(&pgs->ctm)) {
+ scale = fabs(pgs->ctm.xy);
+ set_ctm = fabs(pgs->ctm.yx) != scale;
+ } else if ((pgs->ctm.xx == pgs->ctm.yy && pgs->ctm.xy == -pgs->ctm.yx) ||
+ (pgs->ctm.xx == -pgs->ctm.yy && pgs->ctm.xy == pgs->ctm.yx)
) {
- scale = hypot(pis->ctm.xx, pis->ctm.xy);
+ scale = hypot(pgs->ctm.xx, pgs->ctm.xy);
set_ctm = false;
}
if (set_ctm) {
@@ -596,10 +596,10 @@ gdev_vector_stroke_scaling(const gx_device_vector *vdev,
* formats.)
*/
double
- mxx = pis->ctm.xx / vdev->scale.x,
- mxy = pis->ctm.xy / vdev->scale.y,
- myx = pis->ctm.yx / vdev->scale.x,
- myy = pis->ctm.yy / vdev->scale.y;
+ mxx = pgs->ctm.xx / vdev->scale.x,
+ mxy = pgs->ctm.xy / vdev->scale.y,
+ myx = pgs->ctm.yx / vdev->scale.x,
+ myy = pgs->ctm.yy / vdev->scale.y;
scale = 0.5 * (fabs(mxx) + fabs(mxy) + fabs(myx) + fabs(myy));
pmat->xx = mxx / scale, pmat->xy = mxy / scale;
@@ -864,7 +864,7 @@ gdev_vector_close_file(gx_device_vector * vdev)
/* Initialize for enumerating an image. */
int
gdev_vector_begin_image(gx_device_vector * vdev,
- const gs_imager_state * pis, const gs_image_t * pim,
+ const gs_gstate * pgs, const gs_image_t * pim,
gs_image_format_t format, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, const gx_image_enum_procs_t * pprocs,
@@ -890,14 +890,14 @@ gdev_vector_begin_image(gx_device_vector * vdev,
pie->num_planes;
pie->default_info = 0;
pie->bbox_info = 0;
- if ((code = gdev_vector_update_log_op(vdev, pis->log_op)) < 0 ||
+ if ((code = gdev_vector_update_log_op(vdev, pgs->log_op)) < 0 ||
(code = gdev_vector_update_clip_path(vdev, pcpath)) < 0 ||
((pim->ImageMask ||
- (pim->CombineWithColor && rop3_uses_T(pis->log_op))) &&
- (code = gdev_vector_update_fill_color(vdev, pis, pdcolor)) < 0) ||
+ (pim->CombineWithColor && rop3_uses_T(pgs->log_op))) &&
+ (code = gdev_vector_update_fill_color(vdev, pgs, pdcolor)) < 0) ||
(vdev->bbox_device &&
(code = (*dev_proc(vdev->bbox_device, begin_image))
- ((gx_device *) vdev->bbox_device, pis, pim, format, prect,
+ ((gx_device *) vdev->bbox_device, pgs, pim, format, prect,
pdcolor, pcpath, mem, &pie->bbox_info)) < 0)
)
return code;
@@ -1161,17 +1161,17 @@ gdev_vector_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
}
int
-gdev_vector_fill_path(gx_device * dev, const gs_imager_state * pis,
+gdev_vector_fill_path(gx_device * dev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_device_color * pdevc, const gx_clip_path * pcpath)
{
int code;
if ((code = gdev_vector_update_clip_path(vdev, pcpath)) < 0 ||
- (code = gdev_vector_prepare_fill(vdev, pis, params, pdevc)) < 0 ||
+ (code = gdev_vector_prepare_fill(vdev, pgs, params, pdevc)) < 0 ||
(vdev->bbox_device &&
(code = (*dev_proc(vdev->bbox_device, fill_path))
- ((gx_device *) vdev->bbox_device, pis, ppath, params,
+ ((gx_device *) vdev->bbox_device, pgs, ppath, params,
pdevc, pcpath)) < 0) ||
(code = (*vdev_proc(vdev, dopath))
(vdev, ppath,
@@ -1180,12 +1180,12 @@ gdev_vector_fill_path(gx_device * dev, const gs_imager_state * pis,
vdev->fill_options,
NULL)) < 0
)
- return gx_default_fill_path(dev, pis, ppath, params, pdevc, pcpath);
+ return gx_default_fill_path(dev, pgs, ppath, params, pdevc, pcpath);
return code;
}
int
-gdev_vector_stroke_path(gx_device * dev, const gs_imager_state * pis,
+gdev_vector_stroke_path(gx_device * dev, const gs_gstate * pgs,
gx_path * ppath, const gx_stroke_params * params,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath)
{
@@ -1195,16 +1195,16 @@ gdev_vector_stroke_path(gx_device * dev, const gs_imager_state * pis,
gs_matrix mat;
if ((code = gdev_vector_update_clip_path(vdev, pcpath)) < 0 ||
- (set_ctm = gdev_vector_stroke_scaling(vdev, pis, &scale, &mat)) != 0 ||
- (code = gdev_vector_prepare_stroke(vdev, pis, params, pdcolor, scale)) < 0 ||
+ (set_ctm = gdev_vector_stroke_scaling(vdev, pgs, &scale, &mat)) != 0 ||
+ (code = gdev_vector_prepare_stroke(vdev, pgs, params, pdcolor, scale)) < 0 ||
(vdev->bbox_device &&
(code = (*dev_proc(vdev->bbox_device, stroke_path))
- ((gx_device *) vdev->bbox_device, pis, ppath, params,
+ ((gx_device *) vdev->bbox_device, pgs, ppath, params,
pdcolor, pcpath)) < 0) ||
(code = (*vdev_proc(vdev, dopath))
(vdev, ppath, gx_path_type_stroke | vdev->stroke_options, NULL)) < 0
)
- return gx_default_stroke_path(dev, pis, ppath, params, pdcolor, pcpath);
+ return gx_default_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath);
return code;
}
diff --git a/base/gdevvec.h b/base/gdevvec.h
index 0c0f6f376..d389a43fd 100644
--- a/base/gdevvec.h
+++ b/base/gdevvec.h
@@ -24,7 +24,7 @@
#include "gxdevice.h"
#include "gdevbbox.h"
#include "gxiparam.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxhldevc.h"
#include "stream.h"
@@ -102,7 +102,7 @@ typedef struct gx_device_vector_procs_s {
beginpage. in_page must also be set to false in the device's
output_page method to request that beginpage be called again
when drawing next occurs. */
- /* Imager state */
+ /* gs_gstate */
int (*setlinewidth) (gx_device_vector * vdev, double width);
int (*setlinecap) (gx_device_vector * vdev, gs_line_cap cap);
int (*setlinejoin) (gx_device_vector * vdev, gs_line_join join);
@@ -113,11 +113,11 @@ typedef struct gx_device_vector_procs_s {
int (*setlogop) (gx_device_vector * vdev, gs_logical_operation_t lop,
gs_logical_operation_t diff);
/* Other state */
- bool (*can_handle_hl_color) (gx_device_vector * vdev, const gs_imager_state * pis,
+ bool (*can_handle_hl_color) (gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdc);
- int (*setfillcolor) (gx_device_vector * vdev, const gs_imager_state * pis,
+ int (*setfillcolor) (gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdc);
- int (*setstrokecolor) (gx_device_vector * vdev, const gs_imager_state * pis,
+ int (*setstrokecolor) (gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdc);
/* Paths */
/* dopath and dorect are normally defaulted */
@@ -165,7 +165,7 @@ int gdev_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0,
uint strmbuf_size;\
int open_options; /* see below */\
/* Graphics state */\
- gs_imager_state state;\
+ gs_gstate state;\
float *dash_pattern;\
uint dash_pattern_size;\
bool fill_used_process_color;\
@@ -258,13 +258,13 @@ int gdev_vector_update_log_op(gx_device_vector * vdev,
/* Bring the fill color up to date. */
/* May call setfillcolor. */
int gdev_vector_update_fill_color(gx_device_vector * vdev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_drawing_color * pdcolor);
/* Bring state up to date for filling. */
/* May call setflat, setfillcolor, setlogop. */
int gdev_vector_prepare_fill(gx_device_vector * vdev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_fill_params * params,
const gx_drawing_color * pdcolor);
@@ -272,9 +272,9 @@ int gdev_vector_prepare_fill(gx_device_vector * vdev,
/* for the line width and dash offset explicitly. */
/* May call setlinewidth, setlinecap, setlinejoin, setmiterlimit, */
/* setdash, setflat, setstrokecolor, setlogop. */
-/* Any of pis, params, and pdcolor may be NULL. */
+/* Any of pgs, params, and pdcolor may be NULL. */
int gdev_vector_prepare_stroke(gx_device_vector * vdev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_stroke_params * params,
const gx_drawing_color * pdcolor,
double scale);
@@ -286,7 +286,7 @@ int gdev_vector_prepare_stroke(gx_device_vector * vdev,
* Return 0 if only scaling, 1 if a full matrix is needed.
*/
int gdev_vector_stroke_scaling(const gx_device_vector *vdev,
- const gs_imager_state *pis,
+ const gs_gstate *pgs,
double *pscale, gs_matrix *pmat);
/* Prepare to write a path using the default implementation. */
@@ -368,7 +368,7 @@ extern_st(st_vector_image_enum);
* enumerator.
*/
int gdev_vector_begin_image(gx_device_vector * vdev,
- const gs_imager_state * pis, const gs_image_t * pim,
+ const gs_gstate * pgs, const gs_image_t * pim,
gs_image_format_t format, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, const gx_image_enum_procs_t * pprocs,
diff --git a/base/gsalpha.c b/base/gsalpha.c
index 0968d26ce..06a908bc5 100644
--- a/base/gsalpha.c
+++ b/base/gsalpha.c
@@ -22,7 +22,7 @@
/* setalpha */
int
-gs_setalpha(gs_state * pgs, double alpha)
+gs_setalpha(gs_gstate * pgs, double alpha)
{
pgs->alpha =
(gx_color_value) (alpha < 0 ? 0 : alpha > 1 ? gx_max_color_value :
@@ -33,7 +33,7 @@ gs_setalpha(gs_state * pgs, double alpha)
/* currentalpha */
float
-gs_currentalpha(const gs_state * pgs)
+gs_currentalpha(const gs_gstate * pgs)
{
return (float)pgs->alpha / gx_max_color_value;
}
diff --git a/base/gsalpha.h b/base/gsalpha.h
index 081b4a6eb..cf38a218c 100644
--- a/base/gsalpha.h
+++ b/base/gsalpha.h
@@ -26,7 +26,7 @@
*/
/* Set/read alpha value. */
-int gs_setalpha(gs_state *, double);
-float gs_currentalpha(const gs_state *);
+int gs_setalpha(gs_gstate *, double);
+float gs_currentalpha(const gs_gstate *);
#endif /* gsalpha_INCLUDED */
diff --git a/base/gsalphac.c b/base/gsalphac.c
index 541967137..0a0628dcc 100644
--- a/base/gsalphac.c
+++ b/base/gsalphac.c
@@ -271,7 +271,7 @@ static const gx_device_composite_alpha gs_composite_alpha_device =
/* Create an alpha compositor. */
static int
c_alpha_create_default_compositor(const gs_composite_t * pcte,
- gx_device ** pcdev, gx_device * dev, gs_imager_state * pis,
+ gx_device ** pcdev, gx_device * dev, gs_gstate * pgs,
gs_memory_t * mem)
{
gx_device_composite_alpha *cdev;
diff --git a/base/gscdevn.c b/base/gscdevn.c
index 68cfd504c..29a5b437c 100644
--- a/base/gscdevn.c
+++ b/base/gscdevn.c
@@ -30,7 +30,7 @@
#include "gxfarith.h"
#include "gxfrac.h"
#include "gxcmap.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gscoord.h"
#include "gzstate.h"
#include "gxdevcli.h"
@@ -180,7 +180,7 @@ alloc_device_n_map(gs_device_n_map ** ppmap, gs_memory_t * mem,
* in the next gstate down in the gstate list (pgs->saved).
*/
int
-gs_attachattributecolorspace(gs_separation_name sep_name, gs_state * pgs)
+gs_attachattributecolorspace(gs_separation_name sep_name, gs_gstate * pgs)
{
gs_color_space * pdevncs;
gs_device_n_attributes * patt;
@@ -217,7 +217,7 @@ int
gs_cspace_set_devn_proc(gs_color_space * pcspace,
int (*proc)(const float *,
float *,
- const gs_imager_state *,
+ const gs_gstate *,
void *
),
void *proc_data
@@ -239,7 +239,7 @@ gs_cspace_set_devn_proc(gs_color_space * pcspace,
* Check if we are using the alternate color space.
*/
bool
-using_alt_color_space(const gs_state * pgs)
+using_alt_color_space(const gs_gstate * pgs)
{
return (pgs->color_component_map.use_alt_cspace);
}
@@ -247,7 +247,7 @@ using_alt_color_space(const gs_state * pgs)
/* Map a DeviceN color using a Function. */
int
map_devn_using_function(const float *in, float *out,
- const gs_imager_state *pis, void *data)
+ const gs_gstate *pgs, void *data)
{
gs_function_t *const pfn = data;
@@ -335,29 +335,29 @@ gx_restrict_DeviceN(gs_client_color * pcc, const gs_color_space * pcs)
/* Remap a DeviceN color. */
static const gs_color_space *
gx_concrete_space_DeviceN(const gs_color_space * pcs,
- const gs_imager_state * pis)
+ const gs_gstate * pgs)
{
bool is_lab = false;
#ifdef DEBUG
/*
- * Verify that the color space and imager state info match.
+ * Verify that the color space and gs_gstate info match.
*/
- if (pcs->id != pis->color_component_map.cspace_id)
- dmprintf(pis->memory, "gx_concrete_space_DeviceN: color space id mismatch");
+ if (pcs->id != pgs->color_component_map.cspace_id)
+ dmprintf(pgs->memory, "gx_concrete_space_DeviceN: color space id mismatch");
#endif
/*
* Check if we are using the alternate color space.
*/
- if (pis->color_component_map.use_alt_cspace) {
+ if (pgs->color_component_map.use_alt_cspace) {
/* Need to handle PS CIE space */
if (gs_color_space_is_PSCIE(pcs->base_space)) {
if (pcs->base_space->icc_equivalent == NULL) {
gs_colorspace_set_icc_equivalent(pcs->base_space,
- &is_lab, pis->memory);
+ &is_lab, pgs->memory);
}
return (pcs->base_space->icc_equivalent);
}
- return cs_concrete_space(pcs->base_space, pis);
+ return cs_concrete_space(pcs->base_space, pgs);
}
/*
* DeviceN color spaces are concrete (when not using alt. color space).
@@ -367,7 +367,7 @@ gx_concrete_space_DeviceN(const gs_color_space * pcs,
static int
gx_remap_DeviceN(const gs_client_color * pcc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
frac conc[GS_CLIENT_COLOR_MAX_COMPONENTS];
@@ -378,16 +378,16 @@ gx_remap_DeviceN(const gs_client_color * pcc, const gs_color_space * pcs,
gs_client_color temp;
bool mapped = false;
- if ( pcs->cmm_icc_profile_data != NULL && pis->color_component_map.use_alt_cspace) {
+ if ( pcs->cmm_icc_profile_data != NULL && pgs->color_component_map.use_alt_cspace) {
/* This is the case where we have placed a N-CLR source profile for
this color space */
if (pcs->cmm_icc_profile_data->devicen_permute_needed) {
for ( k = 0; k < i; k++) {
temp.paint.values[k] = pcc->paint.values[pcs->cmm_icc_profile_data->devicen_permute[k]];
}
- code = pacs->type->remap_color(&temp, pacs, pdc, pis, dev, select);
+ code = pacs->type->remap_color(&temp, pacs, pdc, pgs, dev, select);
} else {
- code = pacs->type->remap_color(pcc, pacs, pdc, pis, dev, select);
+ code = pacs->type->remap_color(pcc, pacs, pdc, pgs, dev, select);
}
return(code);
} else {
@@ -395,16 +395,16 @@ gx_remap_DeviceN(const gs_client_color * pcc, const gs_color_space * pcs,
regardless if we are doing the alternate tint transform or not. If
desired, that check could be made in gsicc_transform_named_color and
a decision made to return true or false */
- if (pis->icc_manager->device_named != NULL) {
+ if (pgs->icc_manager->device_named != NULL) {
/* Try to apply the direct replacement */
- mapped = gx_remap_named_color(pcc, pcs, pdc, pis, dev, select);
+ mapped = gx_remap_named_color(pcc, pcs, pdc, pgs, dev, select);
}
if (!mapped) {
- code = (*pcs->type->concretize_color)(pcc, pcs, conc, pis, dev);
+ code = (*pcs->type->concretize_color)(pcc, pcs, conc, pgs, dev);
if (code < 0)
return code;
- pconcs = cs_concrete_space(pcs, pis);
- code = (*pconcs->type->remap_concrete_color)(conc, pconcs, pdc, pis, dev, select);
+ pconcs = cs_concrete_space(pcs, pgs);
+ code = (*pconcs->type->remap_concrete_color)(conc, pconcs, pdc, pgs, dev, select);
}
/* Save original color space and color info into dev color */
i = any_abs(i);
@@ -417,7 +417,7 @@ gx_remap_DeviceN(const gs_client_color * pcc, const gs_color_space * pcs,
static int
gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
int code, tcode = 0;
gs_client_color cc;
@@ -428,9 +428,9 @@ gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
#ifdef DEBUG
/*
- * Verify that the color space and imager state info match.
+ * Verify that the color space and gs_gstate info match.
*/
- if (pcs->id != pis->color_component_map.cspace_id)
+ if (pcs->id != pgs->color_component_map.cspace_id)
dmprintf(dev->memory, "gx_concretize_DeviceN: color space id mismatch");
#endif
@@ -439,7 +439,7 @@ gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
* We must preserve tcode for implementing a semi-hack in the interpreter.
*/
- if (pis->color_component_map.use_alt_cspace) {
+ if (pgs->color_component_map.use_alt_cspace) {
/* Check the 1-element cache first. */
if (map->cache_valid) {
int i;
@@ -458,7 +458,7 @@ gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
}
tcode = (*pcs->params.device_n.map->tint_transform)
(pc->paint.values, &cc.paint.values[0],
- pis, pcs->params.device_n.map->tint_transform_data);
+ pgs, pcs->params.device_n.map->tint_transform_data);
(*pacs->type->restrict_color)(&cc, pacs);
if (tcode < 0)
return tcode;
@@ -468,7 +468,7 @@ gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
rescale_cie_colors(pacs, &cc);
/* If we have not yet created the profile do that now */
if (pacs->icc_equivalent == NULL) {
- gs_colorspace_set_icc_equivalent(pacs, &(is_lab), pis->memory);
+ gs_colorspace_set_icc_equivalent(pacs, &(is_lab), pgs->memory);
}
/* Use the ICC equivalent color space */
pacs = pacs->icc_equivalent;
@@ -480,7 +480,7 @@ gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
cc.paint.values[1] = (cc.paint.values[1]+128)/255.0;
cc.paint.values[2] = (cc.paint.values[2]+128)/255.0;
}
- code = cs_concretize_color(&cc, pacs, pconc, pis, dev);
+ code = cs_concretize_color(&cc, pacs, pconc, pgs, dev);
}
else {
int i;
@@ -494,23 +494,23 @@ gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
static int
gx_remap_concrete_DeviceN(const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
int code = 0;
#ifdef DEBUG
/*
- * Verify that the color space and imager state info match.
+ * Verify that the color space and gs_gstate info match.
*/
- if (pcs->id != pis->color_component_map.cspace_id)
- dmprintf(pis->memory, "gx_remap_concrete_DeviceN: color space id mismatch");
+ if (pcs->id != pgs->color_component_map.cspace_id)
+ dmprintf(pgs->memory, "gx_remap_concrete_DeviceN: color space id mismatch");
#endif
- if (pis->color_component_map.use_alt_cspace) {
+ if (pgs->color_component_map.use_alt_cspace) {
const gs_color_space *pacs = pcs->base_space;
return (*pacs->type->remap_concrete_color)
- (pconc, pacs, pdc, pis, dev, select);
+ (pconc, pacs, pdc, pgs, dev, select);
} else {
/* If we are going DeviceN out to real sep device that understands these,
and if the destination profile is DeviceN, we print the colors directly.
@@ -524,10 +524,10 @@ gx_remap_concrete_DeviceN(const frac * pconc, const gs_color_space * pcs,
if (dev_profile->spotnames != NULL && code >= 0) {
temp_val = dev_profile->spotnames->equiv_cmyk_set;
dev_profile->spotnames->equiv_cmyk_set = false;
- gx_remap_concrete_devicen(pconc, pdc, pis, dev, select);
+ gx_remap_concrete_devicen(pconc, pdc, pgs, dev, select);
dev_profile->spotnames->equiv_cmyk_set = temp_val;
} else {
- gx_remap_concrete_devicen(pconc, pdc, pis, dev, select);
+ gx_remap_concrete_devicen(pconc, pdc, pgs, dev, select);
}
return 0;
}
@@ -539,7 +539,7 @@ gx_remap_concrete_DeviceN(const frac * pconc, const gs_color_space * pcs,
* structure.
*/
static int
-check_DeviceN_component_names(const gs_color_space * pcs, gs_state * pgs)
+check_DeviceN_component_names(const gs_color_space * pcs, gs_gstate * pgs)
{
const gs_separation_name *names = pcs->params.device_n.names;
int num_comp = pcs->params.device_n.num_components;
@@ -606,7 +606,7 @@ check_DeviceN_component_names(const gs_color_space * pcs, gs_state * pgs)
/* Install a DeviceN color space. */
static int
-gx_install_DeviceN(gs_color_space * pcs, gs_state * pgs)
+gx_install_DeviceN(gs_color_space * pcs, gs_gstate * pgs)
{
int code;
code = check_DeviceN_component_names(pcs, pgs);
@@ -654,7 +654,7 @@ gx_install_DeviceN(gs_color_space * pcs, gs_state * pgs)
/* Set overprint information for a DeviceN color space */
static int
-gx_set_overprint_DeviceN(const gs_color_space * pcs, gs_state * pgs)
+gx_set_overprint_DeviceN(const gs_color_space * pcs, gs_gstate * pgs)
{
gs_devicen_color_map * pcmap = &pgs->color_component_map;
int code;
@@ -703,7 +703,7 @@ gx_set_overprint_DeviceN(const gs_color_space * pcs, gs_state * pgs)
}
pgs->effective_overprint_mode = 0;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
}
diff --git a/base/gscdevn.h b/base/gscdevn.h
index 1941a0170..8ca4df3cd 100644
--- a/base/gscdevn.h
+++ b/base/gscdevn.h
@@ -42,7 +42,7 @@ extern int gs_cspace_set_devn_proc(
gs_color_space * pcspace,
int (*proc)(const float *,
float *,
- const gs_imager_state *,
+ const gs_gstate *,
void *
),
void *proc_data
@@ -64,7 +64,7 @@ gs_function_t *gs_cspace_get_devn_function(const gs_color_space *pcspace);
/* Map a DeviceN color using a Function. */
int map_devn_using_function(const float *in, float *out,
- const gs_imager_state *pis, void *data);
+ const gs_gstate *pgs, void *data);
/* Serialize a DeviceN map. */
int gx_serialize_device_n_map(const gs_color_space * pcs, gs_device_n_map * m, stream * s);
@@ -79,6 +79,6 @@ int gx_serialize_device_n_map(const gs_color_space * pcs, gs_device_n_map * m, s
* color space is in the current (temp) gstate. The DeviceN color space is
* in the next gstate down in the gstate list (pgs->saved).
*/
-int gs_attachattributecolorspace(gs_separation_name sep_name, gs_state * pgs);
+int gs_attachattributecolorspace(gs_separation_name sep_name, gs_gstate * pgs);
#endif /* gscdevn_INCLUDED */
diff --git a/base/gschar.c b/base/gschar.c
index 409f24754..3ad56b676 100644
--- a/base/gschar.c
+++ b/base/gschar.c
@@ -47,7 +47,7 @@ gs_show_enum_release(gs_show_enum * penum, gs_memory_t * emem)
/* The elements of pw are: wx, wy, llx, lly, urx, ury. */
/* Note that this returns 1 if we just set up the cache device. */
int
-gs_setcachedevice_double(gs_show_enum *penum, gs_state *pgs, const double *pw)
+gs_setcachedevice_double(gs_show_enum *penum, gs_gstate *pgs, const double *pw)
{
if (penum->pgs != pgs)
return_error(gs_error_rangecheck);
@@ -55,7 +55,7 @@ gs_setcachedevice_double(gs_show_enum *penum, gs_state *pgs, const double *pw)
}
/* The _float procedure is strictly for backward compatibility. */
int
-gs_setcachedevice_float(gs_show_enum * penum, gs_state * pgs, const float *pw)
+gs_setcachedevice_float(gs_show_enum * penum, gs_gstate * pgs, const float *pw)
{
double w[6];
int i;
@@ -69,7 +69,7 @@ gs_setcachedevice_float(gs_show_enum * penum, gs_state * pgs, const float *pw)
/* The elements of pw2 are: w0x, w0y, llx, lly, urx, ury, w1x, w1y, vx, vy. */
/* Note that this returns 1 if we just set up the cache device. */
int
-gs_setcachedevice2_double(gs_show_enum * penum, gs_state * pgs,
+gs_setcachedevice2_double(gs_show_enum * penum, gs_gstate * pgs,
const double *pw2)
{
if (penum->pgs != pgs)
@@ -78,7 +78,7 @@ gs_setcachedevice2_double(gs_show_enum * penum, gs_state * pgs,
}
/* The _float procedure is strictly for backward compatibility. */
int
-gs_setcachedevice2_float(gs_show_enum * penum, gs_state * pgs, const float *pw2)
+gs_setcachedevice2_float(gs_show_enum * penum, gs_gstate * pgs, const float *pw2)
{
double w2[10];
int i;
@@ -92,7 +92,7 @@ gs_setcachedevice2_float(gs_show_enum * penum, gs_state * pgs, const float *pw2)
/* Note that this returns 1 if the current show operation is */
/* non-displaying (stringwidth or cshow). */
int
-gs_setcharwidth(gs_show_enum * penum, gs_state * pgs,
+gs_setcharwidth(gs_show_enum * penum, gs_gstate * pgs,
double wx, double wy)
{
double w[2];
@@ -175,7 +175,7 @@ gs_show_width(const gs_show_enum * penum, gs_point * ppt)
* implementation code requires.
*/
static int
-show_n_begin(gs_show_enum *penum, gs_state *pgs, int code, gs_text_enum_t *pte)
+show_n_begin(gs_show_enum *penum, gs_gstate *pgs, int code, gs_text_enum_t *pte)
{
if (code < 0)
return code;
diff --git a/base/gschar.h b/base/gschar.h
index 85acd8a36..e885a8f3d 100644
--- a/base/gschar.h
+++ b/base/gschar.h
@@ -36,7 +36,7 @@ typedef struct gs_font_s gs_font;
#endif
/* Allocate an enumerator. */
-gs_show_enum *gs_show_enum_alloc(gs_memory_t *, gs_state *, client_name_t);
+gs_show_enum *gs_show_enum_alloc(gs_memory_t *, gs_gstate *, client_name_t);
/* Release the contents of an enumerator. */
/* (This happens automatically if the enumeration finishes normally.) */
@@ -86,15 +86,15 @@ gs_char_path_mode
/* Character cache and metrics operators. */
/* gs_setcachedevice* return 1 iff the cache device was just installed. */
-int gs_setcachedevice_float(gs_show_enum *, gs_state *, const float * /*[6] */ );
-int gs_setcachedevice_double(gs_show_enum *, gs_state *, const double * /*[6] */ );
+int gs_setcachedevice_float(gs_show_enum *, gs_gstate *, const float * /*[6] */ );
+int gs_setcachedevice_double(gs_show_enum *, gs_gstate *, const double * /*[6] */ );
#define gs_setcachedevice(penum, pgs, pw)\
gs_setcachedevice_float(penum, pgs, pw)
-int gs_setcachedevice2_float(gs_show_enum *, gs_state *, const float * /*[10] */ );
-int gs_setcachedevice2_double(gs_show_enum *, gs_state *, const double * /*[10] */ );
+int gs_setcachedevice2_float(gs_show_enum *, gs_gstate *, const float * /*[10] */ );
+int gs_setcachedevice2_double(gs_show_enum *, gs_gstate *, const double * /*[10] */ );
#define gs_setcachedevice2(penum, pgs, pw2)\
gs_setcachedevice2_float(penum, pgs, pw2)
-int gs_setcharwidth(gs_show_enum *, gs_state *, double, double);
+int gs_setcharwidth(gs_show_enum *, gs_gstate *, double, double);
/* Return true if we only need the width from the rasterizer */
/* and can short-circuit the full rendering of the character, */
diff --git a/base/gscicach.c b/base/gscicach.c
index 943d32eb8..71f8a2864 100644
--- a/base/gscicach.c
+++ b/base/gscicach.c
@@ -42,7 +42,7 @@ struct gs_color_index_cache_elem_s {
struct gs_color_index_cache_s {
const gs_color_space *direct_space;
- gs_imager_state *pis;
+ gs_gstate *pgs;
gx_device *dev;
gx_device *trans_dev;
int client_num_components;
@@ -66,7 +66,7 @@ gs_private_st_ptrs6(st_color_index_cache, gs_color_index_cache_t, "gs_color_inde
gs_color_index_cache_t *
gs_color_index_cache_create(gs_memory_t *memory, const gs_color_space *direct_space, gx_device *dev,
- gs_imager_state *pis, bool need_frac, gx_device *trans_dev)
+ gs_gstate *pgs, bool need_frac, gx_device *trans_dev)
{
int client_num_components = cs_num_components(direct_space);
int device_num_components = trans_dev->color_info.num_components;
@@ -88,7 +88,7 @@ gs_color_index_cache_create(gs_memory_t *memory, const gs_color_space *direct_sp
memset(pcic, 0, sizeof(*pcic));
memset(buf, 0, COLOR_INDEX_CACHE_SIZE * sizeof(gs_color_index_cache_elem_t));
pcic->direct_space = direct_space;
- pcic->pis = pis;
+ pcic->pgs = pgs;
pcic->dev = dev;
pcic->trans_dev = trans_dev;
pcic->device_num_components = device_num_components;
@@ -309,7 +309,7 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
sizeof(*paint_values) * client_num_components);
memcpy(fcc.paint.values, paint_values,
sizeof(*paint_values) * client_num_components);
- code = pcs->type->remap_color(&fcc, pcs, pdevc, self->pis,
+ code = pcs->type->remap_color(&fcc, pcs, pdevc, self->pgs,
self->trans_dev, gs_color_select_texture);
if (code < 0)
return code;
diff --git a/base/gscicach.h b/base/gscicach.h
index 80e7928b1..dc98d9f88 100644
--- a/base/gscicach.h
+++ b/base/gscicach.h
@@ -27,7 +27,7 @@ typedef struct gs_color_index_cache_s gs_color_index_cache_t;
#endif
gs_color_index_cache_t *gs_color_index_cache_create(gs_memory_t *memory,
- const gs_color_space *direct_space, gx_device *dev, gs_imager_state *pis, bool need_frac, gx_device *trans_dev);
+ const gs_color_space *direct_space, gx_device *dev, gs_gstate *pgs, bool need_frac, gx_device *trans_dev);
void gs_color_index_cache_destroy(gs_color_index_cache_t *this);
int gs_cached_color_index(gs_color_index_cache_t *this, const float *paint_values, gx_device_color *pdevc, frac31 *frac_values);
diff --git a/base/gscie.c b/base/gscie.c
index d071d3a80..980258eaa 100644
--- a/base/gscie.c
+++ b/base/gscie.c
@@ -50,7 +50,7 @@ static void cie_matrix_init(gs_matrix3 *);
/* Allocator structure types */
private_st_joint_caches();
-extern_st(st_imager_state);
+extern_st(st_gs_gstate);
#define RESTRICTED_INDEX(v, n, itemp)\
((uint)(itemp = (int)(v)) >= (n) ?\
@@ -376,7 +376,7 @@ static bool cie_cache_mult3(gx_cie_vector_cache3_t *,
const gs_matrix3 *, double);
int
-gx_install_cie_abc(gs_cie_abc *pcie, gs_state * pgs)
+gx_install_cie_abc(gs_cie_abc *pcie, gs_gstate * pgs)
{
if_debug_matrix3("[c]CIE MatrixABC =", &pcie->MatrixABC);
cie_matrix_init(&pcie->MatrixABC);
@@ -389,7 +389,7 @@ gx_install_cie_abc(gs_cie_abc *pcie, gs_state * pgs)
}
int
-gx_install_CIEDEFG(gs_color_space * pcs, gs_state * pgs)
+gx_install_CIEDEFG(gs_color_space * pcs, gs_gstate * pgs)
{
gs_cie_defg *pcie = pcs->params.defg;
@@ -400,7 +400,7 @@ gx_install_CIEDEFG(gs_color_space * pcs, gs_state * pgs)
}
int
-gx_install_CIEDEF(gs_color_space * pcs, gs_state * pgs)
+gx_install_CIEDEF(gs_color_space * pcs, gs_gstate * pgs)
{
gs_cie_def *pcie = pcs->params.def;
@@ -411,13 +411,13 @@ gx_install_CIEDEF(gs_color_space * pcs, gs_state * pgs)
}
int
-gx_install_CIEABC(gs_color_space * pcs, gs_state * pgs)
+gx_install_CIEABC(gs_color_space * pcs, gs_gstate * pgs)
{
return gx_install_cie_abc(pcs->params.abc, pgs);
}
int
-gx_install_CIEA(gs_color_space * pcs, gs_state * pgs)
+gx_install_CIEA(gs_color_space * pcs, gs_gstate * pgs)
{
gs_cie_a *pcie = pcs->params.a;
gs_sample_loop_params_t lp;
@@ -440,7 +440,7 @@ gx_install_CIEA(gs_color_space * pcs, gs_state * pgs)
/* Load the common caches when installing the color space. */
/* This routine is exported for the benefit of gsicc.c */
void
-gx_cie_load_common_cache(gs_cie_common * pcie, gs_state * pgs)
+gx_cie_load_common_cache(gs_cie_common * pcie, gs_gstate * pgs)
{
if_debug_matrix3("[c]CIE MatrixLMN =", &pcie->MatrixLMN);
cie_matrix_init(&pcie->MatrixLMN);
@@ -663,7 +663,7 @@ cie_cache_mult3(gx_cie_vector_cache3_t * pvc, const gs_matrix3 * pmat,
/* setcolorrendering */
int
-gs_setcolorrendering(gs_state * pgs, gs_cie_render * pcrd)
+gs_setcolorrendering(gs_gstate * pgs, gs_cie_render * pcrd)
{
int code = gs_cie_render_complete(pcrd);
const gs_cie_render *pcrd_old = pgs->cie_render;
@@ -690,14 +690,14 @@ gs_setcolorrendering(gs_state * pgs, gs_cie_render * pcrd)
/* currentcolorrendering */
const gs_cie_render *
-gs_currentcolorrendering(const gs_state * pgs)
+gs_currentcolorrendering(const gs_gstate * pgs)
{
return pgs->cie_render;
}
/* Unshare (allocating if necessary) the joint caches. */
gx_cie_joint_caches *
-gx_unshare_cie_caches(gs_state * pgs)
+gx_unshare_cie_caches(gs_gstate * pgs)
{
gx_cie_joint_caches *pjc = pgs->cie_joint_caches;
@@ -713,7 +713,7 @@ gx_unshare_cie_caches(gs_state * pgs)
}
gx_cie_joint_caches *
-gx_currentciecaches(gs_state * pgs)
+gx_currentciecaches(gs_gstate * pgs)
{
return pgs->cie_joint_caches;
}
@@ -1104,7 +1104,7 @@ cie_cs_common_abc(const gs_color_space *pcs_orig, const gs_cie_abc **ppabc)
return 0;
}
const gs_cie_common *
-gs_cie_cs_common(const gs_state * pgs)
+gs_cie_cs_common(const gs_gstate * pgs)
{
const gs_cie_abc *ignore_pabc;
@@ -1117,7 +1117,7 @@ gs_cie_cs_common(const gs_state * pgs)
* exist now.
*/
int
-gs_cie_cs_complete(gs_state * pgs, bool init)
+gs_cie_cs_complete(gs_gstate * pgs, bool init)
{
gx_cie_joint_caches *pjc = gx_unshare_cie_caches(pgs);
@@ -1128,12 +1128,12 @@ gs_cie_cs_complete(gs_state * pgs, bool init)
}
/* Actually complete the joint caches. */
int
-gs_cie_jc_complete(const gs_imager_state *pis, const gs_color_space *pcs)
+gs_cie_jc_complete(const gs_gstate *pgs, const gs_color_space *pcs)
{
const gs_cie_abc *pabc;
const gs_cie_common *common = cie_cs_common_abc(pcs, &pabc);
- gs_cie_render *pcrd = pis->cie_render;
- gx_cie_joint_caches *pjc = pis->cie_joint_caches;
+ gs_cie_render *pcrd = pgs->cie_render;
+ gx_cie_joint_caches *pjc = pgs->cie_joint_caches;
if (pjc->cspace_id == pcs->id &&
pjc->render_id == pcrd->id)
@@ -1353,35 +1353,36 @@ cie_joint_caches_complete(gx_cie_joint_caches * pjc,
}
/*
- * Initialize (just enough of) an imager state so that "concretizing" colors
- * using this imager state will do only the CIE->XYZ mapping. This is a
+ * Initialize (just enough of) an gs_gstate so that "concretizing" colors
+ * using this gs_gstate will do only the CIE->XYZ mapping. This is a
* semi-hack for the PDF writer.
*/
int
-gx_cie_to_xyz_alloc(gs_imager_state **ppis, const gs_color_space *pcs,
+gx_cie_to_xyz_alloc(gs_gstate **ppgs, const gs_color_space *pcs,
gs_memory_t *mem)
{
/*
- * In addition to the imager state itself, we need the joint caches.
+ * In addition to the gs_gstate itself, we need the joint caches.
*/
- gs_imager_state *pis =
- gs_alloc_struct(mem, gs_imager_state, &st_imager_state,
- "gx_cie_to_xyz_alloc(imager state)");
+ gs_gstate *pgs =
+ gs_alloc_struct(mem, gs_gstate, &st_gs_gstate,
+ "gx_cie_to_xyz_alloc(gs_gstate)");
gx_cie_joint_caches *pjc;
const gs_cie_abc *pabc;
const gs_cie_common *pcie = cie_cs_common_abc(pcs, &pabc);
int j;
- if (pis == 0)
+ if (pgs == 0)
return_error(gs_error_VMerror);
- memset(pis, 0, sizeof(*pis)); /* mostly paranoia */
- pis->memory = mem;
- gs_imager_state_initialize(pis, mem);
+ memset(pgs, 0, sizeof(*pgs)); /* mostly paranoia */
+ pgs->memory = mem;
+ GS_STATE_INIT_VALUES(pgs, 1.0);
+ gs_gstate_initialize(pgs, mem);
pjc = gs_alloc_struct(mem, gx_cie_joint_caches, &st_joint_caches,
"gx_cie_to_xyz_free(joint caches)");
if (pjc == 0) {
- gs_free_object(mem, pis, "gx_cie_to_xyz_alloc(imager state)");
+ gs_free_object(mem, pgs, "gx_cie_to_xyz_alloc(gs_gstate)");
return_error(gs_error_VMerror);
}
@@ -1401,29 +1402,29 @@ gx_cie_to_xyz_alloc(gs_imager_state **ppis, const gs_color_space *pcs,
pjc->remap_finish = gx_cie_xyz_remap_finish;
pjc->cspace_id = pcs->id;
pjc->status = CIE_JC_STATUS_COMPLETED;
- pis->cie_joint_caches = pjc;
- pis->cie_to_xyz = true;
- *ppis = pis;
+ pgs->cie_joint_caches = pjc;
+ pgs->cie_to_xyz = true;
+ *ppgs = pgs;
return 0;
}
void
-gx_cie_to_xyz_free(gs_imager_state *pis)
+gx_cie_to_xyz_free(gs_gstate *pgs)
{
- gs_memory_t *mem = pis->memory;
+ gs_memory_t *mem = pgs->memory;
- gs_free_object(mem, pis->cie_joint_caches,
+ gs_free_object(mem, pgs->cie_joint_caches,
"gx_cie_to_xyz_free(joint caches)");
/* Free up the ICC objects if created */
- if (pis->icc_link_cache != NULL) {
- rc_decrement(pis->icc_link_cache,"gx_cie_to_xyz_free");
+ if (pgs->icc_link_cache != NULL) {
+ rc_decrement(pgs->icc_link_cache,"gx_cie_to_xyz_free");
}
- if (pis->icc_manager != NULL) {
- rc_decrement(pis->icc_manager,"gx_cie_to_xyz_free");
+ if (pgs->icc_manager != NULL) {
+ rc_decrement(pgs->icc_manager,"gx_cie_to_xyz_free");
}
- if (pis->icc_profile_cache != NULL) {
- rc_decrement(pis->icc_profile_cache,"gx_cie_to_xyz_free");
+ if (pgs->icc_profile_cache != NULL) {
+ rc_decrement(pgs->icc_profile_cache,"gx_cie_to_xyz_free");
}
- gs_free_object(mem, pis, "gx_cie_to_xyz_free(imager state)");
+ gs_free_object(mem, pgs, "gx_cie_to_xyz_free(gs_gstate)");
}
/* ================ Utilities ================ */
diff --git a/base/gscie.h b/base/gscie.h
index dbe84ef1d..692929733 100644
--- a/base/gscie.h
+++ b/base/gscie.h
@@ -369,7 +369,7 @@ typedef struct gx_cie_vector_cache3_s {
/* Elements common to all CIE color space dictionaries. */
struct gs_cie_common_s {
- int (*install_cspace)(gs_color_space *, gs_state *);
+ int (*install_cspace)(gs_color_space *, gs_gstate *);
void *client_data;
gs_range3 RangeLMN;
gs_cie_common_proc3 DecodeLMN;
@@ -596,7 +596,7 @@ typedef enum {
*/
#define GX_CIE_REMAP_FINISH_PROC(proc)\
int proc(cie_cached_vector3 vec3, frac *pconc, float *xyz,\
- const gs_imager_state *pis, const gs_color_space *pcs)
+ const gs_gstate *pgs, const gs_color_space *pcs)
struct gx_cie_joint_caches_s {
/*
@@ -680,13 +680,13 @@ void gs_cie_defg_complete(gs_cie_defg *);
void gs_cie_def_complete(gs_cie_def *);
void gs_cie_abc_complete(gs_cie_abc *);
void gs_cie_a_complete(gs_cie_a *);
-gx_cie_joint_caches *gx_unshare_cie_caches(gs_state *);
-gx_cie_joint_caches *gx_currentciecaches(gs_state *);
-const gs_cie_common *gs_cie_cs_common(const gs_state *);
-int gs_cie_cs_complete(gs_state *, bool);
-int gs_cie_jc_complete(const gs_imager_state *, const gs_color_space *);
+gx_cie_joint_caches *gx_unshare_cie_caches(gs_gstate *);
+gx_cie_joint_caches *gx_currentciecaches(gs_gstate *);
+const gs_cie_common *gs_cie_cs_common(const gs_gstate *);
+int gs_cie_cs_complete(gs_gstate *, bool);
+int gs_cie_jc_complete(const gs_gstate *, const gs_color_space *);
float gs_cie_cached_value(double, const cie_cache_floats *);
-int gx_install_cie_abc(gs_cie_abc *, gs_state *);
+int gx_install_cie_abc(gs_cie_abc *, gs_gstate *);
#define CIE_CLAMP_INDEX(index)\
index = (index < 0 ? 0 :\
diff --git a/base/gsciemap.c b/base/gsciemap.c
index b15bf7069..e0c87eb5e 100644
--- a/base/gsciemap.c
+++ b/base/gsciemap.c
@@ -23,7 +23,7 @@
#include "gxcie.h"
#include "gxdevice.h" /* for gxcmap.h */
#include "gxcmap.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gscolor2.h"
#include "gsicc_create.h" /* Needed for delayed creation of ICC profiles from CIE color spaces */
#include "gsicc_manage.h"
@@ -68,11 +68,11 @@ LOOKUP_ENTRY(cie_cached_value vin, const gx_cie_vector_cache *pcache)
* the extra level of procedure.
*/
#ifdef DEBUG
-# define GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pis, pcs)\
- gx_cie_remap_finish(vec3, pconc, cie_xyz, pis, pcs)
+# define GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pgs, pcs)\
+ gx_cie_remap_finish(vec3, pconc, cie_xyz, pgs, pcs)
#else
-# define GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pis, pcs)\
- ((pis)->cie_joint_caches->remap_finish(vec3, pconc, cie_xyz, pis, pcs))
+# define GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pgs, pcs)\
+ ((pgs)->cie_joint_caches->remap_finish(vec3, pconc, cie_xyz, pgs, pcs))
#endif
/* Forward references */
@@ -202,19 +202,19 @@ rescale_cie_colors(const gs_color_space * pcs, gs_client_color *cc)
* has been defined. The 'cie_to_xyz' flag indicates that we don't need a CRD
*/
static inline int
-gx_cie_check_rendering_inline(const gs_color_space * pcs, frac * pconc, const gs_imager_state * pis)
+gx_cie_check_rendering_inline(const gs_color_space * pcs, frac * pconc, const gs_gstate * pgs)
{
- if (pis->cie_render == 0 && !pis->cie_to_xyz) {
+ if (pgs->cie_render == 0 && !pgs->cie_to_xyz) {
/* No rendering has been defined yet: return black. */
pconc[0] = pconc[1] = pconc[2] = frac_0;
return 1;
}
- if (pis->cie_joint_caches->status == CIE_JC_STATUS_COMPLETED) {
- if (pis->cie_joint_caches->cspace_id != pcs->id)
- pis->cie_joint_caches->status = CIE_JC_STATUS_BUILT;
+ if (pgs->cie_joint_caches->status == CIE_JC_STATUS_COMPLETED) {
+ if (pgs->cie_joint_caches->cspace_id != pcs->id)
+ pgs->cie_joint_caches->status = CIE_JC_STATUS_BUILT;
}
- if (pis->cie_render && pis->cie_joint_caches->status != CIE_JC_STATUS_COMPLETED) {
- int code = gs_cie_jc_complete(pis, pcs);
+ if (pgs->cie_render && pgs->cie_joint_caches->status != CIE_JC_STATUS_COMPLETED) {
+ int code = gs_cie_jc_complete(pgs, pcs);
if (code < 0)
return code;
@@ -222,9 +222,9 @@ gx_cie_check_rendering_inline(const gs_color_space * pcs, frac * pconc, const gs
return 0;
}
int
-gx_cie_check_rendering(const gs_color_space * pcs, frac * pconc, const gs_imager_state * pis)
+gx_cie_check_rendering(const gs_color_space * pcs, frac * pconc, const gs_gstate * pgs)
{
- return gx_cie_check_rendering_inline(pcs, pconc, pis);
+ return gx_cie_check_rendering_inline(pcs, pconc, pgs);
}
/* Common code shared between remap and concretize for defg */
@@ -265,7 +265,7 @@ gx_ciedefg_to_icc(gs_color_space **ppcs_icc, gs_color_space *pcs, gs_memory_t *m
int
gx_remap_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs_in,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
gs_color_space *pcs_icc;
@@ -273,14 +273,14 @@ gx_remap_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs_in,
gs_client_color scale_pc;
gs_color_space *pcs = (gs_color_space *) pcs_in;
- if_debug4m('c', pis->memory, "[c]remap CIEDEFG [%g %g %g %g]\n",
+ if_debug4m('c', pgs->memory, "[c]remap CIEDEFG [%g %g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2], pc->paint.values[3]);
/* If we are comming in here then we have not completed
the conversion of the DEFG space to an ICC type. We
will finish that process now. */
if (pcs->icc_equivalent == NULL) {
- code = gx_ciedefg_to_icc(&pcs_icc, pcs, pis->memory->stable_memory);
+ code = gx_ciedefg_to_icc(&pcs_icc, pcs, pgs->memory->stable_memory);
if (code < 0)
return gs_rethrow(code, "Failed to create ICC profile from CIEDEFG");
} else {
@@ -289,12 +289,12 @@ gx_remap_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Rescale the input based upon the input range since profile is
created to remap this range from 0 to 1 */
if (check_range(&(pcs->params.defg->RangeDEFG.ranges[0]), 4)) {
- return (pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pis,dev,select);
+ return (pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pgs,dev,select);
}
/* Do the rescale from 0 to 1 */
rescale_input_color(&(pcs->params.defg->RangeDEFG.ranges[0]), 4, pc, &scale_pc);
/* Now the icc remap */
- code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select);
+ code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pgs,dev,select);
/* Save unscaled data for high level device (e.g. pdfwrite) */
for (i = 0; i < 4; i++)
pdc->ccolor.paint.values[i] = pc->paint.values[i];
@@ -305,21 +305,21 @@ gx_remap_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Render a CIEBasedDEFG color. */
int
gx_concretize_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs_in,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
int code;
gs_color_space *pcs_icc;
gs_client_color scale_pc;
gs_color_space *pcs = (gs_color_space *) pcs_in;
- if_debug4m('c', pis->memory, "[c]concretize DEFG [%g %g %g %g]\n",
+ if_debug4m('c', pgs->memory, "[c]concretize DEFG [%g %g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2], pc->paint.values[3]);
/* If we are comming in here then we have not completed
the conversion of the DEFG space to an ICC type. We
will finish that process now. */
if (pcs->icc_equivalent == NULL) {
- code = gx_ciedefg_to_icc(&pcs_icc, pcs, pis->memory->stable_memory);
+ code = gx_ciedefg_to_icc(&pcs_icc, pcs, pgs->memory->stable_memory);
if (code < 0)
return gs_rethrow(code, "Failed to create ICC profile from CIEDEFG");
} else {
@@ -328,53 +328,53 @@ gx_concretize_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Rescale the input based upon the input range since profile is
created to remap this range from 0 to 1 */
if (check_range(&(pcs->params.defg->RangeDEFG.ranges[0]), 4)) {
- return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev);
+ return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pgs, dev);
}
/* Do the rescale from 0 to 1 */
rescale_input_color(&(pcs->params.defg->RangeDEFG.ranges[0]), 4, pc, &scale_pc);
/* Now the icc remap */
- return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev);
+ return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pgs, dev);
}
/* Used for when we have to mash entire transform to CIEXYZ */
int
gx_psconcretize_CIEA(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, float * cie_xyz, const gs_imager_state * pis)
+ frac * pconc, float * cie_xyz, const gs_gstate * pgs)
{
const gs_cie_a *pcie = pcs->params.a;
cie_cached_value a = float2cie_cached(pc->paint.values[0]);
cie_cached_vector3 vlmn;
int code;
- if_debug1m('c', pis->memory, "[c]concretize CIEA %g\n", pc->paint.values[0]);
- code = gx_cie_check_rendering_inline(pcs, pconc, pis);
+ if_debug1m('c', pgs->memory, "[c]concretize CIEA %g\n", pc->paint.values[0]);
+ code = gx_cie_check_rendering_inline(pcs, pconc, pgs);
if (code < 0)
return code;
if (code == 1)
return 0;
/* Apply DecodeA and MatrixA. */
- if (!pis->cie_joint_caches->skipDecodeABC)
+ if (!pgs->cie_joint_caches->skipDecodeABC)
vlmn = *LOOKUP_ENTRY(a, &pcie->caches.DecodeA);
else
vlmn.u = vlmn.v = vlmn.w = a;
- GX_CIE_REMAP_FINISH(vlmn, pconc, cie_xyz, pis, pcs);
+ GX_CIE_REMAP_FINISH(vlmn, pconc, cie_xyz, pgs, pcs);
return 0;
}
/* Used for when we have to mash entire transform to CIEXYZ */
int
gx_psconcretize_CIEABC(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, float * cie_xyz, const gs_imager_state * pis)
+ frac * pconc, float * cie_xyz, const gs_gstate * pgs)
{
const gs_cie_abc *pcie = pcs->params.abc;
cie_cached_vector3 vec3;
int code;
- if_debug3m('c', pis->memory, "[c]concretize CIEABC [%g %g %g]\n",
+ if_debug3m('c', pgs->memory, "[c]concretize CIEABC [%g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2]);
- code = gx_cie_check_rendering_inline(pcs, pconc, pis);
+ code = gx_cie_check_rendering_inline(pcs, pconc, pgs);
if (code < 0)
return code;
if (code == 1)
@@ -383,17 +383,17 @@ gx_psconcretize_CIEABC(const gs_client_color * pc, const gs_color_space * pcs,
vec3.u = float2cie_cached(pc->paint.values[0]);
vec3.v = float2cie_cached(pc->paint.values[1]);
vec3.w = float2cie_cached(pc->paint.values[2]);
- if (!pis->cie_joint_caches->skipDecodeABC)
+ if (!pgs->cie_joint_caches->skipDecodeABC)
cie_lookup_map3(&vec3 /* ABC => LMN */, &pcie->caches.DecodeABC,
"Decode/MatrixABC");
- GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pis, pcs);
+ GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pgs, pcs);
return 0;
}
/* Used for when we have to mash entire transform to CIEXYZ */
int
gx_psconcretize_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, float * cie_xyz, const gs_imager_state * pis)
+ frac * pconc, float * cie_xyz, const gs_gstate * pgs)
{
const gs_cie_defg *pcie = pcs->params.defg;
int i;
@@ -402,10 +402,10 @@ gx_psconcretize_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs,
cie_cached_vector3 vec3;
int code;
- if_debug4m('c', pis->memory, "[c]concretize DEFG [%g %g %g %g]\n",
+ if_debug4m('c', pgs->memory, "[c]concretize DEFG [%g %g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2], pc->paint.values[3]);
- code = gx_cie_check_rendering_inline(pcs, pconc, pis);
+ code = gx_cie_check_rendering_inline(pcs, pconc, pgs);
if (code < 0)
return code;
if (code == 1)
@@ -445,17 +445,17 @@ gx_psconcretize_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs,
vec3.v = SCALE_TO_RANGE(pcie->RangeABC.ranges[1], abc[1]);
vec3.w = SCALE_TO_RANGE(pcie->RangeABC.ranges[2], abc[2]);
/* Apply DecodeABC and MatrixABC. */
- if (!pis->cie_joint_caches->skipDecodeABC)
+ if (!pgs->cie_joint_caches->skipDecodeABC)
cie_lookup_map3(&vec3 /* ABC => LMN */, &pcie->caches.DecodeABC,
"Decode/MatrixABC");
- GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pis, pcs);
+ GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pgs, pcs);
return 0;
}
/* Render a CIEBasedDEF color. */
int
gx_psconcretize_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, float * cie_xyz, const gs_imager_state * pis)
+ frac * pconc, float * cie_xyz, const gs_gstate * pgs)
{
const gs_cie_def *pcie = pcs->params.def;
int i;
@@ -464,10 +464,10 @@ gx_psconcretize_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs,
cie_cached_vector3 vec3;
int code;
- if_debug3m('c', pis->memory, "[c]concretize DEF [%g %g %g]\n",
+ if_debug3m('c', pgs->memory, "[c]concretize DEF [%g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2]);
- code = gx_cie_check_rendering_inline(pcs, pconc, pis);
+ code = gx_cie_check_rendering_inline(pcs, pconc, pgs);
if (code < 0)
return code;
if (code == 1)
@@ -503,10 +503,10 @@ gx_psconcretize_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs,
vec3.v = SCALE_TO_RANGE(pcie->RangeABC.ranges[1], abc[1]);
vec3.w = SCALE_TO_RANGE(pcie->RangeABC.ranges[2], abc[2]);
/* Apply DecodeABC and MatrixABC. */
- if (!pis->cie_joint_caches->skipDecodeABC)
+ if (!pgs->cie_joint_caches->skipDecodeABC)
cie_lookup_map3(&vec3 /* ABC => LMN */, &pcie->caches.DecodeABC,
"Decode/MatrixABC");
- GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pis, pcs);
+ GX_CIE_REMAP_FINISH(vec3, pconc, cie_xyz, pgs, pcs);
return 0;
}
#undef SCALE_TO_RANGE
@@ -549,7 +549,7 @@ gx_ciedef_to_icc(gs_color_space **ppcs_icc, gs_color_space *pcs, gs_memory_t *me
int
gx_remap_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs_in,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
gs_color_space *pcs_icc;
@@ -557,14 +557,14 @@ gx_remap_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs_in,
int i,code;
gs_color_space *pcs = (gs_color_space *) pcs_in;
- if_debug3m('c', pis->memory, "[c]remap CIEDEF [%g %g %g]\n",
+ if_debug3m('c', pgs->memory, "[c]remap CIEDEF [%g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2]);
/* If we are comming in here then we have not completed
the conversion of the DEF space to an ICC type. We
will finish that process now. */
if (pcs->icc_equivalent == NULL) {
- code = gx_ciedef_to_icc(&pcs_icc, pcs, pis->memory->stable_memory);
+ code = gx_ciedef_to_icc(&pcs_icc, pcs, pgs->memory->stable_memory);
if (code < 0)
return gs_rethrow(code, "Failed to build ICC profile from CIEDEF");
} else {
@@ -573,12 +573,12 @@ gx_remap_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Rescale the input based upon the input range since profile is
created to remap this range from 0 to 1 */
if (check_range(&(pcs->params.def->RangeDEF.ranges[0]), 3)) {
- return (pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pis,dev,select);
+ return (pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pgs,dev,select);
}
/* Do the rescale from 0 to 1 */
rescale_input_color(&(pcs->params.def->RangeDEF.ranges[0]), 3, pc, &scale_pc);
/* Now the icc remap */
- code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select);
+ code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pgs,dev,select);
/* Save unscaled data for high level device (e.g. pdfwrite) */
for (i = 0; i < 3; i++)
pdc->ccolor.paint.values[i] = pc->paint.values[i];
@@ -589,21 +589,21 @@ gx_remap_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Render a CIEBasedDEF color. */
int
gx_concretize_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs_in,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
int code = 0;
gs_color_space *pcs_icc;
gs_client_color scale_pc;
gs_color_space *pcs = (gs_color_space *) pcs_in;
- if_debug3m('c', pis->memory, "[c]concretize DEF [%g %g %g]\n",
+ if_debug3m('c', pgs->memory, "[c]concretize DEF [%g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2]);
/* If we are comming in here then we have not completed
the conversion of the DEF space to an ICC type. We
will finish that process now. */
if (pcs->icc_equivalent == NULL) {
- code = gx_ciedef_to_icc(&pcs_icc, pcs, pis->memory->stable_memory);
+ code = gx_ciedef_to_icc(&pcs_icc, pcs, pgs->memory->stable_memory);
if (code < 0)
return gs_rethrow(code, "Failed to build ICC profile from CIEDEF");
} else {
@@ -612,12 +612,12 @@ gx_concretize_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Rescale the input based upon the input range since profile is
created to remap this range from 0 to 1 */
if (check_range(&(pcs->params.def->RangeDEF.ranges[0]), 3)) {
- return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev);
+ return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pgs, dev);
}
/* Do the rescale from 0 to 1 */
rescale_input_color(&(pcs->params.def->RangeDEF.ranges[0]), 3, pc, &scale_pc);
/* Now the icc remap */
- return (pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis, dev);
+ return (pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pgs, dev);
}
#undef SCALE_TO_RANGE
@@ -662,7 +662,7 @@ gx_cieabc_to_icc(gs_color_space **ppcs_icc, gs_color_space *pcs, bool *islab,
/* needs to be efficient. */
int
gx_remap_CIEABC(const gs_client_color * pc, const gs_color_space * pcs_in,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
gs_color_space *pcs_icc;
@@ -671,14 +671,14 @@ gx_remap_CIEABC(const gs_client_color * pc, const gs_color_space * pcs_in,
int i, code;
gs_color_space *pcs = (gs_color_space *) pcs_in;
- if_debug3m('c', pis->memory, "[c]remap CIEABC [%g %g %g]\n",
+ if_debug3m('c', pgs->memory, "[c]remap CIEABC [%g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2]);
/* If we are comming in here then we have not completed
the conversion of the ABC space to an ICC type. We
will finish that process now. */
if (pcs->icc_equivalent == NULL) {
- code = gx_cieabc_to_icc(&pcs_icc, pcs, &islab, pis->memory->stable_memory);
+ code = gx_cieabc_to_icc(&pcs_icc, pcs, &islab, pgs->memory->stable_memory);
if (code < 0)
return gs_rethrow(code, "Failed to create ICC profile from CIEABC");
} else {
@@ -687,12 +687,12 @@ gx_remap_CIEABC(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Rescale the input based upon the input range since profile is
created to remap this range from 0 to 1 */
if (check_range(&(pcs->params.abc->RangeABC.ranges[0]), 3)) {
- return (pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pis,dev,select);
+ return (pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pgs,dev,select);
}
/* Do the rescale from 0 to 1 */
rescale_input_color(&(pcs->params.abc->RangeABC.ranges[0]), 3, pc, &scale_pc);
/* Now the icc remap */
- code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select);
+ code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pgs,dev,select);
/* Save unscaled data for high level device (e.g. pdfwrite) */
for (i = 0; i < 3; i++)
pdc->ccolor.paint.values[i] = pc->paint.values[i];
@@ -703,7 +703,7 @@ gx_remap_CIEABC(const gs_client_color * pc, const gs_color_space * pcs_in,
int
gx_concretize_CIEABC(const gs_client_color * pc, const gs_color_space * pcs_in,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
gs_color_space *pcs_icc;
gs_client_color scale_pc;
@@ -711,14 +711,14 @@ gx_concretize_CIEABC(const gs_client_color * pc, const gs_color_space * pcs_in,
gs_color_space *pcs = (gs_color_space *) pcs_in;
int code = 0;
- if_debug3m('c', pis->memory, "[c]concretize CIEABC [%g %g %g]\n",
+ if_debug3m('c', pgs->memory, "[c]concretize CIEABC [%g %g %g]\n",
pc->paint.values[0], pc->paint.values[1],
pc->paint.values[2]);
/* If we are comming in here then we have not completed
the conversion of the ABC space to an ICC type. We
will finish that process now. */
if (pcs->icc_equivalent == NULL) {
- code = gx_cieabc_to_icc(&pcs_icc, pcs, &islab, pis->memory->stable_memory);
+ code = gx_cieabc_to_icc(&pcs_icc, pcs, &islab, pgs->memory->stable_memory);
if (code < 0)
return gs_rethrow(code, "Failed to create ICC profile from CIEABC");
} else {
@@ -727,12 +727,12 @@ gx_concretize_CIEABC(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Rescale the input based upon the input range since profile is
created to remap this range from 0 to 1 */
if (check_range(&(pcs->params.abc->RangeABC.ranges[0]), 3)) {
- return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev);
+ return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pgs, dev);
}
/* Do the rescale from 0 to 1 */
rescale_input_color(&(pcs->params.abc->RangeABC.ranges[0]), 3, pc, &scale_pc);
/* Now the icc remap */
- return (pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis, dev);
+ return (pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pgs, dev);
}
/* Common code shared between remap and concretize */
@@ -773,7 +773,7 @@ gx_ciea_to_icc(gs_color_space **ppcs_icc, gs_color_space *pcs, gs_memory_t *memo
int
gx_remap_CIEA(const gs_client_color * pc, const gs_color_space * pcs_in,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
int code;
@@ -786,7 +786,7 @@ gx_remap_CIEA(const gs_client_color * pc, const gs_color_space * pcs_in,
the conversion of the CIE A space to an ICC type. We
will finish that process now. */
if (pcs->icc_equivalent == NULL) {
- code = gx_ciea_to_icc(&pcs_icc, pcs, pis->memory->stable_memory);
+ code = gx_ciea_to_icc(&pcs_icc, pcs, pgs->memory->stable_memory);
if (code < 0)
return gs_rethrow(code, "Failed to create ICC profile from CIEA");
} else {
@@ -796,12 +796,12 @@ gx_remap_CIEA(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Rescale the input based upon the input range since profile is
created to remap this range from 0 to 1 */
if (check_range(&(pcs->params.a->RangeA), 1)) {
- return (pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pis,dev,select);
+ return (pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pgs,dev,select);
}
/* Do the rescale from 0 to 1 */
rescale_input_color(&(pcs->params.a->RangeA), 1, pc, &scale_pc);
/* Now the icc remap */
- code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select);
+ code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pgs,dev,select);
/* Save unscaled data for high level device (e.g. pdfwrite) */
pdc->ccolor.paint.values[0] = pc->paint.values[0];
pdc->ccolor_valid = true;
@@ -811,7 +811,7 @@ gx_remap_CIEA(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Render a CIEBasedA color. */
int
gx_concretize_CIEA(const gs_client_color * pc, const gs_color_space * pcs_in,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
int code = 0;
gs_color_space *pcs_icc;
@@ -823,7 +823,7 @@ gx_concretize_CIEA(const gs_client_color * pc, const gs_color_space * pcs_in,
the conversion of the CIE A space to an ICC type. We
will finish that process now. */
if (pcs->icc_equivalent == NULL) {
- code = gx_ciea_to_icc(&pcs_icc, pcs, pis->memory->stable_memory);
+ code = gx_ciea_to_icc(&pcs_icc, pcs, pgs->memory->stable_memory);
if (code < 0)
return gs_rethrow(code, "Failed to create ICC profile from CIEA");
} else {
@@ -833,12 +833,12 @@ gx_concretize_CIEA(const gs_client_color * pc, const gs_color_space * pcs_in,
/* Rescale the input based upon the input range since profile is
created to remap this range from 0 to 1 */
if (check_range(&(pcs->params.a->RangeA), 1)) {
- return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev);
+ return (pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pgs, dev);
}
/* Do the rescale from 0 to 1 */
rescale_input_color(&(pcs->params.a->RangeA), 1, pc, &scale_pc);
/* Now the icc remap */
- return (pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis, dev);
+ return (pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pgs, dev);
}
/* Call for cases where the equivalent icc color space needs to be set */
@@ -876,10 +876,10 @@ gs_colorspace_set_icc_equivalent(gs_color_space *pcs, bool *islab,
/* Call the remap_finish procedure in the joint_caches structure. */
int
gx_cie_remap_finish(cie_cached_vector3 vec3, frac * pconc, float *cie_xyz,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gs_color_space *pcs)
{
- return pis->cie_joint_caches->remap_finish(vec3, pconc, cie_xyz, pis, pcs);
+ return pgs->cie_joint_caches->remap_finish(vec3, pconc, cie_xyz, pgs, pcs);
}
/* Finish remapping a CIEBased color. */
@@ -887,11 +887,11 @@ gx_cie_remap_finish(cie_cached_vector3 vec3, frac * pconc, float *cie_xyz,
/* this procedure is exported for the benefit of gsicc.c */
int
gx_cie_real_remap_finish(cie_cached_vector3 vec3, frac * pconc, float * xyz,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gs_color_space *pcs)
{
- const gs_cie_render *pcrd = pis->cie_render;
- const gx_cie_joint_caches *pjc = pis->cie_joint_caches;
+ const gs_cie_render *pcrd = pgs->cie_render;
+ const gx_cie_joint_caches *pjc = pgs->cie_joint_caches;
const gs_const_string *table = pcrd->RenderTable.lookup.table;
int tabc[3]; /* indices for final EncodeABC lookup */
@@ -963,13 +963,13 @@ gx_cie_real_remap_finish(cie_cached_vector3 vec3, frac * pconc, float * xyz,
rfix[2] = FABC(2, s);
#undef FABC
#undef EABC
- if_debug6m('c', pis->memory, "[c]ABC=%g,%g,%g => iabc=%g,%g,%g\n",
+ if_debug6m('c', pgs->memory, "[c]ABC=%g,%g,%g => iabc=%g,%g,%g\n",
cie_cached2float(vec3.u), cie_cached2float(vec3.v),
cie_cached2float(vec3.w), fixed2float(rfix[0]),
fixed2float(rfix[1]), fixed2float(rfix[2]));
gx_color_interpolate_linear(rfix, &pcrd->RenderTable.lookup,
pconc);
- if_debug3m('c', pis->memory, "[c] interpolated => %g,%g,%g\n",
+ if_debug3m('c', pgs->memory, "[c] interpolated => %g,%g,%g\n",
frac2float(pconc[0]), frac2float(pconc[1]),
frac2float(pconc[2]));
if (!pcrd->caches.RenderTableT_is_identity) {
@@ -998,7 +998,7 @@ gx_cie_real_remap_finish(cie_cached_vector3 vec3, frac * pconc, float * xyz,
/* (*pcrd->RenderTable.T)(prtc, m, pcrd, pconc); */
- if_debug6m('c', pis->memory, "[c]ABC=%g,%g,%g => iabc=%d,%d,%d\n",
+ if_debug6m('c', pgs->memory, "[c]ABC=%g,%g,%g => iabc=%d,%d,%d\n",
cie_cached2float(vec3.u), cie_cached2float(vec3.v),
cie_cached2float(vec3.w), ia, ib, ic);
if (pcrd->caches.RenderTableT_is_identity) {
@@ -1046,10 +1046,10 @@ float2frac_clamp(double x)
}
int
gx_cie_xyz_remap_finish(cie_cached_vector3 vec3, frac * pconc, float *xyz,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gs_color_space *pcs)
{
- const gx_cie_joint_caches *pjc = pis->cie_joint_caches;
+ const gx_cie_joint_caches *pjc = pgs->cie_joint_caches;
/*
* All the steps through DecodeABC/MatrixABC have been applied, i.e.,
diff --git a/base/gsclipsr.c b/base/gsclipsr.c
index 076286c1b..5ae78a2cf 100644
--- a/base/gsclipsr.c
+++ b/base/gsclipsr.c
@@ -45,7 +45,7 @@ rc_free_clip_stack(gs_memory_t * mem, void *vstack, client_name_t cname)
/* clipsave */
int
-gs_clipsave(gs_state *pgs)
+gs_clipsave(gs_gstate *pgs)
{
gs_memory_t *mem = pgs->memory;
gx_clip_path *copy =
@@ -68,7 +68,7 @@ gs_clipsave(gs_state *pgs)
/* cliprestore */
int
-gs_cliprestore(gs_state *pgs)
+gs_cliprestore(gs_gstate *pgs)
{
gx_clip_stack_t *stack = pgs->clip_stack;
diff --git a/base/gsclipsr.h b/base/gsclipsr.h
index cdb7ea7f3..d779e2733 100644
--- a/base/gsclipsr.h
+++ b/base/gsclipsr.h
@@ -19,7 +19,7 @@
#ifndef gsclipsr_INCLUDED
# define gsclipsr_INCLUDED
-int gs_clipsave(gs_state *);
-int gs_cliprestore(gs_state *);
+int gs_clipsave(gs_gstate *);
+int gs_cliprestore(gs_gstate *);
#endif /* gsclipsr_INCLUDED */
diff --git a/base/gscolor.c b/base/gscolor.c
index a7b3e2f17..6e5703711 100644
--- a/base/gscolor.c
+++ b/base/gscolor.c
@@ -28,7 +28,7 @@
#include "gzstate.h"
/* Imported from gsht.c */
-void gx_set_effective_transfer(gs_state *);
+void gx_set_effective_transfer(gs_gstate *);
/* Structure descriptors */
public_st_client_color();
@@ -99,11 +99,11 @@ gx_no_adjust_color_count(const gs_client_color * pcc,
}
/* Forward declarations */
-void load_transfer_map(gs_state *, gx_transfer_map *, double);
+void load_transfer_map(gs_gstate *, gx_transfer_map *, double);
/* setgray */
int
-gs_setgray(gs_state * pgs, double gray)
+gs_setgray(gs_gstate * pgs, double gray)
{
gs_color_space *pcs;
int code;
@@ -125,7 +125,7 @@ gs_setgray(gs_state * pgs, double gray)
/* setrgbcolor */
int
-gs_setrgbcolor(gs_state * pgs, double r, double g, double b)
+gs_setrgbcolor(gs_gstate * pgs, double r, double g, double b)
{
gs_color_space *pcs;
int code;
@@ -149,7 +149,7 @@ gs_setrgbcolor(gs_state * pgs, double r, double g, double b)
/* setnullcolor */
int
-gs_setnullcolor(gs_state * pgs)
+gs_setnullcolor(gs_gstate * pgs)
{
if (pgs->in_cachedevice)
return_error(gs_error_undefined);
@@ -161,12 +161,12 @@ gs_setnullcolor(gs_state * pgs)
/* settransfer */
/* Remap=0 is used by the interpreter. */
int
-gs_settransfer(gs_state * pgs, gs_mapping_proc tproc)
+gs_settransfer(gs_gstate * pgs, gs_mapping_proc tproc)
{
return gs_settransfer_remap(pgs, tproc, true);
}
int
-gs_settransfer_remap(gs_state * pgs, gs_mapping_proc tproc, bool remap)
+gs_settransfer_remap(gs_gstate * pgs, gs_mapping_proc tproc, bool remap)
{
gx_transfer *ptran = &pgs->set_transfer;
@@ -202,7 +202,7 @@ gs_settransfer_remap(gs_state * pgs, gs_mapping_proc tproc, bool remap)
/* currenttransfer */
gs_mapping_proc
-gs_currenttransfer(const gs_state * pgs)
+gs_currenttransfer(const gs_gstate * pgs)
{
return pgs->set_transfer.gray->proc;
}
@@ -211,7 +211,7 @@ gs_currenttransfer(const gs_state * pgs)
/* Set device color = 1 for writing into the character cache. */
int
-gx_set_device_color_1(gs_state * pgs)
+gx_set_device_color_1(gs_gstate * pgs)
{
gs_color_space *pcs;
@@ -250,7 +250,7 @@ transfer_use_proc(double value, const gx_transfer_map * pmap,
return (*pmap->proc) (value, pmap);
}
void
-load_transfer_map(gs_state * pgs, gx_transfer_map * pmap, double min_value)
+load_transfer_map(gs_gstate * pgs, gx_transfer_map * pmap, double min_value)
{
gs_mapping_closure_proc_t proc;
const void *proc_data;
diff --git a/base/gscolor.h b/base/gscolor.h
index bc3464d37..cca3debc0 100644
--- a/base/gscolor.h
+++ b/base/gscolor.h
@@ -22,15 +22,15 @@
#include "gxtmap.h"
/* Color and gray interface */
-int gs_setgray(gs_state *, double);
-int gs_currentgray(const gs_state *, float *);
-int gs_setrgbcolor(gs_state *, double, double, double);
-int gs_currentrgbcolor(const gs_state *, float[3]);
-int gs_setnullcolor(gs_state *);
+int gs_setgray(gs_gstate *, double);
+int gs_currentgray(const gs_gstate *, float *);
+int gs_setrgbcolor(gs_gstate *, double, double, double);
+int gs_currentrgbcolor(const gs_gstate *, float[3]);
+int gs_setnullcolor(gs_gstate *);
/* Transfer function */
-int gs_settransfer(gs_state *, gs_mapping_proc);
-int gs_settransfer_remap(gs_state *, gs_mapping_proc, bool);
-gs_mapping_proc gs_currenttransfer(const gs_state *);
+int gs_settransfer(gs_gstate *, gs_mapping_proc);
+int gs_settransfer_remap(gs_gstate *, gs_mapping_proc, bool);
+gs_mapping_proc gs_currenttransfer(const gs_gstate *);
#endif /* gscolor_INCLUDED */
diff --git a/base/gscolor1.c b/base/gscolor1.c
index 52f8969d5..a93284f12 100644
--- a/base/gscolor1.c
+++ b/base/gscolor1.c
@@ -31,17 +31,17 @@
#include "gzht.h"
/* Imports from gscolor.c */
-void load_transfer_map(gs_state *, gx_transfer_map *, double);
+void load_transfer_map(gs_gstate *, gx_transfer_map *, double);
/* Imported from gsht.c */
-void gx_set_effective_transfer(gs_state *);
+void gx_set_effective_transfer(gs_gstate *);
/* Force a parameter into the range [0.0..1.0]. */
#define FORCE_UNIT(p) (p < 0.0 ? 0.0 : p > 1.0 ? 1.0 : p)
/* setcmykcolor */
int
-gs_setcmykcolor(gs_state * pgs, double c, double m, double y, double k)
+gs_setcmykcolor(gs_gstate * pgs, double c, double m, double y, double k)
{
gs_color_space *pcs;
int code;
@@ -67,12 +67,12 @@ gs_setcmykcolor(gs_state * pgs, double c, double m, double y, double k)
/* setblackgeneration */
/* Remap=0 is used by the interpreter. */
int
-gs_setblackgeneration(gs_state * pgs, gs_mapping_proc proc)
+gs_setblackgeneration(gs_gstate * pgs, gs_mapping_proc proc)
{
return gs_setblackgeneration_remap(pgs, proc, true);
}
int
-gs_setblackgeneration_remap(gs_state * pgs, gs_mapping_proc proc, bool remap)
+gs_setblackgeneration_remap(gs_gstate * pgs, gs_mapping_proc proc, bool remap)
{
rc_unshare_struct(pgs->black_generation, gx_transfer_map,
&st_transfer_map, pgs->memory,
@@ -89,7 +89,7 @@ gs_setblackgeneration_remap(gs_state * pgs, gs_mapping_proc proc, bool remap)
/* currentblackgeneration */
gs_mapping_proc
-gs_currentblackgeneration(const gs_state * pgs)
+gs_currentblackgeneration(const gs_gstate * pgs)
{
return pgs->black_generation->proc;
}
@@ -97,12 +97,12 @@ gs_currentblackgeneration(const gs_state * pgs)
/* setundercolorremoval */
/* Remap=0 is used by the interpreter. */
int
-gs_setundercolorremoval(gs_state * pgs, gs_mapping_proc proc)
+gs_setundercolorremoval(gs_gstate * pgs, gs_mapping_proc proc)
{
return gs_setundercolorremoval_remap(pgs, proc, true);
}
int
-gs_setundercolorremoval_remap(gs_state * pgs, gs_mapping_proc proc, bool remap)
+gs_setundercolorremoval_remap(gs_gstate * pgs, gs_mapping_proc proc, bool remap)
{
rc_unshare_struct(pgs->undercolor_removal, gx_transfer_map,
&st_transfer_map, pgs->memory,
@@ -119,7 +119,7 @@ gs_setundercolorremoval_remap(gs_state * pgs, gs_mapping_proc proc, bool remap)
/* currentundercolorremoval */
gs_mapping_proc
-gs_currentundercolorremoval(const gs_state * pgs)
+gs_currentundercolorremoval(const gs_gstate * pgs)
{
return pgs->undercolor_removal->proc;
}
@@ -127,7 +127,7 @@ gs_currentundercolorremoval(const gs_state * pgs)
/* setcolortransfer */
/* Remap=0 is used by the interpreter. */
int
-gs_setcolortransfer_remap(gs_state * pgs, gs_mapping_proc red_proc,
+gs_setcolortransfer_remap(gs_gstate * pgs, gs_mapping_proc red_proc,
gs_mapping_proc green_proc,
gs_mapping_proc blue_proc,
gs_mapping_proc gray_proc, bool remap)
@@ -182,7 +182,7 @@ gs_setcolortransfer_remap(gs_state * pgs, gs_mapping_proc red_proc,
return_error(gs_error_VMerror);
}
int
-gs_setcolortransfer(gs_state * pgs, gs_mapping_proc red_proc,
+gs_setcolortransfer(gs_gstate * pgs, gs_mapping_proc red_proc,
gs_mapping_proc green_proc, gs_mapping_proc blue_proc,
gs_mapping_proc gray_proc)
{
@@ -192,7 +192,7 @@ gs_setcolortransfer(gs_state * pgs, gs_mapping_proc red_proc,
/* currentcolortransfer */
void
-gs_currentcolortransfer(const gs_state * pgs, gs_mapping_proc procs[4])
+gs_currentcolortransfer(const gs_gstate * pgs, gs_mapping_proc procs[4])
{
const gx_transfer *ptran = &pgs->set_transfer;
diff --git a/base/gscolor1.h b/base/gscolor1.h
index 5e74303ed..465a9f333 100644
--- a/base/gscolor1.h
+++ b/base/gscolor1.h
@@ -21,24 +21,24 @@
# define gscolor1_INCLUDED
/* Color and gray interface */
-int gs_setcmykcolor(gs_state *, double, double, double, double),
- gs_currentcmykcolor(const gs_state *, float[4]),
- gs_setblackgeneration(gs_state *, gs_mapping_proc),
- gs_setblackgeneration_remap(gs_state *, gs_mapping_proc, bool);
-gs_mapping_proc gs_currentblackgeneration(const gs_state *);
-int gs_setundercolorremoval(gs_state *, gs_mapping_proc),
- gs_setundercolorremoval_remap(gs_state *, gs_mapping_proc, bool);
-gs_mapping_proc gs_currentundercolorremoval(const gs_state *);
+int gs_setcmykcolor(gs_gstate *, double, double, double, double),
+ gs_currentcmykcolor(const gs_gstate *, float[4]),
+ gs_setblackgeneration(gs_gstate *, gs_mapping_proc),
+ gs_setblackgeneration_remap(gs_gstate *, gs_mapping_proc, bool);
+gs_mapping_proc gs_currentblackgeneration(const gs_gstate *);
+int gs_setundercolorremoval(gs_gstate *, gs_mapping_proc),
+ gs_setundercolorremoval_remap(gs_gstate *, gs_mapping_proc, bool);
+gs_mapping_proc gs_currentundercolorremoval(const gs_gstate *);
/* Transfer function */
-int gs_setcolortransfer(gs_state *, gs_mapping_proc /*red */ ,
+int gs_setcolortransfer(gs_gstate *, gs_mapping_proc /*red */ ,
gs_mapping_proc /*green */ ,
gs_mapping_proc /*blue */ ,
gs_mapping_proc /*gray */ ),
- gs_setcolortransfer_remap(gs_state *, gs_mapping_proc /*red */ ,
+ gs_setcolortransfer_remap(gs_gstate *, gs_mapping_proc /*red */ ,
gs_mapping_proc /*green */ ,
gs_mapping_proc /*blue */ ,
gs_mapping_proc /*gray */ , bool);
-void gs_currentcolortransfer(const gs_state *, gs_mapping_proc[4]);
+void gs_currentcolortransfer(const gs_gstate *, gs_mapping_proc[4]);
#endif /* gscolor1_INCLUDED */
diff --git a/base/gscolor2.c b/base/gscolor2.c
index 64874e845..67b36a786 100644
--- a/base/gscolor2.c
+++ b/base/gscolor2.c
@@ -31,7 +31,7 @@
/* ---------------- General colors and color spaces ---------------- */
int
-gs_setcolorspace_only(gs_state * pgs, gs_color_space * pcs)
+gs_setcolorspace_only(gs_gstate * pgs, gs_color_space * pcs)
{
int code = 0;
gs_color_space *cs_old = pgs->color[0].color_space;
@@ -57,7 +57,7 @@ gs_setcolorspace_only(gs_state * pgs, gs_color_space * pcs)
/* setcolorspace */
int
-gs_setcolorspace(gs_state * pgs, gs_color_space * pcs)
+gs_setcolorspace(gs_gstate * pgs, gs_color_space * pcs)
{
int code = 0;
@@ -73,14 +73,14 @@ gs_setcolorspace(gs_state * pgs, gs_color_space * pcs)
/* currentcolorspace */
gs_color_space *
-gs_currentcolorspace(const gs_state * pgs)
+gs_currentcolorspace(const gs_gstate * pgs)
{
return pgs->color[0].color_space;
}
/* setcolor */
int
-gs_setcolor(gs_state * pgs, const gs_client_color * pcc)
+gs_setcolor(gs_gstate * pgs, const gs_client_color * pcc)
{
gs_color_space * pcs = pgs->color[0].color_space;
gs_client_color cc_old = *pgs->color[0].ccolor;
@@ -110,14 +110,14 @@ gs_setcolor(gs_state * pgs, const gs_client_color * pcc)
/* currentcolor */
const gs_client_color *
-gs_currentcolor(const gs_state * pgs)
+gs_currentcolor(const gs_gstate * pgs)
{
return pgs->color[0].ccolor;
}
/* currentdevicecolor */
const gx_device_color *
-gs_currentdevicecolor(const gs_state * pgs)
+gs_currentdevicecolor(const gs_gstate * pgs)
{
return pgs->color[0].dev_color;
}
@@ -265,7 +265,7 @@ gx_polarity_Indexed(const gs_color_space * pcs)
}
static int
-gx_install_Indexed(gs_color_space * pcs, gs_state * pgs)
+gx_install_Indexed(gs_color_space * pcs, gs_gstate * pgs)
{
return (*pcs->base_space->type->install_cspace)
(pcs->base_space, pgs);
@@ -274,7 +274,7 @@ gx_install_Indexed(gs_color_space * pcs, gs_state * pgs)
/* Color space overprint setting ditto. */
static int
-gx_set_overprint_Indexed(const gs_color_space * pcs, gs_state * pgs)
+gx_set_overprint_Indexed(const gs_color_space * pcs, gs_gstate * pgs)
{
return (*pcs->base_space->type->set_overprint)
((const gs_color_space *)pcs->base_space, pgs);
@@ -478,23 +478,23 @@ gx_restrict_Indexed(gs_client_color * pcc, const gs_color_space * pcs)
/* Color remapping for Indexed color spaces. */
static const gs_color_space *
gx_concrete_space_Indexed(const gs_color_space * pcs,
- const gs_imager_state * pis)
+ const gs_gstate * pgs)
{
bool is_lab = false;
if (gs_color_space_is_PSCIE(pcs->base_space)) {
if (pcs->base_space->icc_equivalent == NULL) {
gs_colorspace_set_icc_equivalent(pcs->base_space,
- &is_lab, pis->memory);
+ &is_lab, pgs->memory);
}
return (pcs->base_space->icc_equivalent);
}
- return cs_concrete_space(pcs->base_space, pis);
+ return cs_concrete_space(pcs->base_space, pgs);
}
static int
gx_concretize_Indexed(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
gs_client_color cc;
const gs_color_space *pbcs =
@@ -503,14 +503,14 @@ gx_concretize_Indexed(const gs_client_color * pc, const gs_color_space * pcs,
if (code < 0)
return code;
- return (*pbcs->type->concretize_color) (&cc, pbcs, pconc, pis, dev);
+ return (*pbcs->type->concretize_color) (&cc, pbcs, pconc, pgs, dev);
}
/* We should only be here for cases where the base space is DeviceN or Sep and
we are doing named color replacement. */
static int
gx_remap_IndexedNamed(const gs_client_color * pcc, const gs_color_space * pcs,
-gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
frac conc[GS_CLIENT_COLOR_MAX_COMPONENTS];
@@ -523,9 +523,9 @@ gs_color_select_t select)
if (code < 0)
return code;
- pconcs = cs_concrete_space(pcs, pis);
+ pconcs = cs_concrete_space(pcs, pgs);
/* Now see if we can do the named color replacement */
- mapped = gx_remap_named_color(&cc, pconcs, pdc, pis, dev, select);
+ mapped = gx_remap_named_color(&cc, pconcs, pdc, pgs, dev, select);
if (!mapped) {
/* Named color remap failed perhaps due to colorant not found. Do the
@@ -533,10 +533,10 @@ gs_color_select_t select)
const gs_color_space *pbcs =
(const gs_color_space *)pcs->base_space;
- code = (*pbcs->type->concretize_color) (&cc, pbcs, conc, pis, dev);
+ code = (*pbcs->type->concretize_color) (&cc, pbcs, conc, pgs, dev);
if (code < 0)
return code;
- code = (*pconcs->type->remap_concrete_color)(conc, pconcs, pdc, pis, dev, select);
+ code = (*pconcs->type->remap_concrete_color)(conc, pconcs, pdc, pgs, dev, select);
}
/* Save original color space and color info into dev color */
@@ -796,7 +796,7 @@ gx_serialize_Indexed(const gs_color_space * pcs, stream * s)
* res_name and name_length passes the resource name.
*/
int
-gs_includecolorspace(gs_state * pgs, const byte *res_name, int name_length)
+gs_includecolorspace(gs_gstate * pgs, const byte *res_name, int name_length)
{
return (*dev_proc(pgs->device, include_color_space))(pgs->device, gs_currentcolorspace_inline(pgs), res_name, name_length);
}
diff --git a/base/gscolor2.h b/base/gscolor2.h
index d4d0c1806..e640c2d7e 100644
--- a/base/gscolor2.h
+++ b/base/gscolor2.h
@@ -32,12 +32,12 @@
*/
/* General color routines */
-gs_color_space *gs_currentcolorspace(const gs_state *);
-int gs_setcolorspace(gs_state *, gs_color_space *);
-int gs_setcolorspace_only(gs_state *, gs_color_space *);
-const gs_client_color *gs_currentcolor(const gs_state *);
-int gs_setcolor(gs_state *, const gs_client_color *);
-const gx_device_color *gs_currentdevicecolor(const gs_state *);
+gs_color_space *gs_currentcolorspace(const gs_gstate *);
+int gs_setcolorspace(gs_gstate *, gs_color_space *);
+int gs_setcolorspace_only(gs_gstate *, gs_color_space *);
+const gs_client_color *gs_currentcolor(const gs_gstate *);
+int gs_setcolor(gs_gstate *, const gs_client_color *);
+const gx_device_color *gs_currentdevicecolor(const gs_gstate *);
/* Look up with restriction */
int
@@ -53,10 +53,10 @@ extern const gs_color_space_type gs_color_space_type_Indexed_Named;
# define gs_cie_render_DEFINED
typedef struct gs_cie_render_s gs_cie_render;
#endif
-const gs_cie_render *gs_currentcolorrendering(const gs_state *);
-int gs_setcolorrendering(gs_state *, gs_cie_render *);
+const gs_cie_render *gs_currentcolorrendering(const gs_gstate *);
+int gs_setcolorrendering(gs_gstate *, gs_cie_render *);
/* High level device support */
-int gs_includecolorspace(gs_state * pgs, const byte *res_name, int name_length);
+int gs_includecolorspace(gs_gstate * pgs, const byte *res_name, int name_length);
#endif /* gscolor2_INCLUDED */
diff --git a/base/gscolor3.c b/base/gscolor3.c
index e0f4ff8b8..c065218bd 100644
--- a/base/gscolor3.c
+++ b/base/gscolor3.c
@@ -33,7 +33,7 @@
/* setsmoothness */
int
-gs_setsmoothness(gs_state * pgs, double smoothness)
+gs_setsmoothness(gs_gstate * pgs, double smoothness)
{
pgs->smoothness =
(smoothness < 0 ? 0 : smoothness > 1 ? 1 : smoothness);
@@ -42,14 +42,14 @@ gs_setsmoothness(gs_state * pgs, double smoothness)
/* currentsmoothness */
float
-gs_currentsmoothness(const gs_state * pgs)
+gs_currentsmoothness(const gs_gstate * pgs)
{
return pgs->smoothness;
}
/* shfill */
int
-gs_shfill(gs_state * pgs, const gs_shading_t * psh)
+gs_shfill(gs_gstate * pgs, const gs_shading_t * psh)
{
/*
* shfill is equivalent to filling the current clipping path (or, if
@@ -94,7 +94,7 @@ gs_shfill(gs_state * pgs, const gs_shading_t * psh)
return_error(gs_error_VMerror);
pcs->params.pattern.has_base_space = false;
- code = pcs->type->remap_color(&cc, pcs, &devc, (gs_imager_state *)pgs,
+ code = pcs->type->remap_color(&cc, pcs, &devc, pgs,
pgs->device, gs_color_select_texture);
if (code >= 0) {
gx_device *dev = pgs->device;
diff --git a/base/gscolor3.h b/base/gscolor3.h
index e5ba619bc..db576552b 100644
--- a/base/gscolor3.h
+++ b/base/gscolor3.h
@@ -25,8 +25,8 @@
typedef struct gs_shading_s gs_shading_t;
#endif
-int gs_setsmoothness(gs_state *, double);
-float gs_currentsmoothness(const gs_state *);
-int gs_shfill(gs_state *, const gs_shading_t *);
+int gs_setsmoothness(gs_gstate *, double);
+float gs_currentsmoothness(const gs_gstate *);
+int gs_shfill(gs_gstate *, const gs_shading_t *);
#endif /* gscolor3_INCLUDED */
diff --git a/base/gscoord.c b/base/gscoord.c
index bc9d6dc81..bd2cb4232 100644
--- a/base/gscoord.c
+++ b/base/gscoord.c
@@ -54,7 +54,7 @@ static void trace_matrix(const gs_memory_t *mem, const gs_matrix *);
}
static int
-ctm_set_inverse(gs_state * pgs)
+ctm_set_inverse(gs_gstate * pgs)
{
int code = gs_matrix_invert(&ctm_only(pgs), &pgs->ctm_inverse);
@@ -96,7 +96,7 @@ ctm_set_inverse(gs_state * pgs)
/* ------ Coordinate system definition ------ */
int
-gs_initmatrix(gs_state * pgs)
+gs_initmatrix(gs_gstate * pgs)
{
gs_matrix imat;
@@ -111,7 +111,7 @@ gs_initmatrix(gs_state * pgs)
}
int
-gs_defaultmatrix(const gs_state * pgs, gs_matrix * pmat)
+gs_defaultmatrix(const gs_gstate * pgs, gs_matrix * pmat)
{
gx_device *dev;
@@ -130,7 +130,7 @@ gs_defaultmatrix(const gs_state * pgs, gs_matrix * pmat)
}
int
-gs_setdefaultmatrix(gs_state * pgs, const gs_matrix * pmat)
+gs_setdefaultmatrix(gs_gstate * pgs, const gs_matrix * pmat)
{
if (pmat == NULL)
pgs->ctm_default_set = false;
@@ -142,7 +142,7 @@ gs_setdefaultmatrix(gs_state * pgs, const gs_matrix * pmat)
}
int
-gs_currentmatrix(const gs_state * pgs, gs_matrix * pmat)
+gs_currentmatrix(const gs_gstate * pgs, gs_matrix * pmat)
{
*pmat = ctm_only(pgs);
return 0;
@@ -151,7 +151,7 @@ gs_currentmatrix(const gs_state * pgs, gs_matrix * pmat)
/* Set the current transformation matrix for rendering text. */
/* Note that this may be based on a font other than the current font. */
int
-gs_setcharmatrix(gs_state * pgs, const gs_matrix * pmat)
+gs_setcharmatrix(gs_gstate * pgs, const gs_matrix * pmat)
{
gs_matrix cmat;
int code = gs_matrix_multiply(pmat, &ctm_only(pgs), &cmat);
@@ -172,7 +172,7 @@ gs_setcharmatrix(gs_state * pgs, const gs_matrix * pmat)
/* for rendering text. If force=true, update char_tm if it is invalid; */
/* if force=false, don't update char_tm, and return an error code. */
int
-gs_currentcharmatrix(gs_state * pgs, gs_matrix * ptm, bool force)
+gs_currentcharmatrix(gs_gstate * pgs, gs_matrix * ptm, bool force)
{
if (!pgs->char_tm_valid) {
int code;
@@ -189,7 +189,7 @@ gs_currentcharmatrix(gs_state * pgs, gs_matrix * ptm, bool force)
}
int
-gs_setmatrix(gs_state * pgs, const gs_matrix * pmat)
+gs_setmatrix(gs_gstate * pgs, const gs_matrix * pmat)
{
update_ctm(pgs, pmat->tx, pmat->ty);
set_ctm_only(pgs, *pmat);
@@ -201,19 +201,19 @@ gs_setmatrix(gs_state * pgs, const gs_matrix * pmat)
}
int
-gs_imager_setmatrix(gs_imager_state * pis, const gs_matrix * pmat)
+gs_gstate_setmatrix(gs_gstate * pgs, const gs_matrix * pmat)
{
- update_matrix_fixed(pis->ctm, pmat->tx, pmat->ty);
- set_ctm_only(pis, *pmat);
+ update_matrix_fixed(pgs->ctm, pmat->tx, pmat->ty);
+ set_ctm_only(pgs, *pmat);
#ifdef DEBUG
if (gs_debug_c('x'))
- dmlprintf(pis->memory, "[x]imager_setmatrix:\n"), trace_ctm(pis);
+ dmlprintf(pgs->memory, "[x]imager_setmatrix:\n"), trace_ctm(pgs);
#endif
return 0;
}
int
-gs_settocharmatrix(gs_state * pgs)
+gs_settocharmatrix(gs_gstate * pgs)
{
if (pgs->char_tm_valid) {
pgs->ctm = pgs->char_tm;
@@ -224,7 +224,7 @@ gs_settocharmatrix(gs_state * pgs)
}
int
-gs_translate(gs_state * pgs, double dx, double dy)
+gs_translate(gs_gstate * pgs, double dx, double dy)
{
gs_point pt;
int code;
@@ -244,7 +244,7 @@ gs_translate(gs_state * pgs, double dx, double dy)
}
int
-gs_translate_untransformed(gs_state * pgs, double dx, double dy)
+gs_translate_untransformed(gs_gstate * pgs, double dx, double dy)
{
gs_point pt;
@@ -261,7 +261,7 @@ gs_translate_untransformed(gs_state * pgs, double dx, double dy)
}
int
-gs_scale(gs_state * pgs, double sx, double sy)
+gs_scale(gs_gstate * pgs, double sx, double sy)
{
pgs->ctm.xx *= sx;
pgs->ctm.xy *= sx;
@@ -276,7 +276,7 @@ gs_scale(gs_state * pgs, double sx, double sy)
}
int
-gs_rotate(gs_state * pgs, double ang)
+gs_rotate(gs_gstate * pgs, double ang)
{
int code = gs_matrix_rotate(&ctm_only(pgs), ang,
&ctm_only_writable(pgs));
@@ -290,7 +290,7 @@ gs_rotate(gs_state * pgs, double ang)
}
int
-gs_concat(gs_state * pgs, const gs_matrix * pmat)
+gs_concat(gs_gstate * pgs, const gs_matrix * pmat)
{
gs_matrix cmat;
int code = gs_matrix_multiply(pmat, &ctm_only(pgs), &cmat);
@@ -311,19 +311,19 @@ gs_concat(gs_state * pgs, const gs_matrix * pmat)
#define is_skewed(pmat) (!(is_xxyy(pmat) || is_xyyx(pmat)))
int
-gs_transform(gs_state * pgs, double x, double y, gs_point * pt)
+gs_transform(gs_gstate * pgs, double x, double y, gs_point * pt)
{
return gs_point_transform(x, y, &ctm_only(pgs), pt);
}
int
-gs_dtransform(gs_state * pgs, double dx, double dy, gs_point * pt)
+gs_dtransform(gs_gstate * pgs, double dx, double dy, gs_point * pt)
{
return gs_distance_transform(dx, dy, &ctm_only(pgs), pt);
}
int
-gs_itransform(gs_state * pgs, double x, double y, gs_point * pt)
+gs_itransform(gs_gstate * pgs, double x, double y, gs_point * pt)
{ /* If the matrix isn't skewed, we get more accurate results */
/* by using transform_inverse than by using the inverse matrix. */
if (!is_skewed(&pgs->ctm)) {
@@ -335,7 +335,7 @@ gs_itransform(gs_state * pgs, double x, double y, gs_point * pt)
}
int
-gs_idtransform(gs_state * pgs, double dx, double dy, gs_point * pt)
+gs_idtransform(gs_gstate * pgs, double dx, double dy, gs_point * pt)
{ /* If the matrix isn't skewed, we get more accurate results */
/* by using transform_inverse than by using the inverse matrix. */
if (!is_skewed(&pgs->ctm)) {
@@ -348,10 +348,10 @@ gs_idtransform(gs_state * pgs, double dx, double dy, gs_point * pt)
}
int
-gs_imager_idtransform(const gs_imager_state * pis, double dx, double dy,
+gs_gstate_idtransform(const gs_gstate * pgs, double dx, double dy,
gs_point * pt)
{
- return gs_distance_transform_inverse(dx, dy, &ctm_only(pis), pt);
+ return gs_distance_transform_inverse(dx, dy, &ctm_only(pgs), pt);
}
/* ------ For internal use only ------ */
@@ -359,7 +359,7 @@ gs_imager_idtransform(const gs_imager_state * pis, double dx, double dy,
/* Set the translation to a fixed value, and translate any existing path. */
/* Used by gschar.c to prepare for a BuildChar or BuildGlyph procedure. */
int
-gx_translate_to_fixed(register gs_state * pgs, fixed px, fixed py)
+gx_translate_to_fixed(register gs_gstate * pgs, fixed px, fixed py)
{
double fpx = fixed2float(px);
double fdx = fpx - pgs->ctm.tx;
@@ -407,7 +407,7 @@ gx_translate_to_fixed(register gs_state * pgs, fixed px, fixed py)
/* Scale the CTM and character matrix for oversampling. */
int
-gx_scale_char_matrix(register gs_state * pgs, int sx, int sy)
+gx_scale_char_matrix(register gs_gstate * pgs, int sx, int sy)
{
#define scale_cxy(s, vx, vy)\
if ( s != 1 )\
diff --git a/base/gscoord.h b/base/gscoord.h
index 00a0ac2a9..53455747a 100644
--- a/base/gscoord.h
+++ b/base/gscoord.h
@@ -21,34 +21,34 @@
# define gscoord_INCLUDED
/* Coordinate system modification */
-int gs_initmatrix(gs_state *),
- gs_defaultmatrix(const gs_state *, gs_matrix *),
- gs_currentmatrix(const gs_state *, gs_matrix *),
- gs_setmatrix(gs_state *, const gs_matrix *),
- gs_translate(gs_state *, double, double),
- gs_translate_untransformed(gs_state *, double, double),
- gs_scale(gs_state *, double, double),
- gs_rotate(gs_state *, double),
- gs_concat(gs_state *, const gs_matrix *);
+int gs_initmatrix(gs_gstate *),
+ gs_defaultmatrix(const gs_gstate *, gs_matrix *),
+ gs_currentmatrix(const gs_gstate *, gs_matrix *),
+ gs_setmatrix(gs_gstate *, const gs_matrix *),
+ gs_translate(gs_gstate *, double, double),
+ gs_translate_untransformed(gs_gstate *, double, double),
+ gs_scale(gs_gstate *, double, double),
+ gs_rotate(gs_gstate *, double),
+ gs_concat(gs_gstate *, const gs_matrix *);
/* Extensions */
-int gs_setdefaultmatrix(gs_state *, const gs_matrix *),
- gs_currentcharmatrix(gs_state *, gs_matrix *, bool),
- gs_setcharmatrix(gs_state *, const gs_matrix *),
- gs_settocharmatrix(gs_state *);
+int gs_setdefaultmatrix(gs_gstate *, const gs_matrix *),
+ gs_currentcharmatrix(gs_gstate *, gs_matrix *, bool),
+ gs_setcharmatrix(gs_gstate *, const gs_matrix *),
+ gs_settocharmatrix(gs_gstate *);
/* Coordinate transformation */
-int gs_transform(gs_state *, double, double, gs_point *),
- gs_dtransform(gs_state *, double, double, gs_point *),
- gs_itransform(gs_state *, double, double, gs_point *),
- gs_idtransform(gs_state *, double, double, gs_point *);
-
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+int gs_transform(gs_gstate *, double, double, gs_point *),
+ gs_dtransform(gs_gstate *, double, double, gs_point *),
+ gs_itransform(gs_gstate *, double, double, gs_point *),
+ gs_idtransform(gs_gstate *, double, double, gs_point *);
+
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
-int gs_imager_setmatrix(gs_imager_state *, const gs_matrix *);
-int gs_imager_idtransform(const gs_imager_state *, double, double, gs_point *);
+int gs_gstate_setmatrix(gs_gstate *, const gs_matrix *);
+int gs_gstate_idtransform(const gs_gstate *, double, double, gs_point *);
#endif /* gscoord_INCLUDED */
diff --git a/base/gscpixel.c b/base/gscpixel.c
index dab73a132..78dd5c3bb 100644
--- a/base/gscpixel.c
+++ b/base/gscpixel.c
@@ -21,7 +21,7 @@
#include "gxcspace.h"
#include "gscpixel.h"
#include "gxdevice.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gsovrc.h"
#include "gsstate.h"
#include "gzstate.h"
@@ -89,7 +89,7 @@ gx_restrict_DevicePixel(gs_client_color * pcc, const gs_color_space * pcs)
static int
gx_concretize_DevicePixel(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
/****** NOT ENOUGH BITS IN float OR frac ******/
pconc[0] = (frac) (ulong) pc->paint.values[0];
@@ -98,7 +98,7 @@ gx_concretize_DevicePixel(const gs_client_color * pc, const gs_color_space * pcs
static int
gx_remap_concrete_DevicePixel(const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
color_set_pure(pdc, pconc[0] & ((1 << dev->color_info.depth) - 1));
@@ -107,13 +107,13 @@ gx_remap_concrete_DevicePixel(const frac * pconc, const gs_color_space * pcs,
/* DevicePixel disables overprint */
static int
-gx_set_overprint_DevicePixel(const gs_color_space * pcs, gs_state * pgs)
+gx_set_overprint_DevicePixel(const gs_color_space * pcs, gs_gstate * pgs)
{
gs_overprint_params_t params;
params.retain_any_comps = false;
pgs->effective_overprint_mode = 0;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
/* ---------------- Serialization. -------------------------------- */
diff --git a/base/gscscie.c b/base/gscscie.c
index b39619352..fb8f67e7d 100644
--- a/base/gscscie.c
+++ b/base/gscscie.c
@@ -122,16 +122,16 @@ const gs_color_space_type gs_color_space_type_CIEA = {
/* Determine the concrete space underlying a CIEBased space. */
const gs_color_space *
-gx_concrete_space_CIE(const gs_color_space * pcs, const gs_imager_state * pis)
+gx_concrete_space_CIE(const gs_color_space * pcs, const gs_gstate * pgs)
{
- const gs_cie_render *pcie = pis->cie_render;
+ const gs_cie_render *pcie = pgs->cie_render;
if (pcie == 0 || pcie->RenderTable.lookup.table == 0 ||
pcie->RenderTable.lookup.m == 3
) {
- return pis->devicergb_cs;
+ return pgs->devicergb_cs;
} else { /* pcie->RenderTable.lookup.m == 4 */
- return pis->devicecmyk_cs;
+ return pgs->devicecmyk_cs;
}
}
@@ -140,7 +140,7 @@ gx_concrete_space_CIE(const gs_color_space * pcs, const gs_imager_state * pis)
/* interpreters can substitute their own installer. */
/* This procedure is exported for the benefit of gsicc.c */
int
-gx_install_CIE(gs_color_space * pcs, gs_state * pgs)
+gx_install_CIE(gs_color_space * pcs, gs_gstate * pgs)
{
return (*pcs->params.a->common.install_cspace) (pcs, pgs);
}
diff --git a/base/gscsepr.c b/base/gscsepr.c
index 09b5b5916..c79012441 100644
--- a/base/gscsepr.c
+++ b/base/gscsepr.c
@@ -81,30 +81,30 @@ RELOC_PTRS_END
/* Get the concrete space for a Separation space. */
static const gs_color_space *
gx_concrete_space_Separation(const gs_color_space * pcs,
- const gs_imager_state * pis)
+ const gs_gstate * pgs)
{
bool is_lab = false;
#ifdef DEBUG
/*
- * Verify that the color space and imager state info match.
+ * Verify that the color space and gs_gstate info match.
*/
- if (pcs->id != pis->color_component_map.cspace_id)
- dmprintf(pis->memory, "gx_concretze_space_Separation: color space id mismatch");
+ if (pcs->id != pgs->color_component_map.cspace_id)
+ dmprintf(pgs->memory, "gx_concretze_space_Separation: color space id mismatch");
#endif
/*
* Check if we are using the alternate color space.
*/
- if (pis->color_component_map.use_alt_cspace) {
+ if (pgs->color_component_map.use_alt_cspace) {
/* Need to handle PS CIE space */
if (gs_color_space_is_PSCIE(pcs->base_space)) {
if (pcs->base_space->icc_equivalent == NULL) {
gs_colorspace_set_icc_equivalent(pcs->base_space,
- &is_lab, pis->memory);
+ &is_lab, pgs->memory);
}
return (pcs->base_space->icc_equivalent);
}
- return cs_concrete_space(pcs->base_space, pis);
+ return cs_concrete_space(pcs->base_space, pgs);
}
/*
* Separation color spaces are concrete (when not using alt. color space).
@@ -113,11 +113,11 @@ gx_concrete_space_Separation(const gs_color_space * pcs,
}
static int
-check_Separation_component_name(const gs_color_space * pcs, gs_state * pgs);
+check_Separation_component_name(const gs_color_space * pcs, gs_gstate * pgs);
/* Install a Separation color space. */
static int
-gx_install_Separation(gs_color_space * pcs, gs_state * pgs)
+gx_install_Separation(gs_color_space * pcs, gs_gstate * pgs)
{
int code;
@@ -145,7 +145,7 @@ gx_install_Separation(gs_color_space * pcs, gs_state * pgs)
/* Set the overprint information appropriate to a separation color space */
static int
-gx_set_overprint_Separation(const gs_color_space * pcs, gs_state * pgs)
+gx_set_overprint_Separation(const gs_color_space * pcs, gs_gstate * pgs)
{
gs_devicen_color_map * pcmap = &pgs->color_component_map;
gx_device *dev = pgs->device;
@@ -178,7 +178,7 @@ gx_set_overprint_Separation(const gs_color_space * pcs, gs_state * pgs)
}
}
pgs->effective_overprint_mode = 0;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
}
@@ -233,7 +233,7 @@ int
gs_cspace_set_sepr_proc(gs_color_space * pcspace,
int (*proc)(const float *,
float *,
- const gs_imager_state *,
+ const gs_gstate *,
void *
),
void *proc_data
@@ -299,7 +299,7 @@ gx_init_Separation(gs_client_color * pcc, const gs_color_space * pcs)
static int
gx_remap_Separation(const gs_client_color * pcc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
int code = 0;
@@ -311,12 +311,12 @@ gx_remap_Separation(const gs_client_color * pcc, const gs_color_space * pcs,
value. A decision can be made in gsicc_transform_named_color to
return false if you don't want those named colors to be mapped */
if (pcs->params.separation.sep_type == SEP_OTHER &&
- pis->icc_manager->device_named != NULL) {
+ pgs->icc_manager->device_named != NULL) {
/* Try to apply the direct replacement */
- mapped = gx_remap_named_color(pcc, pcs, pdc, pis, dev, select);
+ mapped = gx_remap_named_color(pcc, pcs, pdc, pgs, dev, select);
}
if (!mapped)
- code = gx_default_remap_color(pcc, pcs, pdc, pis, dev, select);
+ code = gx_default_remap_color(pcc, pcs, pdc, pgs, dev, select);
} else {
color_set_null(pdc);
}
@@ -328,7 +328,7 @@ gx_remap_Separation(const gs_client_color * pcc, const gs_color_space * pcs,
static int
gx_concretize_Separation(const gs_client_color *pc, const gs_color_space *pcs,
- frac *pconc, const gs_imager_state *pis, gx_device *dev)
+ frac *pconc, const gs_gstate *pgs, gx_device *dev)
{
int code;
gs_client_color cc;
@@ -348,7 +348,7 @@ gx_concretize_Separation(const gs_client_color *pc, const gs_color_space *pcs,
}
code = (*pcs->params.separation.map->tint_transform)
(pc->paint.values, &cc.paint.values[0],
- pis, pcs->params.separation.map->tint_transform_data);
+ pgs, pcs->params.separation.map->tint_transform_data);
if (code < 0)
return code;
(*pacs->type->restrict_color)(&cc, pacs);
@@ -358,7 +358,7 @@ gx_concretize_Separation(const gs_client_color *pc, const gs_color_space *pcs,
rescale_cie_colors(pacs, &cc);
/* If we have not yet created the profile do that now */
if (pacs->icc_equivalent == NULL) {
- gs_colorspace_set_icc_equivalent(pacs, &(is_lab), pis->memory);
+ gs_colorspace_set_icc_equivalent(pacs, &(is_lab), pgs->memory);
}
/* Use the ICC equivalent color space */
pacs = pacs->icc_equivalent;
@@ -370,7 +370,7 @@ gx_concretize_Separation(const gs_client_color *pc, const gs_color_space *pcs,
cc.paint.values[1] = (cc.paint.values[1]+128)/255.0;
cc.paint.values[2] = (cc.paint.values[2]+128)/255.0;
}
- return cs_concretize_color(&cc, pacs, pconc, pis, dev);
+ return cs_concretize_color(&cc, pacs, pconc, pgs, dev);
} else {
pconc[0] = gx_unit_frac(pc->paint.values[0]);
}
@@ -379,25 +379,25 @@ gx_concretize_Separation(const gs_client_color *pc, const gs_color_space *pcs,
static int
gx_remap_concrete_Separation(const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
#ifdef DEBUG
/*
- * Verify that the color space and imager state info match.
+ * Verify that the color space and gs_gstate info match.
*/
- if (pcs->id != pis->color_component_map.cspace_id)
- dmprintf(pis->memory, "gx_remap_concrete_Separation: color space id mismatch");
+ if (pcs->id != pgs->color_component_map.cspace_id)
+ dmprintf(pgs->memory, "gx_remap_concrete_Separation: color space id mismatch");
#endif
- if (pis->color_component_map.use_alt_cspace) {
+ if (pgs->color_component_map.use_alt_cspace) {
const gs_color_space *pacs = pcs->base_space;
return (*pacs->type->remap_concrete_color)
- (pconc, pacs, pdc, pis, dev, select);
+ (pconc, pacs, pdc, pgs, dev, select);
} else {
/* We need to determine if we did a direct color replacement */
- gx_remap_concrete_separation(pconc[0], pdc, pis, dev, select);
+ gx_remap_concrete_separation(pconc[0], pdc, pgs, dev, select);
return 0;
}
}
@@ -408,7 +408,7 @@ gx_remap_concrete_Separation(const frac * pconc, const gs_color_space * pcs,
* structure.
*/
static int
-check_Separation_component_name(const gs_color_space * pcs, gs_state * pgs)
+check_Separation_component_name(const gs_color_space * pcs, gs_gstate * pgs)
{
const gs_separation_name name = pcs->params.separation.sep_name;
int colorant_number;
diff --git a/base/gscsepr.h b/base/gscsepr.h
index 38724f1de..97adeaebb 100644
--- a/base/gscsepr.h
+++ b/base/gscsepr.h
@@ -54,7 +54,7 @@ typedef struct gs_function_s gs_function_t;
int gs_cspace_set_sepr_proc(gs_color_space * pcspace,
int (*proc)(const float *,
float *,
- const gs_imager_state *,
+ const gs_gstate *,
void *
),
void *proc_data
diff --git a/base/gscspace.c b/base/gscspace.c
index 4a8f9a398..07adb7302 100644
--- a/base/gscspace.c
+++ b/base/gscspace.c
@@ -23,7 +23,7 @@
#include "gsutil.h" /* for gs_next_ids */
#include "gxcmap.h"
#include "gxcspace.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gsovrc.h"
#include "gsstate.h"
#include "gsdevice.h"
@@ -163,7 +163,7 @@ gs_cspace_new_DeviceCMYK(gs_memory_t *mem)
/* For use in initializing ICC color spaces for XPS */
gs_color_space *
-gs_cspace_new_ICC(gs_memory_t *pmem, gs_state * pgs, int components)
+gs_cspace_new_ICC(gs_memory_t *pmem, gs_gstate * pgs, int components)
{
gsicc_manager_t *icc_manage = pgs->icc_manager;
int code = 0;
@@ -263,7 +263,7 @@ gs_color_space_restrict_color(gs_client_color *pcc, const gs_color_space *pcs)
/* Install a DeviceGray color space. */
static int
-gx_install_DeviceGray(gs_color_space * pcs, gs_state * pgs)
+gx_install_DeviceGray(gs_color_space * pcs, gs_gstate * pgs)
{
/* If we already have profile data installed, nothing to do here. */
if (pcs->cmm_icc_profile_data != NULL)
@@ -347,7 +347,7 @@ void rc_decrement_only_cs(gs_color_space *pcs, const char *cname)
}
}
-void cs_adjust_counts_icc(gs_state *pgs, int delta)
+void cs_adjust_counts_icc(gs_gstate *pgs, int delta)
{
gs_color_space *pcs = gs_currentcolorspace_inline(pgs);
@@ -360,14 +360,14 @@ void cs_adjust_counts_icc(gs_state *pgs, int delta)
/* Null color space installation procedure. */
int
-gx_no_install_cspace(gs_color_space * pcs, gs_state * pgs)
+gx_no_install_cspace(gs_color_space * pcs, gs_gstate * pgs)
{
return 0;
}
/* Install a DeviceRGB color space. */
static int
-gx_install_DeviceRGB(gs_color_space * pcs, gs_state * pgs)
+gx_install_DeviceRGB(gs_color_space * pcs, gs_gstate * pgs)
{
/* If we already have profile_data, nothing to do here. */
if (pcs->cmm_icc_profile_data != NULL)
@@ -386,7 +386,7 @@ gx_install_DeviceRGB(gs_color_space * pcs, gs_state * pgs)
/* Install a DeviceCMYK color space. */
static int
-gx_install_DeviceCMYK(gs_color_space * pcs, gs_state * pgs)
+gx_install_DeviceCMYK(gs_color_space * pcs, gs_gstate * pgs)
{
/* If we already have profile data, nothing to do here. */
if (pcs->cmm_icc_profile_data != NULL)
@@ -414,17 +414,16 @@ gx_install_DeviceCMYK(gs_color_space * pcs, gs_state * pgs)
* special verson that supports overprint mode.
*/
int
-gx_spot_colors_set_overprint(const gs_color_space * pcs, gs_state * pgs)
+gx_spot_colors_set_overprint(const gs_color_space * pcs, gs_gstate * pgs)
{
- gs_imager_state * pis = (gs_imager_state *)pgs;
gs_overprint_params_t params;
- if ((params.retain_any_comps = pis->overprint))
+ if ((params.retain_any_comps = pgs->overprint))
params.retain_spot_comps = true;
pgs->effective_overprint_mode = 0;
params.k_value = 0;
params.blendspot = false;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
/*
@@ -434,17 +433,16 @@ gx_spot_colors_set_overprint(const gs_color_space * pcs, gs_state * pgs)
* devices
*/
int
-gx_simulated_set_overprint(const gs_color_space * pcs, gs_state * pgs)
+gx_simulated_set_overprint(const gs_color_space * pcs, gs_gstate * pgs)
{
- gs_imager_state * pis = (gs_imager_state *)pgs;
gs_overprint_params_t params;
- if ((params.retain_any_comps = pis->overprint))
+ if ((params.retain_any_comps = pgs->overprint))
params.retain_spot_comps = true;
pgs->effective_overprint_mode = 0;
params.k_value = 0;
params.blendspot = true;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
static bool
@@ -615,7 +613,7 @@ check_rgb_color_model_comps(gx_device * dev)
* the set of drawn components.
*/
static int
-gx_set_overprint_DeviceCMYK(const gs_color_space * pcs, gs_state * pgs)
+gx_set_overprint_DeviceCMYK(const gs_color_space * pcs, gs_gstate * pgs)
{
gx_device * dev = pgs->device;
gx_device_color_info * pcinfo = (dev == 0 ? 0 : &dev->color_info);
@@ -643,7 +641,7 @@ gx_set_overprint_DeviceCMYK(const gs_color_space * pcs, gs_state * pgs)
overprinting is no longer previewed. We follow the same logic here.
If the source and destination ICC profiles do not match, then there is
effectively no overprinting enabled. This is bug 692433 */
-int gx_set_overprint_cmyk(const gs_color_space * pcs, gs_state * pgs)
+int gx_set_overprint_cmyk(const gs_color_space * pcs, gs_gstate * pgs)
{
gx_device * dev = pgs->device;
gx_device_color_info * pcinfo = (dev == 0 ? 0 : &dev->color_info);
@@ -737,14 +735,14 @@ int gx_set_overprint_cmyk(const gs_color_space * pcs, gs_state * pgs)
params.drawn_comps = drawn_comps;
params.k_value = 0;
params.blendspot = false;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
/* This is used for the case where we have an RGB based device, but we want
to simulate CMY overprinting. Color management is pretty much thrown out
the window when doing this. */
-int gx_set_overprint_rgb(const gs_color_space * pcs, gs_state * pgs)
+int gx_set_overprint_rgb(const gs_color_space * pcs, gs_gstate * pgs)
{
gx_device * dev = pgs->device;
gx_device_color_info * pcinfo = (dev == 0 ? 0 : &dev->color_info);
@@ -827,12 +825,12 @@ int gx_set_overprint_rgb(const gs_color_space * pcs, gs_state * pgs)
params.retain_any_comps = true;
params.retain_spot_comps = false;
params.drawn_comps = drawn_comps;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
/* A stub for a color mapping linearity check, when it is inapplicable. */
int
-gx_cspace_no_linear(const gs_color_space *cs, const gs_imager_state * pis,
+gx_cspace_no_linear(const gs_color_space *cs, const gs_gstate * pgs,
gx_device * dev,
const gs_client_color *c0, const gs_client_color *c1,
const gs_client_color *c2, const gs_client_color *c3,
@@ -842,10 +840,10 @@ gx_cspace_no_linear(const gs_color_space *cs, const gs_imager_state * pis,
}
static inline int
-cc2dc(const gs_color_space *cs, const gs_imager_state * pis, gx_device *dev,
+cc2dc(const gs_color_space *cs, const gs_gstate * pgs, gx_device *dev,
gx_device_color *dc, const gs_client_color *cc)
{
- return cs->type->remap_color(cc, cs, dc, pis, dev, gs_color_select_texture);
+ return cs->type->remap_color(cc, cs, dc, pgs, dev, gs_color_select_texture);
}
static inline void
@@ -909,7 +907,7 @@ is_dc_nearly_linear(const gx_device *dev, const gx_device_color *c,
/* Default color mapping linearity check, a 2-points case. */
static int
-gx_cspace_is_linear_in_line(const gs_color_space *cs, const gs_imager_state * pis,
+gx_cspace_is_linear_in_line(const gs_color_space *cs, const gs_gstate * pgs,
gx_device *dev,
const gs_client_color *c0, const gs_client_color *c1,
float smoothness)
@@ -920,20 +918,20 @@ gx_cspace_is_linear_in_line(const gs_color_space *cs, const gs_imager_state * pi
uchar ndev = dev->color_info.num_components;
int code;
- code = cc2dc(cs, pis, dev, &d[0], c0);
+ code = cc2dc(cs, pgs, dev, &d[0], c0);
if (code < 0)
return code;
- code = cc2dc(cs, pis, dev, &d[1], c1);
+ code = cc2dc(cs, pgs, dev, &d[1], c1);
if (code < 0)
return code;
interpolate_cc(&c01a, c0, c1, 0.3, n);
- code = cc2dc(cs, pis, dev, &d01a, &c01a);
+ code = cc2dc(cs, pgs, dev, &d01a, &c01a);
if (code < 0)
return code;
if (!is_dc_nearly_linear(dev, &d01a, &d[0], &d[1], 0.3, ndev, smoothness))
return 0;
interpolate_cc(&c01b, c0, c1, 0.7, n);
- code = cc2dc(cs, pis, dev, &d01b, &c01b);
+ code = cc2dc(cs, pgs, dev, &d01b, &c01b);
if (code < 0)
return code;
if (!is_dc_nearly_linear(dev, &d01b, &d[0], &d[1], 0.7, ndev, smoothness))
@@ -943,7 +941,7 @@ gx_cspace_is_linear_in_line(const gs_color_space *cs, const gs_imager_state * pi
/* Default color mapping linearity check, a triangle case. */
static int
-gx_cspace_is_linear_in_triangle(const gs_color_space *cs, const gs_imager_state * pis,
+gx_cspace_is_linear_in_triangle(const gs_color_space *cs, const gs_gstate * pgs,
gx_device *dev,
const gs_client_color *c0, const gs_client_color *c1,
const gs_client_color *c2, float smoothness)
@@ -962,39 +960,39 @@ gx_cspace_is_linear_in_triangle(const gs_color_space *cs, const gs_imager_state
int code;
- code = cc2dc(cs, pis, dev, &d[0], c0);
+ code = cc2dc(cs, pgs, dev, &d[0], c0);
if (code < 0)
return code;
- code = cc2dc(cs, pis, dev, &d[1], c1);
+ code = cc2dc(cs, pgs, dev, &d[1], c1);
if (code < 0)
return code;
- code = cc2dc(cs, pis, dev, &d[2], c2);
+ code = cc2dc(cs, pgs, dev, &d[2], c2);
if (code < 0)
return code;
interpolate_cc(&c01, c0, c1, 0.5, n);
- code = cc2dc(cs, pis, dev, &d01, &c01);
+ code = cc2dc(cs, pgs, dev, &d01, &c01);
if (code < 0)
return code;
if (!is_dc_nearly_linear(dev, &d01, &d[0], &d[1], 0.5, ndev, smoothness))
return 0;
interpolate_cc(&c012, c2, &c01, 2.0 / 3, n);
- code = cc2dc(cs, pis, dev, &d012, &c012);
+ code = cc2dc(cs, pgs, dev, &d012, &c012);
if (code < 0)
return code;
if (!is_dc_nearly_linear(dev, &d012, &d[2], &d01, 2.0 / 3, ndev, smoothness))
return 0;
interpolate_cc(&c12, c1, c2, 0.5, n);
- code = cc2dc(cs, pis, dev, &d12, &c12);
+ code = cc2dc(cs, pgs, dev, &d12, &c12);
if (code < 0)
return code;
if (!is_dc_nearly_linear(dev, &d12, &d[1], &d[2], 0.5, ndev, smoothness))
return 0;
interpolate_cc(&c20, c2, c0, 0.5, n);
- code = cc2dc(cs, pis, dev, &d20, &c20);
+ code = cc2dc(cs, pgs, dev, &d20, &c20);
if (code < 0)
return code;
if (!is_dc_nearly_linear(dev, &d20, &d[2], &d[0], 0.5, ndev, smoothness))
@@ -1004,7 +1002,7 @@ gx_cspace_is_linear_in_triangle(const gs_color_space *cs, const gs_imager_state
/* Default color mapping linearity check. */
int
-gx_cspace_is_linear_default(const gs_color_space *cs, const gs_imager_state * pis,
+gx_cspace_is_linear_default(const gs_color_space *cs, const gs_gstate * pgs,
gx_device *dev,
const gs_client_color *c0, const gs_client_color *c1,
const gs_client_color *c2, const gs_client_color *c3,
@@ -1017,13 +1015,13 @@ gx_cspace_is_linear_default(const gs_color_space *cs, const gs_imager_state * pi
if (dev->color_info.separable_and_linear != GX_CINFO_SEP_LIN)
return_error(gs_error_rangecheck);
if (c2 == NULL)
- return gx_cspace_is_linear_in_line(cs, pis, dev, c0, c1, smoothness);
- code = gx_cspace_is_linear_in_triangle(cs, pis, dev, c0, c1, c2, smoothness);
+ return gx_cspace_is_linear_in_line(cs, pgs, dev, c0, c1, smoothness);
+ code = gx_cspace_is_linear_in_triangle(cs, pgs, dev, c0, c1, c2, smoothness);
if (code <= 0)
return code;
if (c3 == NULL)
return 1;
- return gx_cspace_is_linear_in_triangle(cs, pis, dev, c1, c2, c3, smoothness);
+ return gx_cspace_is_linear_in_triangle(cs, pgs, dev, c1, c2, c3, smoothness);
}
/* Serialization. */
diff --git a/base/gscspace.h b/base/gscspace.h
index 17cc09e66..397cb03b5 100644
--- a/base/gscspace.h
+++ b/base/gscspace.h
@@ -133,9 +133,9 @@
*/
/* Opaque types for a graphics state stuff */
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gsicc_link_DEFINED
@@ -346,7 +346,7 @@ struct gs_color_space_s {
gs_color_space *gs_cspace_new_DeviceGray(gs_memory_t *mem);
gs_color_space *gs_cspace_new_DeviceRGB(gs_memory_t *mem);
gs_color_space *gs_cspace_new_DeviceCMYK(gs_memory_t *mem);
-gs_color_space *gs_cspace_new_ICC(gs_memory_t *pmem, gs_state * pgs,
+gs_color_space *gs_cspace_new_ICC(gs_memory_t *pmem, gs_gstate * pgs,
int components);
/* ------ Accessors ------ */
@@ -395,7 +395,7 @@ void rc_decrement_cs(gs_color_space *pcs, const char *cname);
void rc_decrement_only_cs(gs_color_space *pcs, const char *cname);
-void cs_adjust_counts_icc(gs_state *pgs, int delta);
+void cs_adjust_counts_icc(gs_gstate *pgs, int delta);
/* backwards compatibility */
#define gs_color_space_indexed_base_space(pcspace)\
diff --git a/base/gscssub.c b/base/gscssub.c
index bda54a010..6a29b8e6d 100644
--- a/base/gscssub.c
+++ b/base/gscssub.c
@@ -27,7 +27,7 @@
* for the Device* color spaces (previously, only CIEBased color spaces could
* be used for this purpose). */
int
-gs_setsubstitutecolorspace(gs_state *pgs, gs_color_space_index csi,
+gs_setsubstitutecolorspace(gs_gstate *pgs, gs_color_space_index csi,
const gs_color_space *pcs)
{
int index = (int)csi;
@@ -65,7 +65,7 @@ gs_setsubstitutecolorspace(gs_state *pgs, gs_color_space_index csi,
/* Possibly-substituted color space accessors. */
const gs_color_space *
-gs_current_DeviceGray_space(const gs_state *pgs)
+gs_current_DeviceGray_space(const gs_gstate *pgs)
{
const gs_color_space *pcs;
@@ -74,7 +74,7 @@ gs_current_DeviceGray_space(const gs_state *pgs)
pgs->shared->device_color_spaces.named.Gray : pcs);
}
const gs_color_space *
-gs_current_DeviceRGB_space(const gs_state *pgs)
+gs_current_DeviceRGB_space(const gs_gstate *pgs)
{
const gs_color_space *pcs;
@@ -83,7 +83,7 @@ gs_current_DeviceRGB_space(const gs_state *pgs)
pgs->shared->device_color_spaces.named.RGB : pcs);
}
const gs_color_space *
-gs_current_DeviceCMYK_space(const gs_state *pgs)
+gs_current_DeviceCMYK_space(const gs_gstate *pgs)
{
const gs_color_space *pcs;
@@ -94,7 +94,7 @@ gs_current_DeviceCMYK_space(const gs_state *pgs)
/* .currentsubstitutecolorspace */
const gs_color_space *
-gs_currentsubstitutecolorspace(const gs_state *pgs, gs_color_space_index csi)
+gs_currentsubstitutecolorspace(const gs_gstate *pgs, gs_color_space_index csi)
{
switch (csi) {
case gs_color_space_index_DeviceGray:
diff --git a/base/gscssub.h b/base/gscssub.h
index d73dfe6f5..478ee6f94 100644
--- a/base/gscssub.h
+++ b/base/gscssub.h
@@ -53,18 +53,18 @@
*/
/* If pcs is NULL, it means undo any substitution. */
-int gs_setsubstitutecolorspace(gs_state *pgs, gs_color_space_index csi,
+int gs_setsubstitutecolorspace(gs_gstate *pgs, gs_color_space_index csi,
const gs_color_space *pcs);
const gs_color_space *
- gs_currentsubstitutecolorspace(const gs_state *pgs,
+ gs_currentsubstitutecolorspace(const gs_gstate *pgs,
gs_color_space_index csi);
/*
* The following procedures are primarily for internal use, to provide
* fast access to specific color spaces.
*/
-const gs_color_space *gs_current_DeviceGray_space(const gs_state *pgs);
-const gs_color_space *gs_current_DeviceRGB_space(const gs_state *pgs);
-const gs_color_space *gs_current_DeviceCMYK_space(const gs_state *pgs);
+const gs_color_space *gs_current_DeviceGray_space(const gs_gstate *pgs);
+const gs_color_space *gs_current_DeviceRGB_space(const gs_gstate *pgs);
+const gs_color_space *gs_current_DeviceCMYK_space(const gs_gstate *pgs);
#endif /* gscssub_INCLUDED */
diff --git a/base/gsdevice.c b/base/gsdevice.c
index a8338e954..c812cc0e7 100644
--- a/base/gsdevice.c
+++ b/base/gsdevice.c
@@ -167,7 +167,7 @@ gx_device_set_procs(gx_device * dev)
/* Flush buffered output to the device */
int
-gs_flushpage(gs_state * pgs)
+gs_flushpage(gs_gstate * pgs)
{
gx_device *dev = gs_currentdevice(pgs);
@@ -176,18 +176,18 @@ gs_flushpage(gs_state * pgs)
/* Make the device output the accumulated page description */
int
-gs_copypage(gs_state * pgs)
+gs_copypage(gs_gstate * pgs)
{
return gs_output_page(pgs, 1, 0);
}
int
-gs_output_page(gs_state * pgs, int num_copies, int flush)
+gs_output_page(gs_gstate * pgs, int num_copies, int flush)
{
gx_device *dev = gs_currentdevice(pgs);
cmm_dev_profile_t *dev_profile;
int code;
- /* for devices that hook 'fill_path' in order to pick up imager state */
+ /* for devices that hook 'fill_path' in order to pick up gs_gstate */
/* values such as dev_ht (such as tiffsep1), make a dummy call here */
/* to make sure that it has been called at least once */
code = gs_gsave(pgs);
@@ -260,7 +260,7 @@ gs_copyscanlines(gx_device * dev, int start_y, byte * data, uint size,
/* Get the current device from the graphics state. */
gx_device *
-gs_currentdevice(const gs_state * pgs)
+gs_currentdevice(const gs_gstate * pgs)
{
return pgs->device;
}
@@ -462,36 +462,33 @@ gs_opendevice(gx_device *dev)
}
}
-/* Set device parameters, updating a graphics state or imager state. */
-int
-gs_imager_putdeviceparams(gs_imager_state *pis, gx_device *dev,
- gs_param_list *plist)
-{
- int code = gs_putdeviceparams(dev, plist);
-
- if (code >= 0)
- gx_set_cmap_procs(pis, dev);
- return code;
-}
static void
-gs_state_update_device(gs_state *pgs)
+gs_gstate_update_device(gs_gstate *pgs, gx_device *dev)
{
- gx_set_cmap_procs((gs_imager_state *)pgs, pgs->device);
+ gx_set_cmap_procs(pgs, dev);
gx_unset_dev_color(pgs);
}
+
int
-gs_state_putdeviceparams(gs_state *pgs, gs_param_list *plist)
+gs_gstate_putdeviceparams(gs_gstate *pgs, gx_device *dev, gs_param_list *plist)
{
- int code = gs_putdeviceparams(pgs->device, plist);
+ int code;
+ gx_device *dev2;
+
+ if (dev)
+ dev2 = dev;
+ else
+ dev2 = pgs->device;
+ code = gs_putdeviceparams(dev2, plist);
if (code >= 0)
- gs_state_update_device(pgs);
+ gs_gstate_update_device(pgs, dev2);
return code;
}
/* Set the device in the graphics state */
int
-gs_setdevice(gs_state * pgs, gx_device * dev)
+gs_setdevice(gs_gstate * pgs, gx_device * dev)
{
int code = gs_setdevice_no_erase(pgs, dev);
@@ -500,7 +497,7 @@ gs_setdevice(gs_state * pgs, gx_device * dev)
return code;
}
int
-gs_setdevice_no_erase(gs_state * pgs, gx_device * dev)
+gs_setdevice_no_erase(gs_gstate * pgs, gx_device * dev)
{
int open_code = 0, code;
gs_lib_ctx_t *libctx = gs_lib_ctx_get_interp_instance(pgs->memory);
@@ -582,7 +579,7 @@ gs_setdevice_no_erase(gs_state * pgs, gx_device * dev)
return open_code;
}
int
-gs_setdevice_no_init(gs_state * pgs, gx_device * dev)
+gs_setdevice_no_init(gs_gstate * pgs, gx_device * dev)
{
/*
* Just set the device, possibly changing color space but no other
@@ -604,7 +601,7 @@ gs_setdevice_no_init(gs_state * pgs, gx_device * dev)
return code;
}
rc_assign(pgs->device, dev, "gs_setdevice_no_init");
- gs_state_update_device(pgs);
+ gs_gstate_update_device(pgs, dev);
return pgs->overprint ? gs_do_set_overprint(pgs) : 0;
}
@@ -680,7 +677,7 @@ gx_device_retain(gx_device *dev, bool retained)
/* Select a null device. */
int
-gs_nulldevice(gs_state * pgs)
+gs_nulldevice(gs_gstate * pgs)
{
if (pgs->device == 0 || !gx_device_is_null(pgs->device)) {
gx_device *ndev;
@@ -732,7 +729,7 @@ gs_closedevice(gx_device * dev)
* (For internal use only.)
*/
void
-gx_set_device_only(gs_state * pgs, gx_device * dev)
+gx_set_device_only(gs_gstate * pgs, gx_device * dev)
{
rc_assign(pgs->device, dev, "gx_set_device_only");
}
diff --git a/base/gsdevice.h b/base/gsdevice.h
index 51bcfc1bc..42331ed44 100644
--- a/base/gsdevice.h
+++ b/base/gsdevice.h
@@ -91,38 +91,36 @@ int gs_get_device_or_hw_params(gx_device *, gs_param_list *, bool);
int gs_putdeviceparams(gx_device *, gs_param_list *);
int gs_closedevice(gx_device *);
-/* Device procedures involving an imager state. */
+/* Device procedures involving an gs_gstate. */
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
-int gs_imager_putdeviceparams(gs_imager_state *pis, gx_device *dev,
- gs_param_list *plist);
+int gs_gstate_putdeviceparams(gs_gstate *pgs, gx_device *dev,
+gs_param_list *plist);
/* Device procedures involving a graphics state. */
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
-int gs_flushpage(gs_state *);
-int gs_copypage(gs_state *);
-int gs_output_page(gs_state *, int, int);
-int gs_nulldevice(gs_state *);
-int gs_setdevice(gs_state *, gx_device *);
-int gs_setdevice_no_erase(gs_state *, gx_device *); /* returns 1 */
+int gs_flushpage(gs_gstate *);
+int gs_copypage(gs_gstate *);
+int gs_output_page(gs_gstate *, int, int);
+int gs_nulldevice(gs_gstate *);
+int gs_setdevice(gs_gstate *, gx_device *);
+int gs_setdevice_no_erase(gs_gstate *, gx_device *); /* returns 1 */
/* if erasepage required */
-int gs_setdevice_no_init(gs_state *, gx_device *);
-gx_device *gs_currentdevice(const gs_state *);
+int gs_setdevice_no_init(gs_gstate *, gx_device *);
+gx_device *gs_currentdevice(const gs_gstate *);
/* gzstate.h redefines the following: */
#ifndef gs_currentdevice_inline
# define gs_currentdevice_inline(pgs) gs_currentdevice(pgs)
#endif
-int gs_state_putdeviceparams(gs_state *pgs, gs_param_list *plist);
-
#endif /* gsdevice_INCLUDED */
diff --git a/base/gsdfilt.c b/base/gsdfilt.c
index 2a9247046..dc6ab1118 100644
--- a/base/gsdfilt.c
+++ b/base/gsdfilt.c
@@ -46,7 +46,7 @@ gs_public_st_simple(st_gs_device_filter, gs_device_filter_t,
"gs_device_filter");
int
-gs_push_device_filter(gs_memory_t *mem, gs_state *pgs, gs_device_filter_t *df)
+gs_push_device_filter(gs_memory_t *mem, gs_gstate *pgs, gs_device_filter_t *df)
{
gs_device_filter_stack_t *dfs;
gx_device *new_dev = NULL;
@@ -73,7 +73,7 @@ gs_push_device_filter(gs_memory_t *mem, gs_state *pgs, gs_device_filter_t *df)
}
int
-gs_pop_device_filter(gs_memory_t *mem, gs_state *pgs)
+gs_pop_device_filter(gs_memory_t *mem, gs_gstate *pgs)
{
gs_device_filter_stack_t *dfs_tos = pgs->dfilter_stack;
gx_device *tos_device = pgs->device;
@@ -96,7 +96,7 @@ gs_pop_device_filter(gs_memory_t *mem, gs_state *pgs)
}
int
-gs_clear_device_filters(gs_memory_t *mem, gs_state *pgs)
+gs_clear_device_filters(gs_memory_t *mem, gs_gstate *pgs)
{
int code;
diff --git a/base/gsdfilt.h b/base/gsdfilt.h
index 033c5174f..64ff3f03c 100644
--- a/base/gsdfilt.h
+++ b/base/gsdfilt.h
@@ -17,7 +17,7 @@
#ifndef gsdfilt_INCLUDED
# define gsdfilt_INCLUDED
-/* The device filter stack lives in the gs_state structure. It represents
+/* The device filter stack lives in the gs_gstate structure. It represents
a chained sequence of devices that filter device requests, each forwarding
to its target. The last such target is the physical device as set by
setpagedevice.
@@ -38,11 +38,11 @@ typedef struct gs_device_filter_s gs_device_filter_t;
#endif
struct gs_device_filter_s {
- int (*push)(gs_device_filter_t *self, gs_memory_t *mem, gs_state *pgs,
+ int (*push)(gs_device_filter_t *self, gs_memory_t *mem, gs_gstate *pgs,
gx_device **pdev, gx_device *target);
- int (*prepop)(gs_device_filter_t *self, gs_memory_t *mem, gs_state *pgs,
+ int (*prepop)(gs_device_filter_t *self, gs_memory_t *mem, gs_gstate *pgs,
gx_device *dev);
- int (*postpop)(gs_device_filter_t *self, gs_memory_t *mem, gs_state *pgs,
+ int (*postpop)(gs_device_filter_t *self, gs_memory_t *mem, gs_gstate *pgs,
gx_device *dev);
};
@@ -58,7 +58,7 @@ extern_st(st_gs_device_filter);
*
* Return value: 0 on success, or error code.
**/
-int gs_push_device_filter(gs_memory_t *mem, gs_state *pgs, gs_device_filter_t *df);
+int gs_push_device_filter(gs_memory_t *mem, gs_gstate *pgs, gs_device_filter_t *df);
/**
* gs_pop_device_filter: Pop a device filter.
@@ -70,7 +70,7 @@ int gs_push_device_filter(gs_memory_t *mem, gs_state *pgs, gs_device_filter_t *d
*
* Return value: 0 on success, or error code.
**/
-int gs_pop_device_filter(gs_memory_t *mem, gs_state *pgs);
+int gs_pop_device_filter(gs_memory_t *mem, gs_gstate *pgs);
/**
* gs_clear_device_filters: Clear device filters from a graphics state.
@@ -81,6 +81,6 @@ int gs_pop_device_filter(gs_memory_t *mem, gs_state *pgs);
*
* Return value: 0 on success, or error code.
**/
-int gs_clear_device_filters(gs_memory_t *mem, gs_state *pgs);
+int gs_clear_device_filters(gs_memory_t *mem, gs_gstate *pgs);
#endif /* gsdfilt_INCLUDED */
diff --git a/base/gsdps.c b/base/gsdps.c
index 687826747..b07155ef9 100644
--- a/base/gsdps.c
+++ b/base/gsdps.c
@@ -27,10 +27,10 @@
/* ---------------- View clipping ---------------- */
/* Forward references */
-static int common_viewclip(gs_state *, int);
+static int common_viewclip(gs_gstate *, int);
int
-gs_initviewclip(gs_state * pgs)
+gs_initviewclip(gs_gstate * pgs)
{
gx_clip_path *pcpath = pgs->view_clip;
@@ -42,13 +42,13 @@ gs_initviewclip(gs_state * pgs)
}
int
-gs_viewclip(gs_state * pgs)
+gs_viewclip(gs_gstate * pgs)
{
return common_viewclip(pgs, gx_rule_winding_number);
}
int
-gs_eoviewclip(gs_state * pgs)
+gs_eoviewclip(gs_gstate * pgs)
{
return common_viewclip(pgs, gx_rule_even_odd);
}
@@ -56,7 +56,7 @@ gs_eoviewclip(gs_state * pgs)
/* This code is (almost) copied from common_clip in gspath.c. */
/* Someday we'll find a way to merge them. */
static int
-common_viewclip(gs_state * pgs, int rule)
+common_viewclip(gs_gstate * pgs, int rule)
{
gs_fixed_rect bbox;
gx_clip_path rpath;
@@ -86,7 +86,7 @@ common_viewclip(gs_state * pgs, int rule)
}
int
-gs_viewclippath(gs_state * pgs)
+gs_viewclippath(gs_gstate * pgs)
{
gx_path cpath;
gx_clip_path *pcpath = pgs->view_clip;
diff --git a/base/gsdps.h b/base/gsdps.h
index 4296e9295..998082440 100644
--- a/base/gsdps.h
+++ b/base/gsdps.h
@@ -23,9 +23,9 @@
#include "gsiparm2.h"
/* View clipping */
-int gs_initviewclip(gs_state *);
-int gs_eoviewclip(gs_state *);
-int gs_viewclip(gs_state *);
-int gs_viewclippath(gs_state *);
+int gs_initviewclip(gs_gstate *);
+int gs_eoviewclip(gs_gstate *);
+int gs_viewclip(gs_gstate *);
+int gs_viewclippath(gs_gstate *);
#endif /* gsdps_INCLUDED */
diff --git a/base/gsdps1.c b/base/gsdps1.c
index 8c388b04f..ed7155b89 100644
--- a/base/gsdps1.c
+++ b/base/gsdps1.c
@@ -49,7 +49,7 @@
/* Set the bounding box for the current path. */
int
-gs_setbbox(gs_state * pgs, double llx, double lly, double urx, double ury)
+gs_setbbox(gs_gstate * pgs, double llx, double lly, double urx, double ury)
{
gs_rect ubox, dbox;
gs_fixed_rect obox, bbox;
@@ -98,7 +98,7 @@ gs_setbbox(gs_state * pgs, double llx, double lly, double urx, double ury)
/* Append a list of rectangles to a path. */
static int
-gs_rectappend_compat(gs_state * pgs, const gs_rect * pr, uint count, bool clip)
+gs_rectappend_compat(gs_gstate * pgs, const gs_rect * pr, uint count, bool clip)
{
bool CPSI_mode = gs_currentcpsimode(pgs->memory);
@@ -156,14 +156,14 @@ gs_rectappend_compat(gs_state * pgs, const gs_rect * pr, uint count, bool clip)
return 0;
}
int
-gs_rectappend(gs_state * pgs, const gs_rect * pr, uint count)
+gs_rectappend(gs_gstate * pgs, const gs_rect * pr, uint count)
{
return gs_rectappend_compat(pgs, pr, count, false);
}
/* Clip to a list of rectangles. */
int
-gs_rectclip(gs_state * pgs, const gs_rect * pr, uint count)
+gs_rectclip(gs_gstate * pgs, const gs_rect * pr, uint count)
{
int code;
gx_path save;
@@ -185,7 +185,7 @@ gs_rectclip(gs_state * pgs, const gs_rect * pr, uint count)
/* Fill a list of rectangles. */
/* We take the trouble to do this efficiently in the simple cases. */
int
-gs_rectfill(gs_state * pgs, const gs_rect * pr, uint count)
+gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
{
const gs_rect *rlist = pr;
gx_clip_path *pcpath;
@@ -193,8 +193,8 @@ gs_rectfill(gs_state * pgs, const gs_rect * pr, uint count)
int code;
gx_device * pdev = pgs->device;
gx_device_color *pdc = gs_currentdevicecolor_inline(pgs);
- const gs_imager_state *pis = (const gs_imager_state *)pgs;
- bool hl_color_available = gx_hld_is_hl_color_available(pis, pdc);
+ const gs_gstate *pgs2 = (const gs_gstate *)pgs;
+ bool hl_color_available = gx_hld_is_hl_color_available(pgs2, pdc);
bool hl_color = (hl_color_available &&
dev_proc(pdev, dev_spec_op)(pdev, gxdso_supports_hlcolor,
NULL, 0));
@@ -214,7 +214,7 @@ gs_rectfill(gs_state * pgs, const gs_rect * pr, uint count)
pdc->type == gx_dc_type_pure ||
pdc->type == gx_dc_type_ht_binary ||
pdc->type == gx_dc_type_ht_colored) &&
- gs_state_color_load(pgs) >= 0 &&
+ gs_gstate_color_load(pgs) >= 0 &&
(*dev_proc(pdev, get_alpha_bits)) (pdev, go_graphics)
<= 1 &&
(!pgs->overprint || !pgs->effective_overprint_mode)
@@ -251,7 +251,7 @@ gs_rectfill(gs_state * pgs, const gs_rect * pr, uint count)
if (draw_rect.p.x <= draw_rect.q.x &&
draw_rect.p.y <= draw_rect.q.y) {
code = dev_proc(pdev, fill_rectangle_hl_color)(pdev,
- &draw_rect, pis, pdc, pcpath);
+ &draw_rect, pgs2, pdc, pcpath);
if (code < 0)
return code;
}
@@ -317,7 +317,7 @@ gs_rectfill(gs_state * pgs, const gs_rect * pr, uint count)
/* Stroke a list of rectangles. */
/* (We could do this a lot more efficiently.) */
int
-gs_rectstroke(gs_state * pgs, const gs_rect * pr, uint count,
+gs_rectstroke(gs_gstate * pgs, const gs_rect * pr, uint count,
const gs_matrix * pmat)
{
bool do_save = pmat != NULL || !gx_path_is_null(pgs->path);
diff --git a/base/gsequivc.c b/base/gsequivc.c
index abbb37db0..dcabe81a8 100644
--- a/base/gsequivc.c
+++ b/base/gsequivc.c
@@ -60,7 +60,7 @@
* do the following:
* a. Create a copy of the color space and change the copy so that it
* uses its alternate colorspace.
- * b. Create a copy of the current imager state and modify its color
+ * b. Create a copy of the current gs_gstate and modify its color
* mapping (cmap) procs to use a special set of 'capture' procs.
* c. Based upon the type of color space (Separation or DeviceN) create
* a 'color' which consists of the desired spot color set to 100% and
@@ -111,7 +111,7 @@
static void
update_Separation_spot_equivalent_cmyk_colors(gx_device * pdev,
- const gs_state * pgs, const gs_color_space * pcs,
+ const gs_gstate * pgs, const gs_color_space * pcs,
gs_devn_params * pdevn_params,
equivalent_cmyk_color_params * pparams)
{
@@ -154,7 +154,7 @@ update_Separation_spot_equivalent_cmyk_colors(gx_device * pdev,
may exist in a DeviceN output ICC profile */
static int
update_ICC_spot_equivalent_cmyk_colors(gx_device * pdev,
- const gs_state * pgs, const gs_color_space * pcs,
+ const gs_gstate * pgs, const gs_color_space * pcs,
gs_devn_params * pdevn_params,
equivalent_cmyk_color_params * pparams)
{
@@ -204,7 +204,7 @@ update_ICC_spot_equivalent_cmyk_colors(gx_device * pdev,
static void
update_DeviceN_spot_equivalent_cmyk_colors(gx_device * pdev,
- const gs_state * pgs, const gs_color_space * pcs,
+ const gs_gstate * pgs, const gs_color_space * pcs,
gs_devn_params * pdevn_params,
equivalent_cmyk_color_params * pparams)
{
@@ -285,7 +285,7 @@ static bool check_all_colors_known(int num_spot,
/* If possible, update the equivalent CMYK color for a spot color */
int
-update_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_state * pgs,
+update_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
gs_devn_params * pdevn_params, equivalent_cmyk_color_params * pparams)
{
const gs_color_space * pcs;
@@ -385,7 +385,7 @@ static const gx_color_map_procs cmap_capture_cmyk_color = {
static void
cmap_gray_capture_cmyk_color(frac gray, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
equivalent_cmyk_color_params * pparams =
((color_capture_device *)dev)->pequiv_cmyk_colors;
@@ -399,20 +399,20 @@ cmap_gray_capture_cmyk_color(frac gray, gx_device_color * pdc,
static void
cmap_rgb_capture_cmyk_color(frac r, frac g, frac b, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
equivalent_cmyk_color_params * pparams =
((color_capture_device *)dev)->pequiv_cmyk_colors;
int sep_num = ((color_capture_device *)dev)->sep_num;
frac cmyk[4];
- color_rgb_to_cmyk(r, g, b, pis, cmyk, dev->memory);
+ color_rgb_to_cmyk(r, g, b, pgs, cmyk, dev->memory);
save_spot_equivalent_cmyk_color(sep_num, pparams, cmyk);
}
static void
cmap_cmyk_capture_cmyk_color(frac c, frac m, frac y, frac k, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select,
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select,
const gs_color_space *pcs)
{
equivalent_cmyk_color_params * pparams =
@@ -429,17 +429,17 @@ cmap_cmyk_capture_cmyk_color(frac c, frac m, frac y, frac k, gx_device_color * p
static void
cmap_rgb_alpha_capture_cmyk_color(frac r, frac g, frac b, frac alpha,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
- cmap_rgb_capture_cmyk_color(r, g, b, pdc, pis, dev, select);
+ cmap_rgb_capture_cmyk_color(r, g, b, pdc, pgs, dev, select);
}
static void
cmap_separation_capture_cmyk_color(frac all, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
- dmprintf(pis->memory, "cmap_separation_capture_cmyk_color - this routine should not be executed\n");
+ dmprintf(pgs->memory, "cmap_separation_capture_cmyk_color - this routine should not be executed\n");
}
/* The call to this is actually going to occur if we happen to be using a
@@ -448,7 +448,7 @@ cmap_separation_capture_cmyk_color(frac all, gx_device_color * pdc,
go ahead and just grab the cmyk portion */
static void
cmap_devicen_capture_cmyk_color(const frac * pcc, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
equivalent_cmyk_color_params * pparams =
((color_capture_device *)dev)->pequiv_cmyk_colors;
@@ -462,11 +462,11 @@ cmap_devicen_capture_cmyk_color(const frac * pcc, gx_device_color * pdc,
* alternate color space.
*/
void
-capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_state * pgs,
+capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
const gs_client_color * pcc, const gs_color_space * pcs,
int sep_num, equivalent_cmyk_color_params * pparams)
{
- gs_imager_state temp_state = *((const gs_imager_state *)pgs);
+ gs_gstate temp_state = *((const gs_gstate *)pgs);
color_capture_device temp_device = { 0 };
gx_device_color dev_color;
gsicc_rendering_param_t render_cond;
@@ -525,7 +525,7 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_state * pgs,
set_dev_proc(&temp_device, get_profile, gx_default_get_profile);
/*
- * Create a temp copy of the imager state. We do this so that we
+ * Create a temp copy of the gs_gstate. We do this so that we
* can modify the color space mapping (cmap) procs. We use our
* replacment procs to capture the color. The installation of a
* Separation or DeviceN color space also sets a use_alt_cspace flag
@@ -542,7 +542,7 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_state * pgs,
/* Used for detecting if we are trying to find the equivalant color during
named color replacement */
bool
-named_color_equivalent_cmyk_colors(const gs_imager_state * pis)
+named_color_equivalent_cmyk_colors(const gs_gstate * pgs)
{
- return pis->cmap_procs == &cmap_capture_cmyk_color;
+ return pgs->cmap_procs == &cmap_capture_cmyk_color;
}
diff --git a/base/gsequivc.h b/base/gsequivc.h
index 7a7a1e5ac..56b6c05b8 100644
--- a/base/gsequivc.h
+++ b/base/gsequivc.h
@@ -49,7 +49,7 @@ typedef struct equivalent_cmyk_color_params_s {
* If possible, update the equivalent CMYK color for spot colors.
*/
int update_spot_equivalent_cmyk_colors(gx_device * pdev,
- const gs_state * pgs, gs_devn_params * pdevn_params,
+ const gs_gstate * pgs, gs_devn_params * pdevn_params,
equivalent_cmyk_color_params * pparams);
/*
@@ -57,12 +57,12 @@ int update_spot_equivalent_cmyk_colors(gx_device * pdev,
* color space.
*/
void capture_spot_equivalent_cmyk_colors(gx_device * pdev,
- const gs_state * pgs, const gs_client_color * pcc,
+ const gs_gstate * pgs, const gs_client_color * pcc,
const gs_color_space * pcs, int sep_num,
equivalent_cmyk_color_params * pparams);
/* Used in named color replacement to detect that we are doing the equivalent
computation */
-bool named_color_equivalent_cmyk_colors(const gs_imager_state * pis);
+bool named_color_equivalent_cmyk_colors(const gs_gstate * pgs);
#endif /* define gsequivc_INCLUDED */
diff --git a/base/gsfont.c b/base/gsfont.c
index cf674684c..2c69aa89f 100644
--- a/base/gsfont.c
+++ b/base/gsfont.c
@@ -599,7 +599,7 @@ gs_makefont(gs_font_dir * pdir, const gs_font * pfont,
/* Set the current font. This is provided only for the benefit of cshow, */
/* which must reset the current font without disturbing the root font. */
void
-gs_set_currentfont(gs_state * pgs, gs_font * pfont)
+gs_set_currentfont(gs_gstate * pgs, gs_font * pfont)
{
pgs->font = pfont;
pgs->char_tm_valid = false;
@@ -607,7 +607,7 @@ gs_set_currentfont(gs_state * pgs, gs_font * pfont)
/* setfont */
int
-gs_setfont(gs_state * pgs, gs_font * pfont)
+gs_setfont(gs_gstate * pgs, gs_font * pfont)
{
pgs->font = pgs->root_font = pfont;
pgs->char_tm_valid = false;
@@ -616,14 +616,14 @@ gs_setfont(gs_state * pgs, gs_font * pfont)
/* currentfont */
gs_font *
-gs_currentfont(const gs_state * pgs)
+gs_currentfont(const gs_gstate * pgs)
{
return pgs->font;
}
/* rootfont */
gs_font *
-gs_rootfont(const gs_state * pgs)
+gs_rootfont(const gs_gstate * pgs)
{
return pgs->root_font;
}
@@ -643,7 +643,7 @@ gs_cachestatus(register const gs_font_dir * pdir, register uint pstat[7])
/* setcacheparams */
int
-gs_setcachesize(gs_state * pgs, gs_font_dir * pdir, uint size)
+gs_setcachesize(gs_gstate * pgs, gs_font_dir * pdir, uint size)
{
gs_memory_t *stable_mem = pdir->memory->stable_memory;
if (size < 100000) /* limits derived from CPSI emulation (CET 27-07) */
diff --git a/base/gsfont.h b/base/gsfont.h
index d9cb81288..f89f1a78e 100644
--- a/base/gsfont.h
+++ b/base/gsfont.h
@@ -65,10 +65,10 @@ int gs_font_find_similar(const gs_font_dir * pdir, const gs_font **ppfont,
/* was already in the cache, 1 if a new font was created. */
int gs_scalefont(gs_font_dir *, const gs_font *, double, gs_font **);
int gs_makefont(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
-int gs_setfont(gs_state *, gs_font *);
-gs_font *gs_currentfont(const gs_state *);
-gs_font *gs_rootfont(const gs_state *);
-void gs_set_currentfont(gs_state *, gs_font *);
+int gs_setfont(gs_gstate *, gs_font *);
+gs_font *gs_currentfont(const gs_gstate *);
+gs_font *gs_rootfont(const gs_gstate *);
+void gs_set_currentfont(gs_gstate *, gs_font *);
int gs_purge_font(gs_font *);
/* Locate a gs_font by gs_id. */
gs_font *gs_find_font_by_id(gs_font_dir *pdir, gs_id id, gs_matrix *FontMatrix);
@@ -78,7 +78,7 @@ void gs_cachestatus(const gs_font_dir *, uint[7]);
#define gs_setcachelimit(pdir,limit) gs_setcacheupper(pdir,limit)
uint gs_currentcachesize(const gs_font_dir *);
-int gs_setcachesize(gs_state * pgs, gs_font_dir *, uint);
+int gs_setcachesize(gs_gstate * pgs, gs_font_dir *, uint);
uint gs_currentcachelower(const gs_font_dir *);
int gs_setcachelower(gs_font_dir *, uint);
uint gs_currentcacheupper(const gs_font_dir *);
diff --git a/base/gsgstate.c b/base/gsgstate.c
new file mode 100644
index 000000000..00e14f971
--- /dev/null
+++ b/base/gsgstate.c
@@ -0,0 +1,254 @@
+/* Copyright (C) 2001-2012 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
+ CA 94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+
+/* gs_gstate housekeeping */
+#include "gx.h"
+#include "gserrors.h"
+#include "gscspace.h"
+#include "gscie.h"
+#include "gsstruct.h"
+#include "gsutil.h" /* for gs_next_ids */
+#include "gxbitmap.h"
+#include "gxcmap.h"
+#include "gxdht.h"
+#include "gxgstate.h"
+#include "gzht.h"
+#include "gzline.h"
+#include "gxfmap.h"
+#include "gsicc_cache.h"
+#include "gsicc_manage.h"
+#include "gsicc_profilecache.h"
+
+/******************************************************************************
+ * See gsstate.c for a discussion of graphics state memory management. *
+ ******************************************************************************/
+
+/* Imported values */
+/* The following should include a 'const', but for some reason */
+/* the Watcom compiler won't accept it, even though it happily accepts */
+/* the same construct everywhere else. */
+extern /*const*/ gx_color_map_procs *const cmap_procs_default;
+
+/* GC procedures for gx_line_params */
+static
+ENUM_PTRS_WITH(line_params_enum_ptrs, gx_line_params *plp) return 0;
+ case 0: return ENUM_OBJ((plp->dash.pattern_size == 0 ?
+ NULL : plp->dash.pattern));
+ENUM_PTRS_END
+static RELOC_PTRS_WITH(line_params_reloc_ptrs, gx_line_params *plp)
+{
+ if (plp->dash.pattern_size)
+ RELOC_VAR(plp->dash.pattern);
+} RELOC_PTRS_END
+private_st_line_params();
+
+/*
+ * GC procedures for gs_gstate
+ *
+ * See comments in gixstate.h before the definition of gs_cr_state_do_rc and
+ * st_cr_state_num_ptrs for an explanation about why the effective_transfer
+ * pointers are handled in this manner.
+ */
+public_st_gs_gstate();
+static
+ENUM_PTRS_WITH(gs_gstate_enum_ptrs, gs_gstate *gisvptr)
+ ENUM_SUPER(gs_gstate, st_line_params, line_params, st_gs_gstate_num_ptrs - st_line_params_num_ptrs);
+#define e1(i,elt) ENUM_PTR(i,gs_gstate,elt);
+ gs_gstate_do_ptrs(e1)
+#undef e1
+#define E1(i,elt) ENUM_PTR(i + gs_gstate_num_ptrs,gs_gstate,elt);
+ gs_cr_state_do_ptrs(E1)
+#undef E1
+ case (gs_gstate_num_ptrs + st_cr_state_num_ptrs): /* handle device specially */
+ ENUM_RETURN(gx_device_enum_ptr(gisvptr->device));
+ case (gs_gstate_num_ptrs + st_cr_state_num_ptrs + 1): /* handle device filter stack specially */
+ ENUM_RETURN(gisvptr->dfilter_stack);
+ENUM_PTRS_END
+
+static RELOC_PTRS_WITH(gs_gstate_reloc_ptrs, gs_gstate *gisvptr)
+{
+ RELOC_SUPER(gs_gstate, st_line_params, line_params);
+#define r1(i,elt) RELOC_PTR(gs_gstate,elt);
+ gs_gstate_do_ptrs(r1)
+#undef r1
+#define R1(i,elt) RELOC_PTR(gs_gstate,elt);
+ gs_cr_state_do_ptrs(R1)
+#undef R1
+
+ gisvptr->device = gx_device_reloc_ptr(gisvptr->device, gcst);
+ RELOC_PTR(gs_gstate, dfilter_stack);
+ {
+ int i = GX_DEVICE_COLOR_MAX_COMPONENTS - 1;
+
+ for (; i >= 0; i--)
+ RELOC_PTR(gs_gstate, effective_transfer[i]);
+ }
+} RELOC_PTRS_END
+
+/* Initialize an gs_gstate, other than the parts covered by */
+/* GS_STATE_INIT_VALUES(). */
+int
+gs_gstate_initialize(gs_gstate * pgs, gs_memory_t * mem)
+{
+ int i;
+ pgs->memory = mem;
+ pgs->client_data = 0;
+ pgs->trans_device = 0;
+ /* Color rendering state */
+ pgs->halftone = 0;
+ {
+ int i;
+
+ for (i = 0; i < gs_color_select_count; ++i)
+ pgs->screen_phase[i].x = pgs->screen_phase[i].y = 0;
+ }
+ pgs->dev_ht = 0;
+ pgs->cie_render = 0;
+ pgs->cie_to_xyz = false;
+ pgs->black_generation = 0;
+ pgs->undercolor_removal = 0;
+ /* Allocate an initial transfer map. */
+ rc_alloc_struct_n(pgs->set_transfer.gray,
+ gx_transfer_map, &st_transfer_map,
+ mem, return_error(gs_error_VMerror),
+ "gs_gstate_init(transfer)", 1);
+ pgs->set_transfer.gray->proc = gs_identity_transfer;
+ pgs->set_transfer.gray->id = gs_next_ids(pgs->memory, 1);
+ pgs->set_transfer.gray->values[0] = frac_0;
+ pgs->set_transfer.red =
+ pgs->set_transfer.green =
+ pgs->set_transfer.blue = NULL;
+ for (i = 0; i < GX_DEVICE_COLOR_MAX_COMPONENTS; i++)
+ pgs->effective_transfer[i] = pgs->set_transfer.gray;
+ pgs->cie_joint_caches = NULL;
+ pgs->cie_joint_caches_alt = NULL;
+ pgs->cmap_procs = cmap_procs_default;
+ pgs->pattern_cache = NULL;
+ pgs->have_pattern_streams = false;
+ pgs->devicergb_cs = gs_cspace_new_DeviceRGB(mem);
+ pgs->devicecmyk_cs = gs_cspace_new_DeviceCMYK(mem);
+ pgs->icc_link_cache = gsicc_cache_new(pgs->memory);
+ pgs->icc_manager = gsicc_manager_new(pgs->memory);
+ pgs->icc_profile_cache = gsicc_profilecache_new(pgs->memory);
+#if ENABLE_CUSTOM_COLOR_CALLBACK
+ pgs->custom_color_callback = INIT_CUSTOM_COLOR_PTR;
+#endif
+ return 0;
+}
+
+/*
+ * Make a temporary copy of a gs_gstate. Note that this does not
+ * do all the necessary reference counting, etc. However, it does
+ * clear out the transparency stack in the destination.
+ */
+gs_gstate *
+gs_gstate_copy_temp(const gs_gstate * pgs, gs_memory_t * mem)
+{
+ gs_gstate *pgs_copy =
+ gs_alloc_struct(mem, gs_gstate, &st_gs_gstate,
+ "gs_gstate_copy");
+
+ if (pgs_copy) {
+ *pgs_copy = *pgs;
+ }
+ return pgs_copy;
+}
+
+/* Increment reference counts to note that an gs_gstate has been copied. */
+void
+gs_gstate_copied(gs_gstate * pgs)
+{
+ rc_increment(pgs->halftone);
+ rc_increment(pgs->dev_ht);
+ rc_increment(pgs->cie_render);
+ rc_increment(pgs->black_generation);
+ rc_increment(pgs->undercolor_removal);
+ rc_increment(pgs->set_transfer.gray);
+ rc_increment(pgs->set_transfer.red);
+ rc_increment(pgs->set_transfer.green);
+ rc_increment(pgs->set_transfer.blue);
+ rc_increment(pgs->cie_joint_caches);
+ rc_increment(pgs->cie_joint_caches_alt);
+ rc_increment(pgs->devicergb_cs);
+ rc_increment(pgs->devicecmyk_cs);
+ rc_increment(pgs->icc_link_cache);
+ rc_increment(pgs->icc_profile_cache);
+ rc_increment(pgs->icc_manager);
+}
+
+/* Adjust reference counts before assigning one gs_gstate to another. */
+void
+gs_gstate_pre_assign(gs_gstate *pto, const gs_gstate *pfrom)
+{
+ const char *const cname = "gs_gstate_pre_assign";
+
+#define RCCOPY(element)\
+ rc_pre_assign(pto->element, pfrom->element, cname)
+
+ RCCOPY(cie_joint_caches);
+ RCCOPY(cie_joint_caches_alt);
+ RCCOPY(set_transfer.blue);
+ RCCOPY(set_transfer.green);
+ RCCOPY(set_transfer.red);
+ RCCOPY(set_transfer.gray);
+ RCCOPY(undercolor_removal);
+ RCCOPY(black_generation);
+ RCCOPY(cie_render);
+ RCCOPY(dev_ht);
+ RCCOPY(halftone);
+ RCCOPY(devicergb_cs);
+ RCCOPY(devicecmyk_cs);
+ RCCOPY(icc_link_cache);
+ RCCOPY(icc_profile_cache);
+ RCCOPY(icc_manager);
+#undef RCCOPY
+}
+
+/* Release a gs_gstate. */
+void
+gs_gstate_release(gs_gstate * pgs)
+{
+ const char *const cname = "gs_gstate_release";
+ gx_device_halftone *pdht = pgs->dev_ht;
+
+#define RCDECR(element)\
+ rc_decrement(pgs->element, cname);\
+ pgs->element = NULL /* prevent subsequent decrements from this gs_gstate */
+
+ RCDECR(cie_joint_caches);
+ RCDECR(set_transfer.gray);
+ RCDECR(set_transfer.blue);
+ RCDECR(set_transfer.green);
+ RCDECR(set_transfer.red);
+ RCDECR(undercolor_removal);
+ RCDECR(black_generation);
+ RCDECR(cie_render);
+ /*
+ * If we're going to free the device halftone, make sure we free the
+ * dependent structures as well.
+ */
+ if (pdht != 0 && pdht->rc.ref_count == 1) {
+ gx_device_halftone_release(pdht, pdht->rc.memory);
+ }
+ RCDECR(dev_ht);
+ RCDECR(halftone);
+ RCDECR(devicergb_cs);
+ RCDECR(devicecmyk_cs);
+ RCDECR(icc_link_cache);
+ RCDECR(icc_profile_cache);
+ RCDECR(icc_manager);
+#undef RCDECR
+}
diff --git a/base/gshsb.c b/base/gshsb.c
index e08ec746f..9f5ce22bc 100644
--- a/base/gshsb.c
+++ b/base/gshsb.c
@@ -29,7 +29,7 @@ static void color_rgb_to_hsb(double r, double g, double b, float hsb[3]);
/* sethsbcolor */
int
-gs_sethsbcolor(gs_state * pgs, double h, double s, double b)
+gs_sethsbcolor(gs_gstate * pgs, double h, double s, double b)
{
float rgb[3];
@@ -39,7 +39,7 @@ gs_sethsbcolor(gs_state * pgs, double h, double s, double b)
/* currenthsbcolor */
int
-gs_currenthsbcolor(const gs_state * pgs, float pr3[3])
+gs_currenthsbcolor(const gs_gstate * pgs, float pr3[3])
{
float rgb[3];
diff --git a/base/gshsb.h b/base/gshsb.h
index ca0221099..3e257d258 100644
--- a/base/gshsb.h
+++ b/base/gshsb.h
@@ -19,7 +19,7 @@
#ifndef gshsb_INCLUDED
# define gshsb_INCLUDED
-int gs_sethsbcolor(gs_state *, double, double, double),
- gs_currenthsbcolor(const gs_state *, float[3]);
+int gs_sethsbcolor(gs_gstate *, double, double, double),
+ gs_currenthsbcolor(const gs_gstate *, float[3]);
#endif /* gshsb_INCLUDED */
diff --git a/base/gsht.c b/base/gsht.c
index bbd4489cc..289bf37e8 100644
--- a/base/gsht.c
+++ b/base/gsht.c
@@ -29,7 +29,7 @@
#include "gxfmap.h" /* For effective transfer usage in threshold */
/* Forward declarations */
-void gx_set_effective_transfer(gs_state *);
+void gx_set_effective_transfer(gs_gstate *);
/* Structure types */
public_st_ht_order();
@@ -131,7 +131,7 @@ RELOC_PTRS_END
/* setscreen */
int
-gs_setscreen(gs_state * pgs, gs_screen_halftone * phsp)
+gs_setscreen(gs_gstate * pgs, gs_screen_halftone * phsp)
{
gs_screen_enum senum;
int code = gx_ht_process_screen(&senum, pgs, phsp,
@@ -144,7 +144,7 @@ gs_setscreen(gs_state * pgs, gs_screen_halftone * phsp)
/* currentscreen */
int
-gs_currentscreen(const gs_state * pgs, gs_screen_halftone * phsp)
+gs_currentscreen(const gs_gstate * pgs, gs_screen_halftone * phsp)
{
switch (pgs->halftone->type) {
case ht_type_screen:
@@ -160,7 +160,7 @@ gs_currentscreen(const gs_state * pgs, gs_screen_halftone * phsp)
/* .currentscreenlevels */
int
-gs_currentscreenlevels(const gs_state * pgs)
+gs_currentscreenlevels(const gs_gstate * pgs)
{
int gi = 0;
@@ -174,25 +174,25 @@ gs_currentscreenlevels(const gs_state * pgs)
/* .setscreenphase */
int
-gx_imager_setscreenphase(gs_imager_state * pis, int x, int y,
+gx_gstate_setscreenphase(gs_gstate * pgs, int x, int y,
gs_color_select_t select)
{
if (select == gs_color_select_all) {
int i;
for (i = 0; i < gs_color_select_count; ++i)
- gx_imager_setscreenphase(pis, x, y, (gs_color_select_t) i);
+ gx_gstate_setscreenphase(pgs, x, y, (gs_color_select_t) i);
return 0;
} else if ((int)select < 0 || (int)select >= gs_color_select_count)
return_error(gs_error_rangecheck);
- pis->screen_phase[select].x = x;
- pis->screen_phase[select].y = y;
+ pgs->screen_phase[select].x = x;
+ pgs->screen_phase[select].y = y;
return 0;
}
int
-gs_setscreenphase(gs_state * pgs, int x, int y, gs_color_select_t select)
+gs_setscreenphase(gs_gstate * pgs, int x, int y, gs_color_select_t select)
{
- int code = gx_imager_setscreenphase((gs_imager_state *) pgs, x, y,
+ int code = gx_gstate_setscreenphase(pgs, x, y,
select);
/*
@@ -208,26 +208,26 @@ gs_setscreenphase(gs_state * pgs, int x, int y, gs_color_select_t select)
}
int
-gs_currentscreenphase_pis(const gs_imager_state * pis, gs_int_point * pphase,
+gs_currentscreenphase_pgs(const gs_gstate * pgs, gs_int_point * pphase,
gs_color_select_t select)
{
if ((int)select < 0 || (int)select >= gs_color_select_count)
return_error(gs_error_rangecheck);
- *pphase = pis->screen_phase[select];
+ *pphase = pgs->screen_phase[select];
return 0;
}
/* .currentscreenphase */
int
-gs_currentscreenphase(const gs_state * pgs, gs_int_point * pphase,
+gs_currentscreenphase(const gs_gstate * pgs, gs_int_point * pphase,
gs_color_select_t select)
{
- return gs_currentscreenphase_pis((const gs_imager_state *)pgs, pphase, select);
+ return gs_currentscreenphase_pgs((const gs_gstate *)pgs, pphase, select);
}
/* currenthalftone */
int
-gs_currenthalftone(gs_state * pgs, gs_halftone * pht)
+gs_currenthalftone(gs_gstate * pgs, gs_halftone * pht)
{
*pht = *pgs->halftone;
return 0;
@@ -237,7 +237,7 @@ gs_currenthalftone(gs_state * pgs, gs_halftone * pht)
/* Process one screen plane. */
int
-gx_ht_process_screen_memory(gs_screen_enum * penum, gs_state * pgs,
+gx_ht_process_screen_memory(gs_screen_enum * penum, gs_gstate * pgs,
gs_screen_halftone * phsp, bool accurate, gs_memory_t * mem)
{
gs_point pt;
@@ -703,7 +703,7 @@ gs_color_name_component_number(gx_device * dev, const char * pname,
* then call gs_color_name_component_number.
*/
int
-gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
+gs_cname_to_colorant_number(gs_gstate * pgs, byte * pname, uint name_size,
int halftonetype)
{
gx_device * dev = pgs->device;
@@ -713,15 +713,15 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
}
/*
- * Install a device halftone into the imager state.
+ * Install a device halftone into the gs_gstate.
*
- * To allow halftones to be shared between graphic states, the imager
- * state contains a pointer to a device halftone structure. Thus, when
- * we say a halftone is "in" the imager state, we are only claiming
- * that the halftone pointer in the imager state points to that halftone.
+ * To allow halftones to be shared between graphic states, the
+ * gs_gstate contains a pointer to a device halftone structure. Thus, when
+ * we say a halftone is "in" the gs_gstate, we are only claiming
+ * that the halftone pointer in the gs_gstate points to that halftone.
*
* Though the operand halftone uses the same structure as the halftone
- * "in" the imager state, not all of its fields are filled in, and the
+ * "in" the gs_gstate, not all of its fields are filled in, and the
* organization of components differs. Specifically, the following fields
* are not filled in:
*
@@ -731,7 +731,7 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* on the stack by clients.
*
* id A halftone is not considered to have an identity until it
- * is installed in the imager state. This is a design error
+ * is installed in the gs_gstate. This is a design error
* which reflects the PostScript origins of this code. In
* PostScript, it is impossible to check if two halftone
* specifications (sets of operands to setscreen/setcolorscreen
@@ -759,7 +759,7 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
*
* num_comp For the operand halftone, this is the number of halftone
* components included in the specification. For the device
- * halftone in the imager state, this is always the same as
+ * halftone in the gs_gstate, this is always the same as
* the number of color model components (see num_dev_comp).
*
* num_dev_comp The number of components in the device process color model
@@ -774,7 +774,7 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* components provided. One of these components will usually
* be the same as that identified by the "order" field.
*
- * For the device halftone in the imager state, this field is
+ * For the device halftone in the gs_gstate, this field is
* always non-null, and the size of the array pointed to will
* be the same as the number of components in the process
* color model.
@@ -792,11 +792,11 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* halftone. There it represents the default halftone component, which will
* be used for all device color components for which a named halftone is
* not available. It is ignored (filled with 0's) in the device halftone
- * in the imager state.
+ * in the gs_gstate.
*
* The ordering of entries and the set of fields initialized in the
* components array also vary between the operand device halftone and
- * the device halftone in the imager state.
+ * the device halftone in the gs_gstate.
*
* If the components array is present in the operand device halftone, the
* cname field in each entry of the array will contain a name index
@@ -808,7 +808,7 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* is provided (i.e.: via a HalftoneType 5 dictionary), the first
* entry of the array will be the same as the "order" (default) field.
*
- * For the device halftone in the imager state, the components array is
+ * For the device halftone in the gs_gstate, the components array is
* always present, but the cname and comp_number fields of individual
* entries are ignored. The order of the entries in the array always
* matches the order of components in the device color model.
@@ -818,19 +818,19 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* gx_ht_order structure incorporated in the order field of the halftone
* and the corder field of the elements of the components array. The
* fields of this structure that are handled differently in the operand
- * and imager state device halftones are:
+ * and gs_gstate device halftones are:
*
* params Provides a set of parameters that are required for
* converting a halftone specification to a single
* component order. This field is used only in the
* operand device halftone; it is not set in the device
- * halftone in the imager state.
+ * halftone in the gs_gstate.
*
* orig_height, The height and shift values of the halftone cell,
* orig_shift prior to any replication. These fields are currently
* unused, and will always be the same as the height
* and width fields in the device halftone in the
- * imager state.
+ * gs_gstate.
*
* full_height The height of the smallest replicated tile whose shift
* value is 0. This is calculated as part of the
@@ -843,10 +843,10 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* is a bit complicated. For orders that are "taken over"
* by the installation process, this field will have the
* same value in the operand device halftone and the
- * device halftone in the imager state. For halftones
+ * device halftone in the gs_gstate. For halftones
* that are copied by the installation process, this
* field will have the same value as the memory field in
- * the imager state (the two are usually the same).
+ * the gs_gstate (the two are usually the same).
*
* cache Pointer to a cache of tiles representing various
* levels of the halftone. This may or may not be
@@ -893,7 +893,7 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* halftone structure (i.e.: an ostensibly shareable structure is not
* shareable). Hence, this procedure will always create a new copy of the
* gx_device_halftone structure, either by allocating a new structure or
- * re-using the structure already referenced by the imager state. This
+ * re-using the structure already referenced by the gs_gstate. This
* feature must be retained, as in several cases the calling code will
* allocate the operand device halftone structure on the stack.
*
@@ -901,17 +901,17 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* referenced by the operand device halftone structure. This implied
* that all structures referenced by the gx_device_halftone structure
* needed to be allocated on the heap, and should not be released once
- * the call to gx_imager_dev_ht_install completes.
+ * the call to gx_gstate_dev_ht_install completes.
*
* There were two problems with this approach:
*
* 1. In the event of an error, the calling code most likely would have
- * to release referenced components, as the imager state had not yet
+ * to release referenced components, as the gs_gstate had not yet
* take ownership of them. In many cases, the code did not do this.
*
* 2. When the structures referenced by a single order needed to be
* shared amongst more than one component, there was no easy way to
- * discover this sharing when the imager state's device halftone
+ * discover this sharing when the gs_gstate's device halftone
* subsequently needed to be released. Hence, objects would be
* released multiple times.
*
@@ -922,7 +922,7 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
*
* The approach now taken uses a mixture of the two approaches.
* Ownership to structures referenced by the operand device halftone is
- * assumed by the device halftone in the imager state where this is
+ * assumed by the device halftone in the gs_gstate where this is
* possible. In these cases, the corresponding references are removed in
* the operand device halftone (hence, this operand is no longer
* qualified as const). When a structure is required but ownership cannot
@@ -932,8 +932,8 @@ gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
* returns, whether or not an error is indicated.
*/
int
-gx_imager_dev_ht_install(
- gs_imager_state * pis,
+gx_gstate_dev_ht_install(
+ gs_gstate * pgs,
gx_device_halftone * pdht,
gs_halftone_type type,
const gx_device * dev )
@@ -943,21 +943,21 @@ gx_imager_dev_ht_install(
int i, code = 0;
bool used_default = false;
int lcm_width = 1, lcm_height = 1;
- bool mem_diff = pdht->rc.memory != pis->memory;
+ bool mem_diff = pdht->rc.memory != pgs->memory;
uint w, h;
int dw, dh;
/* construct the new device halftone structure */
memset(&dht.order, 0, sizeof(dht.order));
/* the rc field is filled in later */
- dht.id = gs_next_ids(pis->memory, 1);
+ dht.id = gs_next_ids(pgs->memory, 1);
dht.type = type;
dht.components = gs_alloc_struct_array(
- pis->memory,
+ pgs->memory,
num_comps,
gx_ht_order_component,
&st_ht_order_component_element,
- "gx_imager_dev_ht_install(components)" );
+ "gx_gstate_dev_ht_install(components)" );
if (dht.components == NULL)
return_error(gs_error_VMerror);
dht.num_comp = dht.num_dev_comp = num_comps;
@@ -971,7 +971,7 @@ gx_imager_dev_ht_install(
/*
* Duplicate any of the non-default components, but do not create copies
* of the levels or bit_data arrays. If all goes according to plan, the
- * imager state's device halftone will assume ownership of these arrays
+ * gs_gstate's device halftone will assume ownership of these arrays
* by clearing the corresponding pointers in the operand halftone's
* orders.
*/
@@ -996,7 +996,7 @@ gx_imager_dev_ht_install(
if (mem_diff)
code = gx_ht_copy_ht_order( p_d_order,
p_s_order,
- pis->memory );
+ pgs->memory );
else {
/* check if this is also the default component */
used_default = used_default ||
@@ -1017,7 +1017,7 @@ gx_imager_dev_ht_install(
if (dht.components[i].comp_number != i) {
if (used_default || mem_diff)
- code = gx_ht_copy_ht_order(porder, &pdht->order, pis->memory);
+ code = gx_ht_copy_ht_order(porder, &pdht->order, pgs->memory);
else {
gx_ht_move_ht_order(porder, &pdht->order);
used_default = true;
@@ -1055,13 +1055,13 @@ gx_imager_dev_ht_install(
if (rep_count > sizeof(ulong) * 8 && (num_tiles >
1 + ((num_tiles * 8 * sizeof(ulong)) / rep_count) ))
num_tiles = 1 + ((num_tiles * 8 * sizeof(ulong)) / rep_count);
- pcache = gx_ht_alloc_cache( pis->memory, num_tiles,
+ pcache = gx_ht_alloc_cache( pgs->memory, num_tiles,
tile_bytes * num_tiles );
if (pcache == NULL)
code = gs_error_VMerror;
else {
porder->cache = pcache;
- gx_ht_init_cache(pis->memory, pcache, porder);
+ gx_ht_init_cache(pgs->memory, pcache, porder);
}
}
}
@@ -1070,10 +1070,10 @@ gx_imager_dev_ht_install(
/*
* If everything is OK so far, allocate a unique copy of the device
- * halftone reference by the imager state.
+ * halftone reference by the gs_gstate.
*
* This code requires a special check for the case in which the
- * deivce halftone referenced by the imager state is already unique.
+ * deivce halftone referenced by the gs_gstate is already unique.
* In this case, we must explicitly release just the components array
* (and any structures it refers to) of the existing halftone. This
* cannot be done automatically, as the rc_unshare_struct macro only
@@ -1082,32 +1082,32 @@ gx_imager_dev_ht_install(
*
* Though this is scheduled to be changed, for the time being the
* command list renderer may invoke this code with pdht == psi->dev_ht
- * (in which case we know pis->dev_ht.rc.ref_count == 1). Special
+ * (in which case we know pgs->dev_ht.rc.ref_count == 1). Special
* handling is required in that case, to avoid releasing structures
* we still need.
*/
if (code >= 0) {
- gx_device_halftone * pisdht = pis->dev_ht;
+ gx_device_halftone * pgsdht = pgs->dev_ht;
rc_header tmp_rc;
- if (pisdht != 0 && pisdht->rc.ref_count == 1) {
- if (pdht != pisdht)
- gx_device_halftone_release(pisdht, pisdht->rc.memory);
+ if (pgsdht != 0 && pgsdht->rc.ref_count == 1) {
+ if (pdht != pgsdht)
+ gx_device_halftone_release(pgsdht, pgsdht->rc.memory);
} else {
- rc_unshare_struct( pis->dev_ht,
+ rc_unshare_struct( pgs->dev_ht,
gx_device_halftone,
&st_device_halftone,
- pis->memory,
+ pgs->memory,
BEGIN code = gs_error_VMerror; goto err; END,
- "gx_imager_dev_ht_install" );
- pisdht = pis->dev_ht;
+ "gx_gstate_dev_ht_install" );
+ pgsdht = pgs->dev_ht;
}
/*
* Everything worked. "Assume ownership" of the appropriate
* portions of the source device halftone by clearing the
* associated references. Since we might have
- * pdht == pis->dev_ht, this must done before updating pis->dev_ht.
+ * pdht == pgs->dev_ht, this must done before updating pgs->dev_ht.
*
* If the default order has been used for a device component, and
* any of the source component orders share their levels or bit_data
@@ -1136,12 +1136,12 @@ gx_imager_dev_ht_install(
memset(&pdht->order, 0, sizeof(pdht->order));
}
- tmp_rc = pisdht->rc;
- *pisdht = dht;
- pisdht->rc = tmp_rc;
+ tmp_rc = pgsdht->rc;
+ *pgsdht = dht;
+ pgsdht->rc = tmp_rc;
/* update the effective transfer function array */
- gx_imager_set_effective_xfer(pis);
+ gx_gstate_set_effective_xfer(pgs);
return 0;
}
@@ -1153,9 +1153,9 @@ gx_imager_dev_ht_install(
gx_ht_order * porder = &pcomp->corder;
if (pcomp->comp_number == -1)
- gx_ht_order_release(porder, pis->memory, true);
+ gx_ht_order_release(porder, pgs->memory, true);
}
- gs_free_object(pis->memory, dht.components, "gx_imager_dev_ht_install");
+ gs_free_object(pgs->memory, dht.components, "gx_gstate_dev_ht_install");
return code;
}
@@ -1166,7 +1166,7 @@ gx_imager_dev_ht_install(
* of any substructures.
*/
int
-gx_ht_install(gs_state * pgs, const gs_halftone * pht,
+gx_ht_install(gs_gstate * pgs, const gs_halftone * pht,
gx_device_halftone * pdht)
{
gs_memory_t *mem = pht->rc.memory;
@@ -1183,7 +1183,7 @@ gx_ht_install(gs_state * pgs, const gs_halftone * pht,
rc_alloc_struct_1(new_ht, gs_halftone, &st_halftone,
mem, return_error(gs_error_VMerror),
"gx_ht_install(new halftone)");
- code = gx_imager_dev_ht_install((gs_imager_state *) pgs,
+ code = gx_gstate_dev_ht_install(pgs,
pdht, pht->type, gs_currentdevice_inline(pgs));
if (code < 0) {
if (new_ht != old_ht)
@@ -1222,31 +1222,31 @@ gx_ht_install(gs_state * pgs, const gs_halftone * pht,
/* Reestablish the effective transfer functions, taking into account */
/* any overrides from halftone dictionaries. */
void
-gx_imager_set_effective_xfer(gs_imager_state * pis)
+gx_gstate_set_effective_xfer(gs_gstate * pgs)
{
- gx_device_halftone *pdht = pis->dev_ht;
+ gx_device_halftone *pdht = pgs->dev_ht;
gx_transfer_map *pmap;
gx_ht_order *porder;
int i, component_num;
for (i = 0; i < GX_DEVICE_COLOR_MAX_COMPONENTS; i++)
- pis->effective_transfer[i] = pis->set_transfer.gray; /* default */
+ pgs->effective_transfer[i] = pgs->set_transfer.gray; /* default */
/* Check if we have a transfer functions from setcolortransfer */
- if (pis->set_transfer.red) {
- component_num = pis->set_transfer.red_component_num;
+ if (pgs->set_transfer.red) {
+ component_num = pgs->set_transfer.red_component_num;
if (component_num >= 0)
- pis->effective_transfer[component_num] = pis->set_transfer.red;;
+ pgs->effective_transfer[component_num] = pgs->set_transfer.red;;
}
- if (pis->set_transfer.green) {
- component_num = pis->set_transfer.green_component_num;
+ if (pgs->set_transfer.green) {
+ component_num = pgs->set_transfer.green_component_num;
if (component_num >= 0)
- pis->effective_transfer[component_num] = pis->set_transfer.green;
+ pgs->effective_transfer[component_num] = pgs->set_transfer.green;
}
- if (pis->set_transfer.blue) {
- component_num = pis->set_transfer.blue_component_num;
+ if (pgs->set_transfer.blue) {
+ component_num = pgs->set_transfer.blue_component_num;
if (component_num >= 0)
- pis->effective_transfer[component_num] = pis->set_transfer.blue;
+ pgs->effective_transfer[component_num] = pgs->set_transfer.blue;
}
if (pdht == NULL)
@@ -1263,7 +1263,7 @@ gx_imager_set_effective_xfer(gs_imager_state * pis)
for (i = 0; i < pdht->num_comp; i++) {
pmap = pdht->components[i].corder.transfer;
if (pmap != NULL)
- pis->effective_transfer[i] = pmap;
+ pgs->effective_transfer[i] = pmap;
porder = &(pdht->components[i].corder);
if (porder->threshold != NULL) {
gs_free_object(porder->data_memory->non_gc_memory, porder->threshold,
@@ -1275,26 +1275,26 @@ gx_imager_set_effective_xfer(gs_imager_state * pis)
}
void
-gx_set_effective_transfer(gs_state * pgs)
+gx_set_effective_transfer(gs_gstate * pgs)
{
- gx_imager_set_effective_xfer((gs_imager_state *) pgs);
+ gx_gstate_set_effective_xfer(pgs);
}
/* Check if the transfer function for a component is monotonic. */
/* Used to determine if we can do fast halftoning */
bool
-gx_transfer_is_monotonic(const gs_imager_state *pis, int plane_index)
+gx_transfer_is_monotonic(const gs_gstate *pgs, int plane_index)
{
- if (pis->effective_transfer[plane_index]->proc != gs_identity_transfer) {
+ if (pgs->effective_transfer[plane_index]->proc != gs_identity_transfer) {
bool threshold_inverted;
int t_level;
frac mapped, prev;
- prev = gx_map_color_frac(pis, frac_0, effective_transfer[plane_index]);
+ prev = gx_map_color_frac(pgs, frac_0, effective_transfer[plane_index]);
threshold_inverted = prev >
- gx_map_color_frac(pis, frac_1, effective_transfer[plane_index]);
+ gx_map_color_frac(pgs, frac_1, effective_transfer[plane_index]);
for (t_level = 1; t_level < 255; t_level++) {
- mapped = gx_map_color_frac(pis, byte2frac(t_level), effective_transfer[plane_index]);
+ mapped = gx_map_color_frac(pgs, byte2frac(t_level), effective_transfer[plane_index]);
if ((threshold_inverted && mapped > prev) ||
(!threshold_inverted && mapped < prev))
return false;
@@ -1311,7 +1311,7 @@ gx_transfer_is_monotonic(const gs_imager_state *pis, int plane_index)
*/
int
gx_ht_construct_threshold( gx_ht_order *d_order, gx_device *dev,
- const gs_imager_state * pis, int plane_index)
+ const gs_gstate * pgs, int plane_index)
{
int i, j;
unsigned char *thresh;
@@ -1341,10 +1341,10 @@ gx_ht_construct_threshold( gx_ht_order *d_order, gx_device *dev,
return -1 ; /* error if allocation failed */
}
/* Check if we need to apply a transfer function to the values */
- if (pis->effective_transfer[plane_index]->proc != gs_identity_transfer) {
+ if (pgs->effective_transfer[plane_index]->proc != gs_identity_transfer) {
have_transfer = true;
- threshold_inverted = gx_map_color_frac(pis, frac_0, effective_transfer[plane_index]) >
- gx_map_color_frac(pis, frac_1, effective_transfer[plane_index]);
+ threshold_inverted = gx_map_color_frac(pgs, frac_0, effective_transfer[plane_index]) >
+ gx_map_color_frac(pgs, frac_1, effective_transfer[plane_index]);
}
/* Adjustments to ensure that we properly map our 256 levels into
the number of shades that we have in our halftone screen. For example
@@ -1366,7 +1366,7 @@ gx_ht_construct_threshold( gx_ht_order *d_order, gx_device *dev,
t_level++;
t_level_frac_color = byte2frac(threshold_inverted ? 255 - t_level : t_level);
if (have_transfer)
- t_level_frac_color = gx_map_color_frac(pis, t_level_frac_color, effective_transfer[plane_index]);
+ t_level_frac_color = gx_map_color_frac(pgs, t_level_frac_color, effective_transfer[plane_index]);
shade = t_level_frac_color * nshades / (frac_1_long + 1);
} while (shade < num_levels && t_level < 255);
/* Initialize the thresholds to the lowest level that will be all white */
@@ -1376,7 +1376,7 @@ gx_ht_construct_threshold( gx_ht_order *d_order, gx_device *dev,
for (t_level = 1; t_level < 256; t_level++) {
t_level_frac_color = byte2frac(threshold_inverted ? 255 - t_level : t_level);
if (have_transfer)
- t_level_frac_color = gx_map_color_frac(pis, t_level_frac_color, effective_transfer[plane_index]);
+ t_level_frac_color = gx_map_color_frac(pgs, t_level_frac_color, effective_transfer[plane_index]);
shade = t_level_frac_color * nshades / (frac_1_long + 1);
if (shade < num_levels && shade > base_shade) {
if (d_order->levels[shade] > d_order->levels[base_shade]) {
diff --git a/base/gsht.h b/base/gsht.h
index f2bf1e248..e13435021 100644
--- a/base/gsht.h
+++ b/base/gsht.h
@@ -45,9 +45,9 @@ typedef struct gs_colorscreen_halftone_s {
#define st_colorscreen_halftone_max_ptrs 0
/* Procedural interface */
-int gs_setscreen(gs_state *, gs_screen_halftone *);
-int gs_currentscreen(const gs_state *, gs_screen_halftone *);
-int gs_currentscreenlevels(const gs_state *);
+int gs_setscreen(gs_gstate *, gs_screen_halftone *);
+int gs_currentscreen(const gs_gstate *, gs_screen_halftone *);
+int gs_currentscreenlevels(const gs_gstate *);
/*
* Enumeration-style definition of a single screen. The client must:
@@ -60,7 +60,7 @@ int gs_currentscreenlevels(const gs_state *);
*/
typedef struct gs_screen_enum_s gs_screen_enum;
gs_screen_enum *gs_screen_enum_alloc(gs_memory_t *, client_name_t);
-int gs_screen_init(gs_screen_enum *, gs_state *, gs_screen_halftone *);
+int gs_screen_init(gs_screen_enum *, gs_gstate *, gs_screen_halftone *);
int gs_screen_currentpoint(gs_screen_enum *, gs_point *);
int gs_screen_next(gs_screen_enum *, double);
int gs_screen_install(gs_screen_enum *);
diff --git a/base/gsht1.c b/base/gsht1.c
index 7630ae662..8b8831a8b 100644
--- a/base/gsht1.c
+++ b/base/gsht1.c
@@ -27,16 +27,16 @@
/* Imports from gscolor.c */
-void load_transfer_map(gs_state *, gx_transfer_map *, double);
+void load_transfer_map(gs_gstate *, gx_transfer_map *, double);
/* Forward declarations */
-static int process_spot(gx_ht_order *, gs_state *,
+static int process_spot(gx_ht_order *, gs_gstate *,
gs_spot_halftone *, gs_memory_t *);
-static int process_threshold(gx_ht_order *, gs_state *,
+static int process_threshold(gx_ht_order *, gs_gstate *,
gs_threshold_halftone *, gs_memory_t *);
-static int process_threshold2(gx_ht_order *, gs_state *,
+static int process_threshold2(gx_ht_order *, gs_gstate *,
gs_threshold2_halftone *, gs_memory_t *);
-static int process_client_order(gx_ht_order *, gs_state *,
+static int process_client_order(gx_ht_order *, gs_gstate *,
gs_client_order_halftone *, gs_memory_t *);
/* Structure types */
@@ -106,7 +106,7 @@ RELOC_PTRS_END
/* setcolorscreen */
int
-gs_setcolorscreen(gs_state * pgs, gs_colorscreen_halftone * pht)
+gs_setcolorscreen(gs_gstate * pgs, gs_colorscreen_halftone * pht)
{
gs_halftone ht;
@@ -117,7 +117,7 @@ gs_setcolorscreen(gs_state * pgs, gs_colorscreen_halftone * pht)
/* currentcolorscreen */
int
-gs_currentcolorscreen(gs_state * pgs, gs_colorscreen_halftone * pht)
+gs_currentcolorscreen(gs_gstate * pgs, gs_colorscreen_halftone * pht)
{
int code;
@@ -138,7 +138,7 @@ gs_currentcolorscreen(gs_state * pgs, gs_colorscreen_halftone * pht)
/* Set the halftone in the graphics state. */
int
-gs_sethalftone(gs_state * pgs, gs_halftone * pht)
+gs_sethalftone(gs_gstate * pgs, gs_halftone * pht)
{
gs_halftone ht;
@@ -147,7 +147,7 @@ gs_sethalftone(gs_state * pgs, gs_halftone * pht)
return gs_sethalftone_allocated(pgs, &ht);
}
int
-gs_sethalftone_allocated(gs_state * pgs, gs_halftone * pht)
+gs_sethalftone_allocated(gs_gstate * pgs, gs_halftone * pht)
{
gx_device_halftone dev_ht;
int code = gs_sethalftone_prepare(pgs, pht, &dev_ht);
@@ -162,7 +162,7 @@ gs_sethalftone_allocated(gs_state * pgs, gs_halftone * pht)
/* Prepare the halftone, but don't install it. */
int
-gs_sethalftone_prepare(gs_state * pgs, gs_halftone * pht,
+gs_sethalftone_prepare(gs_gstate * pgs, gs_halftone * pht,
gx_device_halftone * pdht)
{
gs_memory_t *mem = pht->rc.memory;
@@ -320,7 +320,7 @@ gs_sethalftone_prepare(gs_state * pgs, gs_halftone * pht,
/* Process a transfer function override, if any. */
static int
-process_transfer(gx_ht_order * porder, gs_state * pgs,
+process_transfer(gx_ht_order * porder, gs_gstate * pgs,
gs_mapping_proc proc, gs_mapping_closure_t * pmc,
gs_memory_t * mem)
{
@@ -347,7 +347,7 @@ process_transfer(gx_ht_order * porder, gs_state * pgs,
/* Process a spot plane. */
static int
-process_spot(gx_ht_order * porder, gs_state * pgs,
+process_spot(gx_ht_order * porder, gs_gstate * pgs,
gs_spot_halftone * phsp, gs_memory_t * mem)
{
gs_screen_enum senum;
@@ -396,7 +396,7 @@ gx_ht_construct_threshold_order(gx_ht_order * porder, const byte * thresholds)
/* Process a threshold plane. */
static int
-process_threshold(gx_ht_order * porder, gs_state * pgs,
+process_threshold(gx_ht_order * porder, gs_gstate * pgs,
gs_threshold_halftone * phtp, gs_memory_t * mem)
{
int code;
@@ -416,7 +416,7 @@ process_threshold(gx_ht_order * porder, gs_state * pgs,
/* Process an extended threshold plane. */
static int
-process_threshold2(gx_ht_order * porder, gs_state * pgs,
+process_threshold2(gx_ht_order * porder, gs_gstate * pgs,
gs_threshold2_halftone * phtp, gs_memory_t * mem)
{
int code;
@@ -532,7 +532,7 @@ process_threshold2(gx_ht_order * porder, gs_state * pgs,
/* Process a client-order plane. */
static int
-process_client_order(gx_ht_order * porder, gs_state * pgs,
+process_client_order(gx_ht_order * porder, gs_gstate * pgs,
gs_client_order_halftone * phcop, gs_memory_t * mem)
{
int code = (*phcop->procs->create_order) (porder, pgs, phcop, mem);
diff --git a/base/gsht1.h b/base/gsht1.h
index adbc46bff..c91fc5223 100644
--- a/base/gsht1.h
+++ b/base/gsht1.h
@@ -22,8 +22,8 @@
#include "gsht.h"
/* Procedural interface */
-int gs_setcolorscreen(gs_state *, gs_colorscreen_halftone *);
-int gs_currentcolorscreen(gs_state *, gs_colorscreen_halftone *);
+int gs_setcolorscreen(gs_gstate *, gs_colorscreen_halftone *);
+int gs_currentcolorscreen(gs_gstate *, gs_colorscreen_halftone *);
/*
* We include sethalftone here, even though it is a Level 2 feature,
@@ -39,13 +39,13 @@ typedef struct gs_halftone_s gs_halftone;
* gs_halftone structures may have complex substructures. We provide two
* procedures for setting them. gs_halftone assumes that the gs_halftone
* structure and all its substructures was allocated with the same allocator
- * as the gs_state; gs_halftone_allocated looks in the structure itself (the
+ * as the gs_gstate; gs_halftone_allocated looks in the structure itself (the
* rc.memory member) to find the allocator that was used. Both procedures
* copy the top-level structure (using the appropriate allocator), but take
* ownership of the substructures.
*/
-int gs_sethalftone(gs_state *, gs_halftone *);
-int gs_sethalftone_allocated(gs_state *, gs_halftone *);
-int gs_currenthalftone(gs_state *, gs_halftone *);
+int gs_sethalftone(gs_gstate *, gs_halftone *);
+int gs_sethalftone_allocated(gs_gstate *, gs_halftone *);
+int gs_currenthalftone(gs_gstate *, gs_halftone *);
#endif /* gsht1_INCLUDED */
diff --git a/base/gshtscr.c b/base/gshtscr.c
index c80cb5b1a..2fd51563b 100644
--- a/base/gshtscr.c
+++ b/base/gshtscr.c
@@ -178,7 +178,7 @@ gs_screen_enum_alloc(gs_memory_t * mem, client_name_t cname)
/* Set up for halftone sampling. */
int
-gs_screen_init(gs_screen_enum * penum, gs_state * pgs,
+gs_screen_init(gs_screen_enum * penum, gs_gstate * pgs,
gs_screen_halftone * phsp)
{
gs_lib_ctx_t *ctx = gs_lib_ctx_get_interp_instance(pgs->memory);
@@ -187,7 +187,7 @@ gs_screen_init(gs_screen_enum * penum, gs_state * pgs,
ctx->screen_accurate_screens);
}
int
-gs_screen_init_memory(gs_screen_enum * penum, gs_state * pgs,
+gs_screen_init_memory(gs_screen_enum * penum, gs_gstate * pgs,
gs_screen_halftone * phsp, bool accurate, gs_memory_t * mem)
{
int code =
@@ -232,7 +232,7 @@ gs_screen_order_alloc(gx_ht_order *porder, gs_memory_t *mem)
return code;
}
int
-gs_screen_order_init_memory(gx_ht_order * porder, const gs_state * pgs,
+gs_screen_order_init_memory(gx_ht_order * porder, const gs_gstate * pgs,
gs_screen_halftone * phsp, bool accurate,
gs_memory_t * mem)
{
@@ -471,7 +471,7 @@ pick_cell_size(gs_screen_halftone * ph, const gs_matrix * pmat, ulong max_size,
/* This is the second half of gs_screen_init_accurate. */
int
gs_screen_enum_init_memory(gs_screen_enum * penum, const gx_ht_order * porder,
- gs_state * pgs, const gs_screen_halftone * phsp,
+ gs_gstate * pgs, const gs_screen_halftone * phsp,
gs_memory_t * mem)
{
penum->pgs = pgs; /* ensure clean for GC */
diff --git a/base/gshtx.c b/base/gshtx.c
index 1dab7b098..ef395fc68 100644
--- a/base/gshtx.c
+++ b/base/gshtx.c
@@ -320,7 +320,7 @@ static int
build_component(
gs_ht_component * phtc,
gx_ht_order * porder,
- gs_state * pgs,
+ gs_gstate * pgs,
gs_memory_t * pmem
)
{
@@ -396,7 +396,7 @@ free_order_array(
*/
int
gs_ht_install(
- gs_state * pgs,
+ gs_gstate * pgs,
gs_ht * pht
)
{
@@ -501,7 +501,7 @@ create_mask_bits(const byte * mask1, const byte * mask2,
return count;
}
static int
-create_mask_order(gx_ht_order * porder, gs_state * pgs,
+create_mask_order(gx_ht_order * porder, gs_gstate * pgs,
const gs_client_order_halftone * phcop,
gs_memory_t * mem)
{
diff --git a/base/gshtx.h b/base/gshtx.h
index ab1425b32..01f9a722c 100644
--- a/base/gshtx.h
+++ b/base/gshtx.h
@@ -43,9 +43,9 @@
#define ht_threshold threshold
#define ht_multiple multiple
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
@@ -141,6 +141,6 @@ extern void gs_ht_release(gs_ht * pht);
#define gs_ht_init_ptr(pto, pfrom) \
BEGIN gs_ht_reference(pfrom); pto = pfrom; END
-extern int gs_ht_install(gs_state * pgs, gs_ht * pht);
+extern int gs_ht_install(gs_gstate * pgs, gs_ht * pht);
#endif /* gshtx_INCLUDED */
diff --git a/base/gsicc.c b/base/gsicc.c
index bd82ba08e..038fa7366 100644
--- a/base/gsicc.c
+++ b/base/gsicc.c
@@ -87,7 +87,7 @@ gsicc_remap_fast(gx_device *dev, unsigned short *psrc, unsigned short *psrc_cm,
/* ICC color mapping linearity check, a 2-points case. Check only the 1/2 point */
static int
-gx_icc_is_linear_in_line(const gs_color_space *cs, const gs_imager_state * pis,
+gx_icc_is_linear_in_line(const gs_color_space *cs, const gs_gstate * pgs,
gx_device *dev,
const gs_client_color *c0, const gs_client_color *c1,
float smoothness, gsicc_link_t *icclink)
@@ -132,7 +132,7 @@ gx_icc_is_linear_in_line(const gs_color_space *cs, const gs_imager_state * pis,
/* Default icc color mapping linearity check, a triangle case. */
static int
-gx_icc_is_linear_in_triangle(const gs_color_space *cs, const gs_imager_state * pis,
+gx_icc_is_linear_in_triangle(const gs_color_space *cs, const gs_gstate * pgs,
gx_device *dev,
const gs_client_color *c0, const gs_client_color *c1,
const gs_client_color *c2, float smoothness, gsicc_link_t *icclink)
@@ -204,7 +204,7 @@ gx_icc_is_linear_in_triangle(const gs_color_space *cs, const gs_imager_state * p
/* ICC color mapping linearity check. */
int
-gx_cspace_is_linear_ICC(const gs_color_space *cs, const gs_imager_state * pis,
+gx_cspace_is_linear_ICC(const gs_color_space *cs, const gs_gstate * pgs,
gx_device *dev,
const gs_client_color *c0, const gs_client_color *c1,
const gs_client_color *c2, const gs_client_color *c3,
@@ -222,14 +222,14 @@ gx_cspace_is_linear_ICC(const gs_color_space *cs, const gs_imager_state * pis,
if (dev->color_info.separable_and_linear != GX_CINFO_SEP_LIN)
return_error(gs_error_rangecheck);
if (c2 == NULL)
- return gx_icc_is_linear_in_line(cs, pis, dev, c0, c1, smoothness, icclink);
- code = gx_icc_is_linear_in_triangle(cs, pis, dev, c0, c1, c2,
+ return gx_icc_is_linear_in_line(cs, pgs, dev, c0, c1, smoothness, icclink);
+ code = gx_icc_is_linear_in_triangle(cs, pgs, dev, c0, c1, c2,
smoothness, icclink);
if (code <= 0)
return code;
if (c3 == NULL)
return 1;
- return gx_icc_is_linear_in_triangle(cs, pis, dev, c1, c2, c3,
+ return gx_icc_is_linear_in_triangle(cs, pgs, dev, c1, c2, c3,
smoothness, icclink);
}
/*
@@ -300,7 +300,7 @@ gx_restrict_ICC(gs_client_color * pcc, const gs_color_space * pcs)
static int
gx_remap_concrete_icc_devicen(const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
/* Check if this is a device with a DeviceN ICC profile. In this case,
@@ -316,10 +316,10 @@ gx_remap_concrete_icc_devicen(const frac * pconc, const gs_color_space * pcs,
up the equivalent CMYK colors for the spot colors that are present.
This allows us to have some sort of composite viewing of the spot
colors as they would colorimetrically appear. */
- code = gsicc_set_devicen_equiv_colors(dev, pis, dev_profile->device_profile[0]);
+ code = gsicc_set_devicen_equiv_colors(dev, pgs, dev_profile->device_profile[0]);
dev_profile->spotnames->equiv_cmyk_set = true;
}
- gx_remap_concrete_devicen(pconc, pdc, pis, dev, select);
+ gx_remap_concrete_devicen(pconc, pdc, pgs, dev, select);
return code;
}
@@ -330,7 +330,7 @@ gx_remap_concrete_icc_devicen(const frac * pconc, const gs_color_space * pcs,
in the device profile entry of the profile manager. */
int
gx_remap_concrete_ICC(const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
int num_colorants;
@@ -341,19 +341,19 @@ gx_remap_concrete_ICC(const frac * pconc, const gs_color_space * pcs,
num_colorants = gsicc_get_device_profile_comps(dev_profile);
switch( num_colorants ) {
case 1:
- code = gx_remap_concrete_DGray(pconc, pcs, pdc, pis, dev, select);
+ code = gx_remap_concrete_DGray(pconc, pcs, pdc, pgs, dev, select);
break;
case 3:
- code = gx_remap_concrete_DRGB(pconc, pcs, pdc, pis, dev, select);
+ code = gx_remap_concrete_DRGB(pconc, pcs, pdc, pgs, dev, select);
break;
case 4:
- code = gx_remap_concrete_DCMYK(pconc, pcs, pdc, pis, dev, select);
+ code = gx_remap_concrete_DCMYK(pconc, pcs, pdc, pgs, dev, select);
break;
default:
/* This is a special case where we have a source color and our
output profile must be DeviceN. We will need to map our
colorants to the proper planes */
- code = gx_remap_concrete_icc_devicen(pconc, pcs, pdc, pis, dev, select);
+ code = gx_remap_concrete_icc_devicen(pconc, pcs, pdc, pgs, dev, select);
break;
}
return code;
@@ -364,7 +364,7 @@ gx_remap_concrete_ICC(const frac * pconc, const gs_color_space * pcs,
*/
int
gx_remap_ICC(const gs_client_color * pcc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
gsicc_link_t *icc_link;
@@ -386,11 +386,11 @@ gx_remap_ICC(const gs_client_color * pcc, const gs_color_space * pcs,
if (dev_profile == NULL)
return gs_throw(gs_error_Fatal, "Attempting to do ICC remap with no profile");
num_des_comps = gsicc_get_device_profile_comps(dev_profile);
- rendering_params.black_point_comp = pis->blackptcomp;
+ rendering_params.black_point_comp = pgs->blackptcomp;
rendering_params.graphics_type_tag = dev->graphics_type_tag;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = pis->renderingintent;
+ rendering_params.rendering_intent = pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
/* Need to clear out psrc_cm in case we have separation bands that are
not color managed */
@@ -408,7 +408,7 @@ gx_remap_ICC(const gs_client_color * pcc, const gs_color_space * pcs,
}
}
/* Get a link from the cache, or create if it is not there. Need to get 16 bit profile */
- icc_link = gsicc_get_link(pis, dev, pcs, NULL, &rendering_params, pis->memory);
+ icc_link = gsicc_get_link(pgs, dev, pcs, NULL, &rendering_params, pgs->memory);
if (icc_link == NULL) {
#ifdef DEBUG
gs_warn("Could not create ICC link: Check profiles");
@@ -445,7 +445,7 @@ gx_remap_ICC(const gs_client_color * pcc, const gs_color_space * pcs,
for ( k = 0; k < num_des_comps; k++){
conc[k] = ushort2frac(psrc_temp[k]);
}
- gx_remap_concrete_ICC(conc, pcs, pdc, pis, dev, select);
+ gx_remap_concrete_ICC(conc, pcs, pdc, pgs, dev, select);
/* Save original color space and color info into dev color */
i = pcs->cmm_icc_profile_data->num_comps;
@@ -463,7 +463,7 @@ gx_remap_ICC(const gs_client_color * pcc, const gs_color_space * pcs,
*/
int
gx_remap_ICC_imagelab(const gs_client_color * pcc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
gsicc_link_t *icc_link;
@@ -480,11 +480,11 @@ gx_remap_ICC_imagelab(const gs_client_color * pcc, const gs_color_space * pcs,
if (code < 0)
return code;
num_des_comps = gsicc_get_device_profile_comps(dev_profile);
- rendering_params.black_point_comp = pis->blackptcomp;
+ rendering_params.black_point_comp = pgs->blackptcomp;
rendering_params.graphics_type_tag = dev->graphics_type_tag;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = pis->renderingintent;
+ rendering_params.rendering_intent = pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
/* Need to clear out psrc_cm in case we have separation bands that are
not color managed */
@@ -494,7 +494,7 @@ gx_remap_ICC_imagelab(const gs_client_color * pcc, const gs_color_space * pcs,
psrc[k] = (unsigned short) (pcc->paint.values[k]*65535.0);
/* Get a link from the cache, or create if it is not there. Need to get 16 bit profile */
- icc_link = gsicc_get_link(pis, dev, pcs, NULL, &rendering_params, pis->memory);
+ icc_link = gsicc_get_link(pgs, dev, pcs, NULL, &rendering_params, pgs->memory);
if (icc_link == NULL) {
#ifdef DEBUG
gs_warn("Could not create ICC link: Check profiles");
@@ -517,7 +517,7 @@ gx_remap_ICC_imagelab(const gs_client_color * pcc, const gs_color_space * pcs,
for ( k = 0; k < num_des_comps; k++){
conc[k] = ushort2frac(psrc_temp[k]);
}
- gx_remap_concrete_ICC(conc, pcs, pdc, pis, dev, select);
+ gx_remap_concrete_ICC(conc, pcs, pdc, pgs, dev, select);
/* Save original color space and color info into dev color */
i = pcs->cmm_icc_profile_data->num_comps;
@@ -534,7 +534,7 @@ gx_concretize_ICC(
const gs_client_color * pcc,
const gs_color_space * pcs,
frac * pconc,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
gx_device *dev)
{
@@ -552,17 +552,17 @@ gx_concretize_ICC(
return code;
num_des_comps = gsicc_get_device_profile_comps(dev_profile);
/* Define the rendering intents. */
- rendering_params.black_point_comp = pis->blackptcomp;
+ rendering_params.black_point_comp = pgs->blackptcomp;
rendering_params.graphics_type_tag = dev->graphics_type_tag;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = pis->renderingintent;
+ rendering_params.rendering_intent = pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
for (k = 0; k < pcs->cmm_icc_profile_data->num_comps; k++) {
psrc[k] = (unsigned short) (pcc->paint.values[k]*65535.0);
}
/* Get a link from the cache, or create if it is not there. Get 16 bit profile */
- icc_link = gsicc_get_link(pis, dev, pcs, NULL, &rendering_params, pis->memory);
+ icc_link = gsicc_get_link(pgs, dev, pcs, NULL, &rendering_params, pgs->memory);
if (icc_link == NULL) {
#ifdef DEBUG
gs_warn("Could not create ICC link: Check profiles");
@@ -608,7 +608,7 @@ gx_final_ICC(const gs_color_space * pcs)
* the ICC profile or the alternate color space is to be used.
*/
static int
-gx_install_ICC(gs_color_space * pcs, gs_state * pgs)
+gx_install_ICC(gs_color_space * pcs, gs_gstate * pgs)
{
/* update the stub information used by the joint caches */
return 0;
@@ -648,7 +648,7 @@ gx_serialize_ICC(const gs_color_space * pcs, stream * s)
/* Overprint. Here we may have either spot colors or CMYK colors. */
static int
-gx_set_overprint_ICC(const gs_color_space * pcs, gs_state * pgs)
+gx_set_overprint_ICC(const gs_color_space * pcs, gs_gstate * pgs)
{
gx_device *dev = pgs->device;
gx_device_color_info *pcinfo = (dev == 0 ? 0 : &dev->color_info);
diff --git a/base/gsicc_cache.c b/base/gsicc_cache.c
index dc294af81..871bc3242 100644
--- a/base/gsicc_cache.c
+++ b/base/gsicc_cache.c
@@ -22,7 +22,7 @@
#include "gsstruct.h"
#include "scommon.h"
#include "gx.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "smd5.h"
#include "gscms.h"
#include "gsicc_cms.h"
@@ -571,7 +571,7 @@ gsicc_remove_link(gsicc_link_t *link, const gs_memory_t *memory)
}
gsicc_link_t*
-gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
+gsicc_get_link(const gs_gstate *pgs1, gx_device *dev_in,
const gs_color_space *pcs_in,
gs_color_space *output_colorspace,
gsicc_rendering_param_t *rendering_params, gs_memory_t *memory)
@@ -579,7 +579,7 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
cmm_profile_t *gs_input_profile;
cmm_profile_t *gs_srcgtag_profile = NULL;
cmm_profile_t *gs_output_profile;
- gs_state *pgs;
+ gs_gstate *pgs = (gs_gstate *)pgs1;
gx_device *dev;
gsicc_rendering_param_t render_cond;
cmm_dev_profile_t *dev_profile;
@@ -588,9 +588,9 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
gs_color_space *input_colorspace = (gs_color_space*) pcs_in;
if (dev_in == NULL) {
- /* Get from the imager state which is going to be a graphic state.
+ /* Get from the gs_gstate which is going to be a graphic state.
This only occurs for the other (non-ps/pdf) interpreters */
- pgs = (gs_state*) pis;
+ pgs = (gs_gstate*) pgs;
dev = pgs->device;
} else {
dev = dev_in;
@@ -601,7 +601,7 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
} else {
/* Use default type */
gs_input_profile = gsicc_get_gscs_profile(input_colorspace,
- pis->icc_manager);
+ pgs->icc_manager);
}
} else {
gs_input_profile = input_colorspace->cmm_icc_profile_data;
@@ -610,13 +610,13 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
if (code < 0)
return NULL;
/* If present, use an graphic object defined source profile */
- if (pis->icc_manager != NULL &&
- pis->icc_manager->srcgtag_profile != NULL) {
+ if (pgs->icc_manager != NULL &&
+ pgs->icc_manager->srcgtag_profile != NULL) {
if (gs_input_profile->data_cs == gsRGB
|| gs_input_profile->data_cs == gsCMYK) {
gsicc_get_srcprofile(gs_input_profile->data_cs,
dev->graphics_type_tag,
- pis->icc_manager->srcgtag_profile,
+ pgs->icc_manager->srcgtag_profile,
&(gs_srcgtag_profile), &render_cond);
if (gs_srcgtag_profile != NULL) {
/* In this case, the user is letting the source profiles
@@ -651,7 +651,7 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
rendering_params->black_point_comp =
render_cond.black_point_comp & gsBP_MASK;
- return gsicc_get_link_profile(pis, dev, gs_input_profile,
+ return gsicc_get_link_profile(pgs, dev, gs_input_profile,
dev_profile->device_profile[0],
rendering_params, memory,
false);
@@ -666,9 +666,9 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
gsicc_link_t *link;
if (gs_input_profile->data_cs == gsRGB) {
- link = gsicc_nocm_get_link(pis, dev, 3);
+ link = gsicc_nocm_get_link(pgs, dev, 3);
} else {
- link = gsicc_nocm_get_link(pis, dev, 4);
+ link = gsicc_nocm_get_link(pgs, dev, 4);
}
/* Set the identity case if we are in that situation */
if (link != NULL) {
@@ -679,7 +679,7 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
return link;
}
} else if (render_cond.cmm == gsCMM_REPLACE) {
- return gsicc_rcm_get_link(pis, dev,
+ return gsicc_rcm_get_link(pgs, dev,
gs_input_profile->data_cs);
/* Note that there is never an identity case */
}
@@ -701,7 +701,7 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
if (index < gs_color_space_index_DevicePixel &&
dev_profile->usefastcolor) {
/* Return a "link" from the source space to the device color space */
- gsicc_link_t *link = gsicc_nocm_get_link(pis, dev,
+ gsicc_link_t *link = gsicc_nocm_get_link(pgs, dev,
gs_input_profile->num_comps);
if (link != NULL) {
if (gs_input_profile->num_comps ==
@@ -742,7 +742,7 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in,
rendering_params->rendering_intent = rendering_params->rendering_intent & gsRI_MASK;
rendering_params->black_point_comp = rendering_params->black_point_comp & gsBP_MASK;
rendering_params->preserve_black = rendering_params->preserve_black & gsKP_MASK;
- return gsicc_get_link_profile(pis, dev, gs_input_profile, gs_output_profile,
+ return gsicc_get_link_profile(pgs, dev, gs_input_profile, gs_output_profile,
rendering_params, memory, devicegraytok);
}
@@ -809,7 +809,7 @@ gsicc_alloc_link_entry(gsicc_link_cache_t *icc_link_cache,
source profile is a device link profile we have no output profile but
may still have a proofing or another device link profile to use */
gsicc_link_t*
-gsicc_get_link_profile(const gs_imager_state *pis, gx_device *dev,
+gsicc_get_link_profile(const gs_gstate *pgs, gx_device *dev,
cmm_profile_t *gs_input_profile,
cmm_profile_t *gs_output_profile,
gsicc_rendering_param_t *rendering_params,
@@ -818,9 +818,9 @@ gsicc_get_link_profile(const gs_imager_state *pis, gx_device *dev,
gsicc_hashlink_t hash;
gsicc_link_t *link, *found_link;
gcmmhlink_t link_handle = NULL;
- gsicc_manager_t *icc_manager = pis->icc_manager;
- gsicc_link_cache_t *icc_link_cache = pis->icc_link_cache;
- gs_memory_t *cache_mem = pis->icc_link_cache->memory;
+ gsicc_manager_t *icc_manager = pgs->icc_manager;
+ gsicc_link_cache_t *icc_link_cache = pgs->icc_link_cache;
+ gs_memory_t *cache_mem = pgs->icc_link_cache->memory;
gcmmhprofile_t *cms_input_profile;
gcmmhprofile_t *cms_output_profile = NULL;
gcmmhprofile_t *cms_proof_profile = NULL;
@@ -907,9 +907,9 @@ gsicc_get_link_profile(const gs_imager_state *pis, gx_device *dev,
gs_input_profile->rend_cond.cmm == gsCMM_NONE) {
if (gs_input_profile->data_cs == gsRGB) {
- link = gsicc_nocm_get_link(pis, dev, 3);
+ link = gsicc_nocm_get_link(pgs, dev, 3);
} else {
- link = gsicc_nocm_get_link(pis, dev, 4);
+ link = gsicc_nocm_get_link(pgs, dev, 4);
}
/* Set the identity case if we are in that situation */
if (link != NULL) {
@@ -921,7 +921,7 @@ gsicc_get_link_profile(const gs_imager_state *pis, gx_device *dev,
}
} else if (gs_input_profile->rend_is_valid &&
gs_input_profile->rend_cond.cmm == gsCMM_REPLACE) {
- return gsicc_rcm_get_link(pis, dev, gs_input_profile->data_cs);
+ return gsicc_rcm_get_link(pgs, dev, gs_input_profile->data_cs);
/* Note that there is never an identity case for
this type. */
}
@@ -1044,13 +1044,13 @@ gsicc_get_link_profile(const gs_imager_state *pis, gx_device *dev,
DeviceCMYK to ensure that Gray is mapped to K only. This is only
done once and then it is cached and the link used */
if (!src_dev_link && gs_output_profile->data_cs == gsCMYK &&
- gs_input_profile->data_cs == gsGRAY && pis->icc_manager != NULL &&
+ gs_input_profile->data_cs == gsGRAY && pgs->icc_manager != NULL &&
devicegraytok) {
if (icc_manager->graytok_profile == NULL) {
icc_manager->graytok_profile =
gsicc_set_iccsmaskprofile(GRAY_TO_K, strlen(GRAY_TO_K),
- pis->icc_manager,
- pis->icc_manager->memory->stable_memory);
+ pgs->icc_manager,
+ pgs->icc_manager->memory->stable_memory);
if (icc_manager->graytok_profile == NULL) {
return NULL;
}
@@ -1232,7 +1232,7 @@ gsicc_transform_named_color(const float tint_values[],
gsicc_namedcolor_t color_names[],
uint num_names,
gx_color_value device_values[],
- const gs_imager_state *pis, gx_device *dev,
+ const gs_gstate *pgs, gx_device *dev,
cmm_profile_t *gs_output_profile,
gsicc_rendering_param_t *rendering_params)
{
@@ -1262,7 +1262,7 @@ gsicc_transform_named_color(const float tint_values[],
gsicc_rendering_param_t render_cond;
cmm_dev_profile_t *dev_profile;
int indices[GS_CLIENT_COLOR_MAX_COMPONENTS];
- gs_memory_t *nongc_mem = pis->memory->non_gc_memory;
+ gs_memory_t *nongc_mem = pgs->memory->non_gc_memory;
/* Set indices to avoid use of uninitialized index. It is actually not
possible to access them using real data but someone could perhaps
@@ -1270,9 +1270,9 @@ gsicc_transform_named_color(const float tint_values[],
memset(&(indices[0]), 0, sizeof(indices));
/* Check if the data that we have has already been generated. */
- if (pis->icc_manager != NULL) {
- if (pis->icc_manager->device_named != NULL) {
- named_profile = pis->icc_manager->device_named;
+ if (pgs->icc_manager != NULL) {
+ if (pgs->icc_manager->device_named != NULL) {
+ named_profile = pgs->icc_manager->device_named;
if (named_profile->buffer != NULL &&
named_profile->profile_handle == NULL) {
/* Create the structure that we will use in searching */
@@ -1444,10 +1444,10 @@ gsicc_transform_named_color(const float tint_values[],
dev_profile, &(curr_output_profile),
&render_cond);
}
- icc_link = gsicc_get_link_profile(pis, dev,
- pis->icc_manager->lab_profile,
+ icc_link = gsicc_get_link_profile(pgs, dev,
+ pgs->icc_manager->lab_profile,
curr_output_profile, rendering_params,
- pis->memory, false);
+ pgs->memory, false);
if (icc_link->is_identity) {
psrc_temp = &(psrc[0]);
} else {
diff --git a/base/gsicc_cache.h b/base/gsicc_cache.h
index 955ae31ec..77ca9b8f6 100644
--- a/base/gsicc_cache.h
+++ b/base/gsicc_cache.h
@@ -18,9 +18,9 @@
#ifndef gsicccache_INCLUDED
# define gsicccache_INCLUDED
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gx_device_DEFINED
@@ -46,12 +46,12 @@ void gsicc_init_buffer(gsicc_bufferdesc_t *buffer_desc, unsigned char num_chan,
bool gsicc_alloc_link_entry(gsicc_link_cache_t *icc_link_cache,
gsicc_link_t **ret_link, gsicc_hashlink_t hash,
bool include_softproof, bool include_devlink);
-gsicc_link_t* gsicc_get_link(const gs_imager_state * pis, gx_device *dev,
+gsicc_link_t* gsicc_get_link(const gs_gstate * pgs, gx_device *dev,
const gs_color_space *input_colorspace,
gs_color_space *output_colorspace,
gsicc_rendering_param_t *rendering_params,
gs_memory_t *memory);
-gsicc_link_t* gsicc_get_link_profile(const gs_imager_state *pis, gx_device *dev,
+gsicc_link_t* gsicc_get_link_profile(const gs_gstate *pgs, gx_device *dev,
cmm_profile_t *gs_input_profile,
cmm_profile_t *gs_output_profile,
gsicc_rendering_param_t *rendering_params,
@@ -64,7 +64,7 @@ int gsicc_transform_named_color(const float tint_values[],
gsicc_namedcolor_t color_names[],
uint num_names,
gx_color_value device_values[],
- const gs_imager_state *pis, gx_device *dev,
+ const gs_gstate *pgs, gx_device *dev,
cmm_profile_t *gs_output_profile,
gsicc_rendering_param_t *rendering_params);
int gsicc_get_device_profile_comps(cmm_dev_profile_t *dev_profile);
diff --git a/base/gsicc_cms.h b/base/gsicc_cms.h
index cf6cb5f6e..b9a810347 100644
--- a/base/gsicc_cms.h
+++ b/base/gsicc_cms.h
@@ -39,9 +39,9 @@ bool gsicc_mcm_monitor_lab(void *inputcolor, int num_bytes);
void gsicc_mcm_set_link(gsicc_link_t* link);
int gsicc_mcm_end_monitor(gsicc_link_cache_t *cache, gx_device *dev);
int gsicc_mcm_begin_monitor(gsicc_link_cache_t *cache, gx_device *dev);
-gsicc_link_t* gsicc_rcm_get_link(const gs_imager_state *pis, gx_device *dev,
+gsicc_link_t* gsicc_rcm_get_link(const gs_gstate *pgs, gx_device *dev,
gsicc_colorbuffer_t data_cs);
-gsicc_link_t* gsicc_nocm_get_link(const gs_imager_state *pis, gx_device *dev,
+gsicc_link_t* gsicc_nocm_get_link(const gs_gstate *pgs, gx_device *dev,
gs_color_space_index src_index);
gcmmhprofile_t gscms_get_profile_handle_mem(gs_memory_t *mem,
unsigned char *buffer,
diff --git a/base/gsicc_create.c b/base/gsicc_create.c
index 7e5ece2f4..bffff50ab 100644
--- a/base/gsicc_create.c
+++ b/base/gsicc_create.c
@@ -123,7 +123,7 @@ Note: All profile data must be encoded as big-endian
#include "gx.h"
#include <gp.h>
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gstypes.h"
#include "gscspace.h"
#include "gscie.h"
@@ -299,7 +299,7 @@ gsicc_create_clut(const gs_color_space *pcs, gsicc_clut *clut, gs_range *ranges,
gs_vector3 *white_point, bool range_adjust, float cam[],
gs_memory_t *memory)
{
- gs_imager_state *pis;
+ gs_gstate *pgs;
int code;
int num_points = clut->clut_num_entries;
int table_size = clut->clut_dims[0]; /* Same resolution in each direction*/
@@ -316,7 +316,7 @@ gsicc_create_clut(const gs_color_space *pcs, gsicc_clut *clut, gs_range *ranges,
/* This completes the joint cache inefficiently so that
we can sample through it and get our table entries */
- code = gx_cie_to_xyz_alloc(&pis, pcs, memory);
+ code = gx_cie_to_xyz_alloc(&pgs, pcs, memory);
if (code < 0)
return gs_rethrow(code, "Allocation of cie to xyz transform failed");
cs_index = gs_color_space_get_index(pcs);
@@ -385,7 +385,7 @@ gsicc_create_clut(const gs_color_space *pcs, gsicc_clut *clut, gs_range *ranges,
the ICC mapping like the procs associated with the color space */
switch (cs_index) {
case gs_color_space_index_CIEA:
- gx_psconcretize_CIEA(&cc, pcs, xyz, xyz_float, pis);
+ gx_psconcretize_CIEA(&cc, pcs, xyz, xyz_float, pgs);
/* AR forces this case to always be achromatic. We will
do the same even though it does not match the PS
specification */
@@ -396,13 +396,13 @@ gsicc_create_clut(const gs_color_space *pcs, gsicc_clut *clut, gs_range *ranges,
xyz_float[2] = white_point->w * xyz_float[1];
break;
case gs_color_space_index_CIEABC:
- gx_psconcretize_CIEABC(&cc, pcs, xyz, xyz_float, pis);
+ gx_psconcretize_CIEABC(&cc, pcs, xyz, xyz_float, pgs);
break;
case gs_color_space_index_CIEDEF:
- gx_psconcretize_CIEDEF(&cc, pcs, xyz, xyz_float, pis);
+ gx_psconcretize_CIEDEF(&cc, pcs, xyz, xyz_float, pgs);
break;
case gs_color_space_index_CIEDEFG:
- gx_psconcretize_CIEDEFG(&cc, pcs, xyz, xyz_float, pis);
+ gx_psconcretize_CIEDEFG(&cc, pcs, xyz, xyz_float, pgs);
break;
default:
return gs_throw(-1, "Invalid gs_color_space_index when creating ICC profile");
@@ -419,7 +419,7 @@ gsicc_create_clut(const gs_color_space *pcs, gsicc_clut *clut, gs_range *ranges,
*ptr_short ++= (unsigned int)(temp * 65535);
}
}
- gx_cie_to_xyz_free(pis); /* Free the joint cache we created */
+ gx_cie_to_xyz_free(pgs); /* Free the joint cache we created */
for (i = 0; i < num_components; i++) {
gs_free_object(memory, input_samples[i], "gsicc_create_clut");
}
@@ -1816,7 +1816,7 @@ gsicc_create_fromabc(const gs_color_space *pcs, unsigned char **pp_buffer_in,
return gs_rethrow(code, "Create ICC from CIEABC failed");
}
- /* Detect if the space is CIELAB. We don't have access to pis here though */
+ /* Detect if the space is CIELAB. We don't have access to pgs here though */
/* *islab = cie_is_lab(pcie); This is not working yet */
*islab = false;
@@ -2403,7 +2403,7 @@ write_v2_common_data(byte *buffer, int profile_size, icHeader *header,
}
static gsicc_link_t*
-get_link(const gs_imager_state *pis, cmm_profile_t *src_profile,
+get_link(const gs_gstate *pgs, cmm_profile_t *src_profile,
cmm_profile_t *des_profile, gsicc_rendering_intents_t intent)
{
gsicc_rendering_param_t rendering_params;
@@ -2415,8 +2415,8 @@ get_link(const gs_imager_state *pis, cmm_profile_t *src_profile,
rendering_params.preserve_black = gsBLACKPRESERVE_OFF;
rendering_params.rendering_intent = intent;
rendering_params.cmm = gsCMM_DEFAULT;
- return gsicc_get_link_profile(pis, NULL, src_profile, des_profile,
- &rendering_params, pis->memory, false);
+ return gsicc_get_link_profile(pgs, NULL, src_profile, des_profile,
+ &rendering_params, pgs->memory, false);
}
static void
@@ -2666,7 +2666,7 @@ add_lutType(byte *input_ptr, gsicc_clut *lut)
}
static int
-create_write_table_intent(const gs_imager_state *pis, gsicc_rendering_intents_t intent,
+create_write_table_intent(const gs_gstate *pgs, gsicc_rendering_intents_t intent,
cmm_profile_t *src_profile, cmm_profile_t *des_profile, byte *curr_ptr,
int table_size, int bit_depth)
{
@@ -2674,19 +2674,19 @@ create_write_table_intent(const gs_imager_state *pis, gsicc_rendering_intents_t
int code;
gsicc_clut clut;
- link = get_link(pis, src_profile, des_profile, intent);
+ link = get_link(pgs, src_profile, des_profile, intent);
code = create_clut_v2(&clut, link, src_profile->num_comps,
- des_profile->num_comps, table_size, pis->memory, bit_depth);
+ des_profile->num_comps, table_size, pgs->memory, bit_depth);
if (code < 0)
return code;
add_lutType(curr_ptr, &clut);
- clean_lut(&clut, pis->memory);
+ clean_lut(&clut, pgs->memory);
gsicc_release_link(link);
return 0;
}
static void
-gsicc_create_v2input(const gs_imager_state *pis, icHeader *header, cmm_profile_t *src_profile,
+gsicc_create_v2input(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src_profile,
byte *mediawhitept, cmm_profile_t *lab_profile)
{
/* Need to create the forward table only (Gray, RGB, CMYK to LAB) */
@@ -2735,11 +2735,11 @@ gsicc_create_v2input(const gs_imager_state *pis, icHeader *header, cmm_profile_t
num_tags, mediawhitept);
/* Now the A2B0 Tag */
- link = get_link(pis, src_profile, lab_profile, gsPERCEPTUAL);
+ link = get_link(pgs, src_profile, lab_profile, gsPERCEPTUAL);
/* First create the data */
code = create_clut_v2(&clut, link, src_profile->num_comps, 3,
- FORWARD_V2_TABLE_SIZE, pis->memory, 2);
+ FORWARD_V2_TABLE_SIZE, pgs->memory, 2);
if (code < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2input");
return;
@@ -2750,7 +2750,7 @@ gsicc_create_v2input(const gs_imager_state *pis, icHeader *header, cmm_profile_t
/* Clean up */
gsicc_release_link(link);
- clean_lut(&clut, pis->memory);
+ clean_lut(&clut, pgs->memory);
gs_free_object(memory, tag_list, "gsicc_create_v2input");
/* Save the v2 data */
src_profile->v2_data = buffer;
@@ -2763,7 +2763,7 @@ gsicc_create_v2input(const gs_imager_state *pis, icHeader *header, cmm_profile_t
}
static void
-gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_t *src_profile,
+gsicc_create_v2output(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src_profile,
byte *mediawhitept, cmm_profile_t *lab_profile)
{
/* Need to create forward and backward table (Gray, RGB, CMYK to LAB and back)
@@ -2834,7 +2834,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
tag_location = V2_COMMON_TAGS;
/* A2B0 */
- if (create_write_table_intent(pis, gsPERCEPTUAL, src_profile, lab_profile,
+ if (create_write_table_intent(pgs, gsPERCEPTUAL, src_profile, lab_profile,
curr_ptr, FORWARD_V2_TABLE_SIZE, 2) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
@@ -2842,7 +2842,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
curr_ptr += tag_list[tag_location].size;
tag_location++;
/* B2A0 */
- if (create_write_table_intent(pis, gsPERCEPTUAL, lab_profile, src_profile,
+ if (create_write_table_intent(pgs, gsPERCEPTUAL, lab_profile, src_profile,
curr_ptr, BACKWARD_V2_TABLE_SIZE, 1) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
@@ -2851,7 +2851,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
tag_location++;
/* A2B1 */
- if (create_write_table_intent(pis, gsRELATIVECOLORIMETRIC, src_profile,
+ if (create_write_table_intent(pgs, gsRELATIVECOLORIMETRIC, src_profile,
lab_profile, curr_ptr, FORWARD_V2_TABLE_SIZE, 2) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
@@ -2859,7 +2859,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
curr_ptr += tag_list[tag_location].size;
tag_location++;
/* B2A1 */
- if (create_write_table_intent(pis, gsRELATIVECOLORIMETRIC, lab_profile,
+ if (create_write_table_intent(pgs, gsRELATIVECOLORIMETRIC, lab_profile,
src_profile, curr_ptr, BACKWARD_V2_TABLE_SIZE, 1) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
@@ -2868,7 +2868,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
tag_location++;
/* A2B2 */
- if (create_write_table_intent(pis, gsSATURATION, src_profile, lab_profile,
+ if (create_write_table_intent(pgs, gsSATURATION, src_profile, lab_profile,
curr_ptr, FORWARD_V2_TABLE_SIZE, 2) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
@@ -2876,7 +2876,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
curr_ptr += tag_list[tag_location].size;
tag_location++;
/* B2A2 */
- if (create_write_table_intent(pis, gsSATURATION, lab_profile, src_profile,
+ if (create_write_table_intent(pgs, gsSATURATION, lab_profile, src_profile,
curr_ptr, BACKWARD_V2_TABLE_SIZE, 1) < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
@@ -2885,7 +2885,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
tag_location++;
/* Gamut tag, which is bogus */
- code = create_clut_v2(&gamutlut, NULL, src_profile->num_comps, 1, 2, pis->memory, 1);
+ code = create_clut_v2(&gamutlut, NULL, src_profile->num_comps, 1, 2, pgs->memory, 1);
if (code < 0) {
gs_free_object(memory, tag_list, "gsicc_create_v2output");
return;
@@ -2895,7 +2895,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
/* Done */
gs_free_object(memory, tag_list, "gsicc_create_v2output");
- clean_lut(&gamutlut, pis->memory);
+ clean_lut(&gamutlut, pgs->memory);
/* Save the v2 data */
src_profile->v2_data = buffer;
src_profile->v2_size = profile_size;
@@ -2907,7 +2907,7 @@ gsicc_create_v2output(const gs_imager_state *pis, icHeader *header, cmm_profile_
}
static void
-gsicc_create_v2displaygray(const gs_imager_state *pis, icHeader *header, cmm_profile_t *src_profile,
+gsicc_create_v2displaygray(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src_profile,
byte *mediawhitept, cmm_profile_t *xyz_profile)
{
int num_tags = 4;
@@ -2957,7 +2957,7 @@ gsicc_create_v2displaygray(const gs_imager_state *pis, icHeader *header, cmm_pro
/* Now the TRC. First collect the curve data and then write it out */
/* Get the link between our gray profile and XYZ profile */
- link = get_link(pis, src_profile, xyz_profile, gsPERCEPTUAL);
+ link = get_link(pgs, src_profile, xyz_profile, gsPERCEPTUAL);
/* First get the max value for Y on the range */
src = 65535;
(link->procs.map_color)(NULL, link, &src, &(des[0]), 2);
@@ -2987,7 +2987,7 @@ gsicc_create_v2displaygray(const gs_imager_state *pis, icHeader *header, cmm_pro
}
static void
-gsicc_create_v2displayrgb(const gs_imager_state *pis, icHeader *header, cmm_profile_t *src_profile,
+gsicc_create_v2displayrgb(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src_profile,
byte *mediawhitept, cmm_profile_t *xyz_profile)
{
int num_tags = 9;
@@ -3043,7 +3043,7 @@ gsicc_create_v2displayrgb(const gs_imager_state *pis, icHeader *header, cmm_prof
/* Now the main colorants. Get them and the TRC data from using the link
between the source profile and the CIEXYZ profile */
- link = get_link(pis, src_profile, xyz_profile, gsPERCEPTUAL);
+ link = get_link(pgs, src_profile, xyz_profile, gsPERCEPTUAL);
/* Get the Red, Green and Blue colorants */
for (k = 0; k < 3; k++) {
@@ -3077,15 +3077,15 @@ gsicc_create_v2displayrgb(const gs_imager_state *pis, icHeader *header, cmm_prof
}
static void
-gsicc_create_v2display(const gs_imager_state *pis, icHeader *header, cmm_profile_t *src_profile,
+gsicc_create_v2display(const gs_gstate *pgs, icHeader *header, cmm_profile_t *src_profile,
byte *mediawhitept, cmm_profile_t *xyz_profile)
{
/* Need to create matrix with the TRCs. Have to worry about gray
and RGB cases. */
if (header->colorSpace == icSigGrayData)
- gsicc_create_v2displaygray(pis, header, src_profile, mediawhitept, xyz_profile);
+ gsicc_create_v2displaygray(pgs, header, src_profile, mediawhitept, xyz_profile);
else
- gsicc_create_v2displayrgb(pis, header, src_profile, mediawhitept, xyz_profile);
+ gsicc_create_v2displayrgb(pgs, header, src_profile, mediawhitept, xyz_profile);
}
static int
@@ -3250,7 +3250,7 @@ get_mediawp(cmm_profile_t *src_profile, byte *mediawhitept)
}
static void
-gsicc_create_v2(const gs_imager_state *pis, cmm_profile_t *src_profile)
+gsicc_create_v2(const gs_gstate *pgs, cmm_profile_t *src_profile)
{
icProfile iccprofile;
icHeader *header = &(iccprofile.header);
@@ -3298,10 +3298,10 @@ gsicc_create_v2(const gs_imager_state *pis, cmm_profile_t *src_profile)
/* Also, we will want to create an XYZ ICC profile that we can use for
creating our data with lcms. If already created, this profile is
stored in the manager */
- if (pis->icc_manager->xyz_profile != NULL) {
- xyz_profile = pis->icc_manager->xyz_profile;
+ if (pgs->icc_manager->xyz_profile != NULL) {
+ xyz_profile = pgs->icc_manager->xyz_profile;
} else {
- xyz_profile = gsicc_profile_new(NULL, pis->memory, NULL, 0);
+ xyz_profile = gsicc_profile_new(NULL, pgs->memory, NULL, 0);
if (xyz_profile == NULL) {
#ifdef DEBUG
gs_warn("Failed in creating V2 ICC profile");
@@ -3314,25 +3314,25 @@ gsicc_create_v2(const gs_imager_state *pis, cmm_profile_t *src_profile)
#endif
return;
}
- pis->icc_manager->xyz_profile = xyz_profile;
+ pgs->icc_manager->xyz_profile = xyz_profile;
}
/* The type of stuff that we need to create */
switch (header->deviceClass) {
case icSigInputClass:
header->pcs = icSigLabData;
- gsicc_create_v2input(pis, header, src_profile, mediawhitept,
- pis->icc_manager->lab_profile);
+ gsicc_create_v2input(pgs, header, src_profile, mediawhitept,
+ pgs->icc_manager->lab_profile);
break;
case icSigDisplayClass:
header->pcs = icSigXYZData;
- gsicc_create_v2display(pis, header, src_profile, mediawhitept,
+ gsicc_create_v2display(pgs, header, src_profile, mediawhitept,
xyz_profile);
break;
case icSigOutputClass:
header->pcs = icSigLabData;
- gsicc_create_v2output(pis, header, src_profile, mediawhitept,
- pis->icc_manager->lab_profile);
+ gsicc_create_v2output(pgs, header, src_profile, mediawhitept,
+ pgs->icc_manager->lab_profile);
break;
default:
#ifdef DEBUG
@@ -3368,7 +3368,7 @@ gsicc_create_isv2(cmm_profile_t *profile)
}
byte*
-gsicc_create_getv2buffer(const gs_imager_state *pis, cmm_profile_t *srcprofile,
+gsicc_create_getv2buffer(const gs_gstate *pgs, cmm_profile_t *srcprofile,
int *size)
{
if (gsicc_create_isv2(srcprofile)) {
@@ -3379,10 +3379,10 @@ gsicc_create_getv2buffer(const gs_imager_state *pis, cmm_profile_t *srcprofile,
if (srcprofile->profile_handle == NULL)
srcprofile->profile_handle =
gsicc_get_profile_handle_buffer(srcprofile->buffer,
- srcprofile->buffer_size, pis->memory);
+ srcprofile->buffer_size, pgs->memory);
/* Need to create v2 profile */
- gsicc_create_v2(pis, srcprofile);
+ gsicc_create_v2(pgs, srcprofile);
*size = srcprofile->v2_size;
return srcprofile->v2_data;
diff --git a/base/gsicc_create.h b/base/gsicc_create.h
index 7d69d47f4..1d4066b4f 100644
--- a/base/gsicc_create.h
+++ b/base/gsicc_create.h
@@ -42,6 +42,6 @@ cmm_profile_t* gsicc_create_from_cal(float *white, float *black, float *gamma,
float *matrix, gs_memory_t *memory,
int num_colors);
byte* gsicc_getv2buffer(cmm_profile_t *srcprofile, int *size);
-byte* gsicc_create_getv2buffer(const gs_imager_state *pis,
+byte* gsicc_create_getv2buffer(const gs_gstate *pgs,
cmm_profile_t *srcprofile, int *size);
#endif
diff --git a/base/gsicc_manage.c b/base/gsicc_manage.c
index d11fb1b46..a30578761 100644
--- a/base/gsicc_manage.c
+++ b/base/gsicc_manage.c
@@ -24,7 +24,7 @@
#include "strmio.h"
#include "gx.h"
#include "gp.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxcspace.h"
#include "gscms.h"
#include "gsicc_manage.h"
@@ -53,7 +53,7 @@ extern const gs_color_space_type gs_color_space_type_ICC;
/* Static prototypes */
static void gsicc_set_default_cs_value(cmm_profile_t *picc_profile,
- gs_imager_state *pis);
+ gs_gstate *pgs);
static gsicc_namelist_t* gsicc_new_namelist(gs_memory_t *memory);
static gsicc_colorname_t* gsicc_new_colorname(gs_memory_t *memory);
static gsicc_namelist_t* gsicc_get_spotnames(gcmmhprofile_t profile,
@@ -816,10 +816,10 @@ gsicc_set_profile(gsicc_manager_t *icc_manager, const char* pname, int namelen,
}
}
/* If it is not NULL then it has already been set. If it is different than
- what we already have then we will want to free it. Since other imager
- states could have different default profiles, this is done via reference
+ what we already have then we will want to free it. Since other
+ gs_gstates could have different default profiles, this is done via reference
counting. If it is the same as what we already have then we DONT
- increment, since that is done when the imager state is duplicated. It
+ increment, since that is done when the gs_gstate is duplicated. It
could be the same, due to a resetting of the user params. To avoid
recreating the profile data, we compare the string names. */
if (defaulttype != DEVICEN_TYPE && (*manager_default_profile) != NULL) {
@@ -1352,11 +1352,11 @@ gsicc_set_device_blackptcomp(gx_device *dev, gsicc_blackptcomp_t blackptcomp,
exist in an output DeviceN profile. We do this by faking a new separation
space for each one */
int
-gsicc_set_devicen_equiv_colors(gx_device *dev, const gs_imager_state * pis,
+gsicc_set_devicen_equiv_colors(gx_device *dev, const gs_gstate * pgs,
cmm_profile_t *profile)
{
- gs_state temp_state = *((gs_state*)pis);
- gs_color_space *pcspace = gs_cspace_alloc(pis->memory->non_gc_memory,
+ gs_gstate temp_state = *((gs_gstate*)pgs);
+ gs_color_space *pcspace = gs_cspace_alloc(pgs->memory->non_gc_memory,
&gs_color_space_type_ICC);
if (pcspace == NULL)
return gs_throw(gs_error_VMerror, "Insufficient memory for devn equiv colors");
@@ -1507,7 +1507,7 @@ gsicc_set_device_profile_colorants(gx_device *dev, char *name_str)
}
/* We need to set the equivalent CMYK color for this colorant. This is
done by faking out the update spot equivalent call with a special
- imager state and color space that makes it seem like the
+ gs_gstate and color space that makes it seem like the
spot color is a separation color space. Unfortunately, we need the
graphic state to do this so we save it for later when we try to do
our first mapping. We then use this flag to know if we did it yet */
@@ -1910,7 +1910,7 @@ rc_free_icc_profile(gs_memory_t * mem, void *ptr_in, client_name_t cname)
/* We are just starting up. We need to set the initial color space in the
graphic state at this time */
int
-gsicc_init_gs_colors(gs_state *pgs)
+gsicc_init_gs_colors(gs_gstate *pgs)
{
int code = 0;
gs_color_space *cs_old;
@@ -1939,7 +1939,7 @@ gsicc_init_gs_colors(gs_state *pgs)
/* Only set those that have not already been set. */
int
-gsicc_init_iccmanager(gs_state * pgs)
+gsicc_init_iccmanager(gs_gstate * pgs)
{
int code = 0, k;
const char *pname;
@@ -1974,7 +1974,6 @@ gsicc_init_iccmanager(gs_state * pgs)
/* Test bed for V2 creation from V4 */
for (int j = 2; j < 3; j++)
{
- gs_imager_state *pis = (gs_imager_state*)pgs;
byte *data;
int size;
@@ -1992,7 +1991,7 @@ gsicc_init_iccmanager(gs_state * pgs)
profile = NULL;
}
gsicc_initialize_default_profile(profile);
- data = gsicc_create_getv2buffer(pis, profile, &size);
+ data = gsicc_create_getv2buffer(pgs, profile, &size);
}
#endif
return 0;
@@ -2154,9 +2153,9 @@ gsicc_load_namedcolor_buffer(cmm_profile_t *profile, stream *s,
/* Check if the embedded profile is the same as any of the default profiles */
static void
-gsicc_set_default_cs_value(cmm_profile_t *picc_profile, gs_imager_state *pis)
+gsicc_set_default_cs_value(cmm_profile_t *picc_profile, gs_gstate *pgs)
{
- gsicc_manager_t *icc_manager = pis->icc_manager;
+ gsicc_manager_t *icc_manager = pgs->icc_manager;
int64_t hashcode = picc_profile->hashcode;
if ( picc_profile->default_match == DEFAULT_NONE ) {
@@ -2191,14 +2190,14 @@ gsicc_set_default_cs_value(cmm_profile_t *picc_profile, gs_imager_state *pis)
/* Initialize the hash code value */
void
-gsicc_init_hash_cs(cmm_profile_t *picc_profile, gs_imager_state *pis)
+gsicc_init_hash_cs(cmm_profile_t *picc_profile, gs_gstate *pgs)
{
if ( !(picc_profile->hash_is_valid) ) {
gsicc_get_icc_buff_hash(picc_profile->buffer, &(picc_profile->hashcode),
picc_profile->buffer_size);
picc_profile->hash_is_valid = true;
}
- gsicc_set_default_cs_value(picc_profile, pis);
+ gsicc_set_default_cs_value(picc_profile, pgs);
}
/* Interface code to get the profile handle for data
@@ -2562,17 +2561,17 @@ gsicc_extract_profile(gs_graphics_type_tag_t graphics_type_tag,
/* internal ICC and rendering intent override control */
void
-gs_setoverrideicc(gs_imager_state *pis, bool value)
+gs_setoverrideicc(gs_gstate *pgs, bool value)
{
- if (pis->icc_manager != NULL) {
- pis->icc_manager->override_internal = value;
+ if (pgs->icc_manager != NULL) {
+ pgs->icc_manager->override_internal = value;
}
}
bool
-gs_currentoverrideicc(const gs_imager_state *pis)
+gs_currentoverrideicc(const gs_gstate *pgs)
{
- if (pis->icc_manager != NULL) {
- return pis->icc_manager->override_internal;
+ if (pgs->icc_manager != NULL) {
+ return pgs->icc_manager->override_internal;
} else {
return false;
}
@@ -2606,7 +2605,7 @@ dump_icc_buffer(int buffersize, char filename[],byte *Buffer)
/* The following are for setting the system/user params */
/* No default for the deviceN profile. */
void
-gs_currentdevicenicc(const gs_state * pgs, gs_param_string * pval)
+gs_currentdevicenicc(const gs_gstate * pgs, gs_param_string * pval)
{
static const char *const rfs = "";
@@ -2624,7 +2623,7 @@ gs_currentdevicenicc(const gs_state * pgs, gs_param_string * pval)
}
int
-gs_setdevicenprofileicc(const gs_state * pgs, gs_param_string * pval)
+gs_setdevicenprofileicc(const gs_gstate * pgs, gs_param_string * pval)
{
int code = 0;
char *pname, *pstr, *pstrend, *last = NULL;
@@ -2672,7 +2671,7 @@ gs_setdevicenprofileicc(const gs_state * pgs, gs_param_string * pval)
}
void
-gs_currentdefaultgrayicc(const gs_state * pgs, gs_param_string * pval)
+gs_currentdefaultgrayicc(const gs_gstate * pgs, gs_param_string * pval)
{
static const char *const rfs = DEFAULT_GRAY_ICC;
@@ -2687,7 +2686,7 @@ gs_currentdefaultgrayicc(const gs_state * pgs, gs_param_string * pval)
}
int
-gs_setdefaultgrayicc(const gs_state * pgs, gs_param_string * pval)
+gs_setdefaultgrayicc(const gs_gstate * pgs, gs_param_string * pval)
{
int code;
char *pname;
@@ -2716,7 +2715,7 @@ gs_setdefaultgrayicc(const gs_state * pgs, gs_param_string * pval)
/* if this is our first time in here then we need to properly install the
color spaces that were initialized in the graphic state at this time */
if (not_initialized) {
- code = gsicc_init_gs_colors((gs_state*) pgs);
+ code = gsicc_init_gs_colors((gs_gstate*) pgs);
}
if (code < 0)
return gs_throw(code, "error initializing gstate color spaces to icc");
@@ -2724,7 +2723,7 @@ gs_setdefaultgrayicc(const gs_state * pgs, gs_param_string * pval)
}
void
-gs_currenticcdirectory(const gs_state * pgs, gs_param_string * pval)
+gs_currenticcdirectory(const gs_gstate * pgs, gs_param_string * pval)
{
static const char *const rfs = DEFAULT_DIR_ICC; /* as good as any other */
const gs_lib_ctx_t *lib_ctx = pgs->memory->gs_lib_ctx;
@@ -2741,7 +2740,7 @@ gs_currenticcdirectory(const gs_state * pgs, gs_param_string * pval)
}
int
-gs_seticcdirectory(const gs_state * pgs, gs_param_string * pval)
+gs_seticcdirectory(const gs_gstate * pgs, gs_param_string * pval)
{
char *pname;
int namelen = (pval->size)+1;
@@ -2762,7 +2761,7 @@ gs_seticcdirectory(const gs_state * pgs, gs_param_string * pval)
}
void
-gs_currentsrcgtagicc(const gs_state * pgs, gs_param_string * pval)
+gs_currentsrcgtagicc(const gs_gstate * pgs, gs_param_string * pval)
{
if (pgs->icc_manager->srcgtag_profile == NULL) {
pval->data = NULL;
@@ -2776,7 +2775,7 @@ gs_currentsrcgtagicc(const gs_state * pgs, gs_param_string * pval)
}
int
-gs_setsrcgtagicc(const gs_state * pgs, gs_param_string * pval)
+gs_setsrcgtagicc(const gs_gstate * pgs, gs_param_string * pval)
{
int code;
char *pname;
@@ -2798,7 +2797,7 @@ gs_setsrcgtagicc(const gs_state * pgs, gs_param_string * pval)
}
void
-gs_currentdefaultrgbicc(const gs_state * pgs, gs_param_string * pval)
+gs_currentdefaultrgbicc(const gs_gstate * pgs, gs_param_string * pval)
{
static const char *const rfs = DEFAULT_RGB_ICC;
@@ -2813,7 +2812,7 @@ gs_currentdefaultrgbicc(const gs_state * pgs, gs_param_string * pval)
}
int
-gs_setdefaultrgbicc(const gs_state * pgs, gs_param_string * pval)
+gs_setdefaultrgbicc(const gs_gstate * pgs, gs_param_string * pval)
{
int code;
char *pname;
@@ -2836,7 +2835,7 @@ gs_setdefaultrgbicc(const gs_state * pgs, gs_param_string * pval)
}
void
-gs_currentnamedicc(const gs_state * pgs, gs_param_string * pval)
+gs_currentnamedicc(const gs_gstate * pgs, gs_param_string * pval)
{
static const char *const rfs = "";
@@ -2851,7 +2850,7 @@ gs_currentnamedicc(const gs_state * pgs, gs_param_string * pval)
}
int
-gs_setnamedprofileicc(const gs_state * pgs, gs_param_string * pval)
+gs_setnamedprofileicc(const gs_gstate * pgs, gs_param_string * pval)
{
int code;
char* pname;
@@ -2878,7 +2877,7 @@ gs_setnamedprofileicc(const gs_state * pgs, gs_param_string * pval)
}
void
-gs_currentdefaultcmykicc(const gs_state * pgs, gs_param_string * pval)
+gs_currentdefaultcmykicc(const gs_gstate * pgs, gs_param_string * pval)
{
static const char *const rfs = DEFAULT_CMYK_ICC;
@@ -2893,7 +2892,7 @@ gs_currentdefaultcmykicc(const gs_state * pgs, gs_param_string * pval)
}
int
-gs_setdefaultcmykicc(const gs_state * pgs, gs_param_string * pval)
+gs_setdefaultcmykicc(const gs_gstate * pgs, gs_param_string * pval)
{
int code;
char* pname;
@@ -2916,7 +2915,7 @@ gs_setdefaultcmykicc(const gs_state * pgs, gs_param_string * pval)
}
void
-gs_currentlabicc(const gs_state * pgs, gs_param_string * pval)
+gs_currentlabicc(const gs_gstate * pgs, gs_param_string * pval)
{
static const char *const rfs = LAB_ICC;
@@ -2927,7 +2926,7 @@ gs_currentlabicc(const gs_state * pgs, gs_param_string * pval)
}
int
-gs_setlabicc(const gs_state * pgs, gs_param_string * pval)
+gs_setlabicc(const gs_gstate * pgs, gs_param_string * pval)
{
int code;
char* pname;
diff --git a/base/gsicc_manage.h b/base/gsicc_manage.h
index 94ded14f8..8c3f93c7b 100644
--- a/base/gsicc_manage.h
+++ b/base/gsicc_manage.h
@@ -75,8 +75,8 @@ void gsicc_get_srcprofile(gsicc_colorbuffer_t data_cs,
cmm_srcgtag_profile_t *srcgtag_profile,
cmm_profile_t **profile, gsicc_rendering_param_t *render_cond);
int gsicc_getsrc_channel_count(cmm_profile_t *icc_profile);
-int gsicc_init_iccmanager(gs_state * pgs);
-int gsicc_init_gs_colors(gs_state *pgs);
+int gsicc_init_iccmanager(gs_gstate * pgs);
+int gsicc_init_gs_colors(gs_gstate *pgs);
void gsicc_profile_serialize(gsicc_serialized_profile_t *profile_data,
cmm_profile_t *iccprofile);
int gsicc_set_device_profile_intent(gx_device *dev,
@@ -88,7 +88,7 @@ int gsicc_set_device_blackptcomp(gx_device *dev,
int gsicc_set_device_blackpreserve(gx_device *dev,
gsicc_blackpreserve_t blackpreserve,
gsicc_profile_types_t profile_type);
-int gsicc_set_devicen_equiv_colors(gx_device *dev, const gs_imager_state * pis,
+int gsicc_set_devicen_equiv_colors(gx_device *dev, const gs_gstate * pgs,
cmm_profile_t *profile);
int gsicc_set_device_profile_colorants(gx_device *dev, char *name_str);
int gsicc_init_device_profile_struct(gx_device * dev, char *profile_name,
@@ -110,7 +110,7 @@ int gsicc_set_gscs_profile(gs_color_space *pcs, cmm_profile_t *icc_profile,
gs_memory_t * mem);
cmm_profile_t* gsicc_get_gscs_profile(gs_color_space *gs_colorspace,
gsicc_manager_t *icc_manager);
-void gsicc_init_hash_cs(cmm_profile_t *picc_profile, gs_imager_state *pis);
+void gsicc_init_hash_cs(cmm_profile_t *picc_profile, gs_gstate *pgs);
gcmmhprofile_t gsicc_get_profile_handle_clist(cmm_profile_t *picc_profile,
gs_memory_t *memory);
gcmmhprofile_t gsicc_get_profile_handle_buffer(unsigned char *buffer,
@@ -126,8 +126,8 @@ cmm_profile_t* gsicc_finddevicen(const gs_color_space *pcs,
gs_color_space_index gsicc_get_default_type(cmm_profile_t *profile_data);
bool gsicc_profile_from_ps(cmm_profile_t *profile_data);
cmm_dev_profile_t* gsicc_new_device_profile_array(gs_memory_t *memory);
-void gs_setoverrideicc(gs_imager_state *pis, bool value);
-bool gs_currentoverrideicc(const gs_imager_state *pis);
+void gs_setoverrideicc(gs_gstate *pgs, bool value);
+bool gs_currentoverrideicc(const gs_gstate *pgs);
cmm_profile_t* gsicc_set_iccsmaskprofile(const char *pname, int namelen,
gsicc_manager_t *icc_manager,
gs_memory_t *mem);
@@ -136,22 +136,22 @@ int gsicc_set_device_profile(gx_device * pdev, gs_memory_t * mem,
char* gsicc_get_dev_icccolorants(cmm_dev_profile_t *dev_profile);
void gsicc_setrange_lab(cmm_profile_t *profile);
/* system and user params */
-void gs_currentdevicenicc(const gs_state * pgs, gs_param_string * pval);
-int gs_setdevicenprofileicc(const gs_state * pgs, gs_param_string * pval);
-void gs_currentdefaultgrayicc(const gs_state * pgs, gs_param_string * pval);
-int gs_setdefaultgrayicc(const gs_state * pgs, gs_param_string * pval);
-void gs_currenticcdirectory(const gs_state * pgs, gs_param_string * pval);
-int gs_seticcdirectory(const gs_state * pgs, gs_param_string * pval);
-void gs_currentsrcgtagicc(const gs_state * pgs, gs_param_string * pval);
-int gs_setsrcgtagicc(const gs_state * pgs, gs_param_string * pval);
-void gs_currentdefaultrgbicc(const gs_state * pgs, gs_param_string * pval);
-int gs_setdefaultrgbicc(const gs_state * pgs, gs_param_string * pval);
-void gs_currentnamedicc(const gs_state * pgs, gs_param_string * pval);
-int gs_setnamedprofileicc(const gs_state * pgs, gs_param_string * pval);
-void gs_currentdefaultcmykicc(const gs_state * pgs, gs_param_string * pval);
-int gs_setdefaultcmykicc(const gs_state * pgs, gs_param_string * pval);
-void gs_currentlabicc(const gs_state * pgs, gs_param_string * pval);
-int gs_setlabicc(const gs_state * pgs, gs_param_string * pval);
+void gs_currentdevicenicc(const gs_gstate * pgs, gs_param_string * pval);
+int gs_setdevicenprofileicc(const gs_gstate * pgs, gs_param_string * pval);
+void gs_currentdefaultgrayicc(const gs_gstate * pgs, gs_param_string * pval);
+int gs_setdefaultgrayicc(const gs_gstate * pgs, gs_param_string * pval);
+void gs_currenticcdirectory(const gs_gstate * pgs, gs_param_string * pval);
+int gs_seticcdirectory(const gs_gstate * pgs, gs_param_string * pval);
+void gs_currentsrcgtagicc(const gs_gstate * pgs, gs_param_string * pval);
+int gs_setsrcgtagicc(const gs_gstate * pgs, gs_param_string * pval);
+void gs_currentdefaultrgbicc(const gs_gstate * pgs, gs_param_string * pval);
+int gs_setdefaultrgbicc(const gs_gstate * pgs, gs_param_string * pval);
+void gs_currentnamedicc(const gs_gstate * pgs, gs_param_string * pval);
+int gs_setnamedprofileicc(const gs_gstate * pgs, gs_param_string * pval);
+void gs_currentdefaultcmykicc(const gs_gstate * pgs, gs_param_string * pval);
+int gs_setdefaultcmykicc(const gs_gstate * pgs, gs_param_string * pval);
+void gs_currentlabicc(const gs_gstate * pgs, gs_param_string * pval);
+int gs_setlabicc(const gs_gstate * pgs, gs_param_string * pval);
int gsicc_get_device_class(cmm_profile_t *icc_profile);
#if ICC_DUMP
diff --git a/base/gsicc_nocm.c b/base/gsicc_nocm.c
index 48cebe6e9..452380129 100644
--- a/base/gsicc_nocm.c
+++ b/base/gsicc_nocm.c
@@ -25,7 +25,7 @@
#include "scommon.h"
#include "strmio.h"
#include "gx.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxcspace.h"
#include "gsicc_cms.h"
#include "gsicc_cache.h"
@@ -33,8 +33,8 @@
/* A link structure for our non-cm color transform */
typedef struct nocm_link_s {
/* Since RGB to CMYK requires BG and UCR, we need to have the
- imager state available */
- gs_imager_state *pis;
+ gs_gstate available */
+ gs_gstate *pgs;
byte num_in;
byte num_out;
gs_memory_t *memory;
@@ -256,7 +256,7 @@ gsicc_nocm_transform_general(gx_device *dev, gsicc_link_t *icclink,
dev_proc(dev, get_color_mapping_procs)(dev)->map_gray(dev, frac_in[0], frac_out);
break;
case 3:
- dev_proc(dev, get_color_mapping_procs)(dev)->map_rgb(dev, link->pis, frac_in[0], frac_in[1],
+ dev_proc(dev, get_color_mapping_procs)(dev)->map_rgb(dev, link->pgs, frac_in[0], frac_in[1],
frac_in[2], frac_out);
break;
case 4:
@@ -299,16 +299,16 @@ gsicc_nocm_freelink(gsicc_link_t *icclink)
nocm_link_t *nocm_link = (nocm_link_t*) icclink->link_handle;
if (nocm_link) {
- if (nocm_link->pis != NULL) {
- if (nocm_link->pis->black_generation != NULL) {
- gs_free_object(nocm_link->memory, nocm_link->pis->black_generation,
+ if (nocm_link->pgs != NULL) {
+ if (nocm_link->pgs->black_generation != NULL) {
+ gs_free_object(nocm_link->memory, nocm_link->pgs->black_generation,
"gsicc_nocm_freelink");
}
- if (nocm_link->pis->undercolor_removal != NULL) {
- gs_free_object(nocm_link->memory, nocm_link->pis->undercolor_removal,
+ if (nocm_link->pgs->undercolor_removal != NULL) {
+ gs_free_object(nocm_link->memory, nocm_link->pgs->undercolor_removal,
"gsicc_nocm_freelink");
}
- gs_free_object(nocm_link->memory, nocm_link->pis, "gsicc_nocm_freelink");
+ gs_free_object(nocm_link->memory, nocm_link->pgs, "gsicc_nocm_freelink");
}
gs_free_object(nocm_link->memory, nocm_link, "gsicc_nocm_freelink");
icclink->link_handle = NULL;
@@ -342,13 +342,13 @@ gsicc_nocm_copy_curve(gx_transfer_map *in_map, gs_memory_t *mem)
/* Get the link, which is the mapping procedure in this non color managed
transformation case. */
gsicc_link_t*
-gsicc_nocm_get_link(const gs_imager_state *pis, gx_device *dev,
+gsicc_nocm_get_link(const gs_gstate *pgs, gx_device *dev,
gs_color_space_index src_index)
{
gsicc_link_t *result;
gsicc_hashlink_t hash;
nocm_link_t *nocm_link;
- gs_memory_t *mem = pis->icc_link_cache->memory->non_gc_memory;
+ gs_memory_t *mem = pgs->icc_link_cache->memory->non_gc_memory;
bool pageneutralcolor = false;
cmm_dev_profile_t *dev_profile;
int code;
@@ -376,13 +376,13 @@ gsicc_nocm_get_link(const gs_imager_state *pis, gx_device *dev,
hash.link_hashcode = src_index + hash.des_hash * 256 + hash.rend_hash * 4096;
/* Check the cache for a hit. */
- result = gsicc_findcachelink(hash, pis->icc_link_cache, false, false);
+ result = gsicc_findcachelink(hash, pgs->icc_link_cache, false, false);
if (result != NULL) {
return result;
}
/* If not, then lets create a new one. This may actually return a link if
another thread has already created it while we were trying to do so */
- if (gsicc_alloc_link_entry(pis->icc_link_cache, &result, hash, false, false))
+ if (gsicc_alloc_link_entry(pgs->icc_link_cache, &result, hash, false, false))
return result;
if (result == NULL)
@@ -390,7 +390,7 @@ gsicc_nocm_get_link(const gs_imager_state *pis, gx_device *dev,
/* Now compute the link contents */
/* Lock the cache as we alter the procs */
- gx_monitor_enter(pis->icc_link_cache->lock);
+ gx_monitor_enter(pgs->icc_link_cache->lock);
result->procs.map_buffer = gsicc_nocm_transform_color_buffer;
result->procs.map_color = gsicc_nocm_transform_color;
@@ -402,22 +402,22 @@ gsicc_nocm_get_link(const gs_imager_state *pis, gx_device *dev,
return NULL;
result->link_handle = (void*) nocm_link;
nocm_link->memory = mem;
- /* Create a dummy imager state and populate the ucr/bg values. This
+ /* Create a dummy gs_gstate and populate the ucr/bg values. This
is the only part that we need */
- if ((pis->black_generation == NULL && pis->undercolor_removal == NULL)) {
- nocm_link->pis = NULL;
+ if ((pgs->black_generation == NULL && pgs->undercolor_removal == NULL)) {
+ nocm_link->pgs = NULL;
} else {
- nocm_link->pis = (gs_imager_state*)
- gs_alloc_bytes(mem, sizeof(gs_imager_state),
+ nocm_link->pgs = (gs_gstate*)
+ gs_alloc_bytes(mem, sizeof(gs_gstate),
"gsicc_nocm_get_link");
- if (nocm_link->pis == NULL)
+ if (nocm_link->pgs == NULL)
return NULL;
- memset(nocm_link->pis, 0, sizeof(gs_imager_state));
+ memset(nocm_link->pgs, 0, sizeof(gs_gstate));
/* Note if allocation of either of the maps fails, just use NULL */
- nocm_link->pis->black_generation = (gx_transfer_map*)
- gsicc_nocm_copy_curve(pis->black_generation, mem);
- nocm_link->pis->undercolor_removal = (gx_transfer_map*)
- gsicc_nocm_copy_curve(pis->undercolor_removal, mem);
+ nocm_link->pgs->black_generation = (gx_transfer_map*)
+ gsicc_nocm_copy_curve(pgs->black_generation, mem);
+ nocm_link->pgs->undercolor_removal = (gx_transfer_map*)
+ gsicc_nocm_copy_curve(pgs->undercolor_removal, mem);
}
nocm_link->num_out = min(dev->color_info.num_components,
GS_CLIENT_COLOR_MAX_COMPONENTS);
@@ -454,7 +454,7 @@ gsicc_nocm_get_link(const gs_imager_state *pis, gx_device *dev,
gx_semaphore_signal(result->wait);
result->num_waiting--;
}
- gx_monitor_leave(pis->icc_link_cache->lock); /* done with updating, let everyone run */
+ gx_monitor_leave(pgs->icc_link_cache->lock); /* done with updating, let everyone run */
return result;
}
diff --git a/base/gsicc_profilecache.c b/base/gsicc_profilecache.c
index 696e2c235..8500cb5a6 100644
--- a/base/gsicc_profilecache.c
+++ b/base/gsicc_profilecache.c
@@ -89,7 +89,7 @@ rc_gsicc_profile_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname
}
void
-gsicc_add_cs(gs_state * pgs, gs_color_space * colorspace, ulong dictkey)
+gsicc_add_cs(gs_gstate * pgs, gs_color_space * colorspace, ulong dictkey)
{
gsicc_profile_entry_t *result;
gsicc_profile_cache_t *profile_cache = pgs->icc_profile_cache;
@@ -117,7 +117,7 @@ gsicc_add_cs(gs_state * pgs, gs_color_space * colorspace, ulong dictkey)
}
gs_color_space*
-gsicc_find_cs(ulong key_test, gs_state * pgs)
+gsicc_find_cs(ulong key_test, gs_gstate * pgs)
{
gsicc_profile_cache_t *profile_cache = pgs->icc_profile_cache;
gsicc_profile_entry_t *prev = NULL, *curr = profile_cache->head;
diff --git a/base/gsicc_profilecache.h b/base/gsicc_profilecache.h
index bf7457a95..773728a48 100644
--- a/base/gsicc_profilecache.h
+++ b/base/gsicc_profilecache.h
@@ -21,7 +21,7 @@
# define gsicc_profilecache_INCLUDED
gsicc_profile_cache_t* gsicc_profilecache_new(gs_memory_t *memory);
-gs_color_space* gsicc_find_cs(ulong key_test, gs_state * pgs);
-void gsicc_add_cs(gs_state * pgs, gs_color_space * pcs, ulong dictkey);
+gs_color_space* gsicc_find_cs(ulong key_test, gs_gstate * pgs);
+void gsicc_add_cs(gs_gstate * pgs, gs_color_space * pcs, ulong dictkey);
#endif
diff --git a/base/gsicc_replacecm.c b/base/gsicc_replacecm.c
index 29300872e..5af1ae913 100644
--- a/base/gsicc_replacecm.c
+++ b/base/gsicc_replacecm.c
@@ -25,7 +25,7 @@
#include "scommon.h"
#include "strmio.h"
#include "gx.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxcspace.h"
#include "gsicc_cms.h"
#include "gsicc_cache.h"
@@ -300,7 +300,7 @@ gsicc_rcm_freelink(gsicc_link_t *icclink)
the number of components for the source so that we know what we are
coming from (e.g. RGB, CMYK, Gray) */
gsicc_link_t*
-gsicc_rcm_get_link(const gs_imager_state *pis, gx_device *dev,
+gsicc_rcm_get_link(const gs_gstate *pgs, gx_device *dev,
gsicc_colorbuffer_t data_cs)
{
gsicc_link_t *result;
@@ -338,13 +338,13 @@ gsicc_rcm_get_link(const gs_imager_state *pis, gx_device *dev,
hash.link_hashcode = data_cs + hash.des_hash * 256 + hash.rend_hash * 4096;
/* Check the cache for a hit. */
- result = gsicc_findcachelink(hash, pis->icc_link_cache, false, false);
+ result = gsicc_findcachelink(hash, pgs->icc_link_cache, false, false);
if (result != NULL) {
return result;
}
/* If not, then lets create a new one. This may actually return a link if
another thread has already created it while we were trying to do so */
- if (gsicc_alloc_link_entry(pis->icc_link_cache, &result, hash, false, false))
+ if (gsicc_alloc_link_entry(pgs->icc_link_cache, &result, hash, false, false))
return result;
if (result == NULL)
@@ -352,7 +352,7 @@ gsicc_rcm_get_link(const gs_imager_state *pis, gx_device *dev,
/* Now compute the link contents */
/* Lock the cache as we alter the procs */
- gx_monitor_enter(pis->icc_link_cache->lock);
+ gx_monitor_enter(pgs->icc_link_cache->lock);
result->procs.map_buffer = gsicc_rcm_transform_color_buffer;
result->procs.map_color = gsicc_rcm_transform_color;
@@ -415,7 +415,7 @@ gsicc_rcm_get_link(const gs_imager_state *pis, gx_device *dev,
gx_semaphore_signal(result->wait);
result->num_waiting--;
}
- gx_monitor_leave(pis->icc_link_cache->lock); /* done with updating, let everyone run */
+ gx_monitor_leave(pgs->icc_link_cache->lock); /* done with updating, let everyone run */
return result;
}
diff --git a/base/gsimage.c b/base/gsimage.c
index 14d7dffb1..a336d7058 100644
--- a/base/gsimage.c
+++ b/base/gsimage.c
@@ -152,7 +152,7 @@ static RELOC_PTRS_WITH(gs_image_enum_reloc_ptrs, gs_image_enum *eptr)
RELOC_PTRS_END
static int
-is_image_visible(const gs_image_common_t * pic, gs_state * pgs, gx_clip_path *pcpath)
+is_image_visible(const gs_image_common_t * pic, gs_gstate * pgs, gx_clip_path *pcpath)
{
/* HACK : We need the source image size here,
but gs_image_common_t doesn't pass it.
@@ -201,7 +201,7 @@ is_image_visible(const gs_image_common_t * pic, gs_state * pgs, gx_clip_path *pc
/* Create an image enumerator given image parameters and a graphics state. */
int
-gs_image_begin_typed(const gs_image_common_t * pic, gs_state * pgs,
+gs_image_begin_typed(const gs_image_common_t * pic, gs_gstate * pgs,
bool uses_color, gx_image_enum_common_t ** ppie)
{
gx_device *dev = gs_currentdevice(pgs);
@@ -219,13 +219,13 @@ gs_image_begin_typed(const gs_image_common_t * pic, gs_state * pgs,
code = gx_set_dev_color(pgs);
if (code != 0)
return code;
- code = gs_state_color_load(pgs);
+ code = gs_gstate_color_load(pgs);
if (code < 0)
return code;
}
/* Imagemask with shading color needs a special optimization
with converting the image into a clipping.
- Check for such case after gs_state_color_load is done,
+ Check for such case after gs_gstate_color_load is done,
because it can cause interpreter callout.
*/
if (pic->type->begin_typed_image == &gx_begin_image1) {
@@ -241,7 +241,7 @@ gs_image_begin_typed(const gs_image_common_t * pic, gs_state * pgs,
pdevc = &dc_temp;
}
}
- code = gx_device_begin_typed_image(dev2, (const gs_imager_state *)pgs,
+ code = gx_device_begin_typed_image(dev2, (const gs_gstate *)pgs,
NULL, pic, NULL, pdevc, pcpath, pgs->memory, ppie);
if (code < 0)
return code;
@@ -279,7 +279,7 @@ gs_image_enum_alloc(gs_memory_t * mem, client_name_t cname)
/* Start processing an ImageType 1 image. */
int
gs_image_init(gs_image_enum * penum, const gs_image_t * pim, bool multi,
- gs_state * pgs)
+ gs_gstate * pgs)
{
gs_image_t image;
gx_image_enum_common_t *pie;
@@ -411,7 +411,7 @@ gs_image_common_init(gs_image_enum * penum, gx_image_enum_common_t * pie,
*/
int
gs_image_enum_init(gs_image_enum * penum, gx_image_enum_common_t * pie,
- const gs_data_image_t * pim, gs_state *pgs)
+ const gs_data_image_t * pim, gs_gstate *pgs)
{
pgs->device->sgr.stroke_stored = false;
return gs_image_common_init(penum, pie, pim,
@@ -641,7 +641,7 @@ gs_image_next_planes(gs_image_enum * penum,
/* Clean up after processing an image. */
/* Public for ghostpcl. */
int
-gs_image_cleanup(gs_image_enum * penum, gs_state *pgs)
+gs_image_cleanup(gs_image_enum * penum, gs_gstate *pgs)
{
int code = 0, code1;
@@ -666,7 +666,7 @@ gs_image_cleanup(gs_image_enum * penum, gs_state *pgs)
/* Clean up after processing an image and free the enumerator. */
int
-gs_image_cleanup_and_free_enum(gs_image_enum * penum, gs_state *pgs)
+gs_image_cleanup_and_free_enum(gs_image_enum * penum, gs_gstate *pgs)
{
int code = gs_image_cleanup(penum, pgs);
diff --git a/base/gsimage.h b/base/gsimage.h
index 65d74e256..716e7ef08 100644
--- a/base/gsimage.h
+++ b/base/gsimage.h
@@ -119,7 +119,7 @@ typedef struct gx_image_enum_common_s gx_image_enum_common_t;
#endif
typedef struct gs_image_enum_s gs_image_enum;
-int gs_image_begin_typed(const gs_image_common_t * pic, gs_state * pgs,
+int gs_image_begin_typed(const gs_image_common_t * pic, gs_gstate * pgs,
bool uses_color, gx_image_enum_common_t ** ppie);
gs_image_enum *gs_image_enum_alloc(gs_memory_t *, client_name_t);
@@ -145,14 +145,14 @@ int gs_image_common_init(gs_image_enum * penum,
/* Initialize an enumerator for an ImageType 1 image. */
int gs_image_init(gs_image_enum * penum, const gs_image_t * pim,
- bool MultipleDataSources, gs_state * pgs);
+ bool MultipleDataSources, gs_gstate * pgs);
/* Initialize an enumerator for a general image.
penum->memory must be initialized in advance.
*/
int gs_image_enum_init(gs_image_enum * penum,
gx_image_enum_common_t * pie,
- const gs_data_image_t * pim, gs_state *pgs);
+ const gs_data_image_t * pim, gs_gstate *pgs);
/*
* Return the number of bytes of data per row
@@ -196,9 +196,9 @@ int gs_image_next(gs_image_enum * penum, const byte * dbytes,
uint dsize, uint * pused);
/* Clean up after processing an image. */
-int gs_image_cleanup(gs_image_enum * penum, gs_state *pgs);
+int gs_image_cleanup(gs_image_enum * penum, gs_gstate *pgs);
/* Clean up after processing an image and free the enumerator. */
-int gs_image_cleanup_and_free_enum(gs_image_enum * penum, gs_state *pgs);
+int gs_image_cleanup_and_free_enum(gs_image_enum * penum, gs_gstate *pgs);
#endif /* gsimage_INCLUDED */
diff --git a/base/gsimpath.c b/base/gsimpath.c
index 3371319cf..635fd4d97 100644
--- a/base/gsimpath.c
+++ b/base/gsimpath.c
@@ -25,7 +25,7 @@
/* Define the state of the conversion process. */
typedef struct {
/* The following are set at the beginning of the conversion. */
- gs_state *pgs;
+ gs_gstate *pgs;
const byte *data; /* image data */
int width, height, raster;
/* The following are updated dynamically. */
@@ -48,7 +48,7 @@ static int add_dxdy(status *, int, int, int);
if ( (code = add_dxdy(s, dx, dy, n)) < 0 ) return code
/* Append an outline derived from an image to the current path. */
int
-gs_imagepath(gs_state * pgs, int width, int height, const byte * data)
+gs_imagepath(gs_gstate * pgs, int width, int height, const byte * data)
{
status stat;
status *out = &stat;
diff --git a/base/gsiparm2.h b/base/gsiparm2.h
index 0f8db02cb..a2a2f7f2a 100644
--- a/base/gsiparm2.h
+++ b/base/gsiparm2.h
@@ -34,7 +34,7 @@ typedef struct gx_path_s gx_path;
typedef struct gs_image2_s {
gs_image_common;
- gs_state *DataSource;
+ gs_gstate *DataSource;
float XOrigin, YOrigin;
float Width, Height;
/*
diff --git a/base/gsistate.c b/base/gsistate.c
deleted file mode 100644
index 892626424..000000000
--- a/base/gsistate.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/* Copyright (C) 2001-2012 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied,
- modified or distributed except as expressly authorized under the terms
- of the license contained in the file LICENSE in this distribution.
-
- Refer to licensing information at http://www.artifex.com or contact
- Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
- CA 94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-
-/* Imager state housekeeping */
-#include "gx.h"
-#include "gserrors.h"
-#include "gscspace.h"
-#include "gscie.h"
-#include "gsstruct.h"
-#include "gsutil.h" /* for gs_next_ids */
-#include "gxbitmap.h"
-#include "gxcmap.h"
-#include "gxdht.h"
-#include "gxistate.h"
-#include "gzht.h"
-#include "gzline.h"
-#include "gxfmap.h"
-#include "gsicc_cache.h"
-#include "gsicc_manage.h"
-#include "gsicc_profilecache.h"
-
-/******************************************************************************
- * See gsstate.c for a discussion of graphics/imager state memory management. *
- ******************************************************************************/
-
-/* Imported values */
-/* The following should include a 'const', but for some reason */
-/* the Watcom compiler won't accept it, even though it happily accepts */
-/* the same construct everywhere else. */
-extern /*const*/ gx_color_map_procs *const cmap_procs_default;
-
-/* GC procedures for gx_line_params */
-static
-ENUM_PTRS_WITH(line_params_enum_ptrs, gx_line_params *plp) return 0;
- case 0: return ENUM_OBJ((plp->dash.pattern_size == 0 ?
- NULL : plp->dash.pattern));
-ENUM_PTRS_END
-static RELOC_PTRS_WITH(line_params_reloc_ptrs, gx_line_params *plp)
-{
- if (plp->dash.pattern_size)
- RELOC_VAR(plp->dash.pattern);
-} RELOC_PTRS_END
-private_st_line_params();
-
-/*
- * GC procedures for gs_imager_state
- *
- * See comments in gixstate.h before the definition of gs_cr_state_do_rc and
- * st_cr_state_num_ptrs for an explanation about why the effective_transfer
- * pointers are handled in this manner.
- */
-public_st_imager_state();
-static
-ENUM_PTRS_BEGIN(imager_state_enum_ptrs)
- ENUM_SUPER(gs_imager_state, st_line_params, line_params, st_imager_state_num_ptrs - st_line_params_num_ptrs);
- ENUM_PTR(0, gs_imager_state, client_data);
- ENUM_PTR(1, gs_imager_state, trans_device);
- ENUM_PTR(2, gs_imager_state, icc_manager);
- ENUM_PTR(3, gs_imager_state, icc_link_cache);
- ENUM_PTR(4, gs_imager_state, icc_profile_cache);
-#define E1(i,elt) ENUM_PTR(i+5,gs_imager_state,elt);
- gs_cr_state_do_ptrs(E1)
-#undef E1
-ENUM_PTRS_END
-static RELOC_PTRS_BEGIN(imager_state_reloc_ptrs)
-{
- RELOC_SUPER(gs_imager_state, st_line_params, line_params);
- RELOC_PTR(gs_imager_state, client_data);
- RELOC_PTR(gs_imager_state, trans_device);
- RELOC_PTR(gs_imager_state, icc_manager);
- RELOC_PTR(gs_imager_state, icc_link_cache);
- RELOC_PTR(gs_imager_state, icc_profile_cache);
-#define R1(i,elt) RELOC_PTR(gs_imager_state,elt);
- gs_cr_state_do_ptrs(R1)
-#undef R1
- {
- int i = GX_DEVICE_COLOR_MAX_COMPONENTS - 1;
-
- for (; i >= 0; i--)
- RELOC_PTR(gs_imager_state, effective_transfer[i]);
- }
-} RELOC_PTRS_END
-
-/* Initialize an imager state, other than the parts covered by */
-/* gs_imager_state_initial. */
-int
-gs_imager_state_initialize(gs_imager_state * pis, gs_memory_t * mem)
-{
- int i;
- pis->memory = mem;
- pis->client_data = 0;
- pis->trans_device = 0;
- /* Color rendering state */
- pis->halftone = 0;
- {
- int i;
-
- for (i = 0; i < gs_color_select_count; ++i)
- pis->screen_phase[i].x = pis->screen_phase[i].y = 0;
- }
- pis->dev_ht = 0;
- pis->cie_render = 0;
- pis->cie_to_xyz = false;
- pis->black_generation = 0;
- pis->undercolor_removal = 0;
- /* Allocate an initial transfer map. */
- rc_alloc_struct_n(pis->set_transfer.gray,
- gx_transfer_map, &st_transfer_map,
- mem, return_error(gs_error_VMerror),
- "gs_imager_state_init(transfer)", 1);
- pis->set_transfer.gray->proc = gs_identity_transfer;
- pis->set_transfer.gray->id = gs_next_ids(pis->memory, 1);
- pis->set_transfer.gray->values[0] = frac_0;
- pis->set_transfer.red =
- pis->set_transfer.green =
- pis->set_transfer.blue = NULL;
- for (i = 0; i < GX_DEVICE_COLOR_MAX_COMPONENTS; i++)
- pis->effective_transfer[i] = pis->set_transfer.gray;
- pis->cie_joint_caches = NULL;
- pis->cie_joint_caches_alt = NULL;
- pis->cmap_procs = cmap_procs_default;
- pis->pattern_cache = NULL;
- pis->have_pattern_streams = false;
- pis->devicergb_cs = gs_cspace_new_DeviceRGB(mem);
- pis->devicecmyk_cs = gs_cspace_new_DeviceCMYK(mem);
- pis->icc_link_cache = gsicc_cache_new(pis->memory);
- pis->icc_manager = gsicc_manager_new(pis->memory);
- pis->icc_profile_cache = gsicc_profilecache_new(pis->memory);
- return 0;
-}
-
-/*
- * Make a temporary copy of a gs_imager_state. Note that this does not
- * do all the necessary reference counting, etc. However, it does
- * clear out the transparency stack in the destination.
- */
-gs_imager_state *
-gs_imager_state_copy(const gs_imager_state * pis, gs_memory_t * mem)
-{
- gs_imager_state *pis_copy =
- gs_alloc_struct(mem, gs_imager_state, &st_imager_state,
- "gs_imager_state_copy");
-
- if (pis_copy) {
- *pis_copy = *pis;
- }
- return pis_copy;
-}
-
-/* Increment reference counts to note that an imager state has been copied. */
-void
-gs_imager_state_copied(gs_imager_state * pis)
-{
- rc_increment(pis->halftone);
- rc_increment(pis->dev_ht);
- rc_increment(pis->cie_render);
- rc_increment(pis->black_generation);
- rc_increment(pis->undercolor_removal);
- rc_increment(pis->set_transfer.gray);
- rc_increment(pis->set_transfer.red);
- rc_increment(pis->set_transfer.green);
- rc_increment(pis->set_transfer.blue);
- rc_increment(pis->cie_joint_caches);
- rc_increment(pis->cie_joint_caches_alt);
- rc_increment(pis->devicergb_cs);
- rc_increment(pis->devicecmyk_cs);
- rc_increment(pis->icc_link_cache);
- rc_increment(pis->icc_profile_cache);
- rc_increment(pis->icc_manager);
-}
-
-/* Adjust reference counts before assigning one imager state to another. */
-void
-gs_imager_state_pre_assign(gs_imager_state *pto, const gs_imager_state *pfrom)
-{
- const char *const cname = "gs_imager_state_pre_assign";
-
-#define RCCOPY(element)\
- rc_pre_assign(pto->element, pfrom->element, cname)
-
- RCCOPY(cie_joint_caches);
- RCCOPY(cie_joint_caches_alt);
- RCCOPY(set_transfer.blue);
- RCCOPY(set_transfer.green);
- RCCOPY(set_transfer.red);
- RCCOPY(set_transfer.gray);
- RCCOPY(undercolor_removal);
- RCCOPY(black_generation);
- RCCOPY(cie_render);
- RCCOPY(dev_ht);
- RCCOPY(halftone);
- RCCOPY(devicergb_cs);
- RCCOPY(devicecmyk_cs);
- RCCOPY(icc_link_cache);
- RCCOPY(icc_profile_cache);
- RCCOPY(icc_manager);
-#undef RCCOPY
-}
-
-/* Release an imager state. */
-void
-gs_imager_state_release(gs_imager_state * pis)
-{
- const char *const cname = "gs_imager_state_release";
- gx_device_halftone *pdht = pis->dev_ht;
-
-#define RCDECR(element)\
- rc_decrement(pis->element, cname);\
- pis->element = NULL /* prevent subsequent decrements from this imager state */
-
- RCDECR(cie_joint_caches);
- RCDECR(set_transfer.gray);
- RCDECR(set_transfer.blue);
- RCDECR(set_transfer.green);
- RCDECR(set_transfer.red);
- RCDECR(undercolor_removal);
- RCDECR(black_generation);
- RCDECR(cie_render);
- /*
- * If we're going to free the device halftone, make sure we free the
- * dependent structures as well.
- */
- if (pdht != 0 && pdht->rc.ref_count == 1) {
- gx_device_halftone_release(pdht, pdht->rc.memory);
- }
- RCDECR(dev_ht);
- RCDECR(halftone);
- RCDECR(devicergb_cs);
- RCDECR(devicecmyk_cs);
- RCDECR(icc_link_cache);
- RCDECR(icc_profile_cache);
- RCDECR(icc_manager);
-#undef RCDECR
-}
diff --git a/base/gslib.c b/base/gslib.c
index 84ea80304..0b9582785 100644
--- a/base/gslib.c
+++ b/base/gslib.c
@@ -52,21 +52,21 @@
/*#define CAPTURE */
/* Test programs */
-static int test1(gs_state *, gs_memory_t *); /* kaleidoscope */
-static int test2(gs_state *, gs_memory_t *); /* pattern fill */
-static int test3(gs_state *, gs_memory_t *); /* RasterOp */
-static int test4(gs_state *, gs_memory_t *); /* set resolution */
-static int test5(gs_state *, gs_memory_t *); /* images */
-static int test6(gs_state *, gs_memory_t *); /* CIE API, snapping */
-static int test7(gs_state *, gs_memory_t *); /* non-monot HT */
-static int test8(gs_state *, gs_memory_t *); /* transp patterns */
+static int test1(gs_gstate *, gs_memory_t *); /* kaleidoscope */
+static int test2(gs_gstate *, gs_memory_t *); /* pattern fill */
+static int test3(gs_gstate *, gs_memory_t *); /* RasterOp */
+static int test4(gs_gstate *, gs_memory_t *); /* set resolution */
+static int test5(gs_gstate *, gs_memory_t *); /* images */
+static int test6(gs_gstate *, gs_memory_t *); /* CIE API, snapping */
+static int test7(gs_gstate *, gs_memory_t *); /* non-monot HT */
+static int test8(gs_gstate *, gs_memory_t *); /* transp patterns */
#ifdef CAPTURE
#include "k/capture.c"
-static int test10(gs_state *, gs_memory_t *); /* captured data */
+static int test10(gs_gstate *, gs_memory_t *); /* captured data */
#endif
-static int (*tests[]) (gs_state *, gs_memory_t *) =
+static int (*tests[]) (gs_gstate *, gs_memory_t *) =
{
test1, test2, test3, test4, test5,
test6, test7, test8, 0
@@ -89,7 +89,7 @@ main(int argc, const char *argv[])
char achar = '0';
gs_memory_t *mem;
- gs_state *pgs;
+ gs_gstate *pgs;
const gx_device *const *list;
gx_device *dev;
gx_device_bbox *bbdev;
@@ -172,7 +172,7 @@ main(int argc, const char *argv[])
}
}
dev = (gx_device *) bbdev;
- pgs = gs_state_alloc(mem);
+ pgs = gs_gstate_alloc(mem);
gs_setdevice_no_erase(pgs, dev); /* can't erase yet */
{
gs_point dpi;
@@ -238,7 +238,7 @@ odsf(double x, double y)
/* Fill a rectangle. */
static int
-fill_rect1(gs_state * pgs, double x, double y, double w, double h)
+fill_rect1(gs_gstate * pgs, double x, double y, double w, double h)
{
gs_rect r;
@@ -311,7 +311,7 @@ rand(void)
return rand_state;
}
static int
-test1(gs_state * pgs, gs_memory_t * mem)
+test1(gs_gstate * pgs, gs_memory_t * mem)
{
int n;
@@ -345,7 +345,7 @@ test1(gs_state * pgs, gs_memory_t * mem)
/* Fill an area with a pattern. */
static int
-test2(gs_state * pgs, gs_memory_t * mem)
+test2(gs_gstate * pgs, gs_memory_t * mem)
{
gs_client_color cc;
gx_tile_bitmap tile;
@@ -406,7 +406,7 @@ test2(gs_state * pgs, gs_memory_t * mem)
/* Currently, this only works with monobit devices. */
static int
-test3(gs_state * pgs, gs_memory_t * mem)
+test3(gs_gstate * pgs, gs_memory_t * mem)
{
gx_device *dev = gs_currentdevice(pgs);
gx_color_index black = gx_device_black(dev);
@@ -448,7 +448,7 @@ test3(gs_state * pgs, gs_memory_t * mem)
/* Set the resolution dynamically. */
static int
-test4(gs_state * pgs, gs_memory_t * mem)
+test4(gs_gstate * pgs, gs_memory_t * mem)
{
gs_c_param_list list;
float resv[2];
@@ -495,7 +495,7 @@ test4(gs_state * pgs, gs_memory_t * mem)
/* Test masked (and non-masked) images. */
static int
-test5(gs_state * pgs, gs_memory_t * mem)
+test5(gs_gstate * pgs, gs_memory_t * mem)
{
gx_device *dev = gs_currentdevice(pgs);
gx_image_enum_common_t *info;
@@ -541,7 +541,7 @@ test5(gs_state * pgs, gs_memory_t * mem)
#define do_image(image, idata)\
BEGIN\
- code = gx_device_begin_typed_image(dev, (gs_imager_state *)pgs, NULL,\
+ code = gx_device_begin_typed_image(dev, pgs, NULL,\
(gs_image_common_t *)&image, NULL, &dcolor, NULL, mem, &info);\
/****** TEST code >= 0 ******/\
planes[0].data = idata;\
@@ -575,7 +575,7 @@ test5(gs_state * pgs, gs_memory_t * mem)
image1.BitsPerComponent = 8;
gs_translate(pgs, 0.5, 4.0);
- code = gx_device_begin_image(dev, (gs_imager_state *) pgs,
+ code = gx_device_begin_image(dev, pgs,
&image1, gs_image_format_chunky,
NULL, &dcolor, NULL, mem, &info1);
/****** TEST code >= 0 ******/
@@ -632,7 +632,7 @@ test5(gs_state * pgs, gs_memory_t * mem)
/* Display with 1-for-1 mask and image. */
gs_translate(pgs, 0.5, 2.0);
- code = gx_device_begin_typed_image(dev, (gs_imager_state *) pgs,
+ code = gx_device_begin_typed_image(dev, pgs,
NULL, (gs_image_common_t *) & image3,
NULL, &dcolor, NULL, mem, &info);
/****** TEST code >= 0 ******/
@@ -655,7 +655,7 @@ test5(gs_state * pgs, gs_memory_t * mem)
image3.MaskDict.Width *= 2;
image3.MaskDict.Height *= 2;
gs_translate(pgs, 1.5, 0.0);
- code = gx_device_begin_typed_image(dev, (gs_imager_state *) pgs,
+ code = gx_device_begin_typed_image(dev, pgs,
NULL, (gs_image_common_t *) & image3,
NULL, &dcolor, NULL, mem, &info);
/****** TEST code >= 0 ******/
@@ -722,7 +722,7 @@ test5(gs_state * pgs, gs_memory_t * mem)
/* Test the C API for CIE CRDs, and color snapping. */
static void
-spectrum(gs_state * pgs, int n)
+spectrum(gs_gstate * pgs, int n)
{
float den = n;
float den1 = n - 1;
@@ -750,7 +750,7 @@ render_abc(double v, const gs_cie_render * ignore_crd)
return v / 2;
}
static int
-test6(gs_state * pgs, gs_memory_t * mem)
+test6(gs_gstate * pgs, gs_memory_t * mem)
{
gs_color_space *pcs;
gs_cie_abc *pabc;
@@ -797,7 +797,7 @@ test6(gs_state * pgs, gs_memory_t * mem)
/* Test the C API for non-monotonic halftones. */
static int
-test7(gs_state * pgs, gs_memory_t * mem)
+test7(gs_gstate * pgs, gs_memory_t * mem)
{
/* Define a non-monotonic 4 x 4 halftone with 4 gray levels. */
static const byte masks[1 * 4 * 4] =
@@ -834,7 +834,7 @@ test7(gs_state * pgs, gs_memory_t * mem)
/* Test partially transparent patterns */
static int
-test8(gs_state * pgs, gs_memory_t * mem)
+test8(gs_gstate * pgs, gs_memory_t * mem)
{
/*
* Define a 16 x 16 pattern using a 4-entry palette
@@ -918,7 +918,7 @@ static const float xmove_origin = 0.0;
static const float ymove_origin = 0.0;
static int
-test10(gs_state * pgs, gs_memory_t * mem)
+test10(gs_gstate * pgs, gs_memory_t * mem)
{
gs_c_param_list list;
gs_param_string nstr, OFstr;
diff --git a/base/gsline.c b/base/gsline.c
index 29820194b..e541d237b 100644
--- a/base/gsline.c
+++ b/base/gsline.c
@@ -32,7 +32,7 @@
/* setlinewidth */
int
-gs_setlinewidth(gs_state * pgs, double width)
+gs_setlinewidth(gs_gstate * pgs, double width)
{
gx_set_line_width(pgs_lp, width);
return 0;
@@ -40,14 +40,14 @@ gs_setlinewidth(gs_state * pgs, double width)
/* currentlinewidth */
float
-gs_currentlinewidth(const gs_state * pgs)
+gs_currentlinewidth(const gs_gstate * pgs)
{
return gx_current_line_width(pgs_lp);
}
/* setlinecap (sets all 3 caps) */
int
-gs_setlinecap(gs_state * pgs, gs_line_cap cap)
+gs_setlinecap(gs_gstate * pgs, gs_line_cap cap)
{
if ((uint) cap > gs_line_cap_max)
return_error(gs_error_rangecheck);
@@ -59,7 +59,7 @@ gs_setlinecap(gs_state * pgs, gs_line_cap cap)
/* setlinestartcap */
int
-gs_setlinestartcap(gs_state * pgs, gs_line_cap cap)
+gs_setlinestartcap(gs_gstate * pgs, gs_line_cap cap)
{
if ((uint) cap > gs_line_cap_max)
return_error(gs_error_rangecheck);
@@ -69,7 +69,7 @@ gs_setlinestartcap(gs_state * pgs, gs_line_cap cap)
/* setlineendcap */
int
-gs_setlineendcap(gs_state * pgs, gs_line_cap cap)
+gs_setlineendcap(gs_gstate * pgs, gs_line_cap cap)
{
if ((uint) cap > gs_line_cap_max)
return_error(gs_error_rangecheck);
@@ -79,7 +79,7 @@ gs_setlineendcap(gs_state * pgs, gs_line_cap cap)
/* setlinedashcap */
int
-gs_setlinedashcap(gs_state * pgs, gs_line_cap cap)
+gs_setlinedashcap(gs_gstate * pgs, gs_line_cap cap)
{
if ((uint) cap > gs_line_cap_max)
return_error(gs_error_rangecheck);
@@ -89,7 +89,7 @@ gs_setlinedashcap(gs_state * pgs, gs_line_cap cap)
/* currentlinecap */
gs_line_cap
-gs_currentlinecap(const gs_state * pgs)
+gs_currentlinecap(const gs_gstate * pgs)
{
/* This assumes that all caps are the same as start_cap - this will be
* the case for postscript at least. */
@@ -98,7 +98,7 @@ gs_currentlinecap(const gs_state * pgs)
/* setlinejoin */
int
-gs_setlinejoin(gs_state * pgs, gs_line_join join)
+gs_setlinejoin(gs_gstate * pgs, gs_line_join join)
{
if ((uint) join > gs_line_join_max)
return_error(gs_error_rangecheck);
@@ -108,7 +108,7 @@ gs_setlinejoin(gs_state * pgs, gs_line_join join)
/* currentlinejoin */
gs_line_join
-gs_currentlinejoin(const gs_state * pgs)
+gs_currentlinejoin(const gs_gstate * pgs)
{
return pgs_lp->join;
}
@@ -140,14 +140,14 @@ gx_set_miter_limit(gx_line_params * plp, double limit)
return 0;
}
int
-gs_setmiterlimit(gs_state * pgs, double limit)
+gs_setmiterlimit(gs_gstate * pgs, double limit)
{
return gx_set_miter_limit(pgs_lp, limit);
}
/* currentmiterlimit */
float
-gs_currentmiterlimit(const gs_state * pgs)
+gs_currentmiterlimit(const gs_gstate * pgs)
{
return pgs_lp->miter_limit;
}
@@ -228,7 +228,7 @@ gx_set_dash(gx_dash_params * dash, const float *pattern, uint length,
return 0;
}
int
-gs_setdash(gs_state * pgs, const float *pattern, uint length, double offset)
+gs_setdash(gs_gstate * pgs, const float *pattern, uint length, double offset)
{
return gx_set_dash(&pgs_lp->dash, pattern, length, offset,
pgs->memory);
@@ -236,57 +236,57 @@ gs_setdash(gs_state * pgs, const float *pattern, uint length, double offset)
/* currentdash */
uint
-gs_currentdash_length(const gs_state * pgs)
+gs_currentdash_length(const gs_gstate * pgs)
{
return pgs_lp->dash.pattern_size;
}
const float *
-gs_currentdash_pattern(const gs_state * pgs)
+gs_currentdash_pattern(const gs_gstate * pgs)
{
return pgs_lp->dash.pattern;
}
float
-gs_currentdash_offset(const gs_state * pgs)
+gs_currentdash_offset(const gs_gstate * pgs)
{
return pgs_lp->dash.offset;
}
/* Internal accessor for line parameters */
const gx_line_params *
-gs_currentlineparams(const gs_imager_state * pis)
+gs_currentlineparams(const gs_gstate * pgs)
{
- return gs_currentlineparams_inline(pis);
+ return gs_currentlineparams_inline(pgs);
}
/* ------ Device-dependent parameters ------ */
/* setflat */
int
-gs_imager_setflat(gs_imager_state * pis, double flat)
+gs_gstate_setflat(gs_gstate * pgs, double flat)
{
if (flat <= 0.2)
flat = 0.2;
else if (flat > 100)
flat = 100;
- pis->flatness = flat;
+ pgs->flatness = flat;
return 0;
}
int
-gs_setflat(gs_state * pgs, double flat)
+gs_setflat(gs_gstate * pgs, double flat)
{
- return gs_imager_setflat((gs_imager_state *) pgs, flat);
+ return gs_gstate_setflat(pgs, flat);
}
/* currentflat */
float
-gs_currentflat(const gs_state * pgs)
+gs_currentflat(const gs_gstate * pgs)
{
return pgs->flatness;
}
/* setstrokeadjust */
int
-gs_setstrokeadjust(gs_state * pgs, bool stroke_adjust)
+gs_setstrokeadjust(gs_gstate * pgs, bool stroke_adjust)
{
pgs->stroke_adjust = stroke_adjust;
return 0;
@@ -294,7 +294,7 @@ gs_setstrokeadjust(gs_state * pgs, bool stroke_adjust)
/* currentstrokeadjust */
bool
-gs_currentstrokeadjust(const gs_state * pgs)
+gs_currentstrokeadjust(const gs_gstate * pgs)
{
return pgs->stroke_adjust;
}
@@ -305,26 +305,26 @@ gs_currentstrokeadjust(const gs_state * pgs)
/* setdashadapt */
void
-gs_setdashadapt(gs_state * pgs, bool adapt)
+gs_setdashadapt(gs_gstate * pgs, bool adapt)
{
pgs_lp->dash.adapt = adapt;
}
/* currentdashadapt */
bool
-gs_imager_currentdashadapt(const gs_imager_state * pis)
+gs_gstate_currentdashadapt(const gs_gstate * pgs)
{
- return gs_currentlineparams_inline(pis)->dash.adapt;
+ return gs_currentlineparams_inline(pgs)->dash.adapt;
}
bool
-gs_currentdashadapt(const gs_state * pgs)
+gs_currentdashadapt(const gs_gstate * pgs)
{
- return gs_imager_currentdashadapt((const gs_imager_state *)pgs);
+ return gs_gstate_currentdashadapt((const gs_gstate *)pgs);
}
/* setcurvejoin */
int
-gs_setcurvejoin(gs_state * pgs, int join)
+gs_setcurvejoin(gs_gstate * pgs, int join)
{
if (join < -1 || join > gs_line_join_max)
return_error(gs_error_rangecheck);
@@ -334,7 +334,7 @@ gs_setcurvejoin(gs_state * pgs, int join)
/* currentcurvejoin */
int
-gs_currentcurvejoin(const gs_state * pgs)
+gs_currentcurvejoin(const gs_gstate * pgs)
{
return pgs_lp->curve_join;
}
@@ -343,21 +343,21 @@ gs_currentcurvejoin(const gs_state * pgs)
/* setaccuratecurves */
void
-gs_setaccuratecurves(gs_state * pgs, bool accurate)
+gs_setaccuratecurves(gs_gstate * pgs, bool accurate)
{
pgs->accurate_curves = accurate;
}
/* currentaccuratecurves */
bool
-gs_imager_currentaccuratecurves(const gs_imager_state * pis)
+gs_gstate_currentaccuratecurves(const gs_gstate * pgs)
{
- return pis->accurate_curves;
+ return pgs->accurate_curves;
}
bool
-gs_currentaccuratecurves(const gs_state * pgs)
+gs_currentaccuratecurves(const gs_gstate * pgs)
{
- return gs_imager_currentaccuratecurves((const gs_imager_state *)pgs);
+ return gs_gstate_currentaccuratecurves((const gs_gstate *)pgs);
}
/* setdotlength */
@@ -371,26 +371,26 @@ gx_set_dot_length(gx_line_params * plp, double length, bool absolute)
return 0;
}
int
-gs_setdotlength(gs_state * pgs, double length, bool absolute)
+gs_setdotlength(gs_gstate * pgs, double length, bool absolute)
{
return gx_set_dot_length(pgs_lp, length, absolute);
}
/* currentdotlength */
float
-gs_currentdotlength(const gs_state * pgs)
+gs_currentdotlength(const gs_gstate * pgs)
{
return pgs_lp->dot_length;
}
bool
-gs_currentdotlength_absolute(const gs_state * pgs)
+gs_currentdotlength_absolute(const gs_gstate * pgs)
{
return pgs_lp->dot_length_absolute;
}
/* setdotorientation */
int
-gs_setdotorientation(gs_state *pgs)
+gs_setdotorientation(gs_gstate *pgs)
{
if (is_xxyy(&pgs->ctm) || is_xyyx(&pgs->ctm))
return gs_currentmatrix(pgs, &pgs_lp->dot_orientation);
@@ -399,7 +399,7 @@ gs_setdotorientation(gs_state *pgs)
/* dotorientation */
int
-gs_dotorientation(gs_state *pgs)
+gs_dotorientation(gs_gstate *pgs)
{
return gs_setmatrix(pgs, &pgs_lp->dot_orientation);
}
diff --git a/base/gsline.h b/base/gsline.h
index 89fbb8d17..7d5a85ca7 100644
--- a/base/gsline.h
+++ b/base/gsline.h
@@ -22,48 +22,48 @@
#include "gslparam.h"
/* Procedures */
-int gs_setlinewidth(gs_state *, double);
-float gs_currentlinewidth(const gs_state *);
-int gs_setlinecap(gs_state *, gs_line_cap);
-gs_line_cap gs_currentlinecap(const gs_state *);
-int gs_setlinestartcap(gs_state *, gs_line_cap);
-int gs_setlineendcap(gs_state *, gs_line_cap);
-int gs_setlinedashcap(gs_state *, gs_line_cap);
-int gs_setlinejoin(gs_state *, gs_line_join);
-gs_line_join gs_currentlinejoin(const gs_state *);
-int gs_setmiterlimit(gs_state *, double);
-float gs_currentmiterlimit(const gs_state *);
-int gs_setdash(gs_state *, const float *, uint, double);
-uint gs_currentdash_length(const gs_state *);
-const float *gs_currentdash_pattern(const gs_state *);
-float gs_currentdash_offset(const gs_state *);
-int gs_setflat(gs_state *, double);
-float gs_currentflat(const gs_state *);
-int gs_setstrokeadjust(gs_state *, bool);
-bool gs_currentstrokeadjust(const gs_state *);
+int gs_setlinewidth(gs_gstate *, double);
+float gs_currentlinewidth(const gs_gstate *);
+int gs_setlinecap(gs_gstate *, gs_line_cap);
+gs_line_cap gs_currentlinecap(const gs_gstate *);
+int gs_setlinestartcap(gs_gstate *, gs_line_cap);
+int gs_setlineendcap(gs_gstate *, gs_line_cap);
+int gs_setlinedashcap(gs_gstate *, gs_line_cap);
+int gs_setlinejoin(gs_gstate *, gs_line_join);
+gs_line_join gs_currentlinejoin(const gs_gstate *);
+int gs_setmiterlimit(gs_gstate *, double);
+float gs_currentmiterlimit(const gs_gstate *);
+int gs_setdash(gs_gstate *, const float *, uint, double);
+uint gs_currentdash_length(const gs_gstate *);
+const float *gs_currentdash_pattern(const gs_gstate *);
+float gs_currentdash_offset(const gs_gstate *);
+int gs_setflat(gs_gstate *, double);
+float gs_currentflat(const gs_gstate *);
+int gs_setstrokeadjust(gs_gstate *, bool);
+bool gs_currentstrokeadjust(const gs_gstate *);
/* Extensions - device-independent */
-void gs_setdashadapt(gs_state *, bool);
-bool gs_currentdashadapt(const gs_state *);
-int gs_setcurvejoin(gs_state *, int);
-int gs_currentcurvejoin(const gs_state *);
+void gs_setdashadapt(gs_gstate *, bool);
+bool gs_currentdashadapt(const gs_gstate *);
+int gs_setcurvejoin(gs_gstate *, int);
+int gs_currentcurvejoin(const gs_gstate *);
/* Extensions - device-dependent */
-void gs_setaccuratecurves(gs_state *, bool);
-bool gs_currentaccuratecurves(const gs_state *);
-int gs_setdotlength(gs_state *, double, bool);
-float gs_currentdotlength(const gs_state *);
-bool gs_currentdotlength_absolute(const gs_state *);
-int gs_setdotorientation(gs_state *);
-int gs_dotorientation(gs_state *);
+void gs_setaccuratecurves(gs_gstate *, bool);
+bool gs_currentaccuratecurves(const gs_gstate *);
+int gs_setdotlength(gs_gstate *, double, bool);
+float gs_currentdotlength(const gs_gstate *);
+bool gs_currentdotlength_absolute(const gs_gstate *);
+int gs_setdotorientation(gs_gstate *);
+int gs_dotorientation(gs_gstate *);
-/* Imager-level procedures */
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+/* gs_gstate-level procedures */
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
-int gs_imager_setflat(gs_imager_state *, double);
-bool gs_imager_currentdashadapt(const gs_imager_state *);
-bool gs_imager_currentaccuratecurves(const gs_imager_state *);
+int gs_gstate_setflat(gs_gstate *, double);
+bool gs_gstate_currentdashadapt(const gs_gstate *);
+bool gs_gstate_currentaccuratecurves(const gs_gstate *);
#endif /* gsline_INCLUDED */
diff --git a/base/gsnamecl.c b/base/gsnamecl.c
index 34293397a..86f743298 100644
--- a/base/gsnamecl.c
+++ b/base/gsnamecl.c
@@ -51,7 +51,7 @@
* Separation color space.
*/
bool
-custom_color_callback_install_Separation(gs_color_space * pcs, gs_state * pgs)
+custom_color_callback_install_Separation(gs_color_space * pcs, gs_gstate * pgs)
{
client_custom_color_params_t * pcb =
(client_custom_color_params_t *) pgs->memory->gs_lib_ctx->custom_color_callback;
@@ -65,7 +65,7 @@ custom_color_callback_install_Separation(gs_color_space * pcs, gs_state * pgs)
* DeviceN color space.
*/
bool
-custom_color_callback_install_DeviceN(gs_color_space * pcs, gs_state * pgs)
+custom_color_callback_install_DeviceN(gs_color_space * pcs, gs_gstate * pgs)
{
client_custom_color_params_t * pcb =
(client_custom_color_params_t *) pgs->memory->gs_lib_ctx->custom_color_callback;
@@ -81,17 +81,17 @@ custom_color_callback_install_DeviceN(gs_color_space * pcs, gs_state * pgs)
int
gx_remap_concrete_custom_color_Separation(const frac * pconc,
const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
client_custom_color_params_t * pcb =
- (client_custom_color_params_t *) pis->memory->gs_lib_ctx->custom_color_callback;
+ (client_custom_color_params_t *) pgs->memory->gs_lib_ctx->custom_color_callback;
if (pcb == NULL) {
return_error(gs_error_rangecheck);
}
else
return pcb->client_procs->remap_Separation(pcb, pconc,
- pcs, pdc, pis, dev, select);
+ pcs, pdc, pgs, dev, select);
}
/*
@@ -101,17 +101,17 @@ gx_remap_concrete_custom_color_Separation(const frac * pconc,
int
gx_remap_concrete_custom_color_DeviceN(const frac * pconc,
const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
client_custom_color_params_t * pcb =
- (client_custom_color_params_t *) pis->memory->gs_lib_ctx->custom_color_callback;
+ (client_custom_color_params_t *) pgs->memory->gs_lib_ctx->custom_color_callback;
if (pcb == NULL) {
return_error(gs_error_rangecheck);
}
else
return pcb->client_procs->remap_DeviceN(pcb, pconc,
- pcs, pdc, pis, dev, select);
+ pcs, pdc, pgs, dev, select);
}
/*
@@ -122,7 +122,7 @@ gx_remap_concrete_custom_color_DeviceN(const frac * pconc,
* would be a problem using integers to pass pointer values on 64 bit systems.
*/
int
-custom_color_callback_get_params(gs_state * pgs, gs_param_list * plist)
+custom_color_callback_get_params(gs_gstate * pgs, gs_param_list * plist)
{
/* Convert our pointer to a PostScript hex string */
char buf[64] = "16#";
@@ -156,7 +156,7 @@ custom_color_callback_get_params(gs_state * pgs, gs_param_list * plist)
* would be a problem using integers to pass pointer values on 64 bit systems.
*/
int
-custom_color_callback_put_params(gs_state * pgs, gs_param_list * plist)
+custom_color_callback_put_params(gs_gstate * pgs, gs_param_list * plist)
{
int code;
size_t iptr = (size_t)(pgs->memory->gs_lib_ctx->custom_color_callback);
diff --git a/base/gsnamecl.h b/base/gsnamecl.h
index 07b06902e..0c4cd2a8c 100644
--- a/base/gsnamecl.h
+++ b/base/gsnamecl.h
@@ -60,14 +60,14 @@ typedef struct gs_color_space_s gs_color_space;
typedef struct gx_device_color_s gx_device_color;
#endif
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gx_device_DEFINED
@@ -96,7 +96,7 @@ typedef struct gs_param_list_s gs_param_list;
* is not being used since PS integers are nominally 32 bits. Thus there
* would be a problem using integers to pass pointer values on 64 bit systems.
*/
-int custom_color_callback_put_params(gs_state * pgs, gs_param_list * plist);
+int custom_color_callback_put_params(gs_gstate * pgs, gs_param_list * plist);
/*
* Get the custom client client callback parameter block pointer. This value
@@ -105,20 +105,20 @@ int custom_color_callback_put_params(gs_state * pgs, gs_param_list * plist);
* is not being used since PS intergers are nominally 32 bits. Thus there
* would be a problem using integers to pass pointer values on 64 bit systems.
*/
-int custom_color_callback_get_params(gs_state * pgs, gs_param_list * plist);
+int custom_color_callback_get_params(gs_gstate * pgs, gs_param_list * plist);
/*
* Check if we want to use the callback color processing logic for the given
* Separation color space.
*/
bool custom_color_callback_install_Separation(gs_color_space * pcs,
- gs_state * pgs);
+ gs_gstate * pgs);
/*
* Check if we want to use the custom client callback processing logic for the
* given DeviceN color space.
*/
-bool custom_color_callback_install_DeviceN(gs_color_space * pcs, gs_state * pgs);
+bool custom_color_callback_install_DeviceN(gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a Separation color into device colorants using the custom client
@@ -126,7 +126,7 @@ bool custom_color_callback_install_DeviceN(gs_color_space * pcs, gs_state * pgs)
*/
int gx_remap_concrete_custom_color_Separation(const frac * pconc,
const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select);
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select);
/*
* Convert a DeviceN color into device colorants using the custom client
@@ -134,7 +134,7 @@ int gx_remap_concrete_custom_color_Separation(const frac * pconc,
*/
int gx_remap_concrete_custom_color_DeviceN(const frac * pconc,
const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select);
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select);
/* "CLIENT COLOR CALLBACK APPLICATION INTERFACE" */
/*
@@ -178,70 +178,70 @@ typedef struct client_custom_color_procs_s {
* Install a DeviceGray color space.
*/
bool (* install_DeviceGray)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a DeviceGray color into device color.
*/
int (* remap_DeviceGray)(client_custom_color_params_t * pparams,
const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Install a DeviceRGB color space.
*/
bool (* install_DeviceRGB)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a DeviceRGB color into device color.
*/
int (* remap_DeviceRGB)(client_custom_color_params_t * pparams,
const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Install a DeviceCMYK color space.
*/
bool (* install_DeviceCMYK)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a DeviceGray color into device color.
*/
int (* remap_DeviceCMYK)(client_custom_color_params_t * pparams,
const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Check if we want to use the callback color processing logic for the
* given Separation color space.
*/
bool (* install_Separation)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a Separation color into device color.
*/
int (* remap_Separation)(client_custom_color_params_t * pparams,
const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Check if we want to use the callback color processing logic for the
* given DeviceN color space.
*/
bool (* install_DeviceN)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a DeviceN color into device color.
*/
int (* remap_DeviceN)(client_custom_color_params_t * pparams,
const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Check if we want to use the callback color processing logic for the
* given CIEBasedA color space.
*/
bool (* install_CIEBasedA)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Please note that the 'complex' color spaces (CIEBasedA, CIEBasedABC,
* CIEBasedDEF, CIEBasedDEFG, and ICCBased) have a different prototype,
@@ -253,59 +253,59 @@ typedef struct client_custom_color_procs_s {
*/
int (* remap_CIEBasedA)(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Check if we want to use the callback color processing logic for the
* given CIEBasedABC color space.
*/
bool (* install_CIEBasedABC)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a CIEBasedABC color into device color.
*/
int (* remap_CIEBasedABC)(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Check if we want to use the callback color processing logic for the
* given CIEBasedDEF color space.
*/
bool (* install_CIEBasedDEF)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a CIEBasedDEF color into device color.
*/
int (* remap_CIEBasedDEF)(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Check if we want to use the callback color processing logic for the
* given CIEBasedDEFG color space.
*/
bool (* install_CIEBasedDEFG)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a CIEBasedDEFG color into device color.
*/
int (* remap_CIEBasedDEFG)(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
/*
* Check if we want to use the callback color processing logic for the
* given ICCBased color space.
*/
bool (* install_ICCBased)(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs);
+ gs_color_space * pcs, gs_gstate * pgs);
/*
* Convert a ICCBased color into device color.
*/
int (* remap_ICCBased)(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select);
} client_custom_color_procs_t;
diff --git a/base/gsncdummy.c b/base/gsncdummy.c
index e70f43bac..1ae428444 100644
--- a/base/gsncdummy.c
+++ b/base/gsncdummy.c
@@ -136,20 +136,20 @@ typedef struct demo_color_space_data_s {
* colorant in the color space.
*/
int color_index[GS_CLIENT_COLOR_MAX_COMPONENTS];
- gs_imager_state *CIEtoXYZ_pis; /* Used to map CIE spaces to XYZ */
+ gs_gstate *CIEtoXYZ_pgs; /* Used to map CIE spaces to XYZ */
/* refer to gx_cie_to_xyz_alloc */
} demo_color_space_data_t;
gs_private_st_ptrs1(st_demo_color_space_data, demo_color_space_data_t,
"demo_color_space_data_t", demo_color_space_enum_ptrs,
- demo_color_space_reloc_ptrs, CIEtoXYZ_pis);
+ demo_color_space_reloc_ptrs, CIEtoXYZ_pgs);
/*
* Dummy install routine for color spaces which are not handled by the client.
*/
static bool
client_install_no_op(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
return false; /* Do nothing */
}
@@ -166,9 +166,9 @@ client_adjust_cspace_count(const gs_color_space * pcs, int delta)
pdata->ref_count += delta;
if (pdata->ref_count <= 0) {
- /* Free up the CIE to XYZ imager state if it was allocated */
- if (pdata->CIEtoXYZ_pis) {
- gx_cie_to_xyz_free(pdata->CIEtoXYZ_pis);
+ /* Free up the CIE to XYZ gs_gstate if it was allocated */
+ if (pdata->CIEtoXYZ_pgs) {
+ gx_cie_to_xyz_free(pdata->CIEtoXYZ_pgs);
}
gs_free_object(pdata->memory, pdata, "client_adjust_cspace_count(pdata)");
}
@@ -186,7 +186,7 @@ allocate_client_data_block(int initial_ref_count, gs_memory_t *mem)
{
/*
* We allocate this with normal GC structure declarations since
- * we need this to be able to allocate the gs_imager_state for XYZ
+ * we need this to be able to allocate the gs_gstate for XYZ
* conversion.
* Since this is in stable memory, we use a simple reference count.
* See client_adjust_cspace_count.
@@ -211,7 +211,7 @@ allocate_client_data_block(int initial_ref_count, gs_memory_t *mem)
static bool
client_install_generic(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
demo_color_space_data_t * pclient_data;
@@ -235,7 +235,7 @@ client_install_generic(client_custom_color_params_t * pparams,
*/
static bool
client_pantone_install_Separation(client_custom_color_params_t * pparam,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
const gs_separation_name name = pcs->params.separation.sep_name;
int pan_index;
@@ -285,7 +285,7 @@ client_pantone_install_Separation(client_custom_color_params_t * pparam,
*/
static bool
client_pantone_install_DeviceN(client_custom_color_params_t * pparam,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
const gs_separation_name *names = pcs->params.device_n.names;
int num_comp = pcs->params.device_n.num_components;
@@ -406,7 +406,7 @@ client_pantone_install_DeviceN(client_custom_color_params_t * pparam,
static int
client_pantone_remap_color(client_custom_color_params_t * pparam,
const frac * pconc, const demo_color_space_data_t * pparams,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select, int num_comp)
{
int i, pantone_index, cvalue;
@@ -463,7 +463,7 @@ client_pantone_remap_color(client_custom_color_params_t * pparam,
cm = (magenta > frac_1) ? frac_1 : (magenta < frac_0) ? frac_0 : magenta;
cy = (yellow > frac_1) ? frac_1 : (yellow < frac_0) ? frac_0 : yellow;
ck = (black > frac_1) ? frac_1 : (black < frac_0) ? frac_0 : black;
- gx_remap_concrete_cmyk(cc, cm, cy, ck, pdc, pis, dev, select);
+ gx_remap_concrete_cmyk(cc, cm, cy, ck, pdc, pgs, dev, select);
return 0;
}
@@ -473,11 +473,11 @@ client_pantone_remap_color(client_custom_color_params_t * pparam,
static int
client_pantone_remap_Separation(client_custom_color_params_t * pparam,
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
return client_pantone_remap_color(pparam, pconc,
(demo_color_space_data_t *)(pcs->pclient_color_space_data),
- pdc, pis, dev, select, 1);
+ pdc, pgs, dev, select, 1);
}
/*
@@ -486,11 +486,11 @@ client_pantone_remap_Separation(client_custom_color_params_t * pparam,
static int
client_pantone_remap_DeviceN(client_custom_color_params_t * pparam,
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
return client_pantone_remap_color(pparam, pconc,
(demo_color_space_data_t *)(pcs->pclient_color_space_data),
- pdc, pis, dev, select, gs_color_space_num_components(pcs));
+ pdc, pgs, dev, select, gs_color_space_num_components(pcs));
}
#if !PANTONE_ONLY
@@ -500,7 +500,7 @@ client_pantone_remap_DeviceN(client_custom_color_params_t * pparam,
*/
static bool
client_install_DeviceGray(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
/* Nothing to do in our demo */
return true;
@@ -512,7 +512,7 @@ client_install_DeviceGray(client_custom_color_params_t * pparams,
*/
static int
convert_intensity_into_device_color(const frac intensity,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
frac cc, cm, cy, ck;
@@ -534,7 +534,7 @@ convert_intensity_into_device_color(const frac intensity,
}
/* Send CMYK colors to the device */
- gx_remap_concrete_cmyk(cc, cm, cy, ck, pdc, pis, dev, select);
+ gx_remap_concrete_cmyk(cc, cm, cy, ck, pdc, pgs, dev, select);
return 0;
}
@@ -544,7 +544,7 @@ convert_intensity_into_device_color(const frac intensity,
static int
client_remap_DeviceGray(client_custom_color_params_t * pparams,
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
#if OBJECT_TYPE_EXAMPLE
@@ -553,13 +553,13 @@ client_remap_DeviceGray(client_custom_color_params_t * pparams,
* intensity of the given colors and the object type. */
frac intensity = pconc[0];
- convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
+ convert_intensity_into_device_color(intensity, pdc, pgs, dev, select);
#else
/* If desired, replace with your own color transformation */
- gx_remap_concrete_gray(pconc[0], pdc, pis, dev, select);
+ gx_remap_concrete_gray(pconc[0], pdc, pgs, dev, select);
#endif
@@ -571,7 +571,7 @@ client_remap_DeviceGray(client_custom_color_params_t * pparams,
*/
static bool
client_install_DeviceRGB(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
/* Nothing to do in our demo */
dlprintf1("client_install_DeviceRGB ri = %d\n", pgs->renderingintent);
@@ -584,7 +584,7 @@ client_install_DeviceRGB(client_custom_color_params_t * pparams,
static int
client_remap_DeviceRGB(client_custom_color_params_t * pparams,
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
#if OBJECT_TYPE_EXAMPLE
@@ -593,13 +593,13 @@ client_remap_DeviceRGB(client_custom_color_params_t * pparams,
* intensity of the given colors and the object type. */
frac intensity = (frac)(pconc[0] * 0.30 + pconc[1] * 0.59 + pconc[2] * 0.11);
- convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
+ convert_intensity_into_device_color(intensity, pdc, pgs, dev, select);
#else
/* If desired, replace with your own color transformation */
- gx_remap_concrete_rgb(pconc[0], pconc[1], pconc[2], pdc, pis, dev, select);
+ gx_remap_concrete_rgb(pconc[0], pconc[1], pconc[2], pdc, pgs, dev, select);
#endif
@@ -611,7 +611,7 @@ client_remap_DeviceRGB(client_custom_color_params_t * pparams,
*/
static bool
client_install_DeviceCMYK(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
/* Nothing to do in our demo */
return true;
@@ -623,7 +623,7 @@ client_install_DeviceCMYK(client_custom_color_params_t * pparams,
static int
client_remap_DeviceCMYK(client_custom_color_params_t * pparams,
const frac * pconc, const gs_color_space * pcs, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
#if OBJECT_TYPE_EXAMPLE
@@ -637,12 +637,12 @@ client_remap_DeviceCMYK(client_custom_color_params_t * pparams,
if (intensity < frac_0)
intensity = frac_0;
- convert_intensity_into_device_color(intensity, pdc, pis, dev, select);
+ convert_intensity_into_device_color(intensity, pdc, pgs, dev, select);
#else
/* If desired, replace with your own color transformation */
- gx_remap_concrete_cmyk(pconc[0], pconc[1], pconc[2], pconc[3],pdc, pis, dev, select);
+ gx_remap_concrete_cmyk(pconc[0], pconc[1], pconc[2], pconc[3],pdc, pgs, dev, select);
#endif
@@ -661,7 +661,7 @@ client_remap_DeviceCMYK(client_custom_color_params_t * pparams,
static bool
client_install_CIEtoA(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
/* get ready for converting to XYZ */
demo_color_space_data_t * pdata;
@@ -692,9 +692,9 @@ client_install_CIEtoA(client_custom_color_params_t * pparams,
gx_cie_load_common_cache(&pcie->common, pgs);
gs_cie_a_complete(pcie);
if ((code=gs_cie_cs_complete(pgs, true)) >= 0) {
- /* Now allocate the conversion imager state in stable_memory */
+ /* Now allocate the conversion gs_gstate in stable_memory */
/* so that the garbage collector won't free it */
- code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
+ code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pgs, pcs,
pcs->rc.memory->stable_memory);
}
if (code < 0) {
@@ -707,7 +707,7 @@ client_install_CIEtoA(client_custom_color_params_t * pparams,
static bool
client_install_CIEtoXYZ(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
/* get ready for converting to XYZ */
demo_color_space_data_t * pdata;
@@ -753,9 +753,9 @@ client_install_CIEtoXYZ(client_custom_color_params_t * pparams,
}
/* Fill the caches we need in the CIE color space */
if ((code=gx_install_cie_abc((gs_cie_abc *)pcie, pgs)) >= 0) {
- /* Now allocate the conversion imager state in stable_memory */
+ /* Now allocate the conversion gs_gstate in stable_memory */
/* so that the garbage collector won't free it */
- code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
+ code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pgs, pcs,
pcs->rc.memory->stable_memory);
}
if (code < 0) {
@@ -768,7 +768,7 @@ client_install_CIEtoXYZ(client_custom_color_params_t * pparams,
static bool
client_install_ICCtoXYZ(client_custom_color_params_t * pparams,
- gs_color_space * pcs, gs_state * pgs)
+ gs_color_space * pcs, gs_gstate * pgs)
{
int code;
const gs_icc_params * picc_params = (const gs_icc_params *)&pcs->params.icc;
@@ -781,7 +781,7 @@ client_install_ICCtoXYZ(client_custom_color_params_t * pparams,
pdata = allocate_client_data_block(1, pcs->rc.memory->stable_memory);
pcs->pclient_color_space_data = (client_color_space_data_t *) pdata;
- /* Need to initialize the client data. The imager_state is what is needed in pdata->CIEtoXZY_ps */
+ /* Need to initialize the client data. The gs_gstate is what is needed in pdata->CIEtoXZY_ps */
/* update the stub information used by the joint caches */
gx_cie_load_common_cache(&picc_info->common, pgs);
@@ -792,9 +792,9 @@ client_install_ICCtoXYZ(client_custom_color_params_t * pparams,
return false;
}
- /* Now allocate the conversion imager state in stable_memory */
+ /* Now allocate the conversion gs_gstate in stable_memory */
/* so that the garbage collector won't free it */
- code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pis, pcs,
+ code = gx_cie_to_xyz_alloc(&pdata->CIEtoXYZ_pgs, pcs,
pcs->rc.memory->stable_memory);
if (code < 0) {
@@ -811,7 +811,7 @@ client_install_ICCtoXYZ(client_custom_color_params_t * pparams,
static int
client_remap_CIEBasedA(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
demo_color_space_data_t * pdata =
@@ -819,10 +819,10 @@ client_remap_CIEBasedA(client_custom_color_params_t * pparams,
frac gray = convert2frac(pc->paint.values[0], pcs->params.a->RangeA);
/*** Demonstrate method to convert to XYZ ***/
- if (pdata->CIEtoXYZ_pis) {
+ if (pdata->CIEtoXYZ_pgs) {
frac xyz[3];
- cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
+ cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pgs);
/* We don't really do anything with these values, but this */
/* is where a real client could convert to a device color */
if_debug4('|', "[c]client_remap CIEA [%g] -> XYZ [%g, %g, %g]\n",
@@ -834,7 +834,7 @@ client_remap_CIEBasedA(client_custom_color_params_t * pparams,
* For demo and debug purposes, make our colors a function of the
* intensity of the given color value and the object type.
*/
- return client_remap_DeviceGray(pparams, &gray, pcs, pdc, pis, dev, select);
+ return client_remap_DeviceGray(pparams, &gray, pcs, pdc, pgs, dev, select);
}
/*
@@ -843,7 +843,7 @@ client_remap_CIEBasedA(client_custom_color_params_t * pparams,
static int
client_remap_CIEBasedABC(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
demo_color_space_data_t * pdata =
@@ -852,10 +852,10 @@ client_remap_CIEBasedABC(client_custom_color_params_t * pparams,
int i;
/*** Demonstrate method to convert to XYZ ***/
- if (pdata->CIEtoXYZ_pis) {
+ if (pdata->CIEtoXYZ_pgs) {
frac xyz[3];
- cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
+ cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pgs);
/* We don't really do anything with these values, but this */
/* is where a real client could convert to a device color */
if_debug6('|', "[c]client_remap CIEABC [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
@@ -871,7 +871,7 @@ client_remap_CIEBasedABC(client_custom_color_params_t * pparams,
for (i = 0; i < 3; i++)
rgb[i] = convert2frac(pc->paint.values[i],
pcs->params.abc->RangeABC.ranges[i]);
- return client_remap_DeviceRGB(pparams, rgb, pcs, pdc, pis, dev, select);
+ return client_remap_DeviceRGB(pparams, rgb, pcs, pdc, pgs, dev, select);
}
/*
@@ -880,7 +880,7 @@ client_remap_CIEBasedABC(client_custom_color_params_t * pparams,
static int
client_remap_CIEBasedDEF(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
demo_color_space_data_t * pdata =
@@ -889,10 +889,10 @@ client_remap_CIEBasedDEF(client_custom_color_params_t * pparams,
int i;
/*** Demonstrate method to convert to XYZ ***/
- if (pdata->CIEtoXYZ_pis) {
+ if (pdata->CIEtoXYZ_pgs) {
frac xyz[3];
- cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
+ cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pgs);
/* We don't really do anything with these values, but this */
/* is where a real client could convert to a device color */
if_debug6('|', "[c]client_remap CIEDEF [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
@@ -908,7 +908,7 @@ client_remap_CIEBasedDEF(client_custom_color_params_t * pparams,
for (i = 0; i < 3; i++)
rgb[i] = convert2frac(pc->paint.values[i],
pcs->params.def->RangeDEF.ranges[i]);
- return client_remap_DeviceRGB(pparams, rgb, pcs, pdc, pis, dev, select);
+ return client_remap_DeviceRGB(pparams, rgb, pcs, pdc, pgs, dev, select);
}
/*
@@ -917,7 +917,7 @@ client_remap_CIEBasedDEF(client_custom_color_params_t * pparams,
static int
client_remap_CIEBasedDEFG(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
demo_color_space_data_t * pdata =
@@ -926,10 +926,10 @@ client_remap_CIEBasedDEFG(client_custom_color_params_t * pparams,
int i;
/*** Demonstrate method to convert to XYZ ***/
- if (pdata->CIEtoXYZ_pis) {
+ if (pdata->CIEtoXYZ_pgs) {
frac xyz[3];
- cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
+ cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pgs);
/* We don't really do anything with these values, but this */
/* is where a real client could convert to a device color */
if_debug7('|', "[c]client_remap CIEDEFG [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
@@ -946,7 +946,7 @@ client_remap_CIEBasedDEFG(client_custom_color_params_t * pparams,
for (i = 0; i < 4; i++)
cmyk[i] = convert2frac(pc->paint.values[i],
pcs->params.defg->RangeDEFG.ranges[i]);
- return client_remap_DeviceRGB(pparams, cmyk, pcs, pdc, pis, dev, select);
+ return client_remap_DeviceRGB(pparams, cmyk, pcs, pdc, pgs, dev, select);
}
/*
@@ -955,7 +955,7 @@ client_remap_CIEBasedDEFG(client_custom_color_params_t * pparams,
static int
client_remap_ICCBased(client_custom_color_params_t * pparams,
const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
demo_color_space_data_t * pdata =
@@ -964,11 +964,11 @@ client_remap_ICCBased(client_custom_color_params_t * pparams,
int i, num_values = pcs->params.icc.picc_info->num_components;
/*** Demonstrate method to convert to XYZ ***/
- if (pdata->CIEtoXYZ_pis) {
+ if (pdata->CIEtoXYZ_pgs) {
frac xyz[3];
- cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pis);
+ cs_concretize_color(pc, pcs, xyz, pdata->CIEtoXYZ_pgs);
/* We don't really do anything with these values, but this */
/* is where a real client could convert to a device color */
if_debug6('|', "[c]client_remap ICCBased [%g, %g, %g] -> XYZ [%g, %g, %g]\n",
@@ -992,14 +992,14 @@ client_remap_ICCBased(client_custom_color_params_t * pparams,
return_error(gs_error_rangecheck);
case 1:
return client_remap_DeviceGray(pparams, frac_color, pcs,
- pdc, pis, dev, select);
+ pdc, pgs, dev, select);
case 3:
return client_remap_DeviceRGB(pparams, frac_color, pcs,
- pdc, pis, dev, select);
+ pdc, pgs, dev, select);
case 4:
default:
return client_remap_DeviceCMYK(pparams, frac_color, pcs,
- pdc, pis, dev, select);
+ pdc, pgs, dev, select);
}
}
diff --git a/base/gsovrc.c b/base/gsovrc.c
index 2f2f22dcf..0594f0526 100644
--- a/base/gsovrc.c
+++ b/base/gsovrc.c
@@ -28,7 +28,7 @@
#include "gxdcolor.h"
#include "gxoprect.h"
#include "gsbitops.h"
-#include "gxistate.h"
+#include "gxgstate.h"
/* GC descriptor for gs_overprint_t */
private_st_gs_overprint_t();
@@ -925,12 +925,12 @@ overprint_create_compositor(
gx_device * dev,
gx_device ** pcdev,
const gs_composite_t * pct,
- gs_imager_state * pis,
+ gs_gstate * pgs,
gs_memory_t * memory,
gx_device * cdev)
{
if (pct->type != &gs_composite_overprint_type)
- return gx_default_create_compositor(dev, pcdev, pct, pis, memory, cdev);
+ return gx_default_create_compositor(dev, pcdev, pct, pgs, memory, cdev);
else {
gs_overprint_params_t params = ((const gs_overprint_t *)pct)->params;
int code;
@@ -1105,7 +1105,7 @@ overprint_copy_planes(gx_device * dev, const byte * data, int data_x, int raster
AND it supports devn colors AND is 8 bit. */
static int
overprint_fill_rectangle_hl_color(gx_device *dev,
- const gs_fixed_rect *rect, const gs_imager_state *pis,
+ const gs_fixed_rect *rect, const gs_gstate *pgs,
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
{
overprint_device_t * opdev = (overprint_device_t *)dev;
@@ -1302,7 +1302,7 @@ c_overprint_create_default_compositor(
const gs_composite_t * pct,
gx_device ** popdev,
gx_device * tdev,
- gs_imager_state * pis,
+ gs_gstate * pgs,
gs_memory_t * mem )
{
const gs_overprint_t * ovrpct = (const gs_overprint_t *)pct;
diff --git a/base/gspaint.c b/base/gspaint.c
index 2c7ccb0d0..4c67b2ffe 100644
--- a/base/gspaint.c
+++ b/base/gspaint.c
@@ -21,7 +21,7 @@
#include "gserrors.h"
#include "gsropt.h" /* for gxpaint.h */
#include "gxfixed.h"
-#include "gxmatrix.h" /* for gs_state */
+#include "gxmatrix.h" /* for gs_gstate */
#include "gspaint.h"
#include "gspath.h"
#include "gzpath.h"
@@ -51,7 +51,7 @@
/* Erase the page */
int
-gs_erasepage(gs_state * pgs)
+gs_erasepage(gs_gstate * pgs)
{
/*
* We can't just fill with device white; we must take the
@@ -71,7 +71,7 @@ gs_erasepage(gs_state * pgs)
/* Fill the page with the current color. */
int
-gs_fillpage(gs_state * pgs)
+gs_fillpage(gs_gstate * pgs)
{
gx_device *dev = gs_currentdevice(pgs);
int code;
@@ -94,8 +94,7 @@ gs_fillpage(gs_state * pgs)
if (code != 0)
return code;
- code = (*dev_proc(dev, fillpage))(dev, (gs_imager_state *)pgs,
- gs_currentdevicecolor_inline(pgs));
+ code = (*dev_proc(dev, fillpage))(dev, pgs, gs_currentdevicecolor_inline(pgs));
if (code < 0)
return code;
@@ -121,7 +120,7 @@ gs_fillpage(gs_state * pgs)
* the former is less inconvenient.
*/
static int
-scale_paths(gs_state * pgs, int log2_scale_x, int log2_scale_y, bool do_path)
+scale_paths(gs_gstate * pgs, int log2_scale_x, int log2_scale_y, bool do_path)
{
/*
* Because of clip and clippath, any of path, clip_path, and view_clip
@@ -173,7 +172,7 @@ scale_paths(gs_state * pgs, int log2_scale_x, int log2_scale_y, bool do_path)
return 0;
}
static void
-scale_dash_pattern(gs_state * pgs, double scale)
+scale_dash_pattern(gs_gstate * pgs, double scale)
{
int i;
@@ -186,7 +185,7 @@ scale_dash_pattern(gs_state * pgs, double scale)
pgs->line_params.dot_length *= scale;
}
static int
-alpha_buffer_init(gs_state * pgs, fixed extra_x, fixed extra_y, int alpha_bits,
+alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits,
bool devn)
{
gx_device *dev = gs_currentdevice_inline(pgs);
@@ -238,7 +237,7 @@ alpha_buffer_init(gs_state * pgs, fixed extra_x, fixed extra_y, int alpha_bits,
/* Release an alpha buffer. */
static int
-alpha_buffer_release(gs_state * pgs, bool newpath)
+alpha_buffer_release(gs_gstate * pgs, bool newpath)
{
gx_device_memory *mdev =
(gx_device_memory *) gs_currentdevice_inline(pgs);
@@ -252,7 +251,7 @@ alpha_buffer_release(gs_state * pgs, bool newpath)
return code;
}
-static int do_fill(gs_state *pgs, int rule)
+static int do_fill(gs_gstate *pgs, int rule)
{
int code, abits, acode, rcode = 0;
bool devn;
@@ -294,7 +293,7 @@ static int do_fill(gs_state *pgs, int rule)
code = gx_set_dev_color(pgs);
if (code != 0)
return code;
- code = gs_state_color_load(pgs);
+ code = gs_gstate_color_load(pgs);
if (code < 0)
return code;
abits = 0;
@@ -323,7 +322,7 @@ static int do_fill(gs_state *pgs, int rule)
/* Fill the current path using a specified rule. */
static int
-fill_with_rule(gs_state * pgs, int rule)
+fill_with_rule(gs_gstate * pgs, int rule)
{
int code;
@@ -341,7 +340,7 @@ fill_with_rule(gs_state * pgs, int rule)
else if (gs_is_null_device(pgs->device)
|| (pgs->show_gstate && pgs->text_rendering_mode == 3
&& pgs->in_cachedevice == CACHE_DEVICE_NOT_CACHING)) {
- /* Handle separately to prevent gs_state_color_load - bug 688308. */
+ /* Handle separately to prevent gs_gstate_color_load - bug 688308. */
gs_newpath(pgs);
code = 0;
} else {
@@ -353,21 +352,21 @@ fill_with_rule(gs_state * pgs, int rule)
}
/* Fill using the winding number rule */
int
-gs_fill(gs_state * pgs)
+gs_fill(gs_gstate * pgs)
{
pgs->device->sgr.stroke_stored = false;
return fill_with_rule(pgs, gx_rule_winding_number);
}
/* Fill using the even/odd rule */
int
-gs_eofill(gs_state * pgs)
+gs_eofill(gs_gstate * pgs)
{
pgs->device->sgr.stroke_stored = false;
return fill_with_rule(pgs, gx_rule_even_odd);
}
static int
-do_stroke(gs_state * pgs)
+do_stroke(gs_gstate * pgs)
{
int code, abits, acode, rcode = 0;
bool devn;
@@ -407,7 +406,7 @@ do_stroke(gs_state * pgs)
code = gx_set_dev_color(pgs);
if (code != 0)
return code;
- code = gs_state_color_load(pgs);
+ code = gs_gstate_color_load(pgs);
if (code < 0)
return code;
abits = 0;
@@ -471,7 +470,7 @@ do_stroke(gs_state * pgs)
/* Stroke the current path */
int
-gs_stroke(gs_state * pgs)
+gs_stroke(gs_gstate * pgs)
{
int code;
@@ -495,7 +494,7 @@ gs_stroke(gs_state * pgs)
return code;
}
if (gs_is_null_device(pgs->device)) {
- /* Handle separately to prevent gs_state_color_load. */
+ /* Handle separately to prevent gs_gstate_color_load. */
gs_newpath(pgs);
code = 0;
} else {
@@ -508,7 +507,7 @@ gs_stroke(gs_state * pgs)
/* Compute the stroked outline of the current path */
static int
-gs_strokepath_aux(gs_state * pgs, bool traditional)
+gs_strokepath_aux(gs_gstate * pgs, bool traditional)
{
gx_path spath;
int code;
@@ -534,13 +533,13 @@ gs_strokepath_aux(gs_state * pgs, bool traditional)
}
int
-gs_strokepath(gs_state * pgs)
+gs_strokepath(gs_gstate * pgs)
{
return gs_strokepath_aux(pgs, true);
}
int
-gs_strokepath2(gs_state * pgs)
+gs_strokepath2(gs_gstate * pgs)
{
return gs_strokepath_aux(pgs, false);
}
diff --git a/base/gspaint.h b/base/gspaint.h
index 162b79740..525c285bf 100644
--- a/base/gspaint.h
+++ b/base/gspaint.h
@@ -21,13 +21,13 @@
# define gspaint_INCLUDED
/* Painting */
-int gs_erasepage(gs_state *),
- gs_fillpage(gs_state *),
- gs_fill(gs_state *),
- gs_eofill(gs_state *),
- gs_stroke(gs_state *);
+int gs_erasepage(gs_gstate *),
+ gs_fillpage(gs_gstate *),
+ gs_fill(gs_gstate *),
+ gs_eofill(gs_gstate *),
+ gs_stroke(gs_gstate *);
/* Image tracing */
-int gs_imagepath(gs_state *, int, int, const byte *);
+int gs_imagepath(gs_gstate *, int, int, const byte *);
#endif /* gspaint_INCLUDED */
diff --git a/base/gspath.c b/base/gspath.c
index 9c4332d82..92b6f9d27 100644
--- a/base/gspath.c
+++ b/base/gspath.c
@@ -32,14 +32,14 @@
/* ------ Miscellaneous ------ */
int
-gs_newpath(gs_state * pgs)
+gs_newpath(gs_gstate * pgs)
{
pgs->current_point_valid = false;
return gx_path_new(pgs->path);
}
int
-gs_closepath(gs_state * pgs)
+gs_closepath(gs_gstate * pgs)
{
gx_path *ppath = pgs->path;
int code = gx_path_close_subpath(ppath);
@@ -51,15 +51,15 @@ gs_closepath(gs_state * pgs)
}
int
-gs_upmergepath(gs_state * pgs)
+gs_upmergepath(gs_gstate * pgs)
{
/*
* We really should be able to implement this as simply
* return gx_path_add_path(pgs->saved->path, pgs->path);
- * But because of the current_point members in the imager state,
+ * But because of the current_point members in the gs_gstate,
* we can't.
*/
- gs_state *saved = pgs->saved;
+ gs_gstate *saved = pgs->saved;
int code;
code = gx_path_add_path(saved->path, pgs->path);
@@ -75,7 +75,7 @@ gs_upmergepath(gs_state * pgs)
/* Get the current path (for internal use only). */
gx_path *
-gx_current_path(const gs_state * pgs)
+gx_current_path(const gs_gstate * pgs)
{
return pgs->path;
}
@@ -90,7 +90,7 @@ clamp_point(gs_fixed_point * ppt, double x, double y)
}
int
-gs_currentpoint(gs_state * pgs, gs_point * ppt)
+gs_currentpoint(gs_gstate * pgs, gs_point * ppt)
{
if (!pgs->current_point_valid)
return_error(gs_error_nocurrentpoint);
@@ -149,20 +149,20 @@ clamp_point_aux(bool clamp_coordinates, gs_fixed_point *ppt, double x, double y)
}
int
-gs_moveto_aux(gs_imager_state *pis, gx_path *ppath, double x, double y)
+gs_moveto_aux(gs_gstate *pgs, gx_path *ppath, double x, double y)
{
gs_fixed_point pt;
int code;
- code = clamp_point_aux(pis->clamp_coordinates, &pt, x, y);
+ code = clamp_point_aux(pgs->clamp_coordinates, &pt, x, y);
if (code < 0)
return code;
- if (pis->hpgl_path_mode && path_subpath_open(ppath))
+ if (pgs->hpgl_path_mode && path_subpath_open(ppath))
{
code = gx_path_add_gap_notes(ppath, pt.x, pt.y, 0);
if (code < 0)
return code;
- gx_setcurrentpoint(pis, x, y);
+ gx_setcurrentpoint(pgs, x, y);
}
else
{
@@ -170,26 +170,26 @@ gs_moveto_aux(gs_imager_state *pis, gx_path *ppath, double x, double y)
if (code < 0)
return code;
ppath->start_flags = ppath->state_flags;
- gx_setcurrentpoint(pis, x, y);
- pis->subpath_start = pis->current_point;
+ gx_setcurrentpoint(pgs, x, y);
+ pgs->subpath_start = pgs->current_point;
}
- pis->current_point_valid = true;
+ pgs->current_point_valid = true;
return 0;
}
int
-gs_moveto(gs_state * pgs, double x, double y)
+gs_moveto(gs_gstate * pgs, double x, double y)
{
gs_point pt;
int code = gs_point_transform_compat(x, y, &pgs->ctm, &pt);
if (code < 0)
return code;
- return gs_moveto_aux((gs_imager_state *)pgs, pgs->path, pt.x, pt.y);
+ return gs_moveto_aux(pgs, pgs->path, pt.x, pt.y);
}
int
-gs_rmoveto(gs_state * pgs, double x, double y)
+gs_rmoveto(gs_gstate * pgs, double x, double y)
{
gs_point dd;
int code;
@@ -200,12 +200,12 @@ gs_rmoveto(gs_state * pgs, double x, double y)
if (code < 0)
return code;
/* fixme : check in range. */
- return gs_moveto_aux((gs_imager_state *)pgs, pgs->path,
+ return gs_moveto_aux(pgs, pgs->path,
dd.x + pgs->current_point.x, dd.y + pgs->current_point.y);
}
static inline int
-gs_lineto_aux(gs_state * pgs, double x, double y)
+gs_lineto_aux(gs_gstate * pgs, double x, double y)
{
gx_path *ppath = pgs->path;
gs_fixed_point pt;
@@ -222,7 +222,7 @@ gs_lineto_aux(gs_state * pgs, double x, double y)
}
int
-gs_lineto(gs_state * pgs, double x, double y)
+gs_lineto(gs_gstate * pgs, double x, double y)
{
gs_point pt;
int code = gs_point_transform_compat(x, y, &pgs->ctm, &pt);
@@ -233,7 +233,7 @@ gs_lineto(gs_state * pgs, double x, double y)
}
int
-gs_rlineto(gs_state * pgs, double x, double y)
+gs_rlineto(gs_gstate * pgs, double x, double y)
{
gs_point dd;
int code;
@@ -251,7 +251,7 @@ gs_rlineto(gs_state * pgs, double x, double y)
/* ------ Curves ------ */
static inline int
-gs_curveto_aux(gs_state * pgs,
+gs_curveto_aux(gs_gstate * pgs,
double x1, double y1, double x2, double y2, double x3, double y3)
{
gs_fixed_point p1, p2, p3;
@@ -275,7 +275,7 @@ gs_curveto_aux(gs_state * pgs,
}
int
-gs_curveto(gs_state * pgs,
+gs_curveto(gs_gstate * pgs,
double x1, double y1, double x2, double y2, double x3, double y3)
{
gs_point pt1, pt2, pt3;
@@ -294,7 +294,7 @@ gs_curveto(gs_state * pgs,
}
int
-gs_rcurveto(gs_state * pgs,
+gs_rcurveto(gs_gstate * pgs,
double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)
{
gs_point dd1, dd2, dd3;
@@ -320,7 +320,7 @@ gs_rcurveto(gs_state * pgs,
/* ------ Clipping ------ */
/* Forward references */
-static int common_clip(gs_state *, int);
+static int common_clip(gs_gstate *, int);
/* Figure out the bbox for a path and a clip path with adjustment if we are
also doing a stroke. This is used by the xps interpeter to deteremine
@@ -329,7 +329,7 @@ static int common_clip(gs_state *, int);
The transparency group will be the intersection of the path and clipping
path */
int
-gx_curr_bbox(gs_state * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type)
+gx_curr_bbox(gs_gstate * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type)
{
gx_clip_path *clip_path;
int code;
@@ -351,8 +351,7 @@ gx_curr_bbox(gs_state * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type)
if (code < 0) return code;
if (comp_type == PATH_STROKE) {
/* Handle any stroke expansion of our bounding box */
- expansion_code = gx_stroke_path_expansion((const gs_imager_state *) pgs,
- pgs->path, &expansion);
+ expansion_code = gx_stroke_path_expansion(pgs, pgs->path, &expansion);
if (expansion_code >= 0) {
path_bbox.p.x -= expansion.x;
path_bbox.p.y -= expansion.y;
@@ -390,7 +389,7 @@ gx_curr_bbox(gs_state * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type)
* device is a cache device.
*/
int
-gx_effective_clip_path(gs_state * pgs, gx_clip_path ** ppcpath)
+gx_effective_clip_path(gs_gstate * pgs, gx_clip_path ** ppcpath)
{
gs_id view_clip_id =
(pgs->view_clip == 0 || pgs->view_clip->rule == 0 ? gs_no_id :
@@ -464,7 +463,7 @@ gx_effective_clip_path(gs_state * pgs, gx_clip_path ** ppcpath)
#ifdef DEBUG
/* Note that we just set the clipping path (internal). */
static void
-note_set_clip_path(const gs_state * pgs)
+note_set_clip_path(const gs_gstate * pgs)
{
if (gs_debug_c('P')) {
dmlprintf(pgs->memory, "[P]Clipping path:\n");
@@ -476,7 +475,7 @@ note_set_clip_path(const gs_state * pgs)
#endif
int
-gs_clippath(gs_state * pgs)
+gs_clippath(gs_gstate * pgs)
{
gx_path cpath;
int code;
@@ -495,7 +494,7 @@ gs_clippath(gs_state * pgs)
}
int
-gs_initclip(gs_state * pgs)
+gs_initclip(gs_gstate * pgs)
{
gs_fixed_rect box;
int code = gx_default_clip_box(pgs, &box);
@@ -506,19 +505,19 @@ gs_initclip(gs_state * pgs)
}
int
-gs_clip(gs_state * pgs)
+gs_clip(gs_gstate * pgs)
{
return common_clip(pgs, gx_rule_winding_number);
}
int
-gs_eoclip(gs_state * pgs)
+gs_eoclip(gs_gstate * pgs)
{
return common_clip(pgs, gx_rule_even_odd);
}
static int
-common_clip(gs_state * pgs, int rule)
+common_clip(gs_gstate * pgs, int rule)
{
int code = gx_cpath_clip(pgs, pgs->clip_path, pgs->path, rule);
if (code < 0)
@@ -531,7 +530,7 @@ common_clip(gs_state * pgs, int rule)
/* Establish a rectangle as the clipping path. */
/* Used by initclip and by the character and Pattern cache logic. */
int
-gx_clip_to_rectangle(gs_state * pgs, gs_fixed_rect * pbox)
+gx_clip_to_rectangle(gs_gstate * pgs, gs_fixed_rect * pbox)
{
int code = gx_cpath_from_rectangle(pgs->clip_path, pbox);
@@ -550,7 +549,7 @@ gx_clip_to_rectangle(gs_state * pgs, gs_fixed_rect * pbox)
/* Set the clipping path to the current path, without intersecting. */
/* This is very inefficient right now. */
int
-gx_clip_to_path(gs_state * pgs)
+gx_clip_to_path(gs_gstate * pgs)
{
gs_fixed_rect bbox;
int code;
@@ -566,7 +565,7 @@ gx_clip_to_path(gs_state * pgs)
/* Get the default clipping box. */
int
-gx_default_clip_box(const gs_state * pgs, gs_fixed_rect * pbox)
+gx_default_clip_box(const gs_gstate * pgs, gs_fixed_rect * pbox)
{
register gx_device *dev = gs_currentdevice(pgs);
gs_rect bbox;
diff --git a/base/gspath.h b/base/gspath.h
index 1fbf56843..851b87361 100644
--- a/base/gspath.h
+++ b/base/gspath.h
@@ -35,27 +35,27 @@
float2fixed(xy))
/* Path constructors */
-int gs_newpath(gs_state *),
- gs_moveto(gs_state *, double, double),
- gs_rmoveto(gs_state *, double, double),
- gs_lineto(gs_state *, double, double),
- gs_rlineto(gs_state *, double, double),
- gs_arc(gs_state *, double, double, double, double, double),
- gs_arcn(gs_state *, double, double, double, double, double),
+int gs_newpath(gs_gstate *),
+ gs_moveto(gs_gstate *, double, double),
+ gs_rmoveto(gs_gstate *, double, double),
+ gs_lineto(gs_gstate *, double, double),
+ gs_rlineto(gs_gstate *, double, double),
+ gs_arc(gs_gstate *, double, double, double, double, double),
+ gs_arcn(gs_gstate *, double, double, double, double, double),
/*
* Because of an obscure bug in the IBM RS/6000 compiler, one (but not
* both) bool argument(s) for gs_arc_add must come before the double
* arguments.
*/
- gs_arc_add(gs_state *, bool, double, double, double, double, double, bool),
- gs_arcto(gs_state *, double, double, double, double, double, float[4]),
- gs_curveto(gs_state *, double, double, double, double, double, double),
- gs_rcurveto(gs_state *, double, double, double, double, double, double),
- gs_closepath(gs_state *);
-
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+ gs_arc_add(gs_gstate *, bool, double, double, double, double, double, bool),
+ gs_arcto(gs_gstate *, double, double, double, double, double, float[4]),
+ gs_curveto(gs_gstate *, double, double, double, double, double, double),
+ gs_rcurveto(gs_gstate *, double, double, double, double, double, double),
+ gs_closepath(gs_gstate *);
+
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gx_path_DEFINED
# define gx_path_DEFINED
@@ -66,21 +66,21 @@ typedef struct gx_path_s gx_path;
typedef struct gs_matrix_fixed_s gs_matrix_fixed;
#endif
-/* Imager-level procedures */
+/* gs_gstate-level procedures */
void make_quadrant_arc(gs_point *p, const gs_point *c,
const gs_point *p0, const gs_point *p1, double r);
/* Add the current path to the path in the previous graphics state. */
-int gs_upmergepath(gs_state *);
+int gs_upmergepath(gs_gstate *);
/* Path accessors and transformers */
-int gs_currentpoint(gs_state *, gs_point *),
- gs_upathbbox(gs_state *, gs_rect *, bool),
- gs_dashpath(gs_state *),
- gs_flattenpath(gs_state *),
- gs_reversepath(gs_state *),
- gs_strokepath(gs_state *),
- gs_strokepath2(gs_state *);
+int gs_currentpoint(gs_gstate *, gs_point *),
+ gs_upathbbox(gs_gstate *, gs_rect *, bool),
+ gs_dashpath(gs_gstate *),
+ gs_flattenpath(gs_gstate *),
+ gs_reversepath(gs_gstate *),
+ gs_strokepath(gs_gstate *),
+ gs_strokepath2(gs_gstate *);
/* The extra argument for gs_upathbbox controls whether to include */
/* a trailing moveto in the bounding box. */
@@ -91,7 +91,7 @@ int gs_currentpoint(gs_state *, gs_point *),
/* This interface conditionally makes a copy of the path. */
gs_path_enum *gs_path_enum_alloc(gs_memory_t *, client_name_t);
-int gs_path_enum_copy_init(gs_memory_t *mem, gs_path_enum *, const gs_state *, bool);
+int gs_path_enum_copy_init(gs_memory_t *mem, gs_path_enum *, const gs_gstate *, bool);
#define gs_path_enum_init(mem, penum, pgs)\
gs_path_enum_copy_init(mem, penum, pgs, true)
@@ -99,9 +99,9 @@ int gs_path_enum_next(gs_path_enum *, gs_point[3]); /* 0 when done */
void gs_path_enum_cleanup(gs_path_enum *);
/* Clipping */
-int gs_clippath(gs_state *),
- gs_initclip(gs_state *),
- gs_clip(gs_state *),
- gs_eoclip(gs_state *);
+int gs_clippath(gs_gstate *),
+ gs_initclip(gs_gstate *),
+ gs_clip(gs_gstate *),
+ gs_eoclip(gs_gstate *);
#endif /* gspath_INCLUDED */
diff --git a/base/gspath1.c b/base/gspath1.c
index 25644c2ba..299b2242e 100644
--- a/base/gspath1.c
+++ b/base/gspath1.c
@@ -41,7 +41,7 @@ typedef enum {
typedef struct arc_curve_params_s {
/* The following are set once. */
gx_path *ppath;
- gs_imager_state *pis;
+ gs_gstate *pgs;
gs_point center; /* (not used by arc_add) */
double radius;
/* The following may be updated dynamically. */
@@ -59,34 +59,34 @@ typedef struct arc_curve_params_s {
/* Forward declarations */
static int arc_add(const arc_curve_params_t *arc, bool is_quadrant);
-static int gs_imager_arc_add(gx_path * ppath, gs_imager_state * pis, bool clockwise,
+static int gs_gstate_arc_add(gx_path * ppath, gs_gstate * pgs, bool clockwise,
double axc, double ayc, double arad, double aang1, double aang2,
bool add_line, gs_point *p3);
int
-gx_setcurrentpoint_from_path(gs_imager_state *pis, gx_path *path)
+gx_setcurrentpoint_from_path(gs_gstate *pgs, gx_path *path)
{
gs_point pt;
pt.x = fixed2float(path->position.x);
pt.y = fixed2float(path->position.y);
- gx_setcurrentpoint(pis, pt.x, pt.y);
- pis->current_point_valid = true;
+ gx_setcurrentpoint(pgs, pt.x, pt.y);
+ pgs->current_point_valid = true;
return 0;
}
static inline int
-gs_arc_add_inline(gs_state *pgs, bool cw, double xc, double yc, double rad,
+gs_arc_add_inline(gs_gstate *pgs, bool cw, double xc, double yc, double rad,
double a1, double a2, bool add)
{
gs_point p3;
- int code = gs_imager_arc_add(pgs->path, (gs_imager_state *)pgs, cw, xc, yc, rad, a1, a2, add, &p3);
+ int code = gs_gstate_arc_add(pgs->path, pgs, cw, xc, yc, rad, a1, a2, add, &p3);
if (code < 0)
return code;
#if !PRECISE_CURRENTPOINT
- return gx_setcurrentpoint_from_path((gs_imager_state *)pgs, pgs->path);
+ return gx_setcurrentpoint_from_path(pgs, pgs->path);
#else
pgs->current_point_valid = true;
return gs_point_transform(p3.x, p3.y, &ctm_only(pgs), &pgs->current_point);
@@ -95,21 +95,21 @@ gs_arc_add_inline(gs_state *pgs, bool cw, double xc, double yc, double rad,
}
int
-gs_arc(gs_state * pgs,
+gs_arc(gs_gstate * pgs,
double xc, double yc, double r, double ang1, double ang2)
{
return gs_arc_add_inline(pgs, false, xc, yc, r, ang1, ang2, true);
}
int
-gs_arcn(gs_state * pgs,
+gs_arcn(gs_gstate * pgs,
double xc, double yc, double r, double ang1, double ang2)
{
return gs_arc_add_inline(pgs, true, xc, yc, r, ang1, ang2, true);
}
int
-gs_arc_add(gs_state * pgs, bool clockwise, double axc, double ayc,
+gs_arc_add(gs_gstate * pgs, bool clockwise, double axc, double ayc,
double arad, double aang1, double aang2, bool add_line)
{
return gs_arc_add_inline(pgs, clockwise, axc, ayc, arad,
@@ -149,13 +149,13 @@ next_arc_quadrant(arc_curve_params_t * arc, double anext)
* If the CTM is well-behaved, we can pre-calculate the delta
* from the arc points to the control points.
*/
- const gs_imager_state *pis = arc->pis;
+ const gs_gstate *pgs = arc->pgs;
double scale = 0; /* Quiet gcc warning. */
- if (is_fzero2(pis->ctm.xy, pis->ctm.yx) ?
- (scale = fabs(pis->ctm.xx)) == fabs(pis->ctm.yy) :
- is_fzero2(pis->ctm.xx, pis->ctm.yy) ?
- (scale = fabs(pis->ctm.xy)) == fabs(pis->ctm.yx) :
+ if (is_fzero2(pgs->ctm.xy, pgs->ctm.yx) ?
+ (scale = fabs(pgs->ctm.xx)) == fabs(pgs->ctm.yy) :
+ is_fzero2(pgs->ctm.xx, pgs->ctm.yy) ?
+ (scale = fabs(pgs->ctm.xy)) == fabs(pgs->ctm.yx) :
0
) {
double scaled_radius = arc->radius * scale;
@@ -200,7 +200,7 @@ next_arc_quadrant(arc_curve_params_t * arc, double anext)
}
static int
-gs_imager_arc_add(gx_path * ppath, gs_imager_state * pis, bool clockwise,
+gs_gstate_arc_add(gx_path * ppath, gs_gstate * pgs, bool clockwise,
double axc, double ayc, double arad, double aang1, double aang2,
bool add_line, gs_point *p3)
{
@@ -211,7 +211,7 @@ gs_imager_arc_add(gx_path * ppath, gs_imager_state * pis, bool clockwise,
int code;
arc.ppath = ppath;
- arc.pis = pis;
+ arc.pgs = pgs;
arc.center.x = axc;
arc.center.y = ayc;
if (ar < 0) {
@@ -308,7 +308,7 @@ last:
}
int
-gs_arcto(gs_state * pgs,
+gs_arcto(gs_gstate * pgs,
double ax1, double ay1, double ax2, double ay2, double arad, float retxy[4])
{
double xt0, yt0, xt2, yt2;
@@ -354,7 +354,7 @@ double ax1, double ay1, double ax2, double ay2, double arad, float retxy[4])
arc_curve_params_t arc;
arc.ppath = pgs->path;
- arc.pis = (gs_imager_state *) pgs;
+ arc.pgs = pgs;
arc.radius = arad;
arc.action = arc_lineto;
arc.notes = sn_none;
@@ -368,7 +368,7 @@ double ax1, double ay1, double ax2, double ay2, double arad, float retxy[4])
arc.pt.y = ay1;
code = arc_add(&arc, false);
if (code == 0)
- code = gx_setcurrentpoint_from_path((gs_imager_state *)pgs, pgs->path);
+ code = gx_setcurrentpoint_from_path(pgs, pgs->path);
}
}
if (retxy != 0) {
@@ -385,7 +385,7 @@ static int
arc_add(const arc_curve_params_t * arc, bool is_quadrant)
{
gx_path *path = arc->ppath;
- gs_imager_state *pis = arc->pis;
+ gs_gstate *pgs = arc->pgs;
double x0 = arc->p0.x, y0 = arc->p0.y;
double xt = arc->pt.x, yt = arc->pt.y;
double fraction;
@@ -394,19 +394,19 @@ arc_add(const arc_curve_params_t * arc, bool is_quadrant)
if ((arc->action != arc_nothing &&
#if !PRECISE_CURRENTPOINT
- (code = gs_point_transform2fixed(&pis->ctm, x0, y0, &p0)) < 0) ||
- (code = gs_point_transform2fixed(&pis->ctm, xt, yt, &pt)) < 0 ||
- (code = gs_point_transform2fixed(&pis->ctm, arc->p3.x, arc->p3.y, &p3)) < 0
+ (code = gs_point_transform2fixed(&pgs->ctm, x0, y0, &p0)) < 0) ||
+ (code = gs_point_transform2fixed(&pgs->ctm, xt, yt, &pt)) < 0 ||
+ (code = gs_point_transform2fixed(&pgs->ctm, arc->p3.x, arc->p3.y, &p3)) < 0
#else
- (code = gs_point_transform2fixed_rounding(&pis->ctm, x0, y0, &p0)) < 0) ||
- (code = gs_point_transform2fixed_rounding(&pis->ctm, xt, yt, &pt)) < 0 ||
- (code = gs_point_transform2fixed_rounding(&pis->ctm, arc->p3.x, arc->p3.y, &p3)) < 0
+ (code = gs_point_transform2fixed_rounding(&pgs->ctm, x0, y0, &p0)) < 0) ||
+ (code = gs_point_transform2fixed_rounding(&pgs->ctm, xt, yt, &pt)) < 0 ||
+ (code = gs_point_transform2fixed_rounding(&pgs->ctm, arc->p3.x, arc->p3.y, &p3)) < 0
#endif
)
return code;
#if PRECISE_CURRENTPOINT
if (!path_position_valid(path))
- gs_point_transform(arc->p0.x, arc->p0.y, &ctm_only(arc->pis), &pis->subpath_start);
+ gs_point_transform(arc->p0.x, arc->p0.y, &ctm_only(arc->pgs), &pgs->subpath_start);
#endif
code = (arc->action == arc_nothing ?
(p0.x = path->position.x, p0.y = path->position.y, 0) :
@@ -482,7 +482,7 @@ make_quadrant_arc(gs_point *p, const gs_point *c,
/* ------ Path transformers ------ */
int
-gs_dashpath(gs_state * pgs)
+gs_dashpath(gs_gstate * pgs)
{
gx_path *ppath;
gx_path fpath;
@@ -495,7 +495,7 @@ gs_dashpath(gs_state * pgs)
return code;
ppath = pgs->path;
gx_path_init_local(&fpath, ppath->memory);
- code = gx_path_add_dash_expansion(ppath, &fpath, (gs_imager_state *)pgs);
+ code = gx_path_add_dash_expansion(ppath, &fpath, pgs);
if (code < 0) {
gx_path_free(&fpath, "gs_dashpath");
return code;
@@ -505,7 +505,7 @@ gs_dashpath(gs_state * pgs)
}
int
-gs_flattenpath(gs_state * pgs)
+gs_flattenpath(gs_gstate * pgs)
{
gx_path *ppath = pgs->path;
gx_path fpath;
@@ -525,7 +525,7 @@ gs_flattenpath(gs_state * pgs)
}
int
-gs_reversepath(gs_state * pgs)
+gs_reversepath(gs_gstate * pgs)
{
gx_path *ppath = pgs->path;
gx_path rpath;
@@ -553,7 +553,7 @@ gs_reversepath(gs_state * pgs)
/* ------ Accessors ------ */
int
-gs_upathbbox(gs_state * pgs, gs_rect * pbox, bool include_moveto)
+gs_upathbbox(gs_gstate * pgs, gs_rect * pbox, bool include_moveto)
{
gs_fixed_rect fbox; /* box in device coordinates */
gs_rect dbox;
@@ -590,7 +590,7 @@ gs_upathbbox(gs_state * pgs, gs_rect * pbox, bool include_moveto)
/* Start enumerating a path */
int
-gs_path_enum_copy_init(gs_memory_t *mem, gs_path_enum * penum, const gs_state * pgs, bool copy)
+gs_path_enum_copy_init(gs_memory_t *mem, gs_path_enum * penum, const gs_gstate * pgs, bool copy)
{
if (copy) {
gx_path *copied_path =
diff --git a/base/gspath2.h b/base/gspath2.h
index f358ebee1..be413de9f 100644
--- a/base/gspath2.h
+++ b/base/gspath2.h
@@ -21,12 +21,12 @@
# define gspath2_INCLUDED
/* Miscellaneous */
-int gs_setbbox(gs_state *, double, double, double, double);
+int gs_setbbox(gs_gstate *, double, double, double, double);
/* Rectangles */
-int gs_rectappend(gs_state *, const gs_rect *, uint);
-int gs_rectclip(gs_state *, const gs_rect *, uint);
-int gs_rectfill(gs_state *, const gs_rect *, uint);
-int gs_rectstroke(gs_state *, const gs_rect *, uint, const gs_matrix *);
+int gs_rectappend(gs_gstate *, const gs_rect *, uint);
+int gs_rectclip(gs_gstate *, const gs_rect *, uint);
+int gs_rectfill(gs_gstate *, const gs_rect *, uint);
+int gs_rectstroke(gs_gstate *, const gs_rect *, uint, const gs_matrix *);
#endif /* gspath2_INCLUDED */
diff --git a/base/gspcolor.c b/base/gspcolor.c
index 7574cc155..b4ccd0ed6 100644
--- a/base/gspcolor.c
+++ b/base/gspcolor.c
@@ -83,7 +83,7 @@ gs_pattern_common_init(gs_pattern_template_t * ppat,
/* Generic makepattern */
int
gs_make_pattern(gs_client_color * pcc, const gs_pattern_template_t * pcp,
- const gs_matrix * pmat, gs_state * pgs, gs_memory_t * mem)
+ const gs_matrix * pmat, gs_gstate * pgs, gs_memory_t * mem)
{
return pcp->type->procs.make_pattern(pcc, pcp, pmat, pgs, mem);
}
@@ -95,20 +95,20 @@ gs_make_pattern(gs_client_color * pcc, const gs_pattern_template_t * pcp,
int
gs_make_pattern_common(gs_client_color *pcc,
const gs_pattern_template_t *ptemp,
- const gs_matrix *pmat, gs_state *pgs, gs_memory_t *mem,
+ const gs_matrix *pmat, gs_gstate *pgs, gs_memory_t *mem,
gs_memory_type_ptr_t pstype)
{
gs_pattern_instance_t *pinst;
- gs_state *saved;
+ gs_gstate *saved;
if (mem == 0)
- mem = gs_state_memory(pgs);
+ mem = gs_gstate_memory(pgs);
rc_alloc_struct_1(pinst, gs_pattern_instance_t, pstype, mem,
return_error(gs_error_VMerror),
"gs_make_pattern_common");
pinst->rc.free = rc_free_pattern_instance;
pinst->type = ptemp->type;
- saved = gs_state_copy(pgs, mem);
+ saved = gs_gstate_copy(pgs, mem);
if (saved == 0) {
gs_free_object(mem, pinst, "gs_make_pattern_common");
return_error(gs_error_VMerror);
@@ -128,13 +128,13 @@ rc_free_pattern_instance(gs_memory_t * mem, void *pinst_void,
{
gs_pattern_instance_t *pinst = pinst_void;
- gs_state_free(pinst->saved);
+ gs_gstate_free(pinst->saved);
rc_free_struct_only(mem, pinst_void, cname);
}
/* setpattern */
int
-gs_setpattern(gs_state * pgs, const gs_client_color * pcc)
+gs_setpattern(gs_gstate * pgs, const gs_client_color * pcc)
{
int code = gs_setpatternspace(pgs);
@@ -146,7 +146,7 @@ gs_setpattern(gs_state * pgs, const gs_client_color * pcc)
/* setpatternspace */
/* This does all the work of setpattern except for the final setcolor. */
int
-gs_setpatternspace(gs_state * pgs)
+gs_setpatternspace(gs_gstate * pgs)
{
int code = 0;
gs_color_space *ccs_old;
@@ -211,7 +211,7 @@ gx_num_components_Pattern(const gs_color_space * pcs)
/* Remap a Pattern color. */
static int
gx_remap_Pattern(const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
if (pc->pattern == 0) {
@@ -221,7 +221,7 @@ gx_remap_Pattern(const gs_client_color * pc, const gs_color_space * pcs,
return 0;
}
return
- pc->pattern->type->procs.remap_color(pc, pcs, pdc, pis, dev, select);
+ pc->pattern->type->procs.remap_color(pc, pcs, pdc, pgs, dev, select);
}
/* Initialize a Pattern color. */
@@ -257,7 +257,7 @@ gx_restrict_Pattern(gs_client_color * pcc, const gs_color_space * pcs)
/* Install a Pattern color space. */
static int
-gx_install_Pattern(gs_color_space * pcs, gs_state * pgs)
+gx_install_Pattern(gs_color_space * pcs, gs_gstate * pgs)
{
if (!pcs->params.pattern.has_base_space)
return 0;
@@ -274,14 +274,14 @@ gx_install_Pattern(gs_color_space * pcs, gs_state * pgs)
* a factor in that set up and here the color space is a pattern.
*/
static int
-gx_set_overprint_Pattern(const gs_color_space * pcs, gs_state * pgs)
+gx_set_overprint_Pattern(const gs_color_space * pcs, gs_gstate * pgs)
{
gs_overprint_params_t params;
if (!pgs->overprint) {
params.retain_any_comps = false;
pgs->effective_overprint_mode = 0;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
return 0;
}
diff --git a/base/gspcolor.h b/base/gspcolor.h
index 13a4cf7a1..46cbc4a9b 100644
--- a/base/gspcolor.h
+++ b/base/gspcolor.h
@@ -83,7 +83,7 @@ typedef struct gs_pattern_instance_s gs_pattern_instance_t;
rc_header rc;\
/* Following are set by makepattern */\
const gs_pattern_type_t *type; /* from template */\
- gs_state *saved;\
+ gs_gstate *saved;\
gs_id pattern_id
struct gs_pattern_instance_s {
gs_pattern_instance_common;
@@ -100,17 +100,17 @@ extern_st(st_pattern_instance);
/* ---------------- Procedures ---------------- */
/* Set a Pattern color or a Pattern color space. */
-int gs_setpattern(gs_state *, const gs_client_color *);
-int gs_setpatternspace(gs_state *);
+int gs_setpattern(gs_gstate *, const gs_client_color *);
+int gs_setpatternspace(gs_gstate *);
/*
* Construct a Pattern color of any PatternType.
* The gs_memory_t argument for gs_make_pattern may be NULL, meaning use the
- * same allocator as for the gs_state argument. Note that gs_make_pattern
+ * same allocator as for the gs_gstate argument. Note that gs_make_pattern
* uses rc_alloc_struct_1 to allocate pattern instances.
*/
int gs_make_pattern(gs_client_color *, const gs_pattern_template_t *,
- const gs_matrix *, gs_state *, gs_memory_t *);
+ const gs_matrix *, gs_gstate *, gs_memory_t *);
const gs_pattern_template_t *gs_get_pattern(const gs_client_color *);
/*
diff --git a/base/gsptype1.c b/base/gsptype1.c
index 3de67d4f6..05e0836c7 100644
--- a/base/gsptype1.c
+++ b/base/gsptype1.c
@@ -119,10 +119,10 @@ gs_pattern1_init(gs_pattern1_template_t * ppat)
/* Make an instance of a PatternType 1 pattern. */
static int compute_inst_matrix(gs_pattern1_instance_t * pinst,
- gs_state * saved, gs_rect * pbbox, int width, int height);
+ gs_gstate * saved, gs_rect * pbbox, int width, int height);
int
gs_makepattern(gs_client_color * pcc, const gs_pattern1_template_t * pcp,
- const gs_matrix * pmat, gs_state * pgs, gs_memory_t * mem)
+ const gs_matrix * pmat, gs_gstate * pgs, gs_memory_t * mem)
{
return gs_pattern1_make_pattern(pcc, (const gs_pattern_template_t *)pcp,
pmat, pgs, mem);
@@ -130,13 +130,13 @@ gs_makepattern(gs_client_color * pcc, const gs_pattern1_template_t * pcp,
static int
gs_pattern1_make_pattern(gs_client_color * pcc,
const gs_pattern_template_t * ptemp,
- const gs_matrix * pmat, gs_state * pgs,
+ const gs_matrix * pmat, gs_gstate * pgs,
gs_memory_t * mem)
{
const gs_pattern1_template_t *pcp = (const gs_pattern1_template_t *)ptemp;
gs_pattern1_instance_t inst;
gs_pattern1_instance_t *pinst;
- gs_state *saved;
+ gs_gstate *saved;
gs_rect bbox;
gs_fixed_rect cbox;
gx_device * pdev = pgs->device;
@@ -149,7 +149,7 @@ gs_pattern1_make_pattern(gs_client_color * pcc,
if (code < 0)
return code;
if (mem == 0)
- mem = gs_state_memory(pgs);
+ mem = gs_gstate_memory(pgs);
pinst = (gs_pattern1_instance_t *)pcc->pattern;
*(gs_pattern_instance_t *)&inst = *(gs_pattern_instance_t *)pinst;
saved = inst.saved;
@@ -377,7 +377,7 @@ gs_pattern1_make_pattern(gs_client_color * pcc,
inst.id = gs_next_ids(mem, 1);
*pinst = inst;
return 0;
- fsaved:gs_state_free(saved);
+ fsaved:gs_gstate_free(saved);
gs_free_object(mem, pinst, "gs_makepattern");
return code;
}
@@ -514,7 +514,7 @@ clamp_pattern_bbox(gs_pattern1_instance_t * pinst, gs_rect * pbbox,
/* Compute the stepping matrix and device space instance bounding box */
/* from the step values and the saved matrix. */
static int
-compute_inst_matrix(gs_pattern1_instance_t * pinst, gs_state * saved,
+compute_inst_matrix(gs_pattern1_instance_t * pinst, gs_gstate * saved,
gs_rect * pbbox, int width, int height)
{
float xx, xy, yx, yy, dx, dy, temp;
@@ -672,7 +672,7 @@ gs_dc_get_pattern_id(const gx_device_color *pdevc)
* reset the overprint information as required.
*/
static int
-gs_pattern1_set_color(const gs_client_color * pcc, gs_state * pgs)
+gs_pattern1_set_color(const gs_client_color * pcc, gs_gstate * pgs)
{
gs_pattern1_instance_t * pinst = (gs_pattern1_instance_t *)pcc->pattern;
gs_pattern1_template_t * ptmplt = &pinst->templat;
@@ -687,7 +687,7 @@ gs_pattern1_set_color(const gs_client_color * pcc, gs_state * pgs)
params.retain_any_comps = false;
pgs->effective_overprint_mode = 0;
- return gs_state_update_overprint(pgs, &params);
+ return gs_gstate_update_overprint(pgs, &params);
}
}
@@ -769,14 +769,14 @@ free_pixmap_pattern(
* PaintProcs for bitmap and pixmap patterns.
*/
static int bitmap_paint(gs_image_enum * pen, gs_data_image_t * pim,
- const gs_depth_bitmap * pbitmap, gs_state * pgs);
+ const gs_depth_bitmap * pbitmap, gs_gstate * pgs);
static int
-mask_PaintProc(const gs_client_color * pcolor, gs_state * pgs)
+mask_PaintProc(const gs_client_color * pcolor, gs_gstate * pgs)
{
const pixmap_info *ppmap = gs_getpattern(pcolor)->client_data;
const gs_depth_bitmap *pbitmap = &(ppmap->bitmap);
gs_image_enum *pen =
- gs_image_enum_alloc(gs_state_memory(pgs), "mask_PaintProc");
+ gs_image_enum_alloc(gs_gstate_memory(pgs), "mask_PaintProc");
gs_image1_t mask;
if (pen == 0)
@@ -788,12 +788,12 @@ mask_PaintProc(const gs_client_color * pcolor, gs_state * pgs)
return bitmap_paint(pen, (gs_data_image_t *) & mask, pbitmap, pgs);
}
static int
-image_PaintProc(const gs_client_color * pcolor, gs_state * pgs)
+image_PaintProc(const gs_client_color * pcolor, gs_gstate * pgs)
{
const pixmap_info *ppmap = gs_getpattern(pcolor)->client_data;
const gs_depth_bitmap *pbitmap = &(ppmap->bitmap);
gs_image_enum *pen =
- gs_image_enum_alloc(gs_state_memory(pgs), "image_PaintProc");
+ gs_image_enum_alloc(gs_gstate_memory(pgs), "image_PaintProc");
gs_color_space *pcspace;
gx_image_enum_common_t *pie;
/*
@@ -862,7 +862,7 @@ image_PaintProc(const gs_client_color * pcolor, gs_state * pgs)
/* Finish painting any kind of bitmap pattern. */
static int
bitmap_paint(gs_image_enum * pen, gs_data_image_t * pim,
- const gs_depth_bitmap * pbitmap, gs_state * pgs)
+ const gs_depth_bitmap * pbitmap, gs_gstate * pgs)
{
uint raster = pbitmap->raster;
uint nbytes = (pim->Width * pbitmap->pix_depth + 7) >> 3;
@@ -882,7 +882,7 @@ bitmap_paint(gs_image_enum * pen, gs_data_image_t * pim,
return code;
}
-int pixmap_high_level_pattern(gs_state * pgs)
+int pixmap_high_level_pattern(gs_gstate * pgs)
{
gs_matrix m;
gs_rect bbox;
@@ -895,8 +895,7 @@ int pixmap_high_level_pattern(gs_state * pgs)
(gs_pattern1_instance_t *)gs_currentcolor(pgs)->pattern;
const pixmap_info *ppmap = ppat->client_data;
- code = gx_pattern_cache_add_dummy_entry((gs_imager_state *)pgs,
- pinst, pgs->device->color_info.depth);
+ code = gx_pattern_cache_add_dummy_entry(pgs, pinst, pgs->device->color_info.depth);
if (code < 0)
return code;
@@ -963,7 +962,7 @@ int pixmap_high_level_pattern(gs_state * pgs)
return code;
}
-static int pixmap_remap_mask_pattern(const gs_client_color *pcc, gs_state *pgs)
+static int pixmap_remap_mask_pattern(const gs_client_color *pcc, gs_gstate *pgs)
{
const gs_client_pattern *ppat = gs_getpattern(pcc);
int code = 0;
@@ -991,7 +990,7 @@ static int pixmap_remap_mask_pattern(const gs_client_color *pcc, gs_state *pgs)
}
}
-static int pixmap_remap_image_pattern(const gs_client_color *pcc, gs_state *pgs)
+static int pixmap_remap_image_pattern(const gs_client_color *pcc, gs_gstate *pgs)
{
const gs_client_pattern *ppat = gs_getpattern(pcc);
int code = 0;
@@ -1036,7 +1035,7 @@ gs_makepixmappattern(
long id,
gs_color_space * pcspace,
uint white_index,
- gs_state * pgs,
+ gs_gstate * pgs,
gs_memory_t * mem
)
{
@@ -1058,7 +1057,7 @@ gs_makepixmappattern(
/* allocate and initialize a pixmap_info structure for the paint proc */
if (mem == 0)
- mem = gs_state_memory(pgs);
+ mem = gs_gstate_memory(pgs);
ppmap = gs_alloc_struct(mem,
pixmap_info,
&st_pixmap_info,
@@ -1134,7 +1133,7 @@ gs_makebitmappattern_xform(
bool mask,
const gs_matrix * pmat,
long id,
- gs_state * pgs,
+ gs_gstate * pgs,
gs_memory_t * mem
)
{
@@ -1409,15 +1408,15 @@ gx_dc_colored_masked_get_dev_halftone(const gx_device_color * pdevc)
/* Macros for pattern loading */
#define FINISH_PATTERN_LOAD\
- while ( !gx_pattern_cache_lookup(pdevc, pis, dev, select) )\
- { code = gx_pattern_load(pdevc, pis, dev, select);\
+ while ( !gx_pattern_cache_lookup(pdevc, pgs, dev, select) )\
+ { code = gx_pattern_load(pdevc, pgs, dev, select);\
if ( code < 0 ) break;\
}\
return code;
/* Ensure that a colored Pattern is loaded in the cache. */
static int
-gx_dc_pattern_load(gx_device_color * pdevc, const gs_imager_state * pis,
+gx_dc_pattern_load(gx_device_color * pdevc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
int code = 0;
@@ -1426,40 +1425,40 @@ gx_dc_pattern_load(gx_device_color * pdevc, const gs_imager_state * pis,
}
/* Ensure that an uncolored Pattern is loaded in the cache. */
static int
-gx_dc_pure_masked_load(gx_device_color * pdevc, const gs_imager_state * pis,
+gx_dc_pure_masked_load(gx_device_color * pdevc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
- int code = (*gx_dc_type_data_pure.load) (pdevc, pis, dev, select);
+ int code = (*gx_dc_type_data_pure.load) (pdevc, pgs, dev, select);
if (code < 0)
return code;
FINISH_PATTERN_LOAD
}
static int
-gx_dc_devn_masked_load(gx_device_color * pdevc, const gs_imager_state * pis,
+gx_dc_devn_masked_load(gx_device_color * pdevc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
- int code = (*gx_dc_type_data_devn.load) (pdevc, pis, dev, select);
+ int code = (*gx_dc_type_data_devn.load) (pdevc, pgs, dev, select);
if (code < 0)
return code;
FINISH_PATTERN_LOAD
}
static int
-gx_dc_binary_masked_load(gx_device_color * pdevc, const gs_imager_state * pis,
+gx_dc_binary_masked_load(gx_device_color * pdevc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
- int code = (*gx_dc_type_data_ht_binary.load) (pdevc, pis, dev, select);
+ int code = (*gx_dc_type_data_ht_binary.load) (pdevc, pgs, dev, select);
if (code < 0)
return code;
FINISH_PATTERN_LOAD
}
static int
-gx_dc_colored_masked_load(gx_device_color * pdevc, const gs_imager_state * pis,
+gx_dc_colored_masked_load(gx_device_color * pdevc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
- int code = (*gx_dc_type_data_ht_colored.load) (pdevc, pis, dev, select);
+ int code = (*gx_dc_type_data_ht_colored.load) (pdevc, pgs, dev, select);
if (code < 0)
return code;
@@ -1468,10 +1467,10 @@ gx_dc_colored_masked_load(gx_device_color * pdevc, const gs_imager_state * pis,
/* Look up a pattern color in the cache. */
bool
-gx_pattern_cache_lookup(gx_device_color * pdevc, const gs_imager_state * pis,
+gx_pattern_cache_lookup(gx_device_color * pdevc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
- gx_pattern_cache *pcache = pis->pattern_cache;
+ gx_pattern_cache *pcache = pgs->pattern_cache;
gx_bitmap_id id = pdevc->mask.id;
if (id == gx_no_bitmap_id) {
@@ -1481,7 +1480,7 @@ gx_pattern_cache_lookup(gx_device_color * pdevc, const gs_imager_state * pis,
if (pcache != 0) {
gx_color_tile *ctile = &pcache->tiles[id % pcache->num_tiles];
bool internal_accum = true;
- if (pis->have_pattern_streams) {
+ if (pgs->have_pattern_streams) {
int code = dev_proc(dev, dev_spec_op)(dev, gxdso_pattern_load, NULL, id);
internal_accum = (code == 0);
if (code < 0)
@@ -1490,8 +1489,8 @@ gx_pattern_cache_lookup(gx_device_color * pdevc, const gs_imager_state * pis,
if (ctile->id == id &&
ctile->is_dummy == !internal_accum
) {
- int px = pis->screen_phase[select].x;
- int py = pis->screen_phase[select].y;
+ int px = pgs->screen_phase[select].x;
+ int py = pgs->screen_phase[select].y;
if (gx_dc_is_pattern1_color(pdevc)) { /* colored */
pdevc->colors.pattern.p_tile = ctile;
@@ -1997,7 +1996,7 @@ gx_dc_pattern_read_trans_buff(gx_color_tile *ptile, int64_t offset,
int
gx_dc_pattern_read(
gx_device_color * pdevc,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_device_color * prior_devc,
const gx_device * dev,
int64_t offset,
@@ -2062,13 +2061,13 @@ gx_dc_pattern_read(
/* the following works for raster or clist patterns */
cache_space_needed = buf.size_b + buf.size_c;
}
- gx_pattern_cache_ensure_space((gs_imager_state *)pis, cache_space_needed);
+ gx_pattern_cache_ensure_space((gs_gstate *)pgs, cache_space_needed);
- code = gx_pattern_cache_get_entry((gs_imager_state *)pis, /* Break 'const'. */
+ code = gx_pattern_cache_get_entry((gs_gstate *)pgs, /* Break 'const'. */
buf.id, &ptile);
if (code < 0)
return code;
- gx_pattern_cache_update_used((gs_imager_state *)pis, cache_space_needed);
+ gx_pattern_cache_update_used((gs_gstate *)pgs, cache_space_needed);
ptile->bits_used = cache_space_needed;
pdevc->type = &gx_dc_pattern;
pdevc->colors.pattern.p_tile = ptile;
@@ -2103,7 +2102,7 @@ gx_dc_pattern_read(
ptile->ttrans->rowstride = trans_info.rowstride;
ptile->ttrans->width = trans_info.width;
pdevc->type = &gx_dc_pattern_trans;
- if_debug2m('?', pis->memory,
+ if_debug2m('?', pgs->memory,
"[v*] Reading trans tile from clist into cache, uid = %ld id = %ld \n",
ptile->uid.id, ptile->id);
@@ -2127,7 +2126,7 @@ gx_dc_pattern_read(
ptile->tbits.size.x = size_b; /* HACK: Use unrelated field for saving size_b between calls. */
ptile->tbits.size.y = size_c; /* HACK: Use unrelated field for saving size_c between calls. */
{
- gs_state state;
+ gs_gstate state;
gs_pattern1_instance_t inst;
memset(&state, 0, sizeof(state));
diff --git a/base/gsptype1.h b/base/gsptype1.h
index 4e10ed9e7..94d969fce 100644
--- a/base/gsptype1.h
+++ b/base/gsptype1.h
@@ -47,7 +47,7 @@ typedef struct gs_pattern1_template_s {
gs_rect BBox;
float XStep;
float YStep;
- int (*PaintProc) (const gs_client_color *, gs_state *);
+ int (*PaintProc) (const gs_client_color *, gs_gstate *);
} gs_pattern1_template_t;
#define private_st_pattern1_template() /* in gspcolor.c */\
@@ -83,11 +83,11 @@ void gs_pattern1_init(gs_pattern1_template_t *);
* PatternType 1 patterns.
*
* The gs_memory_t argument for gs_makepattern may be NULL, meaning use the
- * same allocator as for the gs_state argument. Note that gs_makepattern
+ * same allocator as for the gs_gstate argument. Note that gs_makepattern
* uses rc_alloc_struct_1 to allocate pattern instances.
*/
int gs_makepattern(gs_client_color *, const gs_client_pattern *,
- const gs_matrix *, gs_state *, gs_memory_t *);
+ const gs_matrix *, gs_gstate *, gs_memory_t *);
const gs_client_pattern *gs_getpattern(const gs_client_color *);
/* Check device color for Pattern Type 1. */
@@ -153,7 +153,7 @@ extern int gs_makepixmappattern(
long id,
gs_color_space * pcspace,
uint white_index,
- gs_state * pgs,
+ gs_gstate * pgs,
gs_memory_t * mem
);
@@ -167,14 +167,14 @@ extern int gs_makebitmappattern_xform(
bool mask,
const gs_matrix * pmat,
long id,
- gs_state * pgs,
+ gs_gstate * pgs,
gs_memory_t * mem
);
/*
* High level pattern support for pixmap patterns, if the interpreter supports them.
*/
-extern int pixmap_high_level_pattern(gs_state * pgs);
+extern int pixmap_high_level_pattern(gs_gstate * pgs);
#define gs_makebitmappattern(pcc, tile, mask, pgs, mem) \
gs_makebitmappattern_xform(pcc, tile, mask, 0, no_UniqueID, pgs, mem)
diff --git a/base/gsptype2.c b/base/gsptype2.c
index aa7c90621..4e6f5752d 100644
--- a/base/gsptype2.c
+++ b/base/gsptype2.c
@@ -25,7 +25,7 @@
#include "gxdcolor.h"
#include "gsptype2.h"
#include "gxpcolor.h"
-#include "gxstate.h" /* for gs_state_memory */
+#include "gxstate.h" /* for gs_gstate_memory */
#include "gzpath.h"
#include "gzcpath.h"
#include "gzstate.h"
@@ -86,7 +86,7 @@ gs_pattern2_uses_base_space(const gs_pattern_template_t *ptemp)
static int
gs_pattern2_make_pattern(gs_client_color * pcc,
const gs_pattern_template_t * pcp,
- const gs_matrix * pmat, gs_state * pgs,
+ const gs_matrix * pmat, gs_gstate * pgs,
gs_memory_t * mem)
{
const gs_pattern2_template_t *ptemp =
@@ -169,7 +169,7 @@ gx_dc_pattern2_get_dev_halftone(const gx_device_color * pdevc)
/* Load a PatternType 2 color into the cache. (No effect.) */
static int
-gx_dc_pattern2_load(gx_device_color *pdevc, const gs_imager_state *ignore_pis,
+gx_dc_pattern2_load(gx_device_color *pdevc, const gs_gstate *ignore_pgs,
gx_device *ignore_dev, gs_color_select_t ignore_select)
{
return 0;
@@ -178,7 +178,7 @@ gx_dc_pattern2_load(gx_device_color *pdevc, const gs_imager_state *ignore_pis,
/* Remap a PatternType 2 color. */
static int
gs_pattern2_remap_color(const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
/* We don't do any actual color mapping now. */
@@ -197,7 +197,7 @@ gs_pattern2_remap_color(const gs_client_color * pc, const gs_color_space * pcs,
* information.
*/
static int
-gs_pattern2_set_color(const gs_client_color * pcc, gs_state * pgs)
+gs_pattern2_set_color(const gs_client_color * pcc, gs_gstate * pgs)
{
gs_pattern2_instance_t * pinst = (gs_pattern2_instance_t *)pcc->pattern;
gs_color_space * pcs = pinst->templat.Shading->params.ColorSpace;
@@ -241,7 +241,7 @@ gx_dc_pattern2_fill_rectangle(const gx_device_color * pdevc, int x, int y,
rect.q.x = int2fixed(x + w);
rect.q.y = int2fixed(y + h);
return gs_shading_do_fill_rectangle(pinst->templat.Shading, &rect, dev,
- (gs_imager_state *)pinst->saved, !pinst->shfill);
+ (gs_gstate *)pinst->saved, !pinst->shfill);
}
}
@@ -277,11 +277,11 @@ gx_dc_pattern2_save_dc(
/* Transform a shading bounding box into device space. */
/* This is just a bridge to an old code. */
int
-gx_dc_pattern2_shade_bbox_transform2fixed(const gs_rect * rect, const gs_imager_state * pis,
+gx_dc_pattern2_shade_bbox_transform2fixed(const gs_rect * rect, const gs_gstate * pgs,
gs_fixed_rect * rfixed)
{
gs_rect dev_rect;
- int code = gs_bbox_transform(rect, &ctm_only(pis), &dev_rect);
+ int code = gs_bbox_transform(rect, &ctm_only(pgs), &dev_rect);
if (code >= 0) {
rfixed->p.x = float2fixed(dev_rect.p.x);
@@ -303,7 +303,7 @@ gx_dc_pattern2_get_bbox(const gx_device_color * pdevc, gs_fixed_rect *bbox)
if (!pinst->templat.Shading->params.have_BBox)
return 0;
code = gx_dc_pattern2_shade_bbox_transform2fixed(
- &pinst->templat.Shading->params.BBox, (gs_imager_state *)pinst->saved, bbox);
+ &pinst->templat.Shading->params.BBox, (gs_gstate *)pinst->saved, bbox);
if (code < 0)
return code;
return 1;
@@ -328,9 +328,9 @@ gx_dc_shading_path_add_box(gx_path *ppath, const gx_device_color * pdevc)
if (!psh->params.have_BBox)
return_error(gs_error_unregistered); /* Do not call in this case. */
else {
- gs_state *pis = pinst->saved;
+ gs_gstate *pgs = pinst->saved;
- return gs_shading_path_add_box(ppath, &psh->params.BBox, &pis->ctm);
+ return gs_shading_path_add_box(ppath, &psh->params.BBox, &pgs->ctm);
}
}
@@ -354,7 +354,7 @@ gx_dc_pattern2_clip_with_bbox(const gx_device_color * pdevc, gx_device * pdev,
} else {
if (code >= 0) {
gx_cpath_init_local_shared(cpath_local, *ppcpath1, mem);
- code = gx_cpath_intersect(cpath_local, &box_path, gx_rule_winding_number, (gs_imager_state *)pinst->saved);
+ code = gx_cpath_intersect(cpath_local, &box_path, gx_rule_winding_number, (gs_gstate *)pinst->saved);
*ppcpath1 = cpath_local;
}
}
@@ -382,7 +382,7 @@ gx_dc_pattern2_clip_with_bbox_simple(const gx_device_color * pdevc, gx_device *
/* Ignore huge BBox - bug 689027. */
code = 0;
} else if (code >= 0) {
- code = gx_cpath_intersect(cpath_local, &box_path, gx_rule_winding_number, (gs_imager_state *)pinst->saved);
+ code = gx_cpath_intersect(cpath_local, &box_path, gx_rule_winding_number, (gs_gstate *)pinst->saved);
}
gx_path_free(&box_path, "gx_default_fill_path(path_bbox)");
}
diff --git a/base/gsptype2.h b/base/gsptype2.h
index 18af5d0bc..e08e546a1 100644
--- a/base/gsptype2.h
+++ b/base/gsptype2.h
@@ -104,7 +104,7 @@ int gs_pattern2_set_shfill(gs_client_color * pcc);
/* Transform a shading bounding box into device space. */
int gx_dc_pattern2_shade_bbox_transform2fixed(const gs_rect * rect,
- const gs_imager_state * pis, gs_fixed_rect * rfixed);
+ const gs_gstate * pgs, gs_fixed_rect * rfixed);
/* Get a shading bbox. Returns 1 on success. */
int gx_dc_pattern2_get_bbox(const gx_device_color * pdevc, gs_fixed_rect *bbox);
diff --git a/base/gsrefct.h b/base/gsrefct.h
index 74c53efa5..b1d0df8be 100644
--- a/base/gsrefct.h
+++ b/base/gsrefct.h
@@ -19,6 +19,12 @@
#ifndef gsrefct_INCLUDED
# define gsrefct_INCLUDED
+/* Remove this, hopefully */
+#ifndef gs_memory_DEFINED
+# define gs_memory_DEFINED
+typedef struct gs_memory_s gs_memory_t;
+#endif
+
/*
* A reference-counted object must include the following header:
* rc_header rc;
diff --git a/base/gsrop.c b/base/gsrop.c
index 40261b75f..4b4c2e0af 100644
--- a/base/gsrop.c
+++ b/base/gsrop.c
@@ -22,7 +22,7 @@
/* setrasterop */
int
-gs_setrasterop(gs_state * pgs, gs_rop3_t rop)
+gs_setrasterop(gs_gstate * pgs, gs_rop3_t rop)
{
if (pgs->in_cachedevice)
return_error(gs_error_undefined);
@@ -32,14 +32,14 @@ gs_setrasterop(gs_state * pgs, gs_rop3_t rop)
/* currentrasterop */
gs_rop3_t
-gs_currentrasterop(const gs_state * pgs)
+gs_currentrasterop(const gs_gstate * pgs)
{
return lop_rop(pgs->log_op);
}
/* setsourcetransparent */
int
-gs_setsourcetransparent(gs_state * pgs, bool transparent)
+gs_setsourcetransparent(gs_gstate * pgs, bool transparent)
{
if (pgs->in_cachedevice)
return_error(gs_error_undefined);
@@ -51,14 +51,14 @@ gs_setsourcetransparent(gs_state * pgs, bool transparent)
/* currentsourcetransparent */
bool
-gs_currentsourcetransparent(const gs_state * pgs)
+gs_currentsourcetransparent(const gs_gstate * pgs)
{
return (pgs->log_op & lop_S_transparent) != 0;
}
/* settexturetransparent */
int
-gs_settexturetransparent(gs_state * pgs, bool transparent)
+gs_settexturetransparent(gs_gstate * pgs, bool transparent)
{
if (pgs->in_cachedevice)
return_error(gs_error_undefined);
@@ -70,20 +70,20 @@ gs_settexturetransparent(gs_state * pgs, bool transparent)
/* currenttexturetransparent */
bool
-gs_currenttexturetransparent(const gs_state * pgs)
+gs_currenttexturetransparent(const gs_gstate * pgs)
{
return (pgs->log_op & lop_T_transparent) != 0;
}
/* Save/restore logical operation. (For internal use only.) */
int
-gs_set_logical_op(gs_state * pgs, gs_logical_operation_t lop)
+gs_set_logical_op(gs_gstate * pgs, gs_logical_operation_t lop)
{
pgs->log_op = lop;
return 0;
}
gs_logical_operation_t
-gs_current_logical_op(const gs_state * pgs)
+gs_current_logical_op(const gs_gstate * pgs)
{
return pgs->log_op;
}
diff --git a/base/gsrop.h b/base/gsrop.h
index 4d5f231c1..2d846bda9 100644
--- a/base/gsrop.h
+++ b/base/gsrop.h
@@ -23,15 +23,15 @@
/* Procedural interface */
-int gs_setrasterop(gs_state *, gs_rop3_t);
-gs_rop3_t gs_currentrasterop(const gs_state *);
-int gs_setsourcetransparent(gs_state *, bool);
-bool gs_currentsourcetransparent(const gs_state *);
-int gs_settexturetransparent(gs_state *, bool);
-bool gs_currenttexturetransparent(const gs_state *);
+int gs_setrasterop(gs_gstate *, gs_rop3_t);
+gs_rop3_t gs_currentrasterop(const gs_gstate *);
+int gs_setsourcetransparent(gs_gstate *, bool);
+bool gs_currentsourcetransparent(const gs_gstate *);
+int gs_settexturetransparent(gs_gstate *, bool);
+bool gs_currenttexturetransparent(const gs_gstate *);
/* Save/restore the combined logical operation. */
-gs_logical_operation_t gs_current_logical_op(const gs_state *);
-int gs_set_logical_op(gs_state *, gs_logical_operation_t);
+gs_logical_operation_t gs_current_logical_op(const gs_gstate *);
+int gs_set_logical_op(gs_gstate *, gs_logical_operation_t);
#endif /* gsrop_INCLUDED */
diff --git a/base/gsshade.c b/base/gsshade.c
index c918c04e4..f326f6d4b 100644
--- a/base/gsshade.c
+++ b/base/gsshade.c
@@ -24,7 +24,7 @@
#include "gxcpath.h"
#include "gxcspace.h"
#include "gxdcolor.h" /* for filling background rectangle */
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpaint.h"
#include "gxpath.h"
#include "gxshade.h"
@@ -443,9 +443,9 @@ gs_shading_path_add_box(gx_path *ppath, const gs_rect *pbox,
int
gs_shading_do_fill_rectangle(const gs_shading_t *psh,
const gs_fixed_rect *prect, gx_device *dev,
- gs_imager_state *pis, bool fill_background)
+ gs_gstate *pgs, bool fill_background)
{ /* If you need to fill a path, clip the output device before calling this function. */
- const gs_matrix_fixed *pmat = &pis->ctm;
+ const gs_matrix_fixed *pmat = &pgs->ctm;
gs_fixed_rect path_box;
gs_rect path_rect;
gs_rect rect;
@@ -461,12 +461,12 @@ gs_shading_do_fill_rectangle(const gs_shading_t *psh,
cc = *psh->params.Background;
(*pcs->type->restrict_color)(&cc, pcs);
- code = (*pcs->type->remap_color)(&cc, pcs, &dev_color, pis,
+ code = (*pcs->type->remap_color)(&cc, pcs, &dev_color, pgs,
dev, gs_color_select_texture);
/****** WRONG IF NON-IDEMPOTENT RasterOp ******/
if (code >= 0)
- code = gx_shade_background(dev, &path_box, &dev_color, pis->log_op);
+ code = gx_shade_background(dev, &path_box, &dev_color, pgs->log_op);
}
if (code >= 0) {
path_rect.p.x = fixed2float(path_box.p.x);
@@ -474,7 +474,7 @@ gs_shading_do_fill_rectangle(const gs_shading_t *psh,
path_rect.q.x = fixed2float(path_box.q.x);
path_rect.q.y = fixed2float(path_box.q.y);
gs_bbox_transform_inverse(&path_rect, (const gs_matrix *)pmat, &rect);
- code = gs_shading_fill_rectangle(psh, &rect, &path_box, dev, pis);
+ code = gs_shading_fill_rectangle(psh, &rect, &path_box, dev, pgs);
}
return code;
}
diff --git a/base/gsshade.h b/base/gsshade.h
index a4c5cb782..b32c2569c 100644
--- a/base/gsshade.h
+++ b/base/gsshade.h
@@ -81,10 +81,10 @@ typedef struct gx_device_s gx_device;
#define SHADING_FILL_RECTANGLE_PROC(proc)\
int proc(const gs_shading_t *psh, const gs_rect *prect,\
const gs_fixed_rect *prect_clip, gx_device *dev,\
- gs_imager_state *pis)
+ gs_gstate *pgs)
typedef SHADING_FILL_RECTANGLE_PROC((*shading_fill_rectangle_proc_t));
-#define gs_shading_fill_rectangle(psh, prect, prect_clip, dev, pis)\
- ((psh)->head.procs.fill_rectangle(psh, prect, prect_clip, dev, pis))
+#define gs_shading_fill_rectangle(psh, prect, prect_clip, dev, pgs)\
+ ((psh)->head.procs.fill_rectangle(psh, prect, prect_clip, dev, pgs))
/* Define the generic shading structures. */
typedef struct gs_shading_procs_s {
@@ -258,7 +258,7 @@ typedef struct gs_matrix_fixed_s gs_matrix_fixed;
/* Fill a rectangle with a shading. */
int gs_shading_do_fill_rectangle(const gs_shading_t *psh,
const gs_fixed_rect *prect, gx_device *dev,
- gs_imager_state *pis, bool fill_background);
+ gs_gstate *pgs, bool fill_background);
/* Add a shading bbox to a path. */
int gs_shading_path_add_box(gx_path *ppath, const gs_rect *pbox,
diff --git a/base/gsstate.c b/base/gsstate.c
index c23936f3b..f539a4b7a 100644
--- a/base/gsstate.c
+++ b/base/gsstate.c
@@ -41,13 +41,13 @@
#include "gsicc_manage.h"
/* Forward references */
-static gs_state *gstate_alloc(gs_memory_t *, client_name_t,
- const gs_state *);
-static gs_state *gstate_clone(gs_state *, gs_memory_t *, client_name_t,
- gs_state_copy_reason_t);
-static void gstate_free_contents(gs_state *);
-static int gstate_copy(gs_state *, const gs_state *,
- gs_state_copy_reason_t, client_name_t);
+static gs_gstate *gstate_alloc(gs_memory_t *, client_name_t,
+ const gs_gstate *);
+static gs_gstate *gstate_clone(gs_gstate *, gs_memory_t *, client_name_t,
+ gs_gstate_copy_reason_t);
+static void gstate_free_contents(gs_gstate *);
+static int gstate_copy(gs_gstate *, const gs_gstate *,
+ gs_gstate_copy_reason_t, client_name_t);
static void clip_stack_rc_adjust(gx_clip_stack_t *cs, int delta, client_name_t cname);
/*
@@ -137,7 +137,7 @@ static void clip_stack_rc_adjust(gx_clip_stack_t *cs, int delta, client_name_t c
* individually for each state, except for line_params.dash.pattern.
* Note that effective_clip_shared is not on the list.
*/
-typedef struct gs_state_parts_s {
+typedef struct gs_gstate_parts_s {
gx_path *path;
gx_clip_path *clip_path;
gx_clip_path *effective_clip_path;
@@ -145,7 +145,7 @@ typedef struct gs_state_parts_s {
gs_client_color *ccolor;
gx_device_color *dev_color;
} color[2];
-} gs_state_parts;
+} gs_gstate_parts;
#define GSTATE_ASSIGN_PARTS(pto, pfrom)\
((pto)->path = (pfrom)->path, (pto)->clip_path = (pfrom)->clip_path,\
@@ -155,38 +155,13 @@ typedef struct gs_state_parts_s {
(pto)->color[1].ccolor = (pfrom)->color[1].ccolor,\
(pto)->color[1].dev_color = (pfrom)->color[1].dev_color)
-/* GC descriptors */
-extern_st(st_imager_state);
-public_st_gs_state();
-/* GC procedures for gs_state */
-static ENUM_PTRS_WITH(gs_state_enum_ptrs, gs_state *gsvptr)
-ENUM_PREFIX(st_imager_state, gs_state_num_ptrs + 2);
-#define e1(i,elt) ENUM_PTR(i,gs_state,elt);
-gs_state_do_ptrs(e1)
-case gs_state_num_ptrs: /* handle device specially */
-ENUM_RETURN(gx_device_enum_ptr(gsvptr->device));
-case gs_state_num_ptrs + 1: /* handle device filter stack specially */
-ENUM_RETURN(gsvptr->dfilter_stack);
-#undef e1
-ENUM_PTRS_END
-static RELOC_PTRS_WITH(gs_state_reloc_ptrs, gs_state *gsvptr)
-{
- RELOC_PREFIX(st_imager_state);
- {
-#define r1(i,elt) RELOC_PTR(gs_state,elt);
- gs_state_do_ptrs(r1)
-#undef r1
- gsvptr->device = gx_device_reloc_ptr(gsvptr->device, gcst);
- RELOC_PTR(gs_state, dfilter_stack);
- }
-}
-RELOC_PTRS_END
+extern_st(st_gs_gstate); /* for gstate_alloc() */
/* Copy client data, using the copy_for procedure if available, */
/* the copy procedure otherwise. */
static int
-gstate_copy_client_data(gs_state * pgs, void *dto, void *dfrom,
- gs_state_copy_reason_t reason)
+gstate_copy_client_data(gs_gstate * pgs, void *dto, void *dfrom,
+ gs_gstate_copy_reason_t reason)
{
return (pgs->client_procs.copy_for != 0 ?
(*pgs->client_procs.copy_for) (dto, dfrom, reason) :
@@ -195,11 +170,6 @@ gstate_copy_client_data(gs_state * pgs, void *dto, void *dfrom,
/* ------ Operations on the entire graphics state ------ */
-/* Define the initial value of the graphics state. */
-static const gs_imager_state gstate_initial = {
- gs_imager_state_initial(1.0, true) /* is_gstate == true */
-};
-
/*
* Allocate a path for the graphics state. We use stable memory because
* some PostScript files have Type 3 fonts whose BuildChar procedure
@@ -214,16 +184,16 @@ gstate_path_memory(gs_memory_t *mem)
}
/* Allocate and initialize a graphics state. */
-gs_state *
-gs_state_alloc(gs_memory_t * mem)
+gs_gstate *
+gs_gstate_alloc(gs_memory_t * mem)
{
- gs_state *pgs = gstate_alloc(mem, "gs_state_alloc", NULL);
+ gs_gstate *pgs = gstate_alloc(mem, "gs_gstate_alloc", NULL);
int code;
if (pgs == 0)
return 0;
- *(gs_imager_state *)pgs = gstate_initial; /* this sets is_gstate == true */
- /* Need to set up at least enough to make gs_state_free happy */
+ GS_STATE_INIT_VALUES(pgs, 1.0);
+ /* Need to set up at least enough to make gs_gstate_free happy */
pgs->saved = 0;
pgs->path = NULL;
pgs->clip_path = NULL;
@@ -238,25 +208,25 @@ gs_state_alloc(gs_memory_t * mem)
/*
* Just enough of the state is initialized at this point
- * that it's OK to call gs_state_free if an allocation fails.
+ * that it's OK to call gs_gstate_free if an allocation fails.
*/
- code = gs_imager_state_initialize((gs_imager_state *) pgs, mem);
+ code = gs_gstate_initialize(pgs, mem);
if (code < 0)
goto fail;
/* Finish initializing the color rendering state. */
rc_alloc_struct_1(pgs->halftone, gs_halftone, &st_halftone, mem,
- goto fail, "gs_state_alloc(halftone)");
+ goto fail, "gs_gstate_alloc(halftone)");
pgs->halftone->type = ht_type_none;
/* Initialize other things not covered by initgraphics */
- pgs->path = gx_path_alloc(gstate_path_memory(mem), "gs_state_alloc(path)");
- pgs->clip_path = gx_cpath_alloc(mem, "gs_state_alloc(clip_path)");
+ pgs->path = gx_path_alloc(gstate_path_memory(mem), "gs_gstate_alloc(path)");
+ pgs->clip_path = gx_cpath_alloc(mem, "gs_gstate_alloc(clip_path)");
pgs->clip_stack = 0;
- pgs->view_clip = gx_cpath_alloc(mem, "gs_state_alloc(view_clip)");
+ pgs->view_clip = gx_cpath_alloc(mem, "gs_gstate_alloc(view_clip)");
if (pgs->view_clip == NULL)
goto fail;
pgs->view_clip->rule = 0; /* no clipping */
@@ -301,15 +271,15 @@ gs_state_alloc(gs_memory_t * mem)
return pgs;
/* Something went very wrong. */
fail:
- gs_state_free(pgs);
+ gs_gstate_free(pgs);
return 0;
}
/* Set the client data in a graphics state. */
/* This should only be done to a newly created state. */
void
-gs_state_set_client(gs_state * pgs, void *pdata,
- const gs_state_client_procs * pprocs, bool client_has_pattern_streams)
+gs_gstate_set_client(gs_gstate * pgs, void *pdata,
+ const gs_gstate_client_procs * pprocs, bool client_has_pattern_streams)
{
pgs->client_data = pdata;
pgs->client_procs = *pprocs;
@@ -317,22 +287,22 @@ gs_state_set_client(gs_state * pgs, void *pdata,
}
/* Get the client data from a graphics state. */
-#undef gs_state_client_data /* gzstate.h makes this a macro */
+#undef gs_gstate_client_data /* gzstate.h makes this a macro */
void *
-gs_state_client_data(const gs_state * pgs)
+gs_gstate_client_data(const gs_gstate * pgs)
{
return pgs->client_data;
}
/* Free the chain of gstates.*/
int
-gs_state_free_chain(gs_state * pgs)
+gs_gstate_free_chain(gs_gstate * pgs)
{
- gs_state *saved = pgs, *tmp;
+ gs_gstate *saved = pgs, *tmp;
while(saved != 0) {
tmp = saved->saved;
- gs_state_free(saved);
+ gs_gstate_free(saved);
saved = tmp;
}
return 0;
@@ -340,18 +310,18 @@ gs_state_free_chain(gs_state * pgs)
/* Free a graphics state. */
int
-gs_state_free(gs_state * pgs)
+gs_gstate_free(gs_gstate * pgs)
{
gstate_free_contents(pgs);
- gs_free_object(pgs->memory, pgs, "gs_state_free");
+ gs_free_object(pgs->memory, pgs, "gs_gstate_free");
return 0;
}
/* Save the graphics state. */
int
-gs_gsave(gs_state * pgs)
+gs_gsave(gs_gstate * pgs)
{
- gs_state *pnew = gstate_clone(pgs, pgs->memory, "gs_gsave",
+ gs_gstate *pnew = gstate_clone(pgs, pgs->memory, "gs_gsave",
copy_for_gsave);
if (pnew == 0)
@@ -381,7 +351,7 @@ gs_gsave(gs_state * pgs)
* In addition to an ordinary gsave, we create a new view clip path.
*/
int
-gs_gsave_for_save(gs_state * pgs, gs_state ** psaved)
+gs_gsave_for_save(gs_gstate * pgs, gs_gstate ** psaved)
{
int code;
gx_clip_path *old_cpath = pgs->view_clip;
@@ -414,9 +384,9 @@ fail:
/* Restore the graphics state. Can fully empty graphics stack */
int /* return 0 if ok, 1 if stack was empty */
-gs_grestore_only(gs_state * pgs)
+gs_grestore_only(gs_gstate * pgs)
{
- gs_state *saved = pgs->saved;
+ gs_gstate *saved = pgs->saved;
void *pdata = pgs->client_data;
void *sdata;
bool prior_overprint = pgs->overprint;
@@ -449,7 +419,7 @@ gs_grestore_only(gs_state * pgs)
/* Restore the graphics state per PostScript semantics */
int
-gs_grestore(gs_state * pgs)
+gs_grestore(gs_gstate * pgs)
{
int code;
if (!pgs->saved)
@@ -467,7 +437,7 @@ gs_grestore(gs_state * pgs)
/* Restore the graphics state for a 'restore', splicing the old stack */
/* back on. Note that we actually do a grestoreall + 2 grestores. */
int
-gs_grestoreall_for_restore(gs_state * pgs, gs_state * saved)
+gs_grestoreall_for_restore(gs_gstate * pgs, gs_gstate * saved)
{
int code;
@@ -492,7 +462,7 @@ gs_grestoreall_for_restore(gs_state * pgs, gs_state * saved)
/* Restore to the bottommost graphics state (at this save level). */
int
-gs_grestoreall(gs_state * pgs)
+gs_grestoreall(gs_gstate * pgs)
{
if (!pgs->saved) /* shouldn't happen */
return gs_gsave(pgs);
@@ -506,15 +476,10 @@ gs_grestoreall(gs_state * pgs)
}
/* Allocate and return a new graphics state. */
-gs_state *
-gs_gstate(gs_state * pgs)
-{
- return gs_state_copy(pgs, pgs->memory);
-}
-gs_state *
-gs_state_copy(gs_state * pgs, gs_memory_t * mem)
+gs_gstate *
+gs_gstate_copy(gs_gstate * pgs, gs_memory_t * mem)
{
- gs_state *pnew;
+ gs_gstate *pnew;
/* Prevent 'capturing' the view clip path. */
gx_clip_path *view_clip = pgs->view_clip;
@@ -522,7 +487,7 @@ gs_state_copy(gs_state * pgs, gs_memory_t * mem)
pnew = gstate_clone(pgs, mem, "gs_gstate", copy_for_gstate);
if (pnew == 0)
return 0;
- clip_stack_rc_adjust(pnew->clip_stack, 1, "gs_state_copy");
+ clip_stack_rc_adjust(pnew->clip_stack, 1, "gs_gstate_copy");
rc_increment(pnew->dfilter_stack);
pgs->view_clip = view_clip;
pnew->saved = 0;
@@ -539,14 +504,14 @@ gs_state_copy(gs_state * pgs, gs_memory_t * mem)
/* Copy one previously allocated graphics state to another. */
int
-gs_copygstate(gs_state * pto, const gs_state * pfrom)
+gs_copygstate(gs_gstate * pto, const gs_gstate * pfrom)
{
return gstate_copy(pto, pfrom, copy_for_copygstate, "gs_copygstate");
}
/* Copy the current graphics state to a previously allocated one. */
int
-gs_currentgstate(gs_state * pto, const gs_state * pgs)
+gs_currentgstate(gs_gstate * pto, const gs_gstate * pgs)
{
int code =
gstate_copy(pto, pgs, copy_for_currentgstate, "gs_currentgstate");
@@ -558,14 +523,14 @@ gs_currentgstate(gs_state * pto, const gs_state * pgs)
/* Restore the current graphics state from a previously allocated one. */
int
-gs_setgstate(gs_state * pgs, const gs_state * pfrom)
+gs_setgstate(gs_gstate * pgs, const gs_gstate * pfrom)
{
/*
* The implementation is the same as currentgstate,
* except we must preserve the saved pointer, the level,
* the view clip, and possibly the show_gstate.
*/
- gs_state *saved_show = pgs->show_gstate;
+ gs_gstate *saved_show = pgs->show_gstate;
int level = pgs->level;
gx_clip_path *view_clip = pgs->view_clip;
int code;
@@ -591,25 +556,25 @@ gs_setgstate(gs_state * pgs, const gs_state * pfrom)
/* This is provided only for the interpreter */
/* and for color space implementation. */
gs_memory_t *
-gs_state_memory(const gs_state * pgs)
+gs_gstate_memory(const gs_gstate * pgs)
{
return pgs->memory;
}
/* Get the saved pointer of the graphics state. */
/* This is provided only for Level 2 grestore. */
-gs_state *
-gs_state_saved(const gs_state * pgs)
+gs_gstate *
+gs_gstate_saved(const gs_gstate * pgs)
{
return pgs->saved;
}
/* Swap the saved pointer of the graphics state. */
/* This is provided only for save/restore. */
-gs_state *
-gs_state_swap_saved(gs_state * pgs, gs_state * new_saved)
+gs_gstate *
+gs_gstate_swap_saved(gs_gstate * pgs, gs_gstate * new_saved)
{
- gs_state *saved = pgs->saved;
+ gs_gstate *saved = pgs->saved;
pgs->saved = new_saved;
return saved;
@@ -618,7 +583,7 @@ gs_state_swap_saved(gs_state * pgs, gs_state * new_saved)
/* Swap the memory pointer of the graphics state. */
/* This is provided only for the interpreter. */
gs_memory_t *
-gs_state_swap_memory(gs_state * pgs, gs_memory_t * mem)
+gs_gstate_swap_memory(gs_gstate * pgs, gs_memory_t * mem)
{
gs_memory_t *memory = pgs->memory;
@@ -635,10 +600,9 @@ gs_state_swap_memory(gs_state * pgs, gs_memory_t * mem)
* compositor device.
*/
int
-gs_state_update_overprint(gs_state * pgs, const gs_overprint_params_t * pparams)
+gs_gstate_update_overprint(gs_gstate * pgs, const gs_overprint_params_t * pparams)
{
gs_composite_t * pct = 0;
- gs_imager_state * pis = (gs_imager_state *)pgs;
int code;
gx_device * dev = pgs->device;
gx_device * ovptdev;
@@ -648,7 +612,7 @@ gs_state_update_overprint(gs_state * pgs, const gs_overprint_params_t * pparams)
code = dev_proc(dev, create_compositor)( dev,
&ovptdev,
pct,
- pis,
+ pgs,
pgs->memory,
NULL);
if (code >= 0 || code == gs_error_handled){
@@ -658,7 +622,7 @@ gs_state_update_overprint(gs_state * pgs, const gs_overprint_params_t * pparams)
}
}
if (pct != 0)
- gs_free_object(pgs->memory, pct, "gs_state_update_overprint");
+ gs_free_object(pgs->memory, pct, "gs_gstate_update_overprint");
/* the following hack handles devices that don't support compositors */
if (code == gs_error_unknownerror && !pparams->retain_any_comps)
@@ -683,7 +647,7 @@ gs_state_update_overprint(gs_state * pgs, const gs_overprint_params_t * pparams)
* components "drawn".
*/
int
-gs_do_set_overprint(gs_state * pgs)
+gs_do_set_overprint(gs_gstate * pgs)
{
const gs_color_space * pcs = gs_currentcolorspace_inline(pgs);
const gs_client_color * pcc = gs_currentcolor_inline(pgs);
@@ -698,7 +662,7 @@ gs_do_set_overprint(gs_state * pgs)
/* setoverprint */
void
-gs_setoverprint(gs_state * pgs, bool ovp)
+gs_setoverprint(gs_gstate * pgs, bool ovp)
{
bool prior_ovp = pgs->overprint;
@@ -709,14 +673,14 @@ gs_setoverprint(gs_state * pgs, bool ovp)
/* currentoverprint */
bool
-gs_currentoverprint(const gs_state * pgs)
+gs_currentoverprint(const gs_gstate * pgs)
{
return pgs->overprint;
}
/* setoverprintmode */
int
-gs_setoverprintmode(gs_state * pgs, int mode)
+gs_setoverprintmode(gs_gstate * pgs, int mode)
{
int prior_mode = pgs->effective_overprint_mode;
int code = 0;
@@ -731,7 +695,7 @@ gs_setoverprintmode(gs_state * pgs, int mode)
/* currentoverprintmode */
int
-gs_currentoverprintmode(const gs_state * pgs)
+gs_currentoverprintmode(const gs_gstate * pgs)
{
return pgs->overprint_mode;
}
@@ -763,7 +727,7 @@ gs_currentcpsimode(const gs_memory_t * mem)
* AbsoluteColorimetric 3
*/
int
-gs_setrenderingintent(gs_state *pgs, int ri) {
+gs_setrenderingintent(gs_gstate *pgs, int ri) {
if (ri < 0 || ri > 3)
return_error(gs_error_rangecheck);
pgs->renderingintent = ri;
@@ -772,20 +736,20 @@ gs_setrenderingintent(gs_state *pgs, int ri) {
/* currentrenderingintent */
int
-gs_currentrenderingintent(const gs_state * pgs)
+gs_currentrenderingintent(const gs_gstate * pgs)
{
return pgs->renderingintent;
}
int
-gs_setblackptcomp(gs_state *pgs, bool bkpt) {
+gs_setblackptcomp(gs_gstate *pgs, bool bkpt) {
pgs->blackptcomp = bkpt;
return 0;
}
/* currentrenderingintent */
bool
-gs_currentblackptcomp(const gs_state * pgs)
+gs_currentblackptcomp(const gs_gstate * pgs)
{
return pgs->blackptcomp;
}
@@ -799,9 +763,12 @@ gs_currentblackptcomp(const gs_state * pgs)
* initializaion themselves.
*/
int
-gs_initgraphics(gs_state * pgs)
+gs_initgraphics(gs_gstate * pgs)
{
int code;
+ const gs_gstate gstate_initial = {
+ gs_gstate_initial(1.0)
+ };
gs_initmatrix(pgs);
if ((code = gs_newpath(pgs)) < 0 ||
@@ -825,7 +792,7 @@ gs_initgraphics(gs_state * pgs)
/* setfilladjust */
int
-gs_setfilladjust(gs_state * pgs, double adjust_x, double adjust_y)
+gs_setfilladjust(gs_gstate * pgs, double adjust_x, double adjust_y)
{
#define CLAMP_TO_HALF(v)\
((v) <= 0 ? fixed_0 : (v) >= 0.5 ? fixed_half : float2fixed(v));
@@ -838,7 +805,7 @@ gs_setfilladjust(gs_state * pgs, double adjust_x, double adjust_y)
/* currentfilladjust */
int
-gs_currentfilladjust(const gs_state * pgs, gs_point * adjust)
+gs_currentfilladjust(const gs_gstate * pgs, gs_point * adjust)
{
adjust->x = fixed2float(pgs->fill_adjust.x);
adjust->y = fixed2float(pgs->fill_adjust.y);
@@ -847,42 +814,42 @@ gs_currentfilladjust(const gs_state * pgs, gs_point * adjust)
/* setlimitclamp */
void
-gs_setlimitclamp(gs_state * pgs, bool clamp)
+gs_setlimitclamp(gs_gstate * pgs, bool clamp)
{
pgs->clamp_coordinates = clamp;
}
/* currentlimitclamp */
bool
-gs_currentlimitclamp(const gs_state * pgs)
+gs_currentlimitclamp(const gs_gstate * pgs)
{
return pgs->clamp_coordinates;
}
/* settextrenderingmode */
void
-gs_settextrenderingmode(gs_state * pgs, uint trm)
+gs_settextrenderingmode(gs_gstate * pgs, uint trm)
{
pgs->text_rendering_mode = trm;
}
/* currenttextrenderingmode */
uint
-gs_currenttextrenderingmode(const gs_state * pgs)
+gs_currenttextrenderingmode(const gs_gstate * pgs)
{
return pgs->text_rendering_mode;
}
/* sethpglpathmode */
void
-gs_sethpglpathmode(gs_state * pgs, bool path)
+gs_sethpglpathmode(gs_gstate * pgs, bool path)
{
pgs->hpgl_path_mode = path;
}
/* currenthpglpathmode */
bool
-gs_currenthpglpathmode(const gs_state * pgs)
+gs_currenthpglpathmode(const gs_gstate * pgs)
{
return pgs->hpgl_path_mode;
}
@@ -891,7 +858,7 @@ gs_currenthpglpathmode(const gs_state * pgs)
/* Free the privately allocated parts of a gstate. */
static void
-gstate_free_parts(const gs_state * parts, gs_memory_t * mem, client_name_t cname)
+gstate_free_parts(const gs_gstate * parts, gs_memory_t * mem, client_name_t cname)
{
gs_free_object(mem, parts->color[1].dev_color, cname);
gs_free_object(mem, parts->color[1].ccolor, cname);
@@ -906,7 +873,7 @@ gstate_free_parts(const gs_state * parts, gs_memory_t * mem, client_name_t cname
/* Allocate the privately allocated parts of a gstate. */
static int
-gstate_alloc_parts(gs_state * parts, const gs_state * shared,
+gstate_alloc_parts(gs_gstate * parts, const gs_gstate * shared,
gs_memory_t * mem, client_name_t cname)
{
gs_memory_t *path_mem = gstate_path_memory(mem);
@@ -957,14 +924,15 @@ gstate_alloc_parts(gs_state * parts, const gs_state * shared,
* clip_path and view_clip) effective_clip_path share the segments of
* pfrom's corresponding path(s).
*/
-static gs_state *
-gstate_alloc(gs_memory_t * mem, client_name_t cname, const gs_state * pfrom)
+static gs_gstate *
+gstate_alloc(gs_memory_t * mem, client_name_t cname, const gs_gstate * pfrom)
{
- gs_state *pgs =
- gs_alloc_struct(mem, gs_state, &st_gs_state, cname);
+ gs_gstate *pgs =
+ gs_alloc_struct(mem, gs_gstate, &st_gs_gstate, cname);
if (pgs == 0)
return 0;
+ memset(pgs, 0x00, sizeof(gs_gstate));
if (gstate_alloc_parts(pgs, pfrom, mem, cname) < 0) {
gs_free_object(mem, pgs, cname);
return 0;
@@ -975,7 +943,7 @@ gstate_alloc(gs_memory_t * mem, client_name_t cname, const gs_state * pfrom)
/* Copy the dash pattern from one gstate to another. */
static int
-gstate_copy_dash(gs_state * pto, const gs_state * pfrom)
+gstate_copy_dash(gs_gstate * pto, const gs_gstate * pfrom)
{
return gs_setdash(pto, pfrom->line_params.dash.pattern,
pfrom->line_params.dash.pattern_size,
@@ -986,12 +954,12 @@ gstate_copy_dash(gs_state * pto, const gs_state * pfrom)
/* Return 0 if the allocation fails. */
/* If reason is for_gsave, the clone refers to the old contents, */
/* and we switch the old state to refer to the new contents. */
-static gs_state *
-gstate_clone(gs_state * pfrom, gs_memory_t * mem, client_name_t cname,
- gs_state_copy_reason_t reason)
+static gs_gstate *
+gstate_clone(gs_gstate * pfrom, gs_memory_t * mem, client_name_t cname,
+ gs_gstate_copy_reason_t reason)
{
- gs_state *pgs = gstate_alloc(mem, cname, pfrom);
- gs_state_parts parts;
+ gs_gstate *pgs = gstate_alloc(mem, cname, pfrom);
+ gs_gstate_parts parts;
if (pgs == 0)
return 0;
@@ -1014,7 +982,7 @@ gstate_clone(gs_state * pfrom, gs_memory_t * mem, client_name_t cname,
)
goto fail;
}
- gs_imager_state_copied((gs_imager_state *)pgs);
+ gs_gstate_copied(pgs);
/* Don't do anything to clip_stack. */
rc_increment(pgs->device);
@@ -1062,7 +1030,7 @@ clip_stack_rc_adjust(gx_clip_stack_t *cs, int delta, client_name_t cname)
/* Release the composite parts of a graphics state, */
/* but not the state itself. */
static void
-gstate_free_contents(gs_state * pgs)
+gstate_free_contents(gs_gstate * pgs)
{
gs_memory_t *mem = pgs->memory;
const char *const cname = "gstate_free_contents";
@@ -1078,15 +1046,15 @@ gstate_free_contents(gs_state * pgs)
(*pgs->client_procs.free) (pgs->client_data, mem);
gs_free_object(mem, pgs->line_params.dash.pattern, cname);
gstate_free_parts(pgs, mem, cname);
- gs_imager_state_release((gs_imager_state *)pgs);
+ gs_gstate_release(pgs);
}
/* Copy one gstate to another. */
static int
-gstate_copy(gs_state * pto, const gs_state * pfrom,
- gs_state_copy_reason_t reason, client_name_t cname)
+gstate_copy(gs_gstate * pto, const gs_gstate * pfrom,
+ gs_gstate_copy_reason_t reason, client_name_t cname)
{
- gs_state_parts parts;
+ gs_gstate_parts parts;
GSTATE_ASSIGN_PARTS(&parts, pto);
/* Copy the dash pattern if necessary. */
@@ -1138,11 +1106,10 @@ gstate_copy(gs_state * pto, const gs_state * pfrom,
struct gx_pattern_cache_s *pcache = pto->pattern_cache;
void *pdata = pto->client_data;
gs_memory_t *mem = pto->memory;
- gs_state *saved = pto->saved;
+ gs_gstate *saved = pto->saved;
float *pattern = pto->line_params.dash.pattern;
- gs_imager_state_pre_assign((gs_imager_state *)pto,
- (const gs_imager_state *)pfrom);
+ gs_gstate_pre_assign(pto, (const gs_gstate *)pfrom);
*pto = *pfrom;
pto->client_data = pdata;
pto->memory = mem;
@@ -1152,7 +1119,7 @@ gstate_copy(gs_state * pto, const gs_state * pfrom,
pto->pattern_cache = pcache;
if (pfrom->client_data != 0) {
/* We need to break 'const' here. */
- gstate_copy_client_data((gs_state *) pfrom, pdata,
+ gstate_copy_client_data((gs_gstate *) pfrom, pdata,
pfrom->client_data, reason);
}
}
@@ -1167,12 +1134,12 @@ gstate_copy(gs_state * pto, const gs_state * pfrom,
}
/* Accessories. */
-gs_id gx_get_clip_path_id(gs_state *pgs)
+gs_id gx_get_clip_path_id(gs_gstate *pgs)
{
return pgs->clip_path->id;
}
-void gs_swapcolors_quick(gs_state *pgs)
+void gs_swapcolors_quick(gs_gstate *pgs)
{
struct gx_cie_joint_caches_s *tmp_cie;
gs_devicen_color_map tmp_ccm;
@@ -1193,7 +1160,7 @@ void gs_swapcolors_quick(gs_state *pgs)
pgs->color[0].color_space = pgs->color[1].color_space;
pgs->color[1].color_space = tmp_cs;
- /* Swap the bits of the imager state that depend on the current color */
+ /* Swap the bits of the gs_gstate that depend on the current color */
tmp_cie = pgs->cie_joint_caches;
pgs->cie_joint_caches = pgs->cie_joint_caches_alt;
pgs->cie_joint_caches_alt = tmp_cie;
@@ -1216,7 +1183,7 @@ void gs_swapcolors_quick(gs_state *pgs)
}
-int gs_swapcolors(gs_state *pgs)
+int gs_swapcolors(gs_gstate *pgs)
{
int prior_overprint = pgs->overprint;
diff --git a/base/gsstate.h b/base/gsstate.h
index 6771de462..fde0d2f7e 100644
--- a/base/gsstate.h
+++ b/base/gsstate.h
@@ -20,9 +20,9 @@
# define gsstate_INCLUDED
/* Opaque type for a graphics state */
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
/* opague type for overprint compositor parameters */
@@ -32,35 +32,35 @@ typedef struct gs_overprint_params_s gs_overprint_params_t;
#endif
/* Initial allocation and freeing */
-gs_state *gs_state_alloc(gs_memory_t *); /* 0 if fails */
-int gs_state_free(gs_state *);
-int gs_state_free_chain(gs_state *);
+gs_gstate *gs_gstate_alloc(gs_memory_t *); /* 0 if fails */
+int gs_gstate_free(gs_gstate *);
+int gs_gstate_free_chain(gs_gstate *);
/* Initialization, saving, restoring, and copying */
-int gs_gsave(gs_state *), gs_grestore(gs_state *), gs_grestoreall(gs_state *);
-int gs_grestore_only(gs_state *);
-int gs_gsave_for_save(gs_state *, gs_state **), gs_grestoreall_for_restore(gs_state *, gs_state *);
-gs_state *gs_gstate(gs_state *);
-gs_state *gs_state_copy(gs_state *, gs_memory_t *);
-int gs_copygstate(gs_state * /*to */ , const gs_state * /*from */ ),
- gs_currentgstate(gs_state * /*to */ , const gs_state * /*from */ ),
- gs_setgstate(gs_state * /*to */ , const gs_state * /*from */ );
+int gs_gsave(gs_gstate *), gs_grestore(gs_gstate *), gs_grestoreall(gs_gstate *);
+int gs_grestore_only(gs_gstate *);
+int gs_gsave_for_save(gs_gstate *, gs_gstate **), gs_grestoreall_for_restore(gs_gstate *, gs_gstate *);
-int gs_state_update_overprint(gs_state *, const gs_overprint_params_t *);
-bool gs_currentoverprint(const gs_state *);
-void gs_setoverprint(gs_state *, bool);
-int gs_currentoverprintmode(const gs_state *);
-int gs_setoverprintmode(gs_state *, int);
+gs_gstate *gs_gstate_copy(gs_gstate *, gs_memory_t *);
+int gs_copygstate(gs_gstate * /*to */ , const gs_gstate * /*from */ ),
+ gs_currentgstate(gs_gstate * /*to */ , const gs_gstate * /*from */ ),
+ gs_setgstate(gs_gstate * /*to */ , const gs_gstate * /*from */ );
-int gs_do_set_overprint(gs_state *);
+int gs_gstate_update_overprint(gs_gstate *, const gs_overprint_params_t *);
+bool gs_currentoverprint(const gs_gstate *);
+void gs_setoverprint(gs_gstate *, bool);
+int gs_currentoverprintmode(const gs_gstate *);
+int gs_setoverprintmode(gs_gstate *, int);
-int gs_currentrenderingintent(const gs_state *);
-int gs_setrenderingintent(gs_state *, int);
+int gs_do_set_overprint(gs_gstate *);
-int gs_currentblackptcomp(const gs_state *);
-int gs_setblackptcomp(gs_state *, int);
+int gs_currentrenderingintent(const gs_gstate *);
+int gs_setrenderingintent(gs_gstate *, int);
-int gs_initgraphics(gs_state *);
+int gs_currentblackptcomp(const gs_gstate *);
+int gs_setblackptcomp(gs_gstate *, int);
+
+int gs_initgraphics(gs_gstate *);
bool gs_currentcpsimode(const gs_memory_t *);
void gs_setcpsimode(gs_memory_t *, bool);
@@ -77,25 +77,25 @@ void gs_setcpsimode(gs_memory_t *, bool);
/* Halftone screen */
#include "gsht.h"
#include "gscsel.h"
-int gs_setscreenphase(gs_state *, int, int, gs_color_select_t);
-int gs_currentscreenphase(const gs_state *, gs_int_point *, gs_color_select_t);
+int gs_setscreenphase(gs_gstate *, int, int, gs_color_select_t);
+int gs_currentscreenphase(const gs_gstate *, gs_int_point *, gs_color_select_t);
#define gs_sethalftonephase(pgs, px, py)\
gs_setscreenphase(pgs, px, py, gs_color_select_all)
#define gs_currenthalftonephase(pgs, ppt)\
gs_currentscreenphase(pgs, ppt, 0)
-int gx_imager_setscreenphase(gs_imager_state *, int, int, gs_color_select_t);
+int gx_gstate_setscreenphase(gs_gstate *, int, int, gs_color_select_t);
/* Miscellaneous */
-int gs_setfilladjust(gs_state *, double, double);
-int gs_currentfilladjust(const gs_state *, gs_point *);
-void gs_setlimitclamp(gs_state *, bool);
-bool gs_currentlimitclamp(const gs_state *);
-void gs_settextrenderingmode(gs_state * pgs, uint trm);
-uint gs_currenttextrenderingmode(const gs_state * pgs);
+int gs_setfilladjust(gs_gstate *, double, double);
+int gs_currentfilladjust(const gs_gstate *, gs_point *);
+void gs_setlimitclamp(gs_gstate *, bool);
+bool gs_currentlimitclamp(const gs_gstate *);
+void gs_settextrenderingmode(gs_gstate * pgs, uint trm);
+uint gs_currenttextrenderingmode(const gs_gstate * pgs);
#include "gscpm.h"
-gs_in_cache_device_t gs_incachedevice(const gs_state *);
-void gs_sethpglpathmode(gs_state *, bool);
-bool gs_currenthpglpathmode(const gs_state *);
+gs_in_cache_device_t gs_incachedevice(const gs_gstate *);
+void gs_sethpglpathmode(gs_gstate *, bool);
+bool gs_currenthpglpathmode(const gs_gstate *);
#endif /* gsstate_INCLUDED */
diff --git a/base/gsstype.h b/base/gsstype.h
index 6db5d525b..5c081b059 100644
--- a/base/gsstype.h
+++ b/base/gsstype.h
@@ -19,6 +19,8 @@
#ifndef gsstype_INCLUDED
# define gsstype_INCLUDED
+#include "gsmemory.h"
+
/* Define an opaque type for the garbage collector state. */
typedef struct gc_state_s gc_state_t;
diff --git a/base/gstext.c b/base/gstext.c
index 9098db25a..409869d97 100644
--- a/base/gstext.c
+++ b/base/gstext.c
@@ -25,7 +25,7 @@
#include "gstypes.h"
#include "gxfcache.h"
#include "gxdevcli.h"
-#include "gxdcolor.h" /* for gs_state_color_load */
+#include "gxdcolor.h" /* for gs_gstate_color_load */
#include "gxfont.h" /* for init_fstack */
#include "gxpath.h"
#include "gxtext.h"
@@ -94,7 +94,7 @@ static ENUM_PTRS_WITH(text_enum_enum_ptrs, gs_text_enum_t *eptr)
}
case 0: return ENUM_OBJ(gx_device_enum_ptr(eptr->dev));
case 1: return ENUM_OBJ(gx_device_enum_ptr(eptr->imaging_dev));
-ENUM_PTR3(2, gs_text_enum_t, pis, orig_font, path);
+ENUM_PTR3(2, gs_text_enum_t, pgs, orig_font, path);
ENUM_PTR3(5, gs_text_enum_t, pdcolor, pcpath, current_font);
ENUM_PTRS_END
@@ -105,7 +105,7 @@ static RELOC_PTRS_WITH(text_enum_reloc_ptrs, gs_text_enum_t *eptr)
RELOC_USING(st_gs_text_params, &eptr->text, sizeof(eptr->text));
eptr->dev = gx_device_reloc_ptr(eptr->dev, gcst);
eptr->imaging_dev = gx_device_reloc_ptr(eptr->imaging_dev, gcst);
- RELOC_PTR3(gs_text_enum_t, pis, orig_font, path);
+ RELOC_PTR3(gs_text_enum_t, pgs, orig_font, path);
RELOC_PTR3(gs_text_enum_t, pdcolor, pcpath, current_font);
if (eptr->pair != NULL)
eptr->pair = (cached_fm_pair *)RELOC_OBJ(eptr->pair - eptr->pair->index) +
@@ -117,7 +117,7 @@ RELOC_PTRS_END
/* Begin processing text. */
int
-gx_device_text_begin(gx_device * dev, gs_imager_state * pis,
+gx_device_text_begin(gx_device * dev, gs_gstate * pgs,
const gs_text_params_t * text, gs_font * font,
gx_path * path, /* unless DO_NONE & !RETURN_WIDTH */
const gx_device_color * pdcolor, /* DO_DRAW */
@@ -138,7 +138,7 @@ gx_device_text_begin(gx_device * dev, gs_imager_state * pis,
Since the accumulation may happen while stringwidth.
we pass the device color unconditionally. */
return dev_proc(dev, text_begin)
- (dev, pis, text, font, tpath, pdcolor, tcpath, mem, ppte);
+ (dev, pgs, text, font, tpath, pdcolor, tcpath, mem, ppte);
}
}
@@ -161,7 +161,7 @@ gs_text_enum_init_dynamic(gs_text_enum_t *pte, gs_font *font)
}
int
gs_text_enum_init(gs_text_enum_t *pte, const gs_text_enum_procs_t *procs,
- gx_device *dev, gs_imager_state *pis,
+ gx_device *dev, gs_gstate *pgs,
const gs_text_params_t *text, gs_font *font, gx_path *path,
const gx_device_color *pdcolor, const gx_clip_path *pcpath,
gs_memory_t *mem)
@@ -171,7 +171,7 @@ gs_text_enum_init(gs_text_enum_t *pte, const gs_text_enum_procs_t *procs,
pte->text = *text;
pte->dev = dev;
pte->imaging_dev = NULL;
- pte->pis = pis;
+ pte->pgs = pgs;
pte->orig_font = font;
pte->path = path;
pte->pdcolor = pdcolor;
@@ -196,7 +196,7 @@ gs_text_enum_init(gs_text_enum_t *pte, const gs_text_enum_procs_t *procs,
}
gs_text_enum_t *
-gs_text_enum_alloc(gs_memory_t * mem, gs_imager_state * pis, client_name_t cname)
+gs_text_enum_alloc(gs_memory_t * mem, gs_gstate * pgs, client_name_t cname)
{
gs_text_enum_t *penum;
@@ -207,7 +207,7 @@ gs_text_enum_alloc(gs_memory_t * mem, gs_imager_state * pis, client_name_t cname
/* Initialize pointers for GC */
penum->text.operation = 0; /* no pointers relevant */
penum->dev = 0;
- penum->pis = pis;
+ penum->pgs = pgs;
penum->fapi_log2_scale.x = penum->fapi_log2_scale.y = -1;
penum->fapi_glyph_shift.x = penum->fapi_glyph_shift.y = 0;
penum->fstack.depth = -1;
@@ -244,7 +244,7 @@ gs_text_enum_copy_dynamic(gs_text_enum_t *pto, const gs_text_enum_t *pfrom,
/* Begin processing text based on a graphics state. */
int
-gs_text_begin(gs_state * pgs, const gs_text_params_t * text,
+gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gx_clip_path *pcpath = 0;
@@ -284,11 +284,11 @@ gs_text_begin(gs_state * pgs, const gs_text_params_t * text,
code = gx_set_dev_color(pgs);
if (code != 0)
return code;
- code = gs_state_color_load(pgs);
+ code = gs_gstate_color_load(pgs);
if (code < 0)
return code;
pgs->device->sgr.stroke_stored = false;
- return gx_device_text_begin(pgs->device, (gs_imager_state *) pgs,
+ return gx_device_text_begin(pgs->device, pgs,
text, pgs->font, pgs->path,
gs_currentdevicecolor_inline(pgs),
pcpath, mem, ppte);
@@ -299,7 +299,7 @@ gs_text_begin(gs_state * pgs, const gs_text_params_t * text,
* cshow procedure may have changed the current color).
*/
int
-gs_text_update_dev_color(gs_state * pgs, gs_text_enum_t * pte)
+gs_text_update_dev_color(gs_gstate * pgs, gs_text_enum_t * pte)
{
/*
* The text enumerator holds a device color pointer, which may be a
@@ -320,7 +320,7 @@ gs_text_update_dev_color(gs_state * pgs, gs_text_enum_t * pte)
return 0;
}
-static inline uint text_do_draw(gs_state * pgs)
+static inline uint text_do_draw(gs_gstate * pgs)
{
return (pgs->text_rendering_mode == 3 ?
TEXT_DO_NONE | TEXT_RENDER_MODE_3 : TEXT_DO_DRAW);
@@ -328,7 +328,7 @@ static inline uint text_do_draw(gs_state * pgs)
/* Begin PostScript-equivalent text operations. */
int
-gs_show_begin(gs_state * pgs, const byte * str, uint size,
+gs_show_begin(gs_gstate * pgs, const byte * str, uint size,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -338,7 +338,7 @@ gs_show_begin(gs_state * pgs, const byte * str, uint size,
return gs_text_begin(pgs, &text, mem, ppte);
}
int
-gs_ashow_begin(gs_state * pgs, double ax, double ay, const byte * str, uint size,
+gs_ashow_begin(gs_gstate * pgs, double ax, double ay, const byte * str, uint size,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -351,7 +351,7 @@ gs_ashow_begin(gs_state * pgs, double ax, double ay, const byte * str, uint size
return gs_text_begin(pgs, &text, mem, ppte);
}
int
-gs_widthshow_begin(gs_state * pgs, double cx, double cy, gs_char chr,
+gs_widthshow_begin(gs_gstate * pgs, double cx, double cy, gs_char chr,
const byte * str, uint size,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
@@ -366,7 +366,7 @@ gs_widthshow_begin(gs_state * pgs, double cx, double cy, gs_char chr,
return gs_text_begin(pgs, &text, mem, ppte);
}
int
-gs_awidthshow_begin(gs_state * pgs, double cx, double cy, gs_char chr,
+gs_awidthshow_begin(gs_gstate * pgs, double cx, double cy, gs_char chr,
double ax, double ay, const byte * str, uint size,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
@@ -384,7 +384,7 @@ gs_awidthshow_begin(gs_state * pgs, double cx, double cy, gs_char chr,
return gs_text_begin(pgs, &text, mem, ppte);
}
int
-gs_kshow_begin(gs_state * pgs, const byte * str, uint size,
+gs_kshow_begin(gs_gstate * pgs, const byte * str, uint size,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -406,7 +406,7 @@ gs_get_text_params(gs_text_enum_t *pte)
}
int
-gs_xyshow_begin(gs_state * pgs, const byte * str, uint size,
+gs_xyshow_begin(gs_gstate * pgs, const byte * str, uint size,
const float *x_widths, const float *y_widths,
uint widths_size, gs_memory_t * mem, gs_text_enum_t ** ppte)
{
@@ -456,7 +456,7 @@ setup_FontBBox_as_Metrics2 (gs_text_enum_t * pte, gs_font * pfont)
}
int
-gs_glyphshow_begin(gs_state * pgs, gs_glyph glyph,
+gs_glyphshow_begin(gs_gstate * pgs, gs_glyph glyph,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -471,7 +471,7 @@ gs_glyphshow_begin(gs_state * pgs, gs_glyph glyph,
return result;
}
int
-gs_cshow_begin(gs_state * pgs, const byte * str, uint size,
+gs_cshow_begin(gs_gstate * pgs, const byte * str, uint size,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -481,7 +481,7 @@ gs_cshow_begin(gs_state * pgs, const byte * str, uint size,
return gs_text_begin(pgs, &text, mem, ppte);
}
int
-gs_stringwidth_begin(gs_state * pgs, const byte * str, uint size,
+gs_stringwidth_begin(gs_gstate * pgs, const byte * str, uint size,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -491,7 +491,7 @@ gs_stringwidth_begin(gs_state * pgs, const byte * str, uint size,
return gs_text_begin(pgs, &text, mem, ppte);
}
int
-gs_charpath_begin(gs_state * pgs, const byte * str, uint size, bool stroke_path,
+gs_charpath_begin(gs_gstate * pgs, const byte * str, uint size, bool stroke_path,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -502,7 +502,7 @@ gs_charpath_begin(gs_state * pgs, const byte * str, uint size, bool stroke_path,
return gs_text_begin(pgs, &text, mem, ppte);
}
int
-gs_charboxpath_begin(gs_state * pgs, const byte * str, uint size,
+gs_charboxpath_begin(gs_gstate * pgs, const byte * str, uint size,
bool stroke_path, gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -513,7 +513,7 @@ gs_charboxpath_begin(gs_state * pgs, const byte * str, uint size,
return gs_text_begin(pgs, &text, mem, ppte);
}
int
-gs_glyphpath_begin(gs_state * pgs, gs_glyph glyph, bool stroke_path,
+gs_glyphpath_begin(gs_gstate * pgs, gs_glyph glyph, bool stroke_path,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -529,7 +529,7 @@ gs_glyphpath_begin(gs_state * pgs, gs_glyph glyph, bool stroke_path,
return result;
}
int
-gs_glyphwidth_begin(gs_state * pgs, gs_glyph glyph,
+gs_glyphwidth_begin(gs_gstate * pgs, gs_glyph glyph,
gs_memory_t * mem, gs_text_enum_t ** ppte)
{
gs_text_params_t text;
@@ -745,7 +745,7 @@ gs_default_next_char_glyph(gs_text_enum_t *pte, gs_char *pchr, gs_glyph *pglyph)
/* Dummy (ineffective) BuildChar/BuildGlyph procedure */
int
-gs_no_build_char(gs_show_enum *pte, gs_state *pgs, gs_font *pfont,
+gs_no_build_char(gs_show_enum *pte, gs_gstate *pgs, gs_font *pfont,
gs_char chr, gs_glyph glyph)
{
return 1; /* failure, but not error */
diff --git a/base/gstext.h b/base/gstext.h
index f5bc0041e..be70dd657 100644
--- a/base/gstext.h
+++ b/base/gstext.h
@@ -149,9 +149,9 @@ typedef struct gs_text_enum_s gs_text_enum_t;
# define gx_device_DEFINED
typedef struct gx_device_s gx_device;
#endif
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gx_device_color_DEFINED
# define gx_device_color_DEFINED
@@ -176,7 +176,7 @@ typedef struct gx_clip_path_s gx_clip_path;
*/
#define dev_t_proc_text_begin(proc, dev_t)\
int proc(dev_t *dev,\
- gs_imager_state *pis,\
+ gs_gstate *pgs,\
const gs_text_params_t *text,\
gs_font *font,\
gx_path *path, /* unless DO_NONE */\
@@ -194,53 +194,53 @@ typedef struct gx_clip_path_s gx_clip_path;
dev_proc_text_begin(gx_device_text_begin);
/* Begin processing text with a graphics state. */
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
-int gs_text_begin(gs_state * pgs, const gs_text_params_t * text,
+int gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
gs_memory_t * mem, gs_text_enum_t ** ppenum);
/*
* Update the device color to be used with text (because a kshow or
* cshow procedure may have changed the current color).
*/
-int gs_text_update_dev_color(gs_state * pgs, gs_text_enum_t * pte);
+int gs_text_update_dev_color(gs_gstate * pgs, gs_text_enum_t * pte);
/* Begin the PostScript-equivalent text operators. */
int
-gs_show_begin(gs_state *, const byte *, uint,
+gs_show_begin(gs_gstate *, const byte *, uint,
gs_memory_t *, gs_text_enum_t **),
- gs_ashow_begin(gs_state *, double, double, const byte *, uint,
+ gs_ashow_begin(gs_gstate *, double, double, const byte *, uint,
gs_memory_t *, gs_text_enum_t **),
- gs_widthshow_begin(gs_state *, double, double, gs_char,
+ gs_widthshow_begin(gs_gstate *, double, double, gs_char,
const byte *, uint,
gs_memory_t *, gs_text_enum_t **),
- gs_awidthshow_begin(gs_state *, double, double, gs_char,
+ gs_awidthshow_begin(gs_gstate *, double, double, gs_char,
double, double, const byte *, uint,
gs_memory_t *, gs_text_enum_t **),
- gs_kshow_begin(gs_state *, const byte *, uint,
+ gs_kshow_begin(gs_gstate *, const byte *, uint,
gs_memory_t *, gs_text_enum_t **),
- gs_xyshow_begin(gs_state *, const byte *, uint,
+ gs_xyshow_begin(gs_gstate *, const byte *, uint,
const float *, const float *, uint,
gs_memory_t *, gs_text_enum_t **),
- gs_glyphshow_begin(gs_state *, gs_glyph,
+ gs_glyphshow_begin(gs_gstate *, gs_glyph,
gs_memory_t *, gs_text_enum_t **),
- gs_cshow_begin(gs_state *, const byte *, uint,
+ gs_cshow_begin(gs_gstate *, const byte *, uint,
gs_memory_t *, gs_text_enum_t **),
- gs_stringwidth_begin(gs_state *, const byte *, uint,
+ gs_stringwidth_begin(gs_gstate *, const byte *, uint,
gs_memory_t *, gs_text_enum_t **),
- gs_charpath_begin(gs_state *, const byte *, uint, bool,
+ gs_charpath_begin(gs_gstate *, const byte *, uint, bool,
gs_memory_t *, gs_text_enum_t **),
- gs_glyphpath_begin(gs_state *, gs_glyph, bool,
+ gs_glyphpath_begin(gs_gstate *, gs_glyph, bool,
gs_memory_t *, gs_text_enum_t **),
- gs_glyphwidth_begin(gs_state *, gs_glyph,
+ gs_glyphwidth_begin(gs_gstate *, gs_glyph,
gs_memory_t *, gs_text_enum_t **),
- gs_charboxpath_begin(gs_state *, const byte *, uint, bool,
+ gs_charboxpath_begin(gs_gstate *, const byte *, uint, bool,
gs_memory_t *, gs_text_enum_t **);
/* Compute the number of characters in a text. */
-int gs_text_size(gs_state * pgs, gs_text_params_t *text, gs_memory_t * mem);
+int gs_text_size(gs_gstate * pgs, gs_text_params_t *text, gs_memory_t * mem);
/* Retrieve text params from enumerator. */
gs_text_params_t *gs_get_text_params(gs_text_enum_t *pte);
@@ -328,6 +328,6 @@ int gs_text_retry(gs_text_enum_t *pte);
void gs_text_release(gs_text_enum_t *pte, client_name_t cname);
/* Compute the number of characters in a text. */
-int gs_text_count_chars(gs_state * pgs, gs_text_params_t *text, gs_memory_t * mem);
+int gs_text_count_chars(gs_gstate * pgs, gs_text_params_t *text, gs_memory_t * mem);
#endif /* gstext_INCLUDED */
diff --git a/base/gstrans.c b/base/gstrans.c
index f37a2dcf0..9b00b93d6 100644
--- a/base/gstrans.c
+++ b/base/gstrans.c
@@ -34,7 +34,7 @@
/* ------ Transparency-related graphics state elements ------ */
int
-gs_setblendmode(gs_state *pgs, gs_blend_mode_t mode)
+gs_setblendmode(gs_gstate *pgs, gs_blend_mode_t mode)
{
#ifdef DEBUG
if (gs_debug_c('v')) {
@@ -59,13 +59,13 @@ gs_setblendmode(gs_state *pgs, gs_blend_mode_t mode)
}
gs_blend_mode_t
-gs_currentblendmode(const gs_state *pgs)
+gs_currentblendmode(const gs_gstate *pgs)
{
return pgs->blend_mode;
}
int
-gs_setopacityalpha(gs_state *pgs, double alpha)
+gs_setopacityalpha(gs_gstate *pgs, double alpha)
{
if_debug2m('v', pgs->memory, "[v](0x%lx)opacity.alpha = %g\n", (ulong)pgs, alpha);
pgs->opacity.alpha = (alpha < 0.0 ? 0.0 : alpha > 1.0 ? 1.0 : alpha);
@@ -73,13 +73,13 @@ gs_setopacityalpha(gs_state *pgs, double alpha)
}
float
-gs_currentopacityalpha(const gs_state *pgs)
+gs_currentopacityalpha(const gs_gstate *pgs)
{
return pgs->opacity.alpha;
}
int
-gs_setshapealpha(gs_state *pgs, double alpha)
+gs_setshapealpha(gs_gstate *pgs, double alpha)
{
if_debug2m('v', pgs->memory, "[v](0x%lx)shape.alpha = %g\n", (ulong)pgs, alpha);
pgs->shape.alpha = (alpha < 0.0 ? 0.0 : alpha > 1.0 ? 1.0 : alpha);
@@ -87,13 +87,13 @@ gs_setshapealpha(gs_state *pgs, double alpha)
}
float
-gs_currentshapealpha(const gs_state *pgs)
+gs_currentshapealpha(const gs_gstate *pgs)
{
return pgs->shape.alpha;
}
int
-gs_settextknockout(gs_state *pgs, bool knockout)
+gs_settextknockout(gs_gstate *pgs, bool knockout)
{
if_debug2m('v', pgs->memory, "[v](0x%lx)text_knockout = %s\n",
(ulong)pgs, (knockout ? "true" : "false"));
@@ -102,7 +102,7 @@ gs_settextknockout(gs_state *pgs, bool knockout)
}
bool
-gs_currenttextknockout(const gs_state *pgs)
+gs_currenttextknockout(const gs_gstate *pgs)
{
return pgs->text_knockout;
}
@@ -115,7 +115,7 @@ gs_currenttextknockout(const gs_state *pgs)
be entered as compositor actions in the pattern clist */
static int
-check_for_nontrans_pattern(gs_state *pgs, unsigned char *comp_name)
+check_for_nontrans_pattern(gs_gstate *pgs, unsigned char *comp_name)
{
gx_device * dev = pgs->device;
bool is_patt_clist = gx_device_is_pattern_clist(dev);
@@ -155,9 +155,8 @@ check_for_nontrans_pattern(gs_state *pgs, unsigned char *comp_name)
* compositor device.
*/
static int
-gs_state_update_pdf14trans(gs_state * pgs, gs_pdf14trans_params_t * pparams)
+gs_gstate_update_pdf14trans(gs_gstate * pgs, gs_pdf14trans_params_t * pparams)
{
- gs_imager_state * pis = (gs_imager_state *)pgs;
gx_device * dev = pgs->device;
gx_device *pdf14dev = NULL;
int code;
@@ -166,7 +165,7 @@ gs_state_update_pdf14trans(gs_state * pgs, gs_pdf14trans_params_t * pparams)
/*
* Send the PDF 1.4 create compositor action specified by the parameters.
*/
- code = send_pdf14trans(pis, dev, &pdf14dev, pparams, pgs->memory);
+ code = send_pdf14trans(pgs, dev, &pdf14dev, pparams, pgs->memory);
if (code < 0)
return code;
/*
@@ -198,23 +197,22 @@ gs_trans_group_params_init(gs_transparency_group_params_t *ptgp)
}
int
-gs_update_trans_marking_params(gs_state * pgs)
+gs_update_trans_marking_params(gs_gstate * pgs)
{
gs_pdf14trans_params_t params = { 0 };
if_debug0m('v', pgs->memory, "[v]gs_update_trans_marking_params\n");
params.pdf14_op = PDF14_SET_BLEND_PARAMS;
- return gs_state_update_pdf14trans(pgs, &params);
+ return gs_gstate_update_pdf14trans(pgs, &params);
}
int
-gs_begin_transparency_group(gs_state *pgs,
+gs_begin_transparency_group(gs_gstate *pgs,
const gs_transparency_group_params_t *ptgp,
const gs_rect *pbbox)
{
gs_pdf14trans_params_t params = { 0 };
const gs_color_space *blend_color_space;
- gs_imager_state * pis = (gs_imager_state *)pgs;
cmm_profile_t *profile;
if (check_for_nontrans_pattern(pgs,
@@ -247,7 +245,7 @@ gs_begin_transparency_group(gs_state *pgs,
ICC default color space in these cases. */
blend_color_space = gs_currentcolorspace_inline(pgs);
} else {
- blend_color_space = cs_concrete_space(blend_color_space, pis);
+ blend_color_space = cs_concrete_space(blend_color_space, pgs);
}
/* Note that if the /CS parameter was NOT present in the push
of the transparency group, then we must actually inherent
@@ -327,11 +325,11 @@ gs_begin_transparency_group(gs_state *pgs,
}
#endif
params.bbox = *pbbox;
- return gs_state_update_pdf14trans(pgs, &params);
+ return gs_gstate_update_pdf14trans(pgs, &params);
}
int
-gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
+gx_begin_transparency_group(gs_gstate * pgs, gx_device * pdev,
const gs_pdf14trans_params_t * pparams)
{
gs_transparency_group_params_t tgp = {0};
@@ -351,9 +349,9 @@ gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
tgp.iccprofile = pparams->iccprofile;
tgp.icc_hashcode = pparams->icc_hash;
- pis->opacity.alpha = pparams->opacity.alpha;
- pis->shape.alpha = pparams->shape.alpha;
- pis->blend_mode = pparams->blend_mode;
+ pgs->opacity.alpha = pparams->opacity.alpha;
+ pgs->shape.alpha = pparams->shape.alpha;
+ pgs->blend_mode = pparams->blend_mode;
bbox = pparams->bbox;
#ifdef DEBUG
if (gs_debug_c('v')) {
@@ -361,7 +359,7 @@ gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
GS_COLOR_SPACE_TYPE_NAMES
};
dmlprintf6(pdev->memory, "[v](0x%lx)gx_begin_transparency_group [%g %g %g %g] Num_grp_clr_comp = %d\n",
- (ulong)pis, bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y,
+ (ulong)pgs, bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y,
pparams->group_color_numcomps);
if (tgp.ColorSpace)
dmprintf1(pdev->memory, " CS = %s",
@@ -375,32 +373,32 @@ gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
}
#endif
if (dev_proc(pdev, begin_transparency_group) != 0)
- return (*dev_proc(pdev, begin_transparency_group)) (pdev, &tgp, &bbox, pis,
+ return (*dev_proc(pdev, begin_transparency_group)) (pdev, &tgp, &bbox, pgs,
NULL);
else
return 0;
}
int
-gs_end_transparency_group(gs_state *pgs)
+gs_end_transparency_group(gs_gstate *pgs)
{
gs_pdf14trans_params_t params = { 0 };
- if (pgs->is_gstate && check_for_nontrans_pattern(pgs,
+ if (check_for_nontrans_pattern(pgs,
(unsigned char *)"gs_end_transparency_group")) {
return(0);
}
if_debug0m('v', pgs->memory, "[v]gs_end_transparency_group\n");
params.pdf14_op = PDF14_END_TRANS_GROUP; /* Other parameters not used */
- return gs_state_update_pdf14trans(pgs, &params);
+ return gs_gstate_update_pdf14trans(pgs, &params);
}
int
-gx_end_transparency_group(gs_imager_state * pis, gx_device * pdev)
+gx_end_transparency_group(gs_gstate * pgs, gx_device * pdev)
{
- if_debug0m('v', pis->memory, "[v]gx_end_transparency_group\n");
+ if_debug0m('v', pgs->memory, "[v]gx_end_transparency_group\n");
if (dev_proc(pdev, end_transparency_group) != 0)
- return (*dev_proc(pdev, end_transparency_group)) (pdev, pis);
+ return (*dev_proc(pdev, end_transparency_group)) (pdev, pgs);
else
return 0;
}
@@ -408,10 +406,9 @@ gx_end_transparency_group(gs_imager_state * pis, gx_device * pdev)
/* Commands for handling q softmask Q in graphic states */
int
-gs_push_transparency_state(gs_state *pgs)
+gs_push_transparency_state(gs_gstate *pgs)
{
gs_pdf14trans_params_t params = { 0 };
- gs_imager_state * pis = (gs_imager_state *)pgs;
int code;
if (check_for_nontrans_pattern(pgs,
@@ -422,7 +419,7 @@ gs_push_transparency_state(gs_state *pgs)
that we need to watch for end transparency
soft masks when we are at this graphic state
level */
- /* pis->trans_flags.xstate_pending = true; */
+ /* pgs->trans_flags.xstate_pending = true; */
/* Actually I believe the above flag is not
needed. We really should be watching for
the softmask even at the base level. What
@@ -433,10 +430,10 @@ gs_push_transparency_state(gs_state *pgs)
We will need to send a push state to save
the current soft mask, so that we can
restore it later */
- if (pis->trans_flags.xstate_change) {
+ if (pgs->trans_flags.xstate_change) {
if_debug0m('v', pgs->memory, "[v]gs_push_transparency_state sending\n");
params.pdf14_op = PDF14_PUSH_TRANS_STATE;
- code = gs_state_update_pdf14trans(pgs, &params);
+ code = gs_gstate_update_pdf14trans(pgs, &params);
if (code < 0)
return(code);
} else {
@@ -446,10 +443,9 @@ gs_push_transparency_state(gs_state *pgs)
}
int
-gs_pop_transparency_state(gs_state *pgs, bool force)
+gs_pop_transparency_state(gs_gstate *pgs, bool force)
{
gs_pdf14trans_params_t params = { 0 };
- gs_imager_state * pis = (gs_imager_state *)pgs;
int code;
if (check_for_nontrans_pattern(pgs,
@@ -460,10 +456,10 @@ gs_pop_transparency_state(gs_state *pgs, bool force)
an active softmask for the graphic state. We
need to communicate to the compositor to pop
the softmask */
- if ( pis->trans_flags.xstate_change || force) {
+ if ( pgs->trans_flags.xstate_change || force) {
if_debug0m('v', pgs->memory, "[v]gs_pop_transparency_state sending\n");
params.pdf14_op = PDF14_POP_TRANS_STATE;
- code = gs_state_update_pdf14trans(pgs, &params);
+ code = gs_gstate_update_pdf14trans(pgs, &params);
if ( code < 0 )
return (code);
} else {
@@ -475,21 +471,21 @@ gs_pop_transparency_state(gs_state *pgs, bool force)
}
int
-gx_pop_transparency_state(gs_imager_state * pis, gx_device * pdev)
+gx_pop_transparency_state(gs_gstate * pgs, gx_device * pdev)
{
- if_debug0m('v', pis->memory, "[v]gx_pop_transparency_state\n");
+ if_debug0m('v', pgs->memory, "[v]gx_pop_transparency_state\n");
if (dev_proc(pdev, pop_transparency_state) != 0)
- return (*dev_proc(pdev, pop_transparency_state)) (pdev, pis);
+ return (*dev_proc(pdev, pop_transparency_state)) (pdev, pgs);
else
return 0;
}
int
-gx_push_transparency_state(gs_imager_state * pis, gx_device * pdev)
+gx_push_transparency_state(gs_gstate * pgs, gx_device * pdev)
{
- if_debug0m('v', pis->memory, "[v]gx_push_transparency_state\n");
+ if_debug0m('v', pgs->memory, "[v]gx_push_transparency_state\n");
if (dev_proc(pdev, push_transparency_state) != 0)
- return (*dev_proc(pdev, push_transparency_state)) (pdev, pis);
+ return (*dev_proc(pdev, push_transparency_state)) (pdev, pgs);
else
return 0;
}
@@ -519,7 +515,7 @@ gs_trans_mask_params_init(gs_transparency_mask_params_t *ptmp,
}
int
-gs_begin_transparency_mask(gs_state * pgs,
+gs_begin_transparency_mask(gs_gstate * pgs,
const gs_transparency_mask_params_t * ptmp,
const gs_rect * pbbox, bool mask_is_image)
{
@@ -564,7 +560,7 @@ gs_begin_transparency_mask(gs_state * pgs,
if_debug0m('v', pgs->memory, "[v]pushing soft mask color sending\n");
if (params.subtype != TRANSPARENCY_MASK_None) {
params_color.pdf14_op = PDF14_PUSH_SMASK_COLOR;
- code = gs_state_update_pdf14trans(pgs, &params_color);
+ code = gs_gstate_update_pdf14trans(pgs, &params_color);
if (code < 0)
return(code);
blend_color_space = gs_cspace_new_DeviceGray(pgs->memory);
@@ -607,13 +603,13 @@ gs_begin_transparency_mask(gs_state * pgs,
rc_decrement(blend_color_space->cmm_icc_profile_data, "gs_begin_transparency_mask");
rc_decrement_only_cs(blend_color_space, "gs_begin_transparency_mask");
}
- return gs_state_update_pdf14trans(pgs, &params);
+ return gs_gstate_update_pdf14trans(pgs, &params);
}
/* This occurs on the c-list reader side */
int
-gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
+gx_begin_transparency_mask(gs_gstate * pgs, gx_device * pdev,
const gs_pdf14trans_params_t * pparams)
{
gx_transparency_mask_params_t tmp;
@@ -639,10 +635,10 @@ gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
tmp.icc_hashcode = 0;
}
memcpy(tmp.transfer_fn, pparams->transfer_fn, size_of(tmp.transfer_fn));
- if_debug9m('v', pis->memory,
+ if_debug9m('v', pgs->memory,
"[v](0x%lx)gx_begin_transparency_mask [%g %g %g %g]\n"
" subtype = %d Background_components = %d Num_grp_clr_comp = %d %s\n",
- (ulong)pis, pparams->bbox.p.x, pparams->bbox.p.y,
+ (ulong)pgs, pparams->bbox.p.x, pparams->bbox.p.y,
pparams->bbox.q.x, pparams->bbox.q.y,
(int)tmp.subtype, tmp.Background_components,
tmp.group_color_numcomps,
@@ -650,18 +646,17 @@ gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
"has TR"));
if (dev_proc(pdev, begin_transparency_mask) != 0)
return (*dev_proc(pdev, begin_transparency_mask))
- (pdev, &tmp, &(pparams->bbox), pis, NULL);
+ (pdev, &tmp, &(pparams->bbox), pgs, NULL);
else
return 0;
}
int
-gs_end_transparency_mask(gs_state *pgs,
+gs_end_transparency_mask(gs_gstate *pgs,
gs_transparency_channel_selector_t csel)
{
gs_pdf14trans_params_t params = { 0 };
gs_pdf14trans_params_t params_color = { 0 };
- gs_imager_state * pis = (gs_imager_state *)pgs;
int code;
if (check_for_nontrans_pattern(pgs,
@@ -669,40 +664,40 @@ gs_end_transparency_mask(gs_state *pgs,
return(0);
}
/* If we have done a q then set a flag to watch for any Qs */
- /* if (pis->trans_flags.xstate_pending)
- pis->trans_flags.xstate_change = true; */
+ /* if (pgs->trans_flags.xstate_pending)
+ pgs->trans_flags.xstate_change = true; */
/* This should not depend upon if we have encountered a q
operation. We could be setting a softmask, before
there is any q operation. Unlikely but it could happen.
Then if we encouter a q operation (and this flag
is true) we will need to
push the mask graphic state (PDF14_PUSH_TRANS_STATE). */
- pis->trans_flags.xstate_change = true;
- if_debug1m('v', pis->memory,
+ pgs->trans_flags.xstate_change = true;
+ if_debug1m('v', pgs->memory,
"[v]xstate_changed set true, gstate level is %d\n", pgs->level);
- if_debug2m('v', pis->memory,
+ if_debug2m('v', pgs->memory,
"[v](0x%lx)gs_end_transparency_mask(%d)\n", (ulong)pgs,
(int)csel);
params.pdf14_op = PDF14_END_TRANS_MASK; /* Other parameters not used */
params.csel = csel;
/* If this is the outer end then return us to our normal defaults */
- if_debug0m('v', pis->memory, "[v]popping soft mask color sending\n");
+ if_debug0m('v', pgs->memory, "[v]popping soft mask color sending\n");
params_color.pdf14_op = PDF14_POP_SMASK_COLOR;
- code = gs_state_update_pdf14trans(pgs, &params_color);
+ code = gs_gstate_update_pdf14trans(pgs, &params_color);
if (code < 0)
return(code);
- return gs_state_update_pdf14trans(pgs, &params);
+ return gs_gstate_update_pdf14trans(pgs, &params);
}
int
-gx_end_transparency_mask(gs_imager_state * pis, gx_device * pdev,
+gx_end_transparency_mask(gs_gstate * pgs, gx_device * pdev,
const gs_pdf14trans_params_t * pparams)
{
- if_debug2m('v', pis->memory,
- "[v](0x%lx)gx_end_transparency_mask(%d)\n", (ulong)pis,
+ if_debug2m('v', pgs->memory,
+ "[v](0x%lx)gx_end_transparency_mask(%d)\n", (ulong)pgs,
(int)pparams->csel);
if (dev_proc(pdev, end_transparency_mask) != 0)
- return (*dev_proc(pdev, end_transparency_mask)) (pdev, pis);
+ return (*dev_proc(pdev, end_transparency_mask)) (pdev, pgs);
else
return 0;
}
@@ -714,7 +709,7 @@ gx_end_transparency_mask(gs_imager_state * pis, gx_device * pdev,
* and convert spot colors into process colors.
*/
static int
-get_num_pdf14_spot_colors(gs_state * pgs)
+get_num_pdf14_spot_colors(gs_gstate * pgs)
{
gx_device * dev = pgs->device;
gs_devn_params * pclist_devn_params = dev_proc(dev, ret_devn_params)(dev);
@@ -743,7 +738,7 @@ get_num_pdf14_spot_colors(gs_state * pgs)
}
int
-gs_push_pdf14trans_device(gs_state * pgs, bool is_pattern)
+gs_push_pdf14trans_device(gs_gstate * pgs, bool is_pattern)
{
gs_pdf14trans_params_t params = { 0 };
cmm_profile_t *icc_profile;
@@ -774,36 +769,36 @@ gs_push_pdf14trans_device(gs_state * pgs, bool is_pattern)
params.iccprofile = pgs->icc_manager->default_rgb;
}
/* Note: Other parameters not used */
- return gs_state_update_pdf14trans(pgs, &params);
+ return gs_gstate_update_pdf14trans(pgs, &params);
}
int
-gs_pop_pdf14trans_device(gs_state * pgs, bool is_pattern)
+gs_pop_pdf14trans_device(gs_gstate * pgs, bool is_pattern)
{
gs_pdf14trans_params_t params = { 0 };
params.is_pattern = is_pattern;
params.pdf14_op = PDF14_POP_DEVICE; /* Other parameters not used */
- return gs_state_update_pdf14trans(pgs, &params);
+ return gs_gstate_update_pdf14trans(pgs, &params);
}
int
-gs_abort_pdf14trans_device(gs_state * pgs)
+gs_abort_pdf14trans_device(gs_gstate * pgs)
{
gs_pdf14trans_params_t params = { 0 };
params.pdf14_op = PDF14_ABORT_DEVICE; /* Other parameters not used */
- return gs_state_update_pdf14trans(pgs, &params);
+ return gs_gstate_update_pdf14trans(pgs, &params);
}
/* Something has gone wrong have the device clean up everything */
int
-gx_abort_trans_device(gs_imager_state * pis, gx_device * pdev)
+gx_abort_trans_device(gs_gstate * pgs, gx_device * pdev)
{
- if_debug1m('v', pis->memory, "[v](0x%lx)gx_abort_trans_device\n", (ulong)pis);
+ if_debug1m('v', pgs->memory, "[v](0x%lx)gx_abort_trans_device\n", (ulong)pgs);
if (dev_proc(pdev, discard_transparency_layer) != 0)
- return (*dev_proc(pdev, discard_transparency_layer)) (pdev, pis);
+ return (*dev_proc(pdev, discard_transparency_layer)) (pdev, pgs);
else
return 0;
}
diff --git a/base/gstrans.h b/base/gstrans.h
index dc14d8477..23fc14de5 100644
--- a/base/gstrans.h
+++ b/base/gstrans.h
@@ -140,60 +140,60 @@ typedef struct gs_pdf14trans_s {
} gs_pdf14trans_t;
/* Access transparency-related graphics state elements. */
-int gs_setblendmode(gs_state *, gs_blend_mode_t);
-gs_blend_mode_t gs_currentblendmode(const gs_state *);
-int gs_setopacityalpha(gs_state *, double);
-float gs_currentopacityalpha(const gs_state *);
-int gs_setshapealpha(gs_state *, double);
-float gs_currentshapealpha(const gs_state *);
-int gs_settextknockout(gs_state *, bool);
-bool gs_currenttextknockout(const gs_state *);
+int gs_setblendmode(gs_gstate *, gs_blend_mode_t);
+gs_blend_mode_t gs_currentblendmode(const gs_gstate *);
+int gs_setopacityalpha(gs_gstate *, double);
+float gs_currentopacityalpha(const gs_gstate *);
+int gs_setshapealpha(gs_gstate *, double);
+float gs_currentshapealpha(const gs_gstate *);
+int gs_settextknockout(gs_gstate *, bool);
+bool gs_currenttextknockout(const gs_gstate *);
/*
* We have to abbreviate the procedure name because procedure names are
* only unique to 23 characters on VMS.
*/
-int gs_push_pdf14trans_device(gs_state * pgs, bool is_pattern);
+int gs_push_pdf14trans_device(gs_gstate * pgs, bool is_pattern);
-int gs_pop_pdf14trans_device(gs_state * pgs, bool is_pattern);
+int gs_pop_pdf14trans_device(gs_gstate * pgs, bool is_pattern);
-int gs_abort_pdf14trans_device(gs_state * pgs);
+int gs_abort_pdf14trans_device(gs_gstate * pgs);
void gs_trans_group_params_init(gs_transparency_group_params_t *ptgp);
-int gs_update_trans_marking_params(gs_state * pgs);
+int gs_update_trans_marking_params(gs_gstate * pgs);
-int gs_begin_transparency_group(gs_state * pgs,
+int gs_begin_transparency_group(gs_gstate * pgs,
const gs_transparency_group_params_t *ptgp,
const gs_rect *pbbox);
-int gs_end_transparency_group(gs_state *pgs);
+int gs_end_transparency_group(gs_gstate *pgs);
void gs_trans_mask_params_init(gs_transparency_mask_params_t *ptmp,
gs_transparency_mask_subtype_t subtype);
-int gs_begin_transparency_mask(gs_state *pgs,
+int gs_begin_transparency_mask(gs_gstate *pgs,
const gs_transparency_mask_params_t *ptmp,
const gs_rect *pbbox, bool mask_is_image);
-int gs_end_transparency_mask(gs_state *pgs,
+int gs_end_transparency_mask(gs_gstate *pgs,
gs_transparency_channel_selector_t csel);
/*
* Imager level routines for the PDF 1.4 transparency operations.
*/
-int gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
+int gx_begin_transparency_group(gs_gstate * pgs, gx_device * pdev,
const gs_pdf14trans_params_t * pparams);
-int gx_end_transparency_group(gs_imager_state * pis, gx_device * pdev);
+int gx_end_transparency_group(gs_gstate * pgs, gx_device * pdev);
-int gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
+int gx_begin_transparency_mask(gs_gstate * pgs, gx_device * pdev,
const gs_pdf14trans_params_t * pparams);
-int gx_end_transparency_mask(gs_imager_state * pis, gx_device * pdev,
+int gx_end_transparency_mask(gs_gstate * pgs, gx_device * pdev,
const gs_pdf14trans_params_t * pparams);
-int gx_abort_trans_device(gs_imager_state * pis, gx_device * pdev);
+int gx_abort_trans_device(gs_gstate * pgs, gx_device * pdev);
/* These are used for watching for q Smask Q events. We need to
@@ -203,13 +203,13 @@ int gx_abort_trans_device(gs_imager_state * pis, gx_device * pdev);
clist writer side and the gx functions occur on the
clist reader side */
-int gs_push_transparency_state(gs_state *pgs);
+int gs_push_transparency_state(gs_gstate *pgs);
-int gs_pop_transparency_state(gs_state *pgs, bool force);
+int gs_pop_transparency_state(gs_gstate *pgs, bool force);
-int gx_push_transparency_state(gs_imager_state * pis, gx_device * pdev);
+int gx_push_transparency_state(gs_gstate * pgs, gx_device * pdev);
-int gx_pop_transparency_state(gs_imager_state * pis, gx_device * pdev);
+int gx_pop_transparency_state(gs_gstate * pgs, gx_device * pdev);
/*
* Verify that a compositor data structure is for the PDF 1.4 compositor.
diff --git a/base/gstype1.c b/base/gstype1.c
index d9d87ce0a..c8028e64d 100644
--- a/base/gstype1.c
+++ b/base/gstype1.c
@@ -24,7 +24,7 @@
#include "gxfixed.h"
#include "gxmatrix.h"
#include "gxcoord.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpath.h"
#include "gxfont.h"
#include "gxfont1.h"
@@ -138,7 +138,7 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
break;
case 0:
gs_type1_finish_init(pcis); /* sets origin */
- code = t1_hinter__set_mapping(h, &pcis->pis->ctm,
+ code = t1_hinter__set_mapping(h, &pcis->pgs->ctm,
&pfont->FontMatrix, &pfont->base->FontMatrix,
pcis->scale.x.log2_unit, pcis->scale.x.log2_unit,
pcis->scale.x.log2_unit - pcis->log2_subpixels.x,
@@ -307,7 +307,7 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
code = t1_hinter__endglyph(h);
if (code < 0)
return code;
- code = gx_setcurrentpoint_from_path(pcis->pis, pcis->path);
+ code = gx_setcurrentpoint_from_path(pcis->pgs, pcis->path);
if (code < 0)
return code;
} else {
diff --git a/base/gstype1.h b/base/gstype1.h
index b16674d35..40d25376a 100644
--- a/base/gstype1.h
+++ b/base/gstype1.h
@@ -35,7 +35,7 @@ typedef struct gs_font_type1_s gs_font_type1;
#ifndef gs_type1_data_s_DEFINED
struct gs_type1_data_s;
#endif
-int gs_type1_interp_init(gs_type1_state * pcis, gs_imager_state * pis,
+int gs_type1_interp_init(gs_type1_state * pcis, gs_gstate * pgs,
gx_path * ppath, const gs_log2_scale_point * pscale,
const gs_log2_scale_point * psubpixels, bool no_grid_fitting,
int paint_type, gs_font_type1 * pfont);
@@ -45,7 +45,7 @@ void gs_type1_set_width(gs_type1_state * pcis, const gs_point * pwpt);
/* Backward compatibility */
#define gs_type1_init(pcis, penum, psbpt, charpath_flag, paint_type, pfont)\
- (gs_type1_interp_init(pcis, (gs_imager_state *)((penum)->pgs),\
+ (gs_type1_interp_init(pcis, (gs_gstate *)((penum)->pgs),\
(penum)->pgs->path, &(penum)->log2_current_scale,\
charpath_flag, paint_type, pfont) |\
((psbpt) == 0 ? 0 : (gs_type1_set_lsb(pcis, psbpt), 0)))
diff --git a/base/gstype2.c b/base/gstype2.c
index 160e76de7..10cdcd315 100644
--- a/base/gstype2.c
+++ b/base/gstype2.c
@@ -24,7 +24,7 @@
#include "gxfixed.h"
#include "gxmatrix.h"
#include "gxcoord.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpath.h"
#include "gxfont.h"
#include "gxfont1.h"
@@ -152,7 +152,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
break;
case 0:
gs_type1_finish_init(pcis); /* sets origin */
- code = t1_hinter__set_mapping(h, &pcis->pis->ctm,
+ code = t1_hinter__set_mapping(h, &pcis->pgs->ctm,
&pfont->FontMatrix, &pfont->base->FontMatrix,
pcis->scale.x.log2_unit, pcis->scale.x.log2_unit,
pcis->scale.x.log2_unit - pcis->log2_subpixels.x,
@@ -340,7 +340,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
code = t1_hinter__endglyph(h);
if (code < 0)
return code;
- code = gx_setcurrentpoint_from_path(pcis->pis, pcis->path);
+ code = gx_setcurrentpoint_from_path(pcis->pgs, pcis->path);
if (code < 0)
return code;
} else {
@@ -726,12 +726,12 @@ flex: {
if ((code =
gs_distance_transform(fixed2float(x_join),
fixed2float(y_join),
- &ctm_only(pcis->pis),
+ &ctm_only(pcis->pgs),
&join)) < 0 ||
(code =
gs_distance_transform(fixed2float(x_end),
fixed2float(y_end),
- &ctm_only(pcis->pis),
+ &ctm_only(pcis->pgs),
&end)) < 0
)
return code;
diff --git a/base/gstype42.c b/base/gstype42.c
index 1bca11bf2..4a82606ed 100644
--- a/base/gstype42.c
+++ b/base/gstype42.c
@@ -23,7 +23,7 @@
#include "gserrors.h"
#include "gsstruct.h"
#include "gsccode.h"
-#include "gsline.h" /* for gs_imager_setflat */
+#include "gsline.h" /* for gs_gstate_setflat */
#include "gsmatrix.h"
#include "gsutil.h"
#include "gxchrout.h"
@@ -36,7 +36,7 @@
#include "gxtext.h"
#include "gxchar.h"
#include "gxfcache.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gzstate.h"
#include "stream.h"
@@ -1251,7 +1251,7 @@ gs_type42_get_metrics(gs_font_type42 * pfont, uint glyph_index,
/* Append a TrueType outline to a path. */
/* Note that this does not append the final moveto for the width. */
int
-gs_type42_append(uint glyph_index, gs_state * pgs,
+gs_type42_append(uint glyph_index, gs_gstate * pgs,
gx_path * ppath, gs_text_enum_t *penum, gs_font *pfont,
bool charpath_flag)
{
@@ -1276,12 +1276,11 @@ gs_type42_append(uint glyph_index, gs_state * pgs,
}
return code;
}
- code = gx_setcurrentpoint_from_path((gs_imager_state *)pgs, ppath);
+ code = gx_setcurrentpoint_from_path(pgs, ppath);
if (code < 0)
return code;
/* Set the flatness for curve rendering. */
- return gs_imager_setflat((gs_imager_state *)pgs,
- gs_char_flatness((gs_imager_state *)pgs, 1.0));
+ return gs_gstate_setflat(pgs, gs_char_flatness(pgs, 1.0));
}
#if 0
/* Used only by add_simple below, which has been removed as unused. */
diff --git a/base/gx.h b/base/gx.h
index 9dde4feaf..ac359e789 100644
--- a/base/gx.h
+++ b/base/gx.h
@@ -29,14 +29,9 @@
/* Define opaque types for the graphics state. */
/* This is used so pervasively that we define it here, */
/* rather than at a higher level as perhaps would be more appropriate. */
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
-
-#endif
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
diff --git a/base/gxacpath.c b/base/gxacpath.c
index 78f44a8d8..df5925a74 100644
--- a/base/gxacpath.c
+++ b/base/gxacpath.c
@@ -24,7 +24,7 @@
#include "gsstate.h"
#include "gxdevice.h"
#include "gxfixed.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gzpath.h"
#include "gxpaint.h"
#include "gzcpath.h"
@@ -203,10 +203,10 @@ gx_cpath_accum_discard(gx_device_cpath_accum * padev)
/* Intersect two clipping paths using an accumulator. */
int
gx_cpath_intersect_path_slow(gx_clip_path * pcpath, gx_path * ppath,
- int rule, gs_imager_state *pis,
+ int rule, gs_gstate *pgs,
const gx_fill_params * params0)
{
- gs_logical_operation_t save_lop = gs_current_logical_op_inline(pis);
+ gs_logical_operation_t save_lop = gs_current_logical_op_inline(pgs);
gx_device_cpath_accum adev;
gx_device_color devc;
gx_fill_params params;
@@ -214,22 +214,22 @@ gx_cpath_intersect_path_slow(gx_clip_path * pcpath, gx_path * ppath,
gx_cpath_accum_begin(&adev, pcpath->path.memory);
set_nonclient_dev_color(&devc, 0); /* arbitrary, but not transparent */
- gs_set_logical_op_inline(pis, lop_default);
+ gs_set_logical_op_inline(pgs, lop_default);
if (params0 != 0)
params = *params0;
else {
gs_point fadjust;
params.rule = rule;
- gs_currentfilladjust((gs_state *)pis, &fadjust);
+ gs_currentfilladjust(pgs, &fadjust);
params.adjust.x = float2fixed(fadjust.x);
params.adjust.y = float2fixed(fadjust.y);
- params.flatness = gs_currentflat_inline(pis);
+ params.flatness = gs_currentflat_inline(pgs);
}
- code = gx_fill_path_only(ppath, (gx_device *)&adev, pis,
+ code = gx_fill_path_only(ppath, (gx_device *)&adev, pgs,
&params, &devc, pcpath);
if (code < 0 || (code = gx_cpath_accum_end(&adev, pcpath)) < 0)
gx_cpath_accum_discard(&adev);
- gs_set_logical_op_inline(pis, save_lop);
+ gs_set_logical_op_inline(pgs, save_lop);
return code;
}
diff --git a/base/gxblend.h b/base/gxblend.h
index 9376c2083..758e8ba73 100644
--- a/base/gxblend.h
+++ b/base/gxblend.h
@@ -422,7 +422,7 @@ void pdf14_preserve_backdrop(pdf14_buf *buf, pdf14_buf *tos, bool knockout_buff)
int pdf14_preserve_backdrop_cm(pdf14_buf *buf, cmm_profile_t *group_profile,
pdf14_buf *tos, cmm_profile_t *tos_profile,
- gs_memory_t *memory, gs_imager_state *pis,
+ gs_memory_t *memory, gs_gstate *pgs,
gx_device *dev, bool knockout_buff);
void pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf,
@@ -436,7 +436,7 @@ gx_color_index pdf14_encode_color_tag(gx_device *dev, const gx_color_value color
int pdf14_decode_color(gx_device * dev, gx_color_index color, gx_color_value * out);
void pdf14_gray_cs_to_cmyk_cm(gx_device * dev, frac gray, frac out[]);
-void pdf14_rgb_cs_to_cmyk_cm(gx_device * dev, const gs_imager_state *pis,
+void pdf14_rgb_cs_to_cmyk_cm(gx_device * dev, const gs_gstate *pgs,
frac r, frac g, frac b, frac out[]);
void pdf14_cmyk_cs_to_cmyk_cm(gx_device * dev, frac c, frac m, frac y, frac k, frac out[]);
diff --git a/base/gxblend1.c b/base/gxblend1.c
index 524f1e3f7..fe0b4527a 100644
--- a/base/gxblend1.c
+++ b/base/gxblend1.c
@@ -23,7 +23,7 @@
#include "gxblend.h"
#include "gxdcconv.h"
#include "gxdevcli.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gdevdevn.h"
#include "gdevp14.h"
#include "vdtrace.h"
@@ -127,7 +127,7 @@ copy_extra_planes(byte *des_buf, pdf14_buf *des_info, byte *src_buf,
int
pdf14_preserve_backdrop_cm(pdf14_buf *buf, cmm_profile_t *group_profile,
pdf14_buf *tos, cmm_profile_t *tos_profile,
- gs_memory_t *memory, gs_imager_state *pis, gx_device *dev,
+ gs_memory_t *memory, gs_gstate *pgs, gx_device *dev,
bool knockout_buff)
{
/* Make copy of backdrop, but convert to new group's colorspace */
@@ -153,7 +153,7 @@ pdf14_preserve_backdrop_cm(pdf14_buf *buf, cmm_profile_t *group_profile,
rendering_params.rendering_intent = gsPERCEPTUAL;
rendering_params.cmm = gsCMM_DEFAULT;
/* Request the ICC link for the transform that we will need to use */
- icc_link = gsicc_get_link_profile(pis, dev, tos_profile, group_profile,
+ icc_link = gsicc_get_link_profile(pgs, dev, tos_profile, group_profile,
&rendering_params, memory, false);
if (icc_link == NULL)
return gs_throw(gs_error_unknownerror, "ICC link failed. Trans backdrop");
@@ -621,7 +621,7 @@ pdf14_gray_cs_to_cmyk_cm(gx_device * dev, frac gray, frac out[])
* it is unlikely that any device with a DeviceCMYK color model
* would define this mapping on its own.
*
- * If the imager state is not available, map as though the black
+ * If the gs_gstate is not available, map as though the black
* generation and undercolor removal functions are identity
* transformations. This mode is used primarily to support the
* raster operation (rop) feature of PCL, which requires that
@@ -631,13 +631,13 @@ pdf14_gray_cs_to_cmyk_cm(gx_device * dev, frac gray, frac out[])
* often they are { pop 0 }.
*/
void
-pdf14_rgb_cs_to_cmyk_cm(gx_device * dev, const gs_imager_state *pis,
+pdf14_rgb_cs_to_cmyk_cm(gx_device * dev, const gs_gstate *pgs,
frac r, frac g, frac b, frac out[])
{
uchar num_comp = dev->color_info.num_components;
- if (pis != 0)
- color_rgb_to_cmyk(r, g, b, pis, out, dev->memory);
+ if (pgs != 0)
+ color_rgb_to_cmyk(r, g, b, pgs, out, dev->memory);
else {
frac c = frac_1 - r, m = frac_1 - g, y = frac_1 - b;
frac k = min(c, min(m, y));
diff --git a/base/gxccache.c b/base/gxccache.c
index a51c4db2a..496a8dd9c 100644
--- a/base/gxccache.c
+++ b/base/gxccache.c
@@ -176,7 +176,7 @@ gx_lookup_cached_char(const gs_font * pfont, const cached_fm_pair * pair,
int
gx_image_cached_char(register gs_show_enum * penum, register cached_char * cc)
{
- register gs_state *pgs = penum->pgs;
+ register gs_gstate *pgs = penum->pgs;
gx_device_color *pdevc = gs_currentdevicecolor_inline(pgs);
int x, y, w, h, depth;
int code;
diff --git a/base/gxcdevn.h b/base/gxcdevn.h
index 61fe517c4..193d4842f 100644
--- a/base/gxcdevn.h
+++ b/base/gxcdevn.h
@@ -30,7 +30,7 @@ typedef struct gs_device_n_map_s gs_device_n_map;
struct gs_device_n_map_s {
rc_header rc;
int (*tint_transform)(const float *in, float *out,
- const gs_imager_state *pis, void *data);
+ const gs_gstate *pgs, void *data);
void *tint_transform_data;
bool cache_valid;
float tint[GS_CLIENT_COLOR_MAX_COMPONENTS];
@@ -59,6 +59,6 @@ struct gs_device_n_attributes_s {
device_n_attributes_enum_ptrs, device_n_attributes_reloc_ptrs, cspace, next)
/* Check if we are using the alternate color space */
-bool using_alt_color_space(const gs_state * pgs);
+bool using_alt_color_space(const gs_gstate * pgs);
#endif /* gxcdevn_INCLUDED */
diff --git a/base/gxchar.c b/base/gxchar.c
index 35da387c3..1ed4a134f 100644
--- a/base/gxchar.c
+++ b/base/gxchar.c
@@ -43,7 +43,7 @@
/* Structure descriptors */
public_st_gs_show_enum();
extern_st(st_gs_text_enum);
-extern_st(st_gs_state); /* only for testing */
+extern_st(st_gs_gstate); /* only for testing */
static
ENUM_PTRS_BEGIN(show_enum_enum_ptrs)
return ENUM_USING(st_gs_text_enum, vptr, size, index - 5);
@@ -67,7 +67,7 @@ static int continue_show_update(gs_show_enum *);
static void show_set_scale(const gs_show_enum *, gs_log2_scale_point *log2_scale);
static int show_cache_setup(gs_show_enum *);
static int show_state_setup(gs_show_enum *);
-static int show_origin_setup(gs_state *, fixed, fixed, gs_show_enum * penum);
+static int show_origin_setup(gs_gstate *, fixed, fixed, gs_show_enum * penum);
/* Accessors for current_char and current_glyph. */
#define CURRENT_CHAR(penum) ((penum)->returned.current_char)
@@ -79,7 +79,7 @@ static int show_origin_setup(gs_state *, fixed, fixed, gs_show_enum * penum);
/* Allocate a show enumerator. */
gs_show_enum *
-gs_show_enum_alloc(gs_memory_t * mem, gs_state * pgs, client_name_t cname)
+gs_show_enum_alloc(gs_memory_t * mem, gs_gstate * pgs, client_name_t cname)
{
gs_show_enum *penum;
@@ -119,7 +119,7 @@ static const gs_text_enum_procs_t default_text_procs = {
};
int
-gx_default_text_begin(gx_device * dev, gs_imager_state * pis,
+gx_default_text_begin(gx_device * dev, gs_gstate * pgs1,
const gs_text_params_t * text, gs_font * font,
gx_path * path, const gx_device_color * pdcolor,
const gx_clip_path * pcpath,
@@ -128,20 +128,20 @@ gx_default_text_begin(gx_device * dev, gs_imager_state * pis,
uint operation = text->operation;
bool propagate_charpath = (operation & TEXT_DO_DRAW) != 0;
int code;
- gs_state *pgs = (gs_state *)pis;
+ gs_gstate *pgs = (gs_gstate *)pgs1;
gs_show_enum *penum;
/*
- * For the moment, require pis to be a gs_state *, since all the
+ * For the moment, require pgs to be a gs_gstate *, since all the
* procedures for character rendering expect it.
*/
- if (gs_object_type(mem, pis) != &st_gs_state)
+ if (gs_object_type(mem, pgs) != &st_gs_gstate)
return_error(gs_error_Fatal);
penum = gs_show_enum_alloc(mem, pgs, "gx_default_text_begin");
if (!penum)
return_error(gs_error_VMerror);
code = gs_text_enum_init((gs_text_enum_t *)penum, &default_text_procs,
- dev, pis, text, font, path, pdcolor, pcpath, mem);
+ dev, pgs, text, font, path, pdcolor, pcpath, mem);
if (code < 0) {
gs_free_object(mem, penum, "gx_default_text_begin");
return code;
@@ -208,7 +208,7 @@ gx_default_text_begin(gx_device * dev, gs_imager_state * pis,
/* Compute the number of characters in a text. */
int
-gs_text_count_chars(gs_state * pgs, gs_text_params_t *text, gs_memory_t * mem)
+gs_text_count_chars(gs_gstate * pgs, gs_text_params_t *text, gs_memory_t * mem)
{
font_proc_next_char_glyph((*next_proc)) = pgs->font->procs.next_char_glyph;
@@ -242,13 +242,12 @@ gs_text_count_chars(gs_state * pgs, gs_text_params_t *text, gs_memory_t * mem)
/* An auxiliary functions for pdfwrite to process type 3 fonts. */
int
-gx_hld_stringwidth_begin(gs_imager_state * pis, gx_path **path)
+gx_hld_stringwidth_begin(gs_gstate * pgs, gx_path **path)
{
- gs_state *pgs = (gs_state *)pis;
- extern_st(st_gs_state);
+ extern_st(st_gs_gstate);
int code;
- if (gs_object_type(pis->memory, pis) != &st_gs_state)
+ if (gs_object_type(pgs->memory, pgs) != &st_gs_gstate)
return_error(gs_error_unregistered);
code = gs_gsave(pgs);
if (code < 0)
@@ -263,7 +262,7 @@ int
gx_default_text_restore_state(gs_text_enum_t *pte)
{
gs_show_enum *penum;
- gs_state *pgs;
+ gs_gstate *pgs;
if (SHOW_IS(pte, TEXT_DO_NONE))
return 0;
@@ -274,7 +273,7 @@ gx_default_text_restore_state(gs_text_enum_t *pte)
/* ------ Width/cache setting ------ */
static int
- set_cache_device(gs_show_enum *penum, gs_state *pgs,
+ set_cache_device(gs_show_enum *penum, gs_gstate *pgs,
double llx, double lly, double urx, double ury);
/* This is the default implementation of text enumerator set_cache. */
@@ -283,7 +282,7 @@ gx_show_text_set_cache(gs_text_enum_t *pte, const double *pw,
gs_text_cache_control_t control)
{
gs_show_enum *const penum = (gs_show_enum *)pte;
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
gs_font *pfont = gs_rootfont(pgs);
/* Detect zero FontMatrix now for Adobe compatibility with CET tests.
@@ -360,7 +359,7 @@ gx_show_text_set_cache(gs_text_enum_t *pte, const double *pw,
/* Note that this returns 1 if the current show operation is */
/* non-displaying (stringwidth or cshow). */
int
-set_char_width(gs_show_enum *penum, gs_state *pgs, double wx, double wy)
+set_char_width(gs_show_enum *penum, gs_gstate *pgs, double wx, double wy)
{
int code;
@@ -434,7 +433,7 @@ compute_glyph_raster_params(gs_show_enum *penum, bool in_setcachedevice, int *al
int *depth,
gs_fixed_point *subpix_origin, gs_log2_scale_point *log2_scale)
{
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
gx_device *dev = gs_currentdevice_inline(pgs);
int code;
@@ -483,7 +482,7 @@ compute_glyph_raster_params(gs_show_enum *penum, bool in_setcachedevice, int *al
/* Return 1 if we just set up a cache device. */
/* Used by setcachedevice and setcachedevice2. */
static int
-set_cache_device(gs_show_enum * penum, gs_state * pgs, double llx, double lly,
+set_cache_device(gs_show_enum * penum, gs_gstate * pgs, double llx, double lly,
double urx, double ury)
{
gs_glyph glyph;
@@ -699,7 +698,7 @@ set_cache_device(gs_show_enum * penum, gs_state * pgs, double llx, double lly,
/* Return the cache device status. */
gs_in_cache_device_t
-gs_incachedevice(const gs_state *pgs)
+gs_incachedevice(const gs_gstate *pgs)
{
return pgs->in_cachedevice;
}
@@ -774,7 +773,7 @@ continue_show(gs_show_enum * penum)
static int
continue_kshow(gs_show_enum * penum)
{ int code;
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
if (pgs->font != penum->orig_font)
gs_setfont(pgs, penum->orig_font);
@@ -790,7 +789,7 @@ continue_kshow(gs_show_enum * penum)
static int
show_update(gs_show_enum * penum)
{
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
cached_char *cc = penum->cc;
int code;
@@ -841,7 +840,7 @@ show_update(gs_show_enum * penum)
code = gs_grestore(pgs);
if (code < 0)
return code;
- code = gs_state_color_load(pgs);
+ code = gs_gstate_color_load(pgs);
if (code < 0)
return code;
return gx_image_cached_char(penum, cc);
@@ -861,9 +860,9 @@ show_update(gs_show_enum * penum)
/* Move to next character */
static inline int
-show_fast_move(gs_state * pgs, gs_fixed_point * pwxy)
+show_fast_move(gs_gstate * pgs, gs_fixed_point * pwxy)
{
- return gs_moveto_aux((gs_imager_state *)pgs, pgs->path,
+ return gs_moveto_aux(pgs, pgs->path,
pgs->current_point.x + fixed2float(pwxy->x),
pgs->current_point.y + fixed2float(pwxy->y));
}
@@ -899,7 +898,7 @@ int gx_current_char(const gs_text_enum_t * pte)
static int
show_move(gs_show_enum * penum)
{
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
int code;
if (SHOW_IS(penum, TEXT_REPLACE_WIDTHS)) {
@@ -951,7 +950,7 @@ show_move(gs_show_enum * penum)
int code;
if (penum->use_wxy_float)
- code = gs_moveto_aux((gs_imager_state *)pgs, pgs->path,
+ code = gs_moveto_aux(pgs, pgs->path,
pgs->current_point.x + penum->wxy_float.x + fixed2float(penum->wxy.x),
pgs->current_point.y + penum->wxy_float.y + fixed2float(penum->wxy.y));
else
@@ -970,7 +969,7 @@ show_move(gs_show_enum * penum)
static int
show_proceed(gs_show_enum * penum)
{
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
gs_font *pfont;
cached_fm_pair *pair = 0;
gs_font *rfont =
@@ -987,7 +986,7 @@ show_proceed(gs_show_enum * penum)
gs_log2_scale_point log2_scale;
if (penum->charpath_flag == cpm_show && SHOW_USES_OUTLINE(penum)) {
- code = gs_state_color_load(pgs);
+ code = gs_gstate_color_load(pgs);
if (code < 0)
return code;
}
@@ -1298,7 +1297,7 @@ gx_show_text_retry(gs_text_enum_t *pte)
static int
show_finish(gs_show_enum * penum)
{
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
int code = 0, rcode;
if ((penum->text.operation & TEXT_DO_FALSE_CHARPATH) ||
@@ -1397,7 +1396,7 @@ gs_show_current_font(const gs_show_enum * penum)
static int
show_state_setup(gs_show_enum * penum)
{
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
gx_clip_path *pcpath;
gs_font *pfont;
@@ -1488,15 +1487,12 @@ show_set_scale(const gs_show_enum * penum, gs_log2_scale_point *log2_scale)
* Decide whether to oversample.
* We have to decide this each time setcachedevice is called.
*/
- const gs_state *pgs = NULL;
+ const gs_gstate *pgs = NULL;
- if (gs_object_type(penum->pis->memory, penum) == &st_gs_show_enum) {
+ if (gs_object_type(penum->pgs->memory, penum) == &st_gs_show_enum) {
pgs = penum->pgs;
} else {
- if (penum->pis->is_gstate)
- pgs = (gs_state *)penum->pis;
- else
- outprintf(penum->memory, "Warning: cannot calculate text oversample (TextAlphaBits)\n");
+ pgs = (gs_gstate *)penum->pgs;
}
if (pgs != NULL && (penum->charpath_flag == cpm_show ||
@@ -1542,7 +1538,7 @@ show_set_scale(const gs_show_enum * penum, gs_log2_scale_point *log2_scale)
static int
show_cache_setup(gs_show_enum * penum)
{
- gs_state *pgs = penum->pgs;
+ gs_gstate *pgs = penum->pgs;
gs_memory_t *mem = penum->memory;
gx_device_memory *dev =
gs_alloc_struct(mem, gx_device_memory, &st_device_memory,
@@ -1578,7 +1574,7 @@ show_cache_setup(gs_show_enum * penum)
/* Used before rendering characters, and for moving the origin */
/* in setcachedevice2 when WMode=1. */
static int
-show_origin_setup(gs_state * pgs, fixed cpt_x, fixed cpt_y, gs_show_enum * penum)
+show_origin_setup(gs_gstate * pgs, fixed cpt_x, fixed cpt_y, gs_show_enum * penum)
{
if (penum->charpath_flag == cpm_show) {
/* Round the translation in the graphics state. */
diff --git a/base/gxchar.h b/base/gxchar.h
index b92aa8c74..5ec375554 100644
--- a/base/gxchar.h
+++ b/base/gxchar.h
@@ -70,10 +70,10 @@ struct gs_show_enum_s {
gs_text_enum_common; /* (procs, text, index) */
/* Following are set at creation time */
bool auto_release; /* true if old API, false if new */
- gs_state *pgs;
+ gs_gstate *pgs2;
int level; /* save the level of pgs */
gs_char_path_mode charpath_flag;
- gs_state *show_gstate; /* for setting pgs->show_gstate */
+ gs_gstate *show_gstate; /* for setting pgs->show_gstate */
/* at returns/callouts */
int can_cache; /* -1 if can't use cache at all, */
/* 0 if can read but not load, */
@@ -130,9 +130,9 @@ cached_char *
int gx_image_cached_char(gs_show_enum *, cached_char *);
void gx_compute_text_oversampling(const gs_show_enum * penum, const gs_font *pfont,
int alpha_bits, gs_log2_scale_point *p_log2_scale);
-int set_char_width(gs_show_enum *penum, gs_state *pgs, double wx, double wy);
+int set_char_width(gs_show_enum *penum, gs_gstate *pgs, double wx, double wy);
int gx_default_text_restore_state(gs_text_enum_t *pte);
-int gx_hld_stringwidth_begin(gs_imager_state * pis, gx_path **path);
+int gx_hld_stringwidth_begin(gs_gstate * pgs, gx_path **path);
/* Define the maximum size of a full temporary bitmap when rasterizing, */
/* in bits (not bytes). */
diff --git a/base/gxchrout.c b/base/gxchrout.c
index e06dd675f..0c9cd4891 100644
--- a/base/gxchrout.c
+++ b/base/gxchrout.c
@@ -18,16 +18,16 @@
#include "gx.h"
#include "gxchrout.h"
#include "gxfarith.h"
-#include "gxistate.h"
+#include "gxgstate.h"
/*
* Determine the flatness for rendering a character in an outline font.
- * This may be less than the flatness in the imager state.
+ * This may be less than the flatness in the gs_gstate.
* The second argument is the default scaling for the font: 0.001 for
* Type 1 fonts, 1.0 for TrueType fonts.
*/
double
-gs_char_flatness(const gs_imager_state *pis, double default_scale)
+gs_char_flatness(const gs_gstate *pgs, double default_scale)
{
/*
* Set the flatness to a value that is likely to produce reasonably
@@ -35,12 +35,12 @@ gs_char_flatness(const gs_imager_state *pis, double default_scale)
* graphics state. If the character is very small, set the flatness
* to zero, which will produce very accurate curves.
*/
- double cxx = fabs(pis->ctm.xx), cyy = fabs(pis->ctm.yy);
+ double cxx = fabs(pgs->ctm.xx), cyy = fabs(pgs->ctm.yy);
if (is_fzero(cxx) || (cyy < cxx && !is_fzero(cyy)))
cxx = cyy;
- if (!is_xxyy(&pis->ctm)) {
- double cxy = fabs(pis->ctm.xy), cyx = fabs(pis->ctm.yx);
+ if (!is_xxyy(&pgs->ctm)) {
+ double cxy = fabs(pgs->ctm.xy), cyx = fabs(pgs->ctm.yx);
if (is_fzero(cxx) || (cxy < cxx && !is_fzero(cxy)))
cxx = cxy;
@@ -50,8 +50,8 @@ gs_char_flatness(const gs_imager_state *pis, double default_scale)
/* Correct for the default scaling. */
cxx *= 0.001 / default_scale;
/* Don't let the flatness be worse than the default. */
- if (cxx > pis->flatness)
- cxx = pis->flatness;
+ if (cxx > pgs->flatness)
+ cxx = pgs->flatness;
/* If the character is tiny, force accurate curves. */
if (cxx < 0.2)
cxx = 0;
diff --git a/base/gxchrout.h b/base/gxchrout.h
index 7ea79eb46..6a8f3d967 100644
--- a/base/gxchrout.h
+++ b/base/gxchrout.h
@@ -19,17 +19,17 @@
#ifndef gxchrout_INCLUDED
# define gxchrout_INCLUDED
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
/*
* Determine the flatness for rendering a character in an outline font.
- * This may be less than the flatness in the imager state.
+ * This may be less than the flatness in the gs_gstate.
* The second argument is the default scaling for the font: 0.001 for
* Type 1 fonts, 1.0 for TrueType fonts.
*/
-double gs_char_flatness(const gs_imager_state *pis, double default_scale);
+double gs_char_flatness(const gs_gstate *pgs, double default_scale);
#endif /* gxchrout_INCLUDED */
diff --git a/base/gxcht.c b/base/gxcht.c
index 5761e499e..970acb67b 100644
--- a/base/gxcht.c
+++ b/base/gxcht.c
@@ -25,7 +25,7 @@
#include "gxdevice.h"
#include "gxcmap.h"
#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gzht.h"
#include "gsserial.h"
#include "gxdevsop.h"
@@ -328,12 +328,12 @@ gx_dc_ht_colored_write(
* pdevc pointer to the location in which to write the
* reconstructed device color
*
- * pis pointer to the current imager state (to access the
+ * pgs pointer to the current gs_gstate (to access the
* current halftone)
*
* prior_devc pointer to the current device color (this is provided
* separately because the device color is not part of the
- * imager state)
+ * gs_gstate)
*
* dev pointer to the current device, used to retrieve process
* color model information
@@ -353,7 +353,7 @@ gx_dc_ht_colored_write(
static int
gx_dc_ht_colored_read(
gx_device_color * pdevc,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_device_color * prior_devc,
const gx_device * dev,
int64_t offset,
@@ -379,7 +379,7 @@ gx_dc_ht_colored_read(
/* the number of components is determined by the color model */
devc.colors.colored.num_components = num_comps;
- devc.colors.colored.c_ht = pis->dev_ht;
+ devc.colors.colored.c_ht = pgs->dev_ht;
/*
* Verify that we have at least the flag bits. For performance
@@ -460,10 +460,10 @@ gx_dc_ht_colored_read(
/* set the phase as required (select value is arbitrary) */
color_set_phase_mod( &devc,
- pis->screen_phase[0].x,
- pis->screen_phase[0].y,
- pis->dev_ht->lcm_width,
- pis->dev_ht->lcm_height );
+ pgs->screen_phase[0].x,
+ pgs->screen_phase[0].y,
+ pgs->dev_ht->lcm_width,
+ pgs->dev_ht->lcm_height );
/* everything looks OK */
*pdevc = devc;
@@ -557,7 +557,7 @@ static SET_COLOR_HT_PROC(set_color_ht_gt_4);
/* Prepare to use a colored halftone, by loading the default cache. */
static int
-gx_dc_ht_colored_load(gx_device_color * pdevc, const gs_imager_state * pis,
+gx_dc_ht_colored_load(gx_device_color * pdevc, const gs_gstate * pgs,
gx_device * ignore_dev, gs_color_select_t select)
{
/* TO_DO_DEVICEN */
diff --git a/base/gxcie.h b/base/gxcie.h
index ae0e1721d..d622d27c4 100644
--- a/base/gxcie.h
+++ b/base/gxcie.h
@@ -46,14 +46,14 @@ cs_proc_restrict_color(gx_restrict_CIEA);
cs_proc_install_cspace(gx_install_CIEA);
/*
- * Initialize (just enough of) an imager state so that "concretizing" colors
- * using this imager state will do only the CIE->XYZ mapping. This is a
+ * Initialize (just enough of) an gs_gstate so that "concretizing" colors
+ * using this gs_gstate will do only the CIE->XYZ mapping. This is a
* semi-hack for the PDF writer.
*/
-extern int gx_cie_to_xyz_alloc(gs_imager_state **,
+extern int gx_cie_to_xyz_alloc(gs_gstate **,
const gs_color_space *, gs_memory_t *);
-extern void gx_cie_to_xyz_free(gs_imager_state *);
-extern int gx_cie_to_xyz_alloc2(gs_color_space * pcs, gs_state * pgs);
+extern void gx_cie_to_xyz_free(gs_gstate *);
+extern int gx_cie_to_xyz_alloc2(gs_color_space * pcs, gs_gstate * pgs);
/* Defined in gsciemap.c */
@@ -62,7 +62,7 @@ extern int gx_cie_to_xyz_alloc2(gs_color_space * pcs, gs_state * pgs);
* caches are loaded. Note that the procedure may return 1 if no rendering
* has been defined.
*/
-int gx_cie_check_rendering(const gs_color_space * pcs, frac * pconc, const gs_imager_state * pis);
+int gx_cie_check_rendering(const gs_color_space * pcs, frac * pconc, const gs_gstate * pgs);
/*
* Do the common remapping operation for CIE color spaces. Returns the
@@ -72,7 +72,7 @@ int gx_cie_check_rendering(const gs_color_space * pcs, frac * pconc, const gs_im
*/
extern int gx_cie_remap_finish( cie_cached_vector3,
frac *, float *,
- const gs_imager_state *,
+ const gs_gstate *,
const gs_color_space * );
/* Make sure the prototype matches the one defined in gscie.h. */
extern GX_CIE_REMAP_FINISH_PROC(gx_cie_remap_finish);
@@ -110,7 +110,7 @@ extern void gx_set_common_cie_defaults( gs_cie_common *,
void * client_data );
/* Load the common caches for a CIE color space */
-extern void gx_cie_load_common_cache(gs_cie_common *, gs_state *);
+extern void gx_cie_load_common_cache(gs_cie_common *, gs_gstate *);
/* Complete loading of the common caches */
extern void gx_cie_common_complete(gs_cie_common *);
@@ -135,13 +135,13 @@ cs_proc_concrete_space(gx_concrete_space_CIE);
/* Special operations used in the creation of ICC color spaces from PS
spaces. These are used to map from PS color to CIEXYZ */
int gx_psconcretize_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, float * xyz, const gs_imager_state * pis);
+ frac * pconc, float * xyz, const gs_gstate * pgs);
int gx_psconcretize_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, float * xyz, const gs_imager_state * pis);
+ frac * pconc, float * xyz, const gs_gstate * pgs);
int gx_psconcretize_CIEABC(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, float * xyz, const gs_imager_state * pis);
+ frac * pconc, float * xyz, const gs_gstate * pgs);
int gx_psconcretize_CIEA(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, float * xyz, const gs_imager_state * pis);
+ frac * pconc, float * xyz, const gs_gstate * pgs);
bool check_range(gs_range *ranges, int num_colorants);
bool check_cie_range( const gs_color_space * pcs );
gs_range* get_cie_range( const gs_color_space * pcs );
diff --git a/base/gxcldev.h b/base/gxcldev.h
index 3e1167f10..6d019661b 100644
--- a/base/gxcldev.h
+++ b/base/gxcldev.h
@@ -590,7 +590,7 @@ int cmd_update_lop(gx_device_clist_writer *, gx_clist_state *,
*
* The error_in_rect code detects an error that may be a recoverable
* VMerror, with calling clist_VMerror_recover_flush. It will attempt to fix the
- * VMerror by flushing and closing the band and resetting the imager state,
+ * VMerror by flushing and closing the band and resetting the gs_gstate,
* and then restart emitting the entire band.
* Note that re.y must not change when restarting the band.
*
@@ -746,7 +746,7 @@ int clist_change_bits(gx_device_clist_writer * cldev, gx_clist_state * pcls,
* Write out any necessary color mapping data.
*/
int cmd_put_color_mapping(gx_device_clist_writer * cldev,
- const gs_imager_state * pis);
+ const gs_gstate * pgs);
/*
* Add commands to represent a full (device) halftone.
* (This routine should probably be in some other module.)
diff --git a/base/gxclimag.c b/base/gxclimag.c
index f02f27230..e08cbb292 100644
--- a/base/gxclimag.c
+++ b/base/gxclimag.c
@@ -318,7 +318,7 @@ typedef struct clist_image_enum_s {
gs_pixel_image_t image; /* only uses Width, Height, Interpolate */
gx_drawing_color dcolor; /* only pure right now */
gs_int_rect rect;
- const gs_imager_state *pis;
+ const gs_gstate *pgs;
const gx_clip_path *pcpath;
/* Set at creation time */
gs_image_format_t format;
@@ -354,7 +354,7 @@ typedef struct clist_image_enum_s {
gs_private_st_suffix_add4(st_clist_image_enum, clist_image_enum,
"clist_image_enum", clist_image_enum_enum_ptrs,
clist_image_enum_reloc_ptrs, st_gx_image_enum_common,
- pis, pcpath, color_space.space, buffer);
+ pgs, pcpath, color_space.space, buffer);
static image_enum_proc_plane_data(clist_image_plane_data);
static image_enum_proc_end_image(clist_image_end_image);
@@ -462,7 +462,7 @@ image_matrix_ok_to_band(const gs_matrix * pmat)
/* Start processing an image. */
int
-clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
+clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
const gs_matrix * pmat, const gs_image_common_t * pic,
const gs_int_rect * prect, const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath, gs_memory_t * mem,
@@ -489,11 +489,11 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
clist_icc_color_t icc_zero_init = { 0 };
cmm_profile_t *src_profile;
cmm_srcgtag_profile_t *srcgtag_profile;
- gsicc_rendering_intents_t renderingintent = pis->renderingintent;
- gsicc_blackptcomp_t blackptcomp = pis->blackptcomp;
+ gsicc_rendering_intents_t renderingintent = pgs->renderingintent;
+ gsicc_blackptcomp_t blackptcomp = pgs->blackptcomp;
gsicc_rendering_param_t stored_rendering_cond;
gsicc_rendering_param_t dev_render_cond;
- gs_imager_state *pis_nonconst = (gs_imager_state*) pis;
+ gs_gstate *pgs_nonconst = (gs_gstate*) pgs;
bool intent_changed = false;
bool bp_changed = false;
cmm_dev_profile_t *dev_profile = NULL;
@@ -546,7 +546,7 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
indexed = false;
num_components = gs_color_space_num_components(pcs);
}
- uses_color = pim->CombineWithColor && rop3_uses_T(pis->log_op);
+ uses_color = pim->CombineWithColor && rop3_uses_T(pgs->log_op);
}
code = gx_image_enum_common_init((gx_image_enum_common_t *) pie,
(const gs_data_image_t *) pim,
@@ -579,7 +579,7 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
/****** CAN'T HANDLE IMAGES WITH IRREGULAR DEPTHS ******/
goto use_default;
if ((code = gs_matrix_invert(&pim->ImageMatrix, &mat)) < 0 ||
- (code = gs_matrix_multiply(&mat, &ctm_only(pis), &mat)) < 0 ||
+ (code = gs_matrix_multiply(&mat, &ctm_only(pgs), &mat)) < 0 ||
!(cdev->disable_mask & clist_disable_nonrect_hl_image ?
(is_xxyy(&mat) || is_xyyx(&mat)) :
image_matrix_ok_to_band(&mat)))
@@ -607,7 +607,7 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
pie->rect.p.x = 0, pie->rect.p.y = 0;
pie->rect.q.x = pim->Width, pie->rect.q.y = pim->Height;
}
- pie->pis = pis;
+ pie->pgs = pgs;
pie->pcpath = pcpath;
pie->buffer = NULL;
pie->format = format;
@@ -658,8 +658,8 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
dev_render_cond.preserve_black;
stored_rendering_cond.cmm = gsCMM_DEFAULT; /* Unless spec. below */
/* We may need to do some substitions for the source profile */
- if (pis->icc_manager->srcgtag_profile != NULL) {
- srcgtag_profile = pis->icc_manager->srcgtag_profile;
+ if (pgs->icc_manager->srcgtag_profile != NULL) {
+ srcgtag_profile = pgs->icc_manager->srcgtag_profile;
if (src_profile->data_cs == gsRGB) {
if (srcgtag_profile->rgb_profiles[gsSRC_IMAGPRO] != NULL) {
/* We only do this replacement depending upon the
@@ -670,9 +670,9 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
csi == gs_color_space_index_DeviceRGB) {
src_profile =
srcgtag_profile->rgb_profiles[gsSRC_IMAGPRO];
- pis_nonconst->renderingintent =
+ pgs_nonconst->renderingintent =
srcgtag_profile->rgb_rend_cond[gsSRC_IMAGPRO].rendering_intent;
- pis_nonconst->blackptcomp =
+ pgs_nonconst->blackptcomp =
srcgtag_profile->rgb_rend_cond[gsSRC_IMAGPRO].black_point_comp;
stored_rendering_cond =
srcgtag_profile->rgb_rend_cond[gsSRC_IMAGPRO];
@@ -689,9 +689,9 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
csi == gs_color_space_index_DeviceCMYK) {
src_profile =
srcgtag_profile->cmyk_profiles[gsSRC_IMAGPRO];
- pis_nonconst->renderingintent =
+ pgs_nonconst->renderingintent =
srcgtag_profile->cmyk_rend_cond[gsSRC_IMAGPRO].rendering_intent;
- pis_nonconst->blackptcomp =
+ pgs_nonconst->blackptcomp =
srcgtag_profile->cmyk_rend_cond[gsSRC_IMAGPRO].black_point_comp;
stored_rendering_cond =
srcgtag_profile->cmyk_rend_cond[gsSRC_IMAGPRO];
@@ -706,31 +706,31 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
/* If the device RI is set and we are not setting the RI from
the source structure, then override any RI specified in the
document by the RI specified in the device */
- if (!(pis_nonconst->renderingintent & gsRI_OVERRIDE)) { /* was set by source? */
+ if (!(pgs_nonconst->renderingintent & gsRI_OVERRIDE)) { /* was set by source? */
/* No it was not. See if we should override with the
device setting */
if (dev_render_cond.rendering_intent != gsRINOTSPECIFIED) {
- pis_nonconst->renderingintent =
+ pgs_nonconst->renderingintent =
dev_render_cond.rendering_intent;
}
}
/* We have a similar issue to deal with with respect to the
black point. */
- if (!(pis_nonconst->blackptcomp & gsBP_OVERRIDE)) {
+ if (!(pgs_nonconst->blackptcomp & gsBP_OVERRIDE)) {
if (dev_render_cond.black_point_comp != gsBPNOTSPECIFIED) {
- pis_nonconst->blackptcomp =
+ pgs_nonconst->blackptcomp =
dev_render_cond.black_point_comp;
}
}
- if (renderingintent != pis_nonconst->renderingintent)
+ if (renderingintent != pgs_nonconst->renderingintent)
intent_changed = true;
- if (blackptcomp != pis_nonconst->blackptcomp)
+ if (blackptcomp != pgs_nonconst->blackptcomp)
bp_changed = true;
/* Set for the rendering param structure also */
stored_rendering_cond.rendering_intent =
- pis_nonconst->renderingintent;
+ pgs_nonconst->renderingintent;
stored_rendering_cond.black_point_comp =
- pis_nonconst->blackptcomp;
+ pgs_nonconst->blackptcomp;
stored_rendering_cond.graphics_type_tag = GS_IMAGE_TAG;
if (!(src_profile->hash_is_valid)) {
int64_t hash;
@@ -813,7 +813,7 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
if (pie->decode.unpack == NULL) {
/* If we cant unpack, then end monitoring now. Treat as has color */
dev_profile->pageneutralcolor = false;
- code = gsicc_mcm_end_monitor(pis->icc_link_cache, dev);
+ code = gsicc_mcm_end_monitor(pgs->icc_link_cache, dev);
if (code < 0)
return code;
} else {
@@ -833,7 +833,7 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
if (palette_has_color(pim->ColorSpace, pim)) {
/* Has color. We are done monitoring */
dev_profile->pageneutralcolor = false;
- code = gsicc_mcm_end_monitor(pis->icc_link_cache, dev);
+ code = gsicc_mcm_end_monitor(pgs->icc_link_cache, dev);
if (code < 0)
return code;
}
@@ -884,7 +884,7 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
for (i = 0; i <= max_value; ++i) {
/* Enumerate the indexed colors, or just Black (DeviceGray = 0) */
cc.paint.values[0] = (double)i;
- remap_color(&cc, pcs, &dcolor, pis, dev,
+ remap_color(&cc, pcs, &dcolor, pgs, dev,
gs_color_select_source);
color_usage |= cmd_drawing_color_usage(cdev, &dcolor);
}
@@ -892,7 +892,7 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
}
pie->color_usage.or = color_usage;
pie->color_usage.slow_rop =
- cmd_slow_rop(dev, pis->log_op, (uses_color ? pdcolor : NULL));
+ cmd_slow_rop(dev, pgs->log_op, (uses_color ? pdcolor : NULL));
pie->color_map_is_known = false;
/*
* Calculate a (slightly conservative) Y bounding interval for the image
@@ -921,11 +921,11 @@ clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
cmd_clear_known(cdev, clist_image_unknowns(dev, pie) | begin_image_known);
/* Because the rendering intent may be driven by the source color
settings we may have needed to overide the intent. Need to break the const
- on the pis here for this and reset back */
+ on the pgs here for this and reset back */
if (intent_changed)
- pis_nonconst->renderingintent = renderingintent;
+ pgs_nonconst->renderingintent = renderingintent;
if (bp_changed)
- pis_nonconst->blackptcomp = blackptcomp;
+ pgs_nonconst->blackptcomp = blackptcomp;
cdev->image_enum_id = pie->id;
return 0;
@@ -941,10 +941,10 @@ use_default:
gs_free_object(mem, pie, "clist_begin_typed_image");
*pinfo = NULL;
- if (pis->has_transparency){
+ if (pgs->has_transparency){
return -1;
} else {
- return gx_default_begin_typed_image(dev, pis, pmat, pic, prect,
+ return gx_default_begin_typed_image(dev, pgs, pmat, pic, prect,
pdcolor, pcpath, mem, pinfo);
}
}
@@ -1089,17 +1089,17 @@ clist_image_plane_data(gx_image_enum_common_t * info,
/* Write out begin_image & its preamble for this band */
if (!(re.pcls->known & begin_image_known)) {
- gs_logical_operation_t lop = pie->pis->log_op;
+ gs_logical_operation_t lop = pie->pgs->log_op;
byte *dp;
byte *bp = pie->begin_image_command +
pie->begin_image_command_length;
uint len;
byte image_op = cmd_opv_begin_image;
- /* Make sure the imager state is up to date. */
+ /* Make sure the gs_gstate is up to date. */
do {
code = (pie->color_map_is_known ? 0 :
- cmd_put_color_mapping(cdev, pie->pis));
+ cmd_put_color_mapping(cdev, pie->pgs));
pie->color_map_is_known = true;
if (code >= 0) {
uint want_known = ctm_known | clip_path_known |
@@ -1210,7 +1210,7 @@ clist_image_plane_data(gx_image_enum_common_t * info,
cmm_dev_profile_t *dev_profile;
code = dev_proc(dev, get_profile)(dev, &dev_profile);
dev_profile->pageneutralcolor = false;
- code |= gsicc_mcm_end_monitor(pie->pis->icc_link_cache, dev);
+ code |= gsicc_mcm_end_monitor(pie->pgs->icc_link_cache, dev);
pie->monitor_color = false;
}
} else {
@@ -1307,7 +1307,7 @@ clist_image_end_image(gx_image_enum_common_t * info, bool draw_last)
int
clist_create_compositor(gx_device * dev,
gx_device ** pcdev, const gs_composite_t * pcte,
- gs_imager_state * pis, gs_memory_t * mem, gx_device *cldev)
+ gs_gstate * pgs, gs_memory_t * mem, gx_device *cldev)
{
byte * dp;
uint size = 0, size_dummy;
@@ -1327,7 +1327,7 @@ clist_create_compositor(gx_device * dev,
/* Create a compositor device for clist writing (if needed) */
code = pcte->type->procs.clist_compositor_write_update(pcte, dev,
- pcdev, pis, mem);
+ pcdev, pgs, mem);
if (code < 0)
return code;
@@ -1588,10 +1588,10 @@ cmd_put_halftone(gx_device_clist_writer * cldev, const gx_device_halftone * pdht
/* Write out any necessary color mapping data. */
int
cmd_put_color_mapping(gx_device_clist_writer * cldev,
- const gs_imager_state * pis)
+ const gs_gstate * pgs)
{
int code;
- const gx_device_halftone *pdht = pis->dev_ht;
+ const gx_device_halftone *pdht = pgs->dev_ht;
/* Put out the halftone, if present. */
if (pdht && pdht->id != cldev->device_halftone_id) {
@@ -1602,12 +1602,12 @@ cmd_put_color_mapping(gx_device_clist_writer * cldev,
}
/* Put the under color removal and black generation functions */
code = cmd_put_color_map(cldev, cmd_map_black_generation,
- 0, pis->black_generation,
+ 0, pgs->black_generation,
&cldev->black_generation_id);
if (code < 0)
return code;
code = cmd_put_color_map(cldev, cmd_map_undercolor_removal,
- 0, pis->undercolor_removal,
+ 0, pgs->undercolor_removal,
&cldev->undercolor_removal_id);
if (code < 0)
return code;
@@ -1623,15 +1623,15 @@ cmd_put_color_mapping(gx_device_clist_writer * cldev,
* have in the set_transfer structure. The halftone xfer funcs
* are sent in cmd_put_halftone.
*/
-#define get_id(pis, color, color_num) \
- ((pis->set_transfer.color != NULL && pis->set_transfer.color_num >= 0) \
- ? pis->set_transfer.color->id\
- : pis->set_transfer.gray->id)
-
- xfer_ids[0] = get_id(pis, red, red_component_num);
- xfer_ids[1] = get_id(pis, green, green_component_num);
- xfer_ids[2] = get_id(pis, blue, blue_component_num);
- xfer_ids[3] = default_comp_id = pis->set_transfer.gray->id;
+#define get_id(pgs, color, color_num) \
+ ((pgs->set_transfer.color != NULL && pgs->set_transfer.color_num >= 0) \
+ ? pgs->set_transfer.color->id\
+ : pgs->set_transfer.gray->id)
+
+ xfer_ids[0] = get_id(pgs, red, red_component_num);
+ xfer_ids[1] = get_id(pgs, green, green_component_num);
+ xfer_ids[2] = get_id(pgs, blue, blue_component_num);
+ xfer_ids[3] = default_comp_id = pgs->set_transfer.gray->id;
#undef get_id
for (i = 0; i < countof(cldev->transfer_ids); ++i) {
@@ -1653,7 +1653,7 @@ cmd_put_color_mapping(gx_device_clist_writer * cldev,
gs_id dummy = gs_no_id;
code = cmd_put_color_map(cldev, cmd_map_transfer, 0,
- pis->set_transfer.gray, &dummy);
+ pgs->set_transfer.gray, &dummy);
if (code < 0)
return code;
/* Sending a default will force all xfers to default */
@@ -1663,22 +1663,22 @@ cmd_put_color_mapping(gx_device_clist_writer * cldev,
/* Send any transfer functions which have changed */
if (cldev->transfer_ids[0] != xfer_ids[0]) {
code = cmd_put_color_map(cldev, cmd_map_transfer_0,
- pis->set_transfer.red_component_num,
- pis->set_transfer.red, &cldev->transfer_ids[0]);
+ pgs->set_transfer.red_component_num,
+ pgs->set_transfer.red, &cldev->transfer_ids[0]);
if (code < 0)
return code;
}
if (cldev->transfer_ids[1] != xfer_ids[1]) {
code = cmd_put_color_map(cldev, cmd_map_transfer_1,
- pis->set_transfer.green_component_num,
- pis->set_transfer.green, &cldev->transfer_ids[1]);
+ pgs->set_transfer.green_component_num,
+ pgs->set_transfer.green, &cldev->transfer_ids[1]);
if (code < 0)
return code;
}
if (cldev->transfer_ids[2] != xfer_ids[2]) {
code = cmd_put_color_map(cldev, cmd_map_transfer_2,
- pis->set_transfer.blue_component_num,
- pis->set_transfer.blue, &cldev->transfer_ids[2]);
+ pgs->set_transfer.blue_component_num,
+ pgs->set_transfer.blue, &cldev->transfer_ids[2]);
if (code < 0)
return code;
}
@@ -1876,7 +1876,7 @@ clist_image_unknowns(gx_device *dev, const clist_image_enum *pie)
{
gx_device_clist_writer * const cdev =
&((gx_device_clist *)dev)->writer;
- const gs_imager_state *const pis = pie->pis;
+ const gs_gstate *const pgs = pie->pgs;
uint unknown = 0;
/*
@@ -1885,15 +1885,15 @@ clist_image_unknowns(gx_device *dev, const clist_image_enum *pie)
* are unknown. Set the device state in anticipation of the values
* becoming known.
*/
- if (cdev->imager_state.ctm.xx != pis->ctm.xx ||
- cdev->imager_state.ctm.xy != pis->ctm.xy ||
- cdev->imager_state.ctm.yx != pis->ctm.yx ||
- cdev->imager_state.ctm.yy != pis->ctm.yy ||
- cdev->imager_state.ctm.tx != pis->ctm.tx ||
- cdev->imager_state.ctm.ty != pis->ctm.ty
+ if (cdev->gs_gstate.ctm.xx != pgs->ctm.xx ||
+ cdev->gs_gstate.ctm.xy != pgs->ctm.xy ||
+ cdev->gs_gstate.ctm.yx != pgs->ctm.yx ||
+ cdev->gs_gstate.ctm.yy != pgs->ctm.yy ||
+ cdev->gs_gstate.ctm.tx != pgs->ctm.tx ||
+ cdev->gs_gstate.ctm.ty != pgs->ctm.ty
) {
unknown |= ctm_known;
- cdev->imager_state.ctm = pis->ctm;
+ cdev->gs_gstate.ctm = pgs->ctm;
}
if (pie->color_space.id == gs_no_id) { /* masked image */
cdev->color_space.space = 0; /* for GC */
@@ -1914,29 +1914,29 @@ clist_image_unknowns(gx_device *dev, const clist_image_enum *pie)
* though both parameters are passed in the state as well, this usually
* has no effect.
*/
- if (cdev->imager_state.overprint != pis->overprint ||
- cdev->imager_state.overprint_mode != pis->overprint_mode ||
- cdev->imager_state.blend_mode != pis->blend_mode ||
- cdev->imager_state.text_knockout != pis->text_knockout ||
- cdev->imager_state.renderingintent != pis->renderingintent) {
+ if (cdev->gs_gstate.overprint != pgs->overprint ||
+ cdev->gs_gstate.overprint_mode != pgs->overprint_mode ||
+ cdev->gs_gstate.blend_mode != pgs->blend_mode ||
+ cdev->gs_gstate.text_knockout != pgs->text_knockout ||
+ cdev->gs_gstate.renderingintent != pgs->renderingintent) {
unknown |= op_bm_tk_known;
- cdev->imager_state.overprint = pis->overprint;
- cdev->imager_state.overprint_mode = pis->overprint_mode;
- cdev->imager_state.blend_mode = pis->blend_mode;
- cdev->imager_state.text_knockout = pis->text_knockout;
- cdev->imager_state.renderingintent = pis->renderingintent;
+ cdev->gs_gstate.overprint = pgs->overprint;
+ cdev->gs_gstate.overprint_mode = pgs->overprint_mode;
+ cdev->gs_gstate.blend_mode = pgs->blend_mode;
+ cdev->gs_gstate.text_knockout = pgs->text_knockout;
+ cdev->gs_gstate.renderingintent = pgs->renderingintent;
}
- if (cdev->imager_state.opacity.alpha != pis->opacity.alpha) {
+ if (cdev->gs_gstate.opacity.alpha != pgs->opacity.alpha) {
unknown |= opacity_alpha_known;
- cdev->imager_state.opacity.alpha = pis->opacity.alpha;
+ cdev->gs_gstate.opacity.alpha = pgs->opacity.alpha;
}
- if (cdev->imager_state.shape.alpha != pis->shape.alpha) {
+ if (cdev->gs_gstate.shape.alpha != pgs->shape.alpha) {
unknown |= shape_alpha_known;
- cdev->imager_state.shape.alpha = pis->shape.alpha;
+ cdev->gs_gstate.shape.alpha = pgs->shape.alpha;
}
- if (cdev->imager_state.alpha != pis->alpha) {
+ if (cdev->gs_gstate.alpha != pgs->alpha) {
unknown |= alpha_known;
- cdev->imager_state.alpha = pis->alpha;
+ cdev->gs_gstate.alpha = pgs->alpha;
}
return unknown;
}
diff --git a/base/gxclip.c b/base/gxclip.c
index d5848fb69..cc4211f93 100644
--- a/base/gxclip.c
+++ b/base/gxclip.c
@@ -442,12 +442,12 @@ clip_call_fill_rectangle_hl_color(clip_callback_data_t * pccd, int xc, int yc,
rect.q.x = int2fixed(xec);
rect.q.y = int2fixed(yec);
return (*dev_proc(pccd->tdev, fill_rectangle_hl_color))
- (pccd->tdev, &rect, pccd->pis, pccd->pdcolor, pccd->pcpath);
+ (pccd->tdev, &rect, pccd->pgs, pccd->pdcolor, pccd->pcpath);
}
static int
clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_clip *rdev = (gx_device_clip *) dev;
@@ -482,7 +482,7 @@ clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
newrect.p.y = int2fixed(y);
newrect.q.x = int2fixed(x + w);
newrect.q.y = int2fixed(y + h);
- return dev_proc(tdev, fill_rectangle_hl_color)(tdev, &newrect, pis,
+ return dev_proc(tdev, fill_rectangle_hl_color)(tdev, &newrect, pgs,
pdcolor, pcpath);
}
else if ((rptr->prev == 0 || rptr->prev->ymax != rptr->ymax) &&
@@ -500,14 +500,14 @@ clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
newrect.p.y = int2fixed(y);
newrect.q.x = int2fixed(xe);
newrect.q.y = int2fixed(y + h);
- return dev_proc(tdev, fill_rectangle_hl_color)(tdev, &newrect, pis,
+ return dev_proc(tdev, fill_rectangle_hl_color)(tdev, &newrect, pgs,
pdcolor, pcpath);
}
}
}
ccdata.tdev = tdev;
ccdata.pdcolor = pdcolor;
- ccdata.pis = pis;
+ ccdata.pgs = pgs;
ccdata.pcpath = pcpath;
return clip_enumerate_rest(rdev, x, y, xe, ye,
clip_call_fill_rectangle_hl_color, &ccdata);
@@ -894,7 +894,7 @@ clip_call_fill_path(clip_callback_data_t * pccd, int xc, int yc, int xec, int ye
gx_path_init_local(&rect_path, pccd->ppath->memory);
gx_path_add_rectangle(&rect_path, int2fixed(xc), int2fixed(yc), int2fixed(xec), int2fixed(yec));
code = gx_cpath_intersect(&cpath_intersection, &rect_path,
- gx_rule_winding_number, (gs_imager_state *)(pccd->pis));
+ gx_rule_winding_number, (gs_gstate *)(pccd->pgs));
gx_path_free(&rect_path, "clip_call_fill_path");
} else {
gs_fixed_rect clip_box;
@@ -910,13 +910,13 @@ clip_call_fill_path(clip_callback_data_t * pccd, int xc, int yc, int xec, int ye
proc = dev_proc(tdev, fill_path);
if (proc == NULL)
proc = gx_default_fill_path;
- code = (*proc)(pccd->tdev, pccd->pis, pccd->ppath, pccd->params,
+ code = (*proc)(pccd->tdev, pccd->pgs, pccd->ppath, pccd->params,
pccd->pdcolor, &cpath_intersection);
gx_cpath_free(&cpath_intersection, "clip_call_fill_path");
return code;
}
static int
-clip_fill_path(gx_device * dev, const gs_imager_state * pis,
+clip_fill_path(gx_device * dev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath)
@@ -925,7 +925,7 @@ clip_fill_path(gx_device * dev, const gs_imager_state * pis,
clip_callback_data_t ccdata;
gs_fixed_rect box;
- ccdata.pis = pis;
+ ccdata.pgs = pgs;
ccdata.ppath = ppath;
ccdata.params = params;
ccdata.pdcolor = pdcolor;
diff --git a/base/gxclip.h b/base/gxclip.h
index 1da39c015..1f8f3cc54 100644
--- a/base/gxclip.h
+++ b/base/gxclip.h
@@ -49,7 +49,7 @@ typedef struct clip_callback_data_s {
const gx_strip_bitmap *textures; /* ibid. */
const gx_color_index *tcolors; /* ibid. */
int plane_height; /* copy_planes, strip_copy_rop2 */
- const gs_imager_state * pis; /* fill_path, fill_rectangle_hl_color */
+ const gs_gstate * pgs; /* fill_path, fill_rectangle_hl_color */
gx_path * ppath; /* fill_path */
const gx_fill_params * params; /* fill_path */
} clip_callback_data_t;
diff --git a/base/gxclip2.c b/base/gxclip2.c
index 722cdf02e..7ecd32fcb 100644
--- a/base/gxclip2.c
+++ b/base/gxclip2.c
@@ -155,7 +155,7 @@ tile_clip_set_phase(gx_device_tile_clip * cdev, int px, int py)
/* Fill a rectangle with high level devn color by tiling with the mask. */
static int
tile_clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_tile_clip *cdev = (gx_device_tile_clip *) dev;
diff --git a/base/gxclipm.c b/base/gxclipm.c
index a703d0904..3ff998d0a 100644
--- a/base/gxclipm.c
+++ b/base/gxclipm.c
@@ -119,7 +119,7 @@ const gx_device_mask_clip gs_mask_clip_device =
static int
mask_clip_fill_rectangle_hl_color(gx_device *dev,
const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_mask_clip *cdev = (gx_device_mask_clip *) dev;
diff --git a/base/gxclist.c b/base/gxclist.c
index 8f0361408..08fbe5837 100644
--- a/base/gxclist.c
+++ b/base/gxclist.c
@@ -46,7 +46,7 @@ extern dev_proc_open_device(pattern_clist_open_device);
writer rather than the common. fixme: Also, if icc_cache_cl is not
included in the writer, 64bit builds will seg fault */
-extern_st(st_imager_state);
+extern_st(st_gs_gstate);
static
ENUM_PTRS_WITH(device_clist_enum_ptrs, gx_device_clist *cdev)
if (index < st_device_forward_max_ptrs) {
@@ -67,8 +67,8 @@ ENUM_PTRS_WITH(device_clist_enum_ptrs, gx_device_clist *cdev)
case 3: return ENUM_OBJ(cdev->writer.cropping_stack);
case 4: return ENUM_OBJ(cdev->writer.icc_table);
default:
- return ENUM_USING(st_imager_state, &cdev->writer.imager_state,
- sizeof(gs_imager_state), index - 5);
+ return ENUM_USING(st_gs_gstate, &cdev->writer.gs_gstate,
+ sizeof(gs_gstate), index - 5);
}
}
else {
@@ -101,8 +101,8 @@ RELOC_PTRS_WITH(device_clist_reloc_ptrs, gx_device_clist *cdev)
RELOC_VAR(cdev->writer.pinst);
RELOC_VAR(cdev->writer.cropping_stack);
RELOC_VAR(cdev->writer.icc_table);
- RELOC_USING(st_imager_state, &cdev->writer.imager_state,
- sizeof(gs_imager_state));
+ RELOC_USING(st_gs_gstate, &cdev->writer.gs_gstate,
+ sizeof(gs_gstate));
} else {
/* 041207
* clist is reader.
@@ -231,11 +231,6 @@ clist_init_io_procs(gx_device_clist *pclist_dev, bool in_memory)
/* ------ Define the command set and syntax ------ */
-/* Initialization for imager state. */
-/* The initial scale is arbitrary. */
-const gs_imager_state clist_imager_state_initial =
-{gs_imager_state_initial(300.0 / 72.0, false)};
-
/*
* The buffer area (data, data_size) holds a bitmap cache when both writing
* and reading. The rest of the space is used for the command buffer and
@@ -540,7 +535,7 @@ clist_reset(gx_device * dev)
cdev->tile_depth = 0;
cdev->tile_known_min = nbands;
cdev->tile_known_max = -1;
- cdev->imager_state = clist_imager_state_initial;
+ GS_STATE_INIT_VALUES_CLIST((&cdev->gs_gstate));
cdev->clip_path = NULL;
cdev->clip_path_id = gs_no_id;
cdev->color_space.byte1 = 0;
diff --git a/base/gxclist.h b/base/gxclist.h
index 44416b1d2..ccab4dca6 100644
--- a/base/gxclist.h
+++ b/base/gxclist.h
@@ -26,7 +26,7 @@
#include "gxclio.h"
#include "gxcolor2.h" /* for pattern1_instance */
#include "gxdevbuf.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxrplane.h"
#include "gscms.h"
@@ -158,11 +158,11 @@ typedef struct cmd_list_s {
/*
* In order to keep the per-band state down to a reasonable size,
- * we store only a single set of the imager state parameters;
+ * we store only a single set of the gs_gstate parameters;
* for each parameter, each band has a flag that says whether that band
* 'knows' the current value of the parameters.
*/
-extern const gs_imager_state clist_imager_state_initial;
+#define GS_STATE_INIT_VALUES_CLIST(s) GS_STATE_INIT_VALUES(s, 300.0 / 72.0)
/*
* Define the main structure for holding command list state.
@@ -321,11 +321,11 @@ struct gx_device_clist_writer_s {
/* current tile parameters */
/*
* NOTE: we must not set the line_params.dash.pattern member of the
- * imager state to point to the dash_pattern member of the writer
+ * gs_gstate to point to the dash_pattern member of the writer
* state (except transiently), since this would confuse the
* garbage collector.
*/
- gs_imager_state imager_state; /* current values of imager params */
+ gs_gstate gs_gstate; /* current values of gs_gstate params */
bool pdf14_needed; /* if true then not page level opaque mode */
/* above set when not at page level with no SMask or when */
/* the page level BM, shape or opacity alpha needs tranaparency */
@@ -429,7 +429,7 @@ extern_st(st_device_clist);
"gx_device_clist", 0, device_clist_enum_ptrs, device_clist_reloc_ptrs,\
gx_device_finalize)
#define st_device_clist_max_ptrs\
- (st_device_forward_max_ptrs + st_imager_state_num_ptrs + 4)
+ (st_device_forward_max_ptrs + st_gs_gstate_num_ptrs + 4)
#define CLIST_IS_WRITER(cdev) ((cdev)->common.ymin < 0)
diff --git a/base/gxclpath.c b/base/gxclpath.c
index c5f13f47e..3642d40fb 100644
--- a/base/gxclpath.c
+++ b/base/gxclpath.c
@@ -350,7 +350,7 @@ cmd_check_clip_path(gx_device_clist_writer * cldev, const gx_clip_path * pcpath)
(cj_ac_sa_known | flatness_known | op_bm_tk_known | opacity_alpha_known |\
shape_alpha_known | fill_adjust_known | alpha_known | clip_path_known)
static void
-cmd_check_fill_known(gx_device_clist_writer *cdev, const gs_imager_state *pis,
+cmd_check_fill_known(gx_device_clist_writer *cdev, const gs_gstate *pgs,
double flatness, const gs_fixed_point *padjust,
const gx_clip_path *pcpath, uint *punknown)
{
@@ -366,9 +366,9 @@ cmd_check_fill_known(gx_device_clist_writer *cdev, const gs_imager_state *pis,
state_update(accurate_curves);
state_update(stroke_adjust);
}
- if (cdev->imager_state.flatness != flatness) {
+ if (cdev->gs_gstate.flatness != flatness) {
*punknown |= flatness_known;
- cdev->imager_state.flatness = flatness;
+ cdev->gs_gstate.flatness = flatness;
}
/*
* Note: overprint and overprint_mode are implemented via a compositor
@@ -394,13 +394,13 @@ cmd_check_fill_known(gx_device_clist_writer *cdev, const gs_imager_state *pis,
*punknown |= shape_alpha_known;
state_update(shape.alpha);
}
- if (cdev->imager_state.fill_adjust.x != padjust->x ||
- cdev->imager_state.fill_adjust.y != padjust->y
+ if (cdev->gs_gstate.fill_adjust.x != padjust->x ||
+ cdev->gs_gstate.fill_adjust.y != padjust->y
) {
*punknown |= fill_adjust_known;
- cdev->imager_state.fill_adjust = *padjust;
+ cdev->gs_gstate.fill_adjust = *padjust;
}
- if (cdev->imager_state.alpha != pis->alpha) {
+ if (cdev->gs_gstate.alpha != pgs->alpha) {
*punknown |= alpha_known;
state_update(alpha);
}
@@ -464,57 +464,57 @@ cmd_write_unknown(gx_device_clist_writer * cldev, gx_clist_state * pcls,
sizeof(float) + /* miter limit */
2 + /* op_bm_tk and rend intent */
sizeof(float) * 2 + /* opacity/shape alpha */
- sizeof(cldev->imager_state.alpha)
+ sizeof(cldev->gs_gstate.alpha)
];
byte *bp = buf;
if (unknown & cap_join_known) {
- *bp++ = (cldev->imager_state.line_params.start_cap << 3) +
- cldev->imager_state.line_params.join;
- *bp++ = (cldev->imager_state.line_params.end_cap << 3) +
- cldev->imager_state.line_params.dash_cap;
+ *bp++ = (cldev->gs_gstate.line_params.start_cap << 3) +
+ cldev->gs_gstate.line_params.join;
+ *bp++ = (cldev->gs_gstate.line_params.end_cap << 3) +
+ cldev->gs_gstate.line_params.dash_cap;
}
if (unknown & cj_ac_sa_known) {
*bp++ =
- ((cldev->imager_state.line_params.curve_join + 1) << 2) +
- (cldev->imager_state.accurate_curves ? 2 : 0) +
- (cldev->imager_state.stroke_adjust ? 1 : 0);
+ ((cldev->gs_gstate.line_params.curve_join + 1) << 2) +
+ (cldev->gs_gstate.accurate_curves ? 2 : 0) +
+ (cldev->gs_gstate.stroke_adjust ? 1 : 0);
}
if (unknown & flatness_known) {
- memcpy(bp, &cldev->imager_state.flatness, sizeof(float));
+ memcpy(bp, &cldev->gs_gstate.flatness, sizeof(float));
bp += sizeof(float);
}
if (unknown & line_width_known) {
float width =
- gx_current_line_width(&cldev->imager_state.line_params);
+ gx_current_line_width(&cldev->gs_gstate.line_params);
memcpy(bp, &width, sizeof(width));
bp += sizeof(width);
}
if (unknown & miter_limit_known) {
- memcpy(bp, &cldev->imager_state.line_params.miter_limit,
+ memcpy(bp, &cldev->gs_gstate.line_params.miter_limit,
sizeof(float));
bp += sizeof(float);
}
if (unknown & op_bm_tk_known) {
*bp++ =
- ((int)cldev->imager_state.blend_mode << 3) +
- (cldev->imager_state.text_knockout << 2) +
- (cldev->imager_state.overprint_mode << 1) +
- cldev->imager_state.overprint;
- *bp++ = cldev->imager_state.renderingintent;
+ ((int)cldev->gs_gstate.blend_mode << 3) +
+ (cldev->gs_gstate.text_knockout << 2) +
+ (cldev->gs_gstate.overprint_mode << 1) +
+ cldev->gs_gstate.overprint;
+ *bp++ = cldev->gs_gstate.renderingintent;
}
if (unknown & opacity_alpha_known) {
- memcpy(bp, &cldev->imager_state.opacity.alpha, sizeof(float));
+ memcpy(bp, &cldev->gs_gstate.opacity.alpha, sizeof(float));
bp += sizeof(float);
}
if (unknown & shape_alpha_known) {
- memcpy(bp, &cldev->imager_state.shape.alpha, sizeof(float));
+ memcpy(bp, &cldev->gs_gstate.shape.alpha, sizeof(float));
bp += sizeof(float);
}
if (unknown & alpha_known) {
- memcpy(bp, &cldev->imager_state.alpha,
- sizeof(cldev->imager_state.alpha));
- bp += sizeof(cldev->imager_state.alpha);
+ memcpy(bp, &cldev->gs_gstate.alpha,
+ sizeof(cldev->gs_gstate.alpha));
+ bp += sizeof(cldev->gs_gstate.alpha);
}
code = set_cmd_put_op(dp, cldev, pcls, cmd_opv_set_misc2,
1 + cmd_sizew(misc2_unknown) + (bp - buf));
@@ -528,34 +528,34 @@ cmd_write_unknown(gx_device_clist_writer * cldev, gx_clist_state * pcls,
1 + sizeof(fixed) * 2);
if (code < 0)
return code;
- memcpy(dp + 1, &cldev->imager_state.fill_adjust.x, sizeof(fixed));
- memcpy(dp + 1 + sizeof(fixed), &cldev->imager_state.fill_adjust.y, sizeof(fixed));
+ memcpy(dp + 1, &cldev->gs_gstate.fill_adjust.x, sizeof(fixed));
+ memcpy(dp + 1 + sizeof(fixed), &cldev->gs_gstate.fill_adjust.y, sizeof(fixed));
pcls->known |= fill_adjust_known;
}
if (unknown & ctm_known) {
- int len = cmd_write_ctm_return_length(cldev, &ctm_only(&cldev->imager_state));
+ int len = cmd_write_ctm_return_length(cldev, &ctm_only(&cldev->gs_gstate));
code = set_cmd_put_op(dp, cldev, pcls, cmd_opv_set_ctm, len + 1);
if (code < 0)
return code;
- code = cmd_write_ctm(&ctm_only(&cldev->imager_state), dp, len);
+ code = cmd_write_ctm(&ctm_only(&cldev->gs_gstate), dp, len);
if (code < 0)
return code;
pcls->known |= ctm_known;
}
if (unknown & dash_known) {
- int n = cldev->imager_state.line_params.dash.pattern_size;
+ int n = cldev->gs_gstate.line_params.dash.pattern_size;
code = set_cmd_put_op(dp, cldev, pcls, cmd_opv_set_dash,
2 + (n + 2) * sizeof(float));
if (code < 0)
return code;
- dp[1] = n + (cldev->imager_state.line_params.dash.adapt ? 0x80 : 0) +
- (cldev->imager_state.line_params.dot_length_absolute ? 0x40 : 0);
- memcpy(dp + 2, &cldev->imager_state.line_params.dot_length,
+ dp[1] = n + (cldev->gs_gstate.line_params.dash.adapt ? 0x80 : 0) +
+ (cldev->gs_gstate.line_params.dot_length_absolute ? 0x40 : 0);
+ memcpy(dp + 2, &cldev->gs_gstate.line_params.dot_length,
sizeof(float));
memcpy(dp + 2 + sizeof(float),
- &cldev->imager_state.line_params.dash.offset,
+ &cldev->gs_gstate.line_params.dash.offset,
sizeof(float));
if (n != 0)
memcpy(dp + 2 + sizeof(float) * 2,
@@ -705,7 +705,7 @@ cmd_write_unknown(gx_device_clist_writer * cldev, gx_clist_state * pcls,
/* ------ Driver procedures ------ */
int
-clist_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
+clist_fill_path(gx_device * dev, const gs_gstate * pgs, gx_path * ppath,
const gx_fill_params * params, const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath)
{
@@ -713,7 +713,7 @@ clist_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
&((gx_device_clist *)dev)->writer;
uint unknown = 0;
int ry, rheight, rx, rwidth, y0, y1;
- gs_logical_operation_t lop = pis->log_op;
+ gs_logical_operation_t lop = pgs->log_op;
byte op = (byte)
(params->rule == gx_rule_even_odd ?
cmd_opv_eofill : cmd_opv_fill);
@@ -745,7 +745,7 @@ clist_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
gs_debug_c(',')
) {
/* Disable path-based banding. */
- return gx_default_fill_path(dev, pis, ppath, params, pdcolor,
+ return gx_default_fill_path(dev, pgs, ppath, params, pdcolor,
pcpath);
}
if (pdcolor != NULL && gx_dc_is_pattern2_color(pdcolor)) {
@@ -758,7 +758,7 @@ clist_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
See comment below about pdcolor == NULL.
*/
cdev->cropping_saved = false;
- code = gx_default_fill_path(dev, pis, ppath, params, pdcolor, pcpath);
+ code = gx_default_fill_path(dev, pgs, ppath, params, pdcolor, pcpath);
if (cdev->cropping_saved) {
cdev->cropping_min = cdev->save_cropping_min;
cdev->cropping_max = cdev->save_cropping_max;
@@ -770,7 +770,7 @@ clist_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
}
y0 = ry;
y1 = ry + rheight;
- cmd_check_fill_known(cdev, pis, params->flatness, &adjust, pcpath,
+ cmd_check_fill_known(cdev, pgs, params->flatness, &adjust, pcpath,
&unknown);
if (unknown)
cmd_clear_known(cdev, unknown);
@@ -836,7 +836,7 @@ clist_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
return code;
if (code < 0) {
/* Something went wrong, use the default implementation. */
- return gx_default_fill_path(dev, pis, ppath, params, pdcolor,
+ return gx_default_fill_path(dev, pgs, ppath, params, pdcolor,
pcpath);
}
re.pcls->color_usage.slow_rop |= slow_rop;
@@ -854,19 +854,19 @@ clist_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
}
int
-clist_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
+clist_stroke_path(gx_device * dev, const gs_gstate * pgs, gx_path * ppath,
const gx_stroke_params * params,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath)
{
gx_device_clist_writer * const cdev =
&((gx_device_clist *)dev)->writer;
- int pattern_size = pis->line_params.dash.pattern_size;
+ int pattern_size = pgs->line_params.dash.pattern_size;
uint unknown = 0;
gs_fixed_rect bbox;
gs_fixed_point expansion;
int adjust_y, expansion_code;
int ry, rheight;
- gs_logical_operation_t lop = pis->log_op;
+ gs_logical_operation_t lop = pgs->log_op;
bool slow_rop = cmd_slow_rop(dev, lop_know_S_0(lop), pdcolor);
cmd_rects_enum_t re;
@@ -874,13 +874,13 @@ clist_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
gs_debug_c(',')
) {
/* Disable path-based banding. */
- return gx_default_stroke_path(dev, pis, ppath, params, pdcolor,
+ return gx_default_stroke_path(dev, pgs, ppath, params, pdcolor,
pcpath);
}
gx_path_bbox(ppath, &bbox);
- /* We must use the supplied imager state, not our saved one, */
+ /* We must use the supplied gs_gstate, not our saved one, */
/* for computing the stroke expansion. */
- expansion_code = gx_stroke_path_expansion(pis, ppath, &expansion);
+ expansion_code = gx_stroke_path_expansion(pgs, ppath, &expansion);
if (expansion_code < 0) {
/* Expansion is too large: use the entire page. */
adjust_y = 0;
@@ -897,39 +897,39 @@ clist_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
}
/* Check the dash pattern, since we bail out if */
/* the pattern is too large. */
- if (cdev->imager_state.line_params.dash.pattern_size != pattern_size ||
+ if (cdev->gs_gstate.line_params.dash.pattern_size != pattern_size ||
(pattern_size != 0 &&
- memcmp(cdev->dash_pattern, pis->line_params.dash.pattern,
+ memcmp(cdev->dash_pattern, pgs->line_params.dash.pattern,
pattern_size * sizeof(float))) ||
- cdev->imager_state.line_params.dash.offset !=
- pis->line_params.dash.offset ||
- cdev->imager_state.line_params.dash.adapt !=
- pis->line_params.dash.adapt ||
- cdev->imager_state.line_params.dot_length !=
- pis->line_params.dot_length ||
- cdev->imager_state.line_params.dot_length_absolute !=
- pis->line_params.dot_length_absolute
+ cdev->gs_gstate.line_params.dash.offset !=
+ pgs->line_params.dash.offset ||
+ cdev->gs_gstate.line_params.dash.adapt !=
+ pgs->line_params.dash.adapt ||
+ cdev->gs_gstate.line_params.dot_length !=
+ pgs->line_params.dot_length ||
+ cdev->gs_gstate.line_params.dot_length_absolute !=
+ pgs->line_params.dot_length_absolute
) {
/* Bail out if the dash pattern is too long. */
if (pattern_size > cmd_max_dash)
- return gx_default_stroke_path(dev, pis, ppath, params,
+ return gx_default_stroke_path(dev, pgs, ppath, params,
pdcolor, pcpath);
unknown |= dash_known;
/*
* Temporarily reset the dash pattern pointer for gx_set_dash,
* but don't leave it set, since that would confuse the GC.
*/
- cdev->imager_state.line_params.dash.pattern = cdev->dash_pattern;
- gx_set_dash(&cdev->imager_state.line_params.dash,
- pis->line_params.dash.pattern,
- pis->line_params.dash.pattern_size,
- pis->line_params.dash.offset, NULL);
- cdev->imager_state.line_params.dash.pattern = 0;
- gx_set_dash_adapt(&cdev->imager_state.line_params.dash,
- pis->line_params.dash.adapt);
- gx_set_dot_length(&cdev->imager_state.line_params,
- pis->line_params.dot_length,
- pis->line_params.dot_length_absolute);
+ cdev->gs_gstate.line_params.dash.pattern = cdev->dash_pattern;
+ gx_set_dash(&cdev->gs_gstate.line_params.dash,
+ pgs->line_params.dash.pattern,
+ pgs->line_params.dash.pattern_size,
+ pgs->line_params.dash.offset, NULL);
+ cdev->gs_gstate.line_params.dash.pattern = 0;
+ gx_set_dash_adapt(&cdev->gs_gstate.line_params.dash,
+ pgs->line_params.dash.adapt);
+ gx_set_dot_length(&cdev->gs_gstate.line_params,
+ pgs->line_params.dot_length,
+ pgs->line_params.dot_length_absolute);
}
if (state_neq(line_params.start_cap) || state_neq(line_params.join) ||
@@ -940,7 +940,7 @@ clist_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
state_update(line_params.dash_cap);
state_update(line_params.join);
}
- cmd_check_fill_known(cdev, pis, params->flatness, &pis->fill_adjust,
+ cmd_check_fill_known(cdev, pgs, params->flatness, &pgs->fill_adjust,
pcpath, &unknown);
if (state_neq(line_params.half_width)) {
unknown |= line_width_known;
@@ -948,8 +948,8 @@ clist_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
}
if (state_neq(line_params.miter_limit)) {
unknown |= miter_limit_known;
- gx_set_miter_limit(&cdev->imager_state.line_params,
- pis->line_params.miter_limit);
+ gx_set_miter_limit(&cdev->gs_gstate.line_params,
+ pgs->line_params.miter_limit);
}
if (state_neq(ctm.xx) || state_neq(ctm.xy) ||
state_neq(ctm.yx) || state_neq(ctm.yy) ||
@@ -993,7 +993,7 @@ clist_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
return code;
if (code < 0) {
/* Something went wrong, use the default implementation. */
- return gx_default_stroke_path(dev, pis, ppath, params, pdcolor,
+ return gx_default_stroke_path(dev, pgs, ppath, params, pdcolor,
pcpath);
}
re.pcls->color_usage.slow_rop |= slow_rop;
diff --git a/base/gxclpath.h b/base/gxclpath.h
index 0d0259437..1c9d4d6de 100644
--- a/base/gxclpath.h
+++ b/base/gxclpath.h
@@ -80,7 +80,7 @@ typedef enum {
/* op_bm_tk: blend mode(5)text knockout(1)o.p.mode(1)o.p.(1) */
/* segment notes: (byte) */
/* opacity/shape: alpha(float)mask(TBD) */
- /* alpha: <<verbatim copy from imager state>> */
+ /* alpha: <<verbatim copy from gs_gstate>> */
cmd_opv_set_misc2 = 0xd5, /* mask#, selected parameters */
cmd_opv_set_dash = 0xd6, /* adapt(1)abs.dot(1)n(6), dot */
/* length(float), offset(float), */
@@ -220,11 +220,11 @@ dev_proc_fill_triangle(clist_fill_triangle);
/* The procedures and macros defined here are used when writing */
/* (gxclimag.c, gxclpath.c). */
-/* Compare and update members of the imager state. */
+/* Compare and update members of the gs_gstate. */
#define state_neq(member)\
- (cdev->imager_state.member != pis->member)
+ (cdev->gs_gstate.member != pgs->member)
#define state_update(member)\
- (cdev->imager_state.member = pis->member)
+ (cdev->gs_gstate.member = pgs->member)
/* ------ Exported by gxclpath.c ------ */
diff --git a/base/gxclrast.c b/base/gxclrast.c
index 2cb269b78..1a8e8f5c7 100644
--- a/base/gxclrast.c
+++ b/base/gxclrast.c
@@ -23,7 +23,7 @@
#include "gscdefs.h" /* for image type table */
#include "gsbitops.h"
#include "gsparams.h"
-#include "gsstate.h" /* (should only be imager state) */
+#include "gsstate.h" /* (should only be gs_gstate) */
#include "gstrans.h" /* for gs_is_pdf14trans_compositor */
#include "gxdcolor.h"
#include "gxdevice.h"
@@ -247,22 +247,22 @@ static int read_set_bits(command_buf_t *pcb, tile_slot *bits,
int compress, gx_clist_state *pcls,
gx_strip_bitmap *tile, tile_slot **pslot,
gx_device_clist_reader *cdev, gs_memory_t *mem);
-static int read_set_misc2(command_buf_t *pcb, gs_imager_state *pis,
+static int read_set_misc2(command_buf_t *pcb, gs_gstate *pgs,
segment_notes *pnotes);
-static int read_set_color_space(command_buf_t *pcb, gs_imager_state *pis,
+static int read_set_color_space(command_buf_t *pcb, gs_gstate *pgs,
gs_color_space **ppcs, gx_device_clist_reader *cdev,
gs_memory_t *mem);
static int read_begin_image(command_buf_t *pcb, gs_image_common_t *pic,
gs_color_space *pcs);
-static int read_put_params(command_buf_t *pcb, gs_imager_state *pis,
+static int read_put_params(command_buf_t *pcb, gs_gstate *pgs,
gx_device_clist_reader *cdev,
gs_memory_t *mem);
static int read_create_compositor(command_buf_t *pcb, gs_memory_t *mem, gs_composite_t **ppcomp);
-static int apply_create_compositor(gx_device_clist_reader *cdev, gs_imager_state *pis,
+static int apply_create_compositor(gx_device_clist_reader *cdev, gs_gstate *pgs,
gs_memory_t *mem, gs_composite_t *pcomp,
int x0, int y0, gx_device **ptarget);
static int read_alloc_ht_buff(ht_buff_t *, uint, gs_memory_t *);
-static int read_ht_segment(ht_buff_t *, command_buf_t *, gs_imager_state *,
+static int read_ht_segment(ht_buff_t *, command_buf_t *, gs_gstate *,
gx_device *, gs_memory_t *);
static const byte *cmd_read_rect(int, gx_cmd_rect *, const byte *);
@@ -270,7 +270,7 @@ static const byte *cmd_read_short_bits(command_buf_t *pcb, byte *data, int tot_b
int width_bytes, int height,
uint raster, const byte *cbp);
static int cmd_select_map(cmd_map_index, cmd_map_contents,
- gs_imager_state *, int **,
+ gs_gstate *, int **,
frac **, uint *, gs_memory_t *);
static int cmd_create_dev_ht(gx_device_halftone **, gs_memory_t *);
static int cmd_resize_halftone(gx_device_halftone **, uint,
@@ -370,7 +370,7 @@ is_null_compositor_op(const byte *cbp, int *length)
}
static int
-execute_compositor_queue(gx_device_clist_reader *cdev, gx_device **target, gx_device **tdev, gs_imager_state *pis,
+execute_compositor_queue(gx_device_clist_reader *cdev, gx_device **target, gx_device **tdev, gs_gstate *pgs,
gs_composite_t **ppcomp_first, gs_composite_t **ppcomp_last, gs_composite_t *pcomp_from,
int x0, int y0, gs_memory_t *mem, bool idle)
{
@@ -383,7 +383,7 @@ execute_compositor_queue(gx_device_clist_reader *cdev, gx_device **target, gx_de
if (code < 0)
return code;
pcomp->idle |= idle;
- code = apply_create_compositor(cdev, pis, mem, pcomp, x0, y0, target); /* Releases the compositor. */
+ code = apply_create_compositor(cdev, pgs, mem, pcomp, x0, y0, target); /* Releases the compositor. */
if (code < 0)
return code;
*tdev = *target;
@@ -407,7 +407,7 @@ mark_as_idle(gs_composite_t *pcomp_start, gs_composite_t *pcomp_end)
static inline int
drop_compositor_queue(gs_composite_t **ppcomp_first, gs_composite_t **ppcomp_last,
gs_composite_t *pcomp_from, gs_memory_t *mem, int x0, int y0,
- gs_imager_state *pis)
+ gs_gstate *pgs)
{
gs_composite_t *pcomp;
@@ -418,7 +418,7 @@ drop_compositor_queue(gs_composite_t **ppcomp_first, gs_composite_t **ppcomp_las
if (pcomp == NULL)
return 0;
dequeue_compositor(ppcomp_first, ppcomp_last, *ppcomp_last);
- code = pcomp->type->procs.adjust_ctm(pcomp, x0, y0, pis);
+ code = pcomp->type->procs.adjust_ctm(pcomp, x0, y0, pgs);
if (code < 0)
return code;
free_compositor(pcomp, mem);
@@ -427,7 +427,7 @@ drop_compositor_queue(gs_composite_t **ppcomp_first, gs_composite_t **ppcomp_las
}
static int
-read_set_misc_map(byte cb, command_buf_t *pcb, gs_imager_state *pis, gs_memory_t *mem)
+read_set_misc_map(byte cb, command_buf_t *pcb, gs_gstate *pgs, gs_memory_t *mem)
{
const byte *cbp = pcb->ptr;
frac *mdata;
@@ -438,7 +438,7 @@ read_set_misc_map(byte cb, command_buf_t *pcb, gs_imager_state *pis, gs_memory_t
int code;
code = cmd_select_map(cb & 0xf, cont,
- pis,
+ pgs,
&pcomp_num,
&mdata, &count, mem);
@@ -468,7 +468,7 @@ read_set_misc_map(byte cb, command_buf_t *pcb, gs_imager_state *pis, gs_memory_t
}
/* Recompute the effective transfer, */
/* in case this was a transfer map. */
- gx_imager_set_effective_xfer(pis);
+ gx_gstate_set_effective_xfer(pgs);
pcb->ptr = cbp;
return 0;
}
@@ -509,7 +509,7 @@ clist_playback_band(clist_playback_action playback_action,
gx_device_color dcolor;
} clip_save;
bool in_clip = false;
- gs_imager_state imager_state;
+ gs_gstate gs_gstate;
gx_device_color dev_color;
float dash_pattern[cmd_max_dash];
gx_fill_params fill_params;
@@ -608,12 +608,12 @@ in: /* Initialize for a new page. */
}
if (target != 0)
(*dev_proc(target, get_clipping_box))(target, &target_box);
- imager_state = clist_imager_state_initial;
- code = gs_imager_state_initialize(&imager_state, mem);
+ GS_STATE_INIT_VALUES_CLIST((&gs_gstate));
+ code = gs_gstate_initialize(&gs_gstate, mem);
/* Remove the ICC link cache and replace with the device link cache
so that we share the cache across bands */
- rc_decrement(imager_state.icc_link_cache,"clist_playback_band");
- imager_state.icc_link_cache = cdev->icc_cache_cl;
+ rc_decrement(gs_gstate.icc_link_cache,"clist_playback_band");
+ gs_gstate.icc_link_cache = cdev->icc_cache_cl;
/* Need to lock during the increment of the link cache */
gx_monitor_enter(cdev->icc_cache_cl->lock);
rc_increment(cdev->icc_cache_cl);
@@ -621,11 +621,11 @@ in: /* Initialize for a new page. */
if (code < 0)
goto out;
- imager_state.line_params.dash.pattern = dash_pattern;
+ gs_gstate.line_params.dash.pattern = dash_pattern;
if (tdev != 0) {
- gx_set_cmap_procs(&imager_state, tdev);
+ gx_set_cmap_procs(&gs_gstate, tdev);
}
- gx_imager_setscreenphase(&imager_state, -x0, -y0, gs_color_select_all);
+ gx_gstate_setscreenphase(&gs_gstate, -x0, -y0, gs_color_select_all);
#ifdef DEBUG
halftone_type = ht_type_none;
#endif
@@ -740,7 +740,7 @@ in: /* Initialize for a new page. */
state.lop = (state.lop << 6) + (cb & 0x3f);
if_debug1m('L', mem, " lop=0x%x\n", state.lop);
if (state.lop_enabled)
- imager_state.log_op = state.lop;
+ gs_gstate.log_op = state.lop;
break;
case cmd_set_misc_data_x >> 6:
if (cb & 0x20)
@@ -752,7 +752,7 @@ in: /* Initialize for a new page. */
break;
case cmd_set_misc_map >> 6:
cbuf.ptr = cbp;
- code = read_set_misc_map(cb, &cbuf, &imager_state, mem);
+ code = read_set_misc_map(cb, &cbuf, &gs_gstate, mem);
if (code < 0)
goto out;
cbp = cbuf.ptr;
@@ -768,7 +768,7 @@ in: /* Initialize for a new page. */
halftone_type, num_comp);
#endif
code = cmd_resize_halftone(
- &imager_state.dev_ht,
+ &gs_gstate.dev_ht,
num_comp, mem);
if (code < 0)
goto out;
@@ -781,12 +781,12 @@ in: /* Initialize for a new page. */
continue;
case cmd_opv_enable_lop:
state.lop_enabled = true;
- imager_state.log_op = state.lop;
+ gs_gstate.log_op = state.lop;
if_debug0m('L', mem, "\n");
continue;
case cmd_opv_disable_lop:
state.lop_enabled = false;
- imager_state.log_op = lop_default;
+ gs_gstate.log_op = lop_default;
if_debug0m('L', mem, "\n");
continue;
case cmd_opv_end_page:
@@ -1161,10 +1161,10 @@ set_phase: /*
if (state_tile.size.x)
tile_phase.x =
(state.tile_phase.x + x0) % state_tile.size.x;
- if (imager_state.dev_ht && imager_state.dev_ht->lcm_width)
+ if (gs_gstate.dev_ht && gs_gstate.dev_ht->lcm_width)
color_phase.x =
(state.tile_phase.x + x0) %
- imager_state.dev_ht->lcm_width;
+ gs_gstate.dev_ht->lcm_width;
/*
* The true tile height for shifted tiles is not
* size.y: see gxbitmap.h for the computation.
@@ -1182,11 +1182,11 @@ set_phase: /*
tile_phase.y =
(state.tile_phase.y + y0) % full_height;
}
- if (imager_state.dev_ht && imager_state.dev_ht->lcm_height)
+ if (gs_gstate.dev_ht && gs_gstate.dev_ht->lcm_height)
color_phase.y =
(state.tile_phase.y + y0) %
- imager_state.dev_ht->lcm_height;
- gx_imager_setscreenphase(&imager_state,
+ gs_gstate.dev_ht->lcm_height;
+ gx_gstate_setscreenphase(&gs_gstate,
-(state.tile_phase.x + x0),
-(state.tile_phase.y + y0),
gs_color_select_all);
@@ -1194,11 +1194,11 @@ set_phase: /*
case cmd_op_misc2 >> 4:
switch (op) {
case cmd_opv_set_fill_adjust:
- cmd_get_value(imager_state.fill_adjust.x, cbp);
- cmd_get_value(imager_state.fill_adjust.y, cbp);
+ cmd_get_value(gs_gstate.fill_adjust.x, cbp);
+ cmd_get_value(gs_gstate.fill_adjust.y, cbp);
if_debug2m('L', mem, " (%g,%g)\n",
- fixed2float(imager_state.fill_adjust.x),
- fixed2float(imager_state.fill_adjust.y));
+ fixed2float(gs_gstate.fill_adjust.x),
+ fixed2float(gs_gstate.fill_adjust.y));
continue;
case cmd_opv_set_ctm:
{
@@ -1210,12 +1210,12 @@ set_phase: /*
mat.tx, mat.ty);
mat.tx -= x0;
mat.ty -= y0;
- gs_imager_setmatrix(&imager_state, &mat);
+ gs_gstate_setmatrix(&gs_gstate, &mat);
}
continue;
case cmd_opv_set_misc2:
cbuf.ptr = cbp;
- code = read_set_misc2(&cbuf, &imager_state, &notes);
+ code = read_set_misc2(&cbuf, &gs_gstate, &notes);
cbp = cbuf.ptr;
if (code < 0)
goto out;
@@ -1230,12 +1230,12 @@ set_phase: /*
cmd_get_value(offset, cbp);
memcpy(dash_pattern, cbp, n * sizeof(float));
- gx_set_dash(&imager_state.line_params.dash,
+ gx_set_dash(&gs_gstate.line_params.dash,
dash_pattern, n, offset,
NULL);
- gx_set_dash_adapt(&imager_state.line_params.dash,
+ gx_set_dash_adapt(&gs_gstate.line_params.dash,
(nb & 0x80) != 0);
- gx_set_dot_length(&imager_state.line_params,
+ gx_set_dot_length(&gs_gstate.line_params,
dot_length,
(nb & 0x40) != 0);
#ifdef DEBUG
@@ -1281,7 +1281,7 @@ set_phase: /*
/* temporarily set a solid color */
color_set_pure(&dev_color, (gx_color_index)1);
state.lop_enabled = false;
- imager_state.log_op = lop_default;
+ gs_gstate.log_op = lop_default;
break;
case cmd_opv_end_clip:
if_debug0m('L', mem, "\n");
@@ -1304,7 +1304,7 @@ set_phase: /*
pcpath = (use_clip ? &clip_path : NULL);
clipper_dev_open = false;
state.lop_enabled = clip_save.lop_enabled;
- imager_state.log_op =
+ gs_gstate.log_op =
(state.lop_enabled ? state.lop :
lop_default);
dev_color = clip_save.dcolor;
@@ -1312,7 +1312,7 @@ set_phase: /*
break;
case cmd_opv_set_color_space:
cbuf.ptr = cbp;
- code = read_set_color_space(&cbuf, &imager_state,
+ code = read_set_color_space(&cbuf, &gs_gstate,
&pcs, cdev, mem);
cbp = cbuf.ptr;
if (code < 0) {
@@ -1380,7 +1380,7 @@ ibegin: if_debug0m('L', mem, "\n");
/* Processing an image operation */
dev_proc(tdev, set_graphics_type_tag)(tdev, GS_IMAGE_TAG);
code = (*dev_proc(tdev, begin_typed_image))
- (tdev, &imager_state, NULL,
+ (tdev, &gs_gstate, NULL,
(const gs_image_common_t *)&image,
&image_rect, &dev_color, pcpath, mem,
&image_info);
@@ -1536,7 +1536,7 @@ idata: data_size = 0;
switch (*cbp++) {
case cmd_opv_ext_put_params:
cbuf.ptr = cbp;
- code = read_put_params(&cbuf, &imager_state,
+ code = read_put_params(&cbuf, &gs_gstate,
cdev, mem);
cbp = cbuf.ptr;
if (code > 0)
@@ -1553,7 +1553,7 @@ idata: data_size = 0;
* The screen phase may have been changed during
* the processing of masked images.
*/
- gx_imager_setscreenphase(&imager_state,
+ gx_gstate_setscreenphase(&gs_gstate,
-x0, -y0, gs_color_select_all);
cbp -= 2; /* Step back to simplify the cycle invariant below. */
for (;;) {
@@ -1603,7 +1603,7 @@ idata: data_size = 0;
/* Execute idle. */
enqueue_compositor(&pcomp_first, &pcomp_last, pcomp);
code = execute_compositor_queue(cdev, &target, &tdev,
- &imager_state, &pcomp_first, &pcomp_last, pcomp_opening, x0, y0, mem, true);
+ &gs_gstate, &pcomp_first, &pcomp_last, pcomp_opening, x0, y0, mem, true);
if (code < 0)
goto out;
break;
@@ -1611,14 +1611,14 @@ idata: data_size = 0;
/* The opening command was executed. Execute the queue. */
enqueue_compositor(&pcomp_first, &pcomp_last, pcomp);
code = execute_compositor_queue(cdev, &target, &tdev,
- &imager_state, &pcomp_first, &pcomp_last, pcomp_first, x0, y0, mem, false);
+ &gs_gstate, &pcomp_first, &pcomp_last, pcomp_first, x0, y0, mem, false);
if (code < 0)
goto out;
break;
case COMP_REPLACE_PREV:
/* Replace last compositors. */
code = execute_compositor_queue(cdev, &target, &tdev,
- &imager_state, &pcomp_first, &pcomp_last, pcomp_opening, x0, y0, mem, true);
+ &gs_gstate, &pcomp_first, &pcomp_last, pcomp_opening, x0, y0, mem, true);
if (code < 0)
goto out;
enqueue_compositor(&pcomp_first, &pcomp_last, pcomp);
@@ -1634,7 +1634,7 @@ idata: data_size = 0;
case COMP_DROP_QUEUE:
/* Annihilate the last compositors. */
enqueue_compositor(&pcomp_first, &pcomp_last, pcomp);
- code = drop_compositor_queue(&pcomp_first, &pcomp_last, pcomp_opening, mem, x0, y0, &imager_state);
+ code = drop_compositor_queue(&pcomp_first, &pcomp_last, pcomp_opening, mem, x0, y0, &gs_gstate);
if (code < 0)
goto out;
break;
@@ -1648,7 +1648,7 @@ idata: data_size = 0;
} else if (cbp[0] == cmd_opv_end_page) {
/* End page, drop the queue. */
code = execute_compositor_queue(cdev, &target, &tdev,
- &imager_state, &pcomp_first, &pcomp_last, pcomp_first, x0, y0, mem, true);
+ &gs_gstate, &pcomp_first, &pcomp_last, pcomp_first, x0, y0, mem, true);
if (code < 0)
goto out;
break;
@@ -1679,7 +1679,7 @@ idata: data_size = 0;
case cmd_opv_ext_put_ht_seg:
cbuf.ptr = cbp;
code = read_ht_segment(&ht_buff, &cbuf,
- &imager_state, tdev,
+ &gs_gstate, tdev,
mem);
cbp = cbuf.ptr;
if (code < 0)
@@ -1695,7 +1695,7 @@ idata: data_size = 0;
switch (cb >> 6) {
case cmd_set_misc_map >> 6:
cbuf.ptr = cbp;
- code = read_set_misc_map(cb, &cbuf, &imager_state, mem);
+ code = read_set_misc_map(cb, &cbuf, &gs_gstate, mem);
if (code < 0)
goto out;
cbp = cbuf.ptr;
@@ -1712,7 +1712,7 @@ idata: data_size = 0;
} else {
/* A drawing command, execute entire queue. */
code = execute_compositor_queue(cdev, &target, &tdev,
- &imager_state, &pcomp_first, &pcomp_last, pcomp_first, x0, y0, mem, false);
+ &gs_gstate, &pcomp_first, &pcomp_last, pcomp_first, x0, y0, mem, false);
if (code < 0)
goto out;
break;
@@ -1738,7 +1738,7 @@ idata: data_size = 0;
if_debug0m('L', mem, " ext_put_ht_seg\n");
cbuf.ptr = cbp;
code = read_ht_segment(&ht_buff, &cbuf,
- &imager_state, tdev,
+ &gs_gstate, tdev,
mem);
cbp = cbuf.ptr;
if (code < 0)
@@ -1795,7 +1795,7 @@ idata: data_size = 0;
if (!left) {
/* We still need to call pdct->read because it may change dev_color.type -
see gx_dc_null_read.*/
- code = pdct->read(pdcolor, &imager_state,
+ code = pdct->read(pdcolor, &gs_gstate,
pdcolor, tdev, offset,
cbp, 0, mem);
if (code < 0)
@@ -1808,7 +1808,7 @@ idata: data_size = 0;
return code;
}
l = min(left, cbuf.end - cbp);
- code = pdct->read(pdcolor, &imager_state,
+ code = pdct->read(pdcolor, &gs_gstate,
pdcolor, tdev, offset,
cbp, l, mem);
if (code < 0)
@@ -1818,7 +1818,7 @@ idata: data_size = 0;
offset += l;
left -= l;
}
- code = gx_color_load(pdcolor, &imager_state,
+ code = gx_color_load(pdcolor, &gs_gstate,
tdev);
if (code < 0)
goto out;
@@ -1918,8 +1918,8 @@ idata: data_size = 0;
if (in_clip) {
gx_path_init_local(&fpath, mem);
code = gx_path_add_flattened_accurate(&path, &fpath,
- gs_currentflat_inline(&imager_state),
- imager_state.accurate_curves);
+ gs_currentflat_inline(&gs_gstate),
+ gs_gstate.accurate_curves);
if (code < 0)
goto out;
ppath = &fpath;
@@ -1931,24 +1931,24 @@ idata: data_size = 0;
case cmd_opv_eofill:
fill_params.rule = gx_rule_even_odd;
fill:
- fill_params.adjust = imager_state.fill_adjust;
- fill_params.flatness = imager_state.flatness;
+ fill_params.adjust = gs_gstate.fill_adjust;
+ fill_params.flatness = gs_gstate.flatness;
code = gx_fill_path_only(ppath, tdev,
- &imager_state,
+ &gs_gstate,
&fill_params,
&dev_color, pcpath);
break;
case cmd_opv_stroke:
- stroke_params.flatness = imager_state.flatness;
+ stroke_params.flatness = gs_gstate.flatness;
stroke_params.traditional = false;
code = (*dev_proc(tdev, stroke_path))
- (tdev, &imager_state,
+ (tdev, &gs_gstate,
ppath, &stroke_params,
&dev_color, pcpath);
break;
case cmd_opv_polyfill:
code = clist_do_polyfill(tdev, ppath, &dev_color,
- imager_state.log_op);
+ gs_gstate.log_op);
break;
case cmd_opv_fill_trapezoid:
{
@@ -2032,7 +2032,7 @@ idata: data_size = 0;
fa.clip = &clip;
fa.swap_axes = swap_axes;
fa.ht = NULL;
- fa.lop = lop_default; /* fgixme: imager_state.log_op; */
+ fa.lop = lop_default; /* fgixme: gs_gstate.log_op; */
fa.ystart = ybot - y0f;
fa.yend = ytop - y0f;
cmd_getw(colors_mask, cbp);
@@ -2089,7 +2089,7 @@ idata: data_size = 0;
code = gx_default_fill_trapezoid(ttdev, &left, &right,
max(ybot - y0f, fixed_half),
min(ytop - y0f, int2fixed(wh)), swap_axes,
- &dev_color, imager_state.log_op);
+ &dev_color, gs_gstate.log_op);
}
break;
default:
@@ -2134,7 +2134,7 @@ idata: data_size = 0;
/* FIXME: This test should be unnecessary. Bug 692076
* is open pending a proper fix. */
code = (dev_proc(tdev, fillpage) == NULL ? 0 :
- (*dev_proc(tdev, fillpage))(tdev, &imager_state,
+ (*dev_proc(tdev, fillpage))(tdev, &gs_gstate,
&dev_color));
break;
}
@@ -2181,7 +2181,7 @@ idata: data_size = 0;
case cmd_op_tile_rect >> 4:
if (state.rect.width == 0 && state.rect.height == 0 &&
state.rect.x == 0 && state.rect.y == 0) {
- code = (*dev_proc(tdev, fillpage))(tdev, &imager_state, &dev_color);
+ code = (*dev_proc(tdev, fillpage))(tdev, &gs_gstate, &dev_color);
break;
}
case cmd_op_tile_rect_short >> 4:
@@ -2208,7 +2208,7 @@ idata: data_size = 0;
(tdev, source, data_x, raster, gx_no_bitmap_id,
state.rect.x - x0, state.rect.y - y0,
state.rect.width - data_x, state.rect.height,
- &dev_color, 1, imager_state.log_op, pcpath);
+ &dev_color, 1, gs_gstate.log_op, pcpath);
} else {
if (plane_height == 0) {
code = (*dev_proc(tdev, copy_mono))
@@ -2271,7 +2271,7 @@ idata: data_size = 0;
ht_buff.read_size = 0;
if (pcomp_last != NULL) {
- int code1 = drop_compositor_queue(&pcomp_first, &pcomp_last, NULL, mem, x0, y0, &imager_state);
+ int code1 = drop_compositor_queue(&pcomp_first, &pcomp_last, NULL, mem, x0, y0, &gs_gstate);
if (code == 0)
code = code1;
@@ -2279,14 +2279,14 @@ idata: data_size = 0;
rc_decrement_cs(pcs, "clist_playback_band");
gx_cpath_free(&clip_path, "clist_render_band exit");
gx_path_free(&path, "clist_render_band exit");
- if (imager_state.pattern_cache != NULL) {
- gx_pattern_cache_free(imager_state.pattern_cache);
- imager_state.pattern_cache = NULL;
+ if (gs_gstate.pattern_cache != NULL) {
+ gx_pattern_cache_free(gs_gstate.pattern_cache);
+ gs_gstate.pattern_cache = NULL;
}
/* The imager state release will decrement the icc link cache. To avoid
race conditions lock the cache */
gx_monitor_enter(cdev->icc_cache_cl->lock);
- gs_imager_state_release(&imager_state);
+ gs_gstate_release(&gs_gstate);
gx_monitor_leave(cdev->icc_cache_cl->lock); /* done with increment, let everyone run */
gs_free_object(mem, data_bits, "clist_playback_band(data_bits)");
if (target != orig_target) {
@@ -2546,7 +2546,7 @@ static int
read_ht_segment(
ht_buff_t * pht_buff,
command_buf_t * pcb,
- gs_imager_state * pis,
+ gs_gstate * pgs,
gx_device * dev,
gs_memory_t * mem )
{
@@ -2583,7 +2583,7 @@ read_ht_segment(
/* if everything has been read, convert back to a halftone */
if (pbuff != 0) {
- code = gx_ht_read_and_install(pis, dev, pbuff, ht_size, mem);
+ code = gx_ht_read_and_install(pgs, dev, pbuff, ht_size, mem);
/* release any buffered information */
if (pht_buff->pbuff != 0) {
@@ -2602,7 +2602,7 @@ read_ht_segment(
}
static int
-read_set_misc2(command_buf_t *pcb, gs_imager_state *pis, segment_notes *pnotes)
+read_set_misc2(command_buf_t *pcb, gs_gstate *pgs, segment_notes *pnotes)
{
const byte *cbp = pcb->ptr;
uint mask, cb;
@@ -2610,80 +2610,80 @@ read_set_misc2(command_buf_t *pcb, gs_imager_state *pis, segment_notes *pnotes)
cmd_getw(mask, cbp);
if (mask & cap_join_known) {
cb = *cbp++;
- pis->line_params.start_cap = (gs_line_cap)((cb >> 3) & 7);
- pis->line_params.join = (gs_line_join)(cb & 7);
- if_debug2m('L', pis->memory, " start_cap=%d join=%d\n",
- pis->line_params.start_cap, pis->line_params.join);
+ pgs->line_params.start_cap = (gs_line_cap)((cb >> 3) & 7);
+ pgs->line_params.join = (gs_line_join)(cb & 7);
+ if_debug2m('L', pgs->memory, " start_cap=%d join=%d\n",
+ pgs->line_params.start_cap, pgs->line_params.join);
cb = *cbp++;
- pis->line_params.end_cap = (gs_line_cap)((cb >> 3) & 7);
- pis->line_params.dash_cap = (gs_line_cap)(cb & 7);
- if_debug2m('L', pis->memory, "end_cap=%d dash_cap=%d\n",
- pis->line_params.end_cap, pis->line_params.dash_cap);
+ pgs->line_params.end_cap = (gs_line_cap)((cb >> 3) & 7);
+ pgs->line_params.dash_cap = (gs_line_cap)(cb & 7);
+ if_debug2m('L', pgs->memory, "end_cap=%d dash_cap=%d\n",
+ pgs->line_params.end_cap, pgs->line_params.dash_cap);
}
if (mask & cj_ac_sa_known) {
cb = *cbp++;
- pis->line_params.curve_join = ((cb >> 2) & 7) - 1;
- pis->accurate_curves = (cb & 2) != 0;
- pis->stroke_adjust = cb & 1;
- if_debug3m('L', pis->memory, " CJ=%d AC=%d SA=%d\n",
- pis->line_params.curve_join, pis->accurate_curves,
- pis->stroke_adjust);
+ pgs->line_params.curve_join = ((cb >> 2) & 7) - 1;
+ pgs->accurate_curves = (cb & 2) != 0;
+ pgs->stroke_adjust = cb & 1;
+ if_debug3m('L', pgs->memory, " CJ=%d AC=%d SA=%d\n",
+ pgs->line_params.curve_join, pgs->accurate_curves,
+ pgs->stroke_adjust);
}
if (mask & flatness_known) {
- cmd_get_value(pis->flatness, cbp);
- if_debug1m('L', pis->memory, " flatness=%g\n", pis->flatness);
+ cmd_get_value(pgs->flatness, cbp);
+ if_debug1m('L', pgs->memory, " flatness=%g\n", pgs->flatness);
}
if (mask & line_width_known) {
float width;
cmd_get_value(width, cbp);
- if_debug1m('L', pis->memory, " line_width=%g\n", width);
- gx_set_line_width(&pis->line_params, width);
+ if_debug1m('L', pgs->memory, " line_width=%g\n", width);
+ gx_set_line_width(&pgs->line_params, width);
}
if (mask & miter_limit_known) {
float limit;
cmd_get_value(limit, cbp);
- if_debug1m('L', pis->memory, " miter_limit=%g\n", limit);
- gx_set_miter_limit(&pis->line_params, limit);
+ if_debug1m('L', pgs->memory, " miter_limit=%g\n", limit);
+ gx_set_miter_limit(&pgs->line_params, limit);
}
if (mask & op_bm_tk_known) {
cb = *cbp++;
- pis->blend_mode = cb >> 3;
- pis->text_knockout = (cb & 4) != 0;
+ pgs->blend_mode = cb >> 3;
+ pgs->text_knockout = (cb & 4) != 0;
/* the following usually have no effect; see gxclpath.c */
- pis->overprint_mode = (cb >> 1) & 1;
- pis->effective_overprint_mode = pis->overprint_mode;
- pis->overprint = cb & 1;
+ pgs->overprint_mode = (cb >> 1) & 1;
+ pgs->effective_overprint_mode = pgs->overprint_mode;
+ pgs->overprint = cb & 1;
cb = *cbp++;
- pis->renderingintent = cb;
- if_debug5m('L', pis->memory, " BM=%d TK=%d OPM=%d OP=%d RI=%d\n",
- pis->blend_mode, pis->text_knockout, pis->overprint_mode,
- pis->overprint, pis->renderingintent);
+ pgs->renderingintent = cb;
+ if_debug5m('L', pgs->memory, " BM=%d TK=%d OPM=%d OP=%d RI=%d\n",
+ pgs->blend_mode, pgs->text_knockout, pgs->overprint_mode,
+ pgs->overprint, pgs->renderingintent);
}
if (mask & segment_notes_known) {
cb = *cbp++;
*pnotes = (segment_notes)(cb & 0x3f);
- if_debug1m('L', pis->memory, " notes=%d\n", *pnotes);
+ if_debug1m('L', pgs->memory, " notes=%d\n", *pnotes);
}
if (mask & opacity_alpha_known) {
- cmd_get_value(pis->opacity.alpha, cbp);
- if_debug1m('L', pis->memory, " opacity.alpha=%g\n", pis->opacity.alpha);
+ cmd_get_value(pgs->opacity.alpha, cbp);
+ if_debug1m('L', pgs->memory, " opacity.alpha=%g\n", pgs->opacity.alpha);
}
if (mask & shape_alpha_known) {
- cmd_get_value(pis->shape.alpha, cbp);
- if_debug1m('L', pis->memory, " shape.alpha=%g\n", pis->shape.alpha);
+ cmd_get_value(pgs->shape.alpha, cbp);
+ if_debug1m('L', pgs->memory, " shape.alpha=%g\n", pgs->shape.alpha);
}
if (mask & alpha_known) {
- cmd_get_value(pis->alpha, cbp);
- if_debug1m('L', pis->memory, " alpha=%u\n", pis->alpha);
+ cmd_get_value(pgs->alpha, cbp);
+ if_debug1m('L', pgs->memory, " alpha=%u\n", pgs->alpha);
}
pcb->ptr = cbp;
return 0;
}
static int
-read_set_color_space(command_buf_t *pcb, gs_imager_state *pis,
+read_set_color_space(command_buf_t *pcb, gs_gstate *pgs,
gs_color_space **ppcs, gx_device_clist_reader *cdev,
gs_memory_t *mem)
{
@@ -2823,7 +2823,7 @@ read_begin_image(command_buf_t *pcb, gs_image_common_t *pic,
}
static int
-read_put_params(command_buf_t *pcb, gs_imager_state *pis,
+read_put_params(command_buf_t *pcb, gs_gstate *pgs,
gx_device_clist_reader *cdev, gs_memory_t *mem)
{
const byte *cbp = pcb->ptr;
@@ -2882,7 +2882,7 @@ read_put_params(command_buf_t *pcb, gs_imager_state *pis,
code = gs_error_unknownerror; /* must match */
if (code >= 0) {
gs_c_param_list_read(&param_list);
- code = gs_imager_putdeviceparams(pis, (gx_device *)cdev,
+ code = gs_gstate_putdeviceparams(pgs, (gx_device *)cdev,
(gs_param_list *)&param_list);
}
gs_c_param_list_release(&param_list);
@@ -2946,21 +2946,21 @@ read_create_compositor(
return code;
}
-static int apply_create_compositor(gx_device_clist_reader *cdev, gs_imager_state *pis,
+static int apply_create_compositor(gx_device_clist_reader *cdev, gs_gstate *pgs,
gs_memory_t *mem, gs_composite_t *pcomp,
int x0, int y0, gx_device **ptarget)
{
gx_device *tdev = *ptarget;
int code;
- code = pcomp->type->procs.adjust_ctm(pcomp, x0, y0, pis);
+ code = pcomp->type->procs.adjust_ctm(pcomp, x0, y0, pgs);
if (code < 0)
return code;
/*
* Apply the compositor to the target device; note that this may
* change the target device.
*/
- code = dev_proc(tdev, create_compositor)(tdev, &tdev, pcomp, pis, mem, (gx_device*) cdev);
+ code = dev_proc(tdev, create_compositor)(tdev, &tdev, pcomp, pgs, mem, (gx_device*) cdev);
if (code >= 0 && tdev != *ptarget) {
/* If we created a new compositor here, then that new compositor should
* become the device to which we send all future drawing requests. If
@@ -2979,7 +2979,7 @@ static int apply_create_compositor(gx_device_clist_reader *cdev, gs_imager_state
/* Perform any updates for the clist device required */
code = pcomp->type->procs.clist_compositor_read_update(pcomp,
- (gx_device *)cdev, tdev, pis, mem);
+ (gx_device *)cdev, tdev, pgs, mem);
if (code < 0)
return code;
@@ -3069,7 +3069,7 @@ cmd_read_rect(int op, gx_cmd_rect * prect, const byte * cbp)
*/
static int
cmd_select_map(cmd_map_index map_index, cmd_map_contents cont,
- gs_imager_state * pis, int ** pcomp_num, frac ** pmdata,
+ gs_gstate * pgs, int ** pcomp_num, frac ** pmdata,
uint * pcount, gs_memory_t * mem)
{
gx_transfer_map *map;
@@ -3080,36 +3080,36 @@ cmd_select_map(cmd_map_index map_index, cmd_map_contents cont,
switch (map_index) {
case cmd_map_transfer:
if_debug0m('L', mem, " transfer");
- rc_unshare_struct(pis->set_transfer.gray, gx_transfer_map,
+ rc_unshare_struct(pgs->set_transfer.gray, gx_transfer_map,
&st_transfer_map, mem, return_error(gs_error_VMerror),
"cmd_select_map(default_transfer)");
- map = pis->set_transfer.gray;
+ map = pgs->set_transfer.gray;
/* Release all current maps */
- rc_decrement(pis->set_transfer.red, "cmd_select_map(red)");
- pis->set_transfer.red = NULL;
- pis->set_transfer.red_component_num = -1;
- rc_decrement(pis->set_transfer.green, "cmd_select_map(green)");
- pis->set_transfer.green = NULL;
- pis->set_transfer.green_component_num = -1;
- rc_decrement(pis->set_transfer.blue, "cmd_select_map(blue)");
- pis->set_transfer.blue = NULL;
- pis->set_transfer.blue_component_num = -1;
+ rc_decrement(pgs->set_transfer.red, "cmd_select_map(red)");
+ pgs->set_transfer.red = NULL;
+ pgs->set_transfer.red_component_num = -1;
+ rc_decrement(pgs->set_transfer.green, "cmd_select_map(green)");
+ pgs->set_transfer.green = NULL;
+ pgs->set_transfer.green_component_num = -1;
+ rc_decrement(pgs->set_transfer.blue, "cmd_select_map(blue)");
+ pgs->set_transfer.blue = NULL;
+ pgs->set_transfer.blue_component_num = -1;
goto transfer2;
case cmd_map_transfer_0:
- pmap = &pis->set_transfer.red;
- *pcomp_num = &pis->set_transfer.red_component_num;
+ pmap = &pgs->set_transfer.red;
+ *pcomp_num = &pgs->set_transfer.red_component_num;
goto transfer1;
case cmd_map_transfer_1:
- pmap = &pis->set_transfer.green;
- *pcomp_num = &pis->set_transfer.green_component_num;
+ pmap = &pgs->set_transfer.green;
+ *pcomp_num = &pgs->set_transfer.green_component_num;
goto transfer1;
case cmd_map_transfer_2:
- pmap = &pis->set_transfer.blue;
- *pcomp_num = &pis->set_transfer.blue_component_num;
+ pmap = &pgs->set_transfer.blue;
+ *pcomp_num = &pgs->set_transfer.blue_component_num;
goto transfer1;
case cmd_map_transfer_3:
- pmap = &pis->set_transfer.gray;
- *pcomp_num = &pis->set_transfer.gray_component_num;
+ pmap = &pgs->set_transfer.gray;
+ *pcomp_num = &pgs->set_transfer.gray_component_num;
transfer1: if_debug1m('L', mem, " transfer[%d]", (int)(map_index - cmd_map_transfer_0));
rc_unshare_struct(*pmap, gx_transfer_map, &st_transfer_map, mem,
return_error(gs_error_VMerror), "cmd_select_map(transfer)");
@@ -3124,12 +3124,12 @@ transfer2: if (cont != cmd_map_other) {
break;
case cmd_map_black_generation:
if_debug0m('L', mem, " black generation");
- pmap = &pis->black_generation;
+ pmap = &pgs->black_generation;
cname = "cmd_select_map(black generation)";
goto alloc;
case cmd_map_undercolor_removal:
if_debug0m('L', mem, " undercolor removal");
- pmap = &pis->undercolor_removal;
+ pmap = &pgs->undercolor_removal;
cname = "cmd_select_map(undercolor removal)";
alloc: if (cont == cmd_map_none) {
rc_decrement(*pmap, cname);
diff --git a/base/gxclrect.c b/base/gxclrect.c
index 08d304044..ac2596b6f 100644
--- a/base/gxclrect.c
+++ b/base/gxclrect.c
@@ -306,7 +306,7 @@ cmd_write_trapezoid_cmd(gx_device_clist_writer * cldev, gx_clist_state * pcls,
/* ---------------- Driver procedures ---------------- */
int
-clist_fillpage(gx_device * dev, gs_imager_state *pis, gx_drawing_color *pdcolor)
+clist_fillpage(gx_device * dev, gs_gstate *pgs, gx_drawing_color *pdcolor)
{
gx_device_clist * const cldev = (gx_device_clist *)dev;
gx_device_clist_writer * const cdev = &(cldev->writer);
@@ -385,7 +385,7 @@ error_in_rect:
/* This is used in fills from devn color types */
int
clist_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis, const gx_drawing_color *pdcolor,
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
gx_device_clist_writer * const cdev =
diff --git a/base/gxcmap.c b/base/gxcmap.c
index c89f8412b..73e9c3fda 100644
--- a/base/gxcmap.c
+++ b/base/gxcmap.c
@@ -206,7 +206,7 @@ gray_cs_to_gray_cm(gx_device * dev, frac gray, frac out[])
}
static void
-rgb_cs_to_gray_cm(gx_device * dev, const gs_imager_state *pis,
+rgb_cs_to_gray_cm(gx_device * dev, const gs_gstate *pgs,
frac r, frac g, frac b, frac out[])
{
out[0] = color_rgb_to_gray(r, g, b, NULL);
@@ -225,7 +225,7 @@ gray_cs_to_rgb_cm(gx_device * dev, frac gray, frac out[])
}
void
-rgb_cs_to_rgb_cm(gx_device * dev, const gs_imager_state *pis,
+rgb_cs_to_rgb_cm(gx_device * dev, const gs_gstate *pgs,
frac r, frac g, frac b, frac out[])
{
out[0] = r;
@@ -247,7 +247,7 @@ gray_cs_to_rgbk_cm(gx_device * dev, frac gray, frac out[])
}
static void
-rgb_cs_to_rgbk_cm(gx_device * dev, const gs_imager_state *pis,
+rgb_cs_to_rgbk_cm(gx_device * dev, const gs_gstate *pgs,
frac r, frac g, frac b, frac out[])
{
if ((r == g) && (g == b)) {
@@ -289,7 +289,7 @@ gray_cs_to_cmyk_cm(gx_device * dev, frac gray, frac out[])
* it is unlikely that any device with a DeviceCMYK color model
* would define this mapping on its own.
*
- * If the imager state is not available, map as though the black
+ * If the gs_gstate is not available, map as though the black
* generation and undercolor removal functions are identity
* transformations. This mode is used primarily to support the
* raster operation (rop) feature of PCL, which requires that
@@ -299,11 +299,11 @@ gray_cs_to_cmyk_cm(gx_device * dev, frac gray, frac out[])
* often they are { pop 0 }.
*/
static void
-rgb_cs_to_cmyk_cm(gx_device * dev, const gs_imager_state *pis,
+rgb_cs_to_cmyk_cm(gx_device * dev, const gs_gstate *pgs,
frac r, frac g, frac b, frac out[])
{
- if (pis != 0)
- color_rgb_to_cmyk(r, g, b, pis, out, dev->memory);
+ if (pgs != 0)
+ color_rgb_to_cmyk(r, g, b, pgs, out, dev->memory);
else {
frac c = frac_1 - r, m = frac_1 - g, y = frac_1 - b;
frac k = min(c, min(m, y));
@@ -526,29 +526,29 @@ static const gx_color_map_procs cmap_many = {
const gx_color_map_procs *const cmap_procs_default = &cmap_many;
/* Determine the color mapping procedures for a device. */
-/* Note that the default procedure doesn't consult the imager state. */
+/* Note that the default procedure doesn't consult the gs_gstate. */
const gx_color_map_procs *
-gx_get_cmap_procs(const gs_imager_state *pis, const gx_device * dev)
+gx_get_cmap_procs(const gs_gstate *pgs, const gx_device * dev)
{
- return (pis->get_cmap_procs)(pis, dev);
+ return (pgs->get_cmap_procs)(pgs, dev);
}
const gx_color_map_procs *
-gx_default_get_cmap_procs(const gs_imager_state *pis, const gx_device * dev)
+gx_default_get_cmap_procs(const gs_gstate *pgs, const gx_device * dev)
{
return (gx_device_must_halftone(dev) ? &cmap_few : &cmap_many);
}
/* Set the color mapping procedures in the graphics state. */
void
-gx_set_cmap_procs(gs_imager_state * pis, const gx_device * dev)
+gx_set_cmap_procs(gs_gstate * pgs, const gx_device * dev)
{
- pis->cmap_procs = gx_get_cmap_procs(pis, dev);
+ pgs->cmap_procs = gx_get_cmap_procs(pgs, dev);
}
/* Remap the color in the graphics state. */
int
-gx_remap_color(gs_state * pgs)
+gx_remap_color(gs_gstate * pgs)
{
const gs_color_space *pcs = gs_currentcolorspace_inline(pgs);
int code = 0;
@@ -559,7 +559,7 @@ gx_remap_color(gs_state * pgs)
if (!gx_dc_is_pure(gs_currentdevicecolor_inline(pgs)))
code = (*pcs->type->remap_color) (gs_currentcolor_inline(pgs),
pcs, gs_currentdevicecolor_inline(pgs),
- (gs_imager_state *) pgs, pgs->device,
+ (gs_gstate *) pgs, pgs->device,
gs_color_select_texture);
/* if overprint mode is in effect, update the overprint information */
if (code >= 0 && pgs->effective_overprint_mode == 1)
@@ -569,14 +569,14 @@ gx_remap_color(gs_state * pgs)
/* Indicate that a color space has no underlying concrete space. */
const gs_color_space *
-gx_no_concrete_space(const gs_color_space * pcs, const gs_imager_state * pis)
+gx_no_concrete_space(const gs_color_space * pcs, const gs_gstate * pgs)
{
return NULL;
}
/* Indicate that a color space is concrete. */
const gs_color_space *
-gx_same_concrete_space(const gs_color_space * pcs, const gs_imager_state * pis)
+gx_same_concrete_space(const gs_color_space * pcs, const gs_gstate * pgs)
{
return pcs;
}
@@ -584,7 +584,7 @@ gx_same_concrete_space(const gs_color_space * pcs, const gs_imager_state * pis)
/* Indicate that a color cannot be concretized. */
int
gx_no_concretize_color(const gs_client_color * pcc, const gs_color_space * pcs,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
return_error(gs_error_rangecheck);
}
@@ -594,7 +594,7 @@ gx_no_concretize_color(const gs_client_color * pcc, const gs_color_space * pcs,
here */
bool
gx_remap_named_color(const gs_client_color * pcc, const gs_color_space * pcs,
-gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
gx_color_value device_values[GX_DEVICE_COLOR_MAX_COMPONENTS];
@@ -615,15 +615,15 @@ gs_color_select_t select)
int num_src_comps = 1;
/* Define the rendering intents. */
- rendering_params.black_point_comp = pis->blackptcomp;
+ rendering_params.black_point_comp = pgs->blackptcomp;
rendering_params.graphics_type_tag = dev->graphics_type_tag;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = pis->renderingintent;
+ rendering_params.rendering_intent = pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
if (type == gs_color_space_index_Separation) {
- pcs->params.separation.get_colorname_string(pis->memory, name,
+ pcs->params.separation.get_colorname_string(pgs->memory, name,
&pname, &name_size);
named_color_sep.colorant_name = (char*)pname;
named_color_sep.name_size = name_size;
@@ -649,7 +649,7 @@ gs_color_select_t select)
return false; /* Only sep and deviceN for named color replacement */
code = gsicc_transform_named_color(pcc->paint.values, named_color_ptr,
- num_src_comps, device_values, pis, dev, NULL, &rendering_params);
+ num_src_comps, device_values, pgs, dev, NULL, &rendering_params);
if (named_color_devn != NULL)
gs_free_object(dev->memory->non_gc_memory, named_color_devn,
"gx_remap_named_color");
@@ -660,15 +660,15 @@ gs_color_select_t select)
order already. If we have specified the colorants with
-sICCOutputColors (i.e. if you are using an NCLR output profile) then
we should be good. If not or if instead one used SeparationColorNames and
- SeparationOrder to set up the device, then we need to make a copy
- of the imager state and make sure that we set color_component_map is
+ SeparationOrder to set up the device, then we need to make a copy
+ of the gs_gstate and make sure that we set color_component_map is
properly set up for the gx_remap_concrete_devicen proc. */
for (k = 0; k < num_des_comps; k++)
conc[k] = float2frac(((float)device_values[k]) / 65535.0);
/* If we are looking to create the equivalent CMYK value then no need
to worry about NCLR profiles or about altering the colorant map */
- if (!named_color_equivalent_cmyk_colors(pis)) {
+ if (!named_color_equivalent_cmyk_colors(pgs)) {
/* We need to apply transfer functions, possibily halftone and
encode the color for the device. To get proper mapping of the
colors to the device positions, you MUST specify -sICCOutputColors
@@ -683,15 +683,15 @@ gs_color_select_t select)
if (!dev_profile->spotnames->equiv_cmyk_set) {
/* Note that if the improper NCLR profile is used, then the
composite preview will be wrong. */
- code = gsicc_set_devicen_equiv_colors(dev, pis, dev_profile->device_profile[0]);
+ code = gsicc_set_devicen_equiv_colors(dev, pgs, dev_profile->device_profile[0]);
dev_profile->spotnames->equiv_cmyk_set = true;
}
- gx_remap_concrete_devicen(conc, pdc, pis, dev, select);
+ gx_remap_concrete_devicen(conc, pdc, pgs, dev, select);
} else {
- gs_imager_state temp_state = *((const gs_imager_state *)pis);
+ gs_gstate temp_state = *((const gs_gstate *)pgs);
- /* No NCLR profile with spot names. So set up the
- color_component_map in the imager state. Again, note that
+ /* No NCLR profile with spot names. So set up the
+ color_component_map in the gs_gstate. Again, note that
gsicc_transform_named_color must have set ALL the device
colors */
for (k = 0; k < dev->color_info.num_components; k++)
@@ -700,7 +700,7 @@ gs_color_select_t select)
gx_remap_concrete_devicen(conc, pdc, &temp_state, dev, select);
}
} else {
- gx_remap_concrete_devicen(conc, pdc, pis, dev, select);
+ gx_remap_concrete_devicen(conc, pdc, pgs, dev, select);
}
/* Save original color space and color info into dev color */
i = any_abs(i);
@@ -716,18 +716,18 @@ gs_color_select_t select)
color. */
int
gx_default_remap_color(const gs_client_color * pcc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
frac conc[GS_CLIENT_COLOR_MAX_COMPONENTS];
const gs_color_space *pconcs;
int i = pcs->type->num_components(pcs);
- int code = (*pcs->type->concretize_color)(pcc, pcs, conc, pis, dev);
+ int code = (*pcs->type->concretize_color)(pcc, pcs, conc, pgs, dev);
if (code < 0)
return code;
- pconcs = cs_concrete_space(pcs, pis);
- code = (*pconcs->type->remap_concrete_color)(conc, pconcs, pdc, pis, dev, select);
+ pconcs = cs_concrete_space(pcs, pgs);
+ code = (*pconcs->type->remap_concrete_color)(conc, pconcs, pdc, pgs, dev, select);
/* Save original color space and color info into dev color */
i = any_abs(i);
@@ -744,28 +744,28 @@ gx_default_remap_color(const gs_client_color * pcc, const gs_color_space * pcs,
/* DeviceGray */
int
gx_concretize_DeviceGray(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
pconc[0] = gx_unit_frac(pc->paint.values[0]);
return 0;
}
int
gx_remap_concrete_DGray(const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
- if (pis->alpha == gx_max_color_value)
- (*pis->cmap_procs->map_gray)
- (pconc[0], pdc, pis, dev, select);
+ if (pgs->alpha == gx_max_color_value)
+ (*pgs->cmap_procs->map_gray)
+ (pconc[0], pdc, pgs, dev, select);
else
- (*pis->cmap_procs->map_rgb_alpha)
- (pconc[0], pconc[0], pconc[0], cv2frac(pis->alpha),
- pdc, pis, dev, select);
+ (*pgs->cmap_procs->map_rgb_alpha)
+ (pconc[0], pconc[0], pconc[0], cv2frac(pgs->alpha),
+ pdc, pgs, dev, select);
return 0;
}
int
gx_remap_DeviceGray(const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
frac fgray = gx_unit_frac(pc->paint.values[0]);
@@ -776,17 +776,16 @@ gx_remap_DeviceGray(const gs_client_color * pc, const gs_color_space * pcs,
and the color space was never actually "installed" and hence set
over to a proper ICC color space. We will "install" this color space
at this time */
- if (pis->icc_manager->default_gray != NULL) {
+ if (pgs->icc_manager->default_gray != NULL) {
gs_color_space *pcs_notconst = (gs_color_space*) pcs;
- gs_state *pgs = (gs_state*) pis;
- pcs_notconst->cmm_icc_profile_data = pis->icc_manager->default_gray;
- rc_increment(pis->icc_manager->default_gray);
+ pcs_notconst->cmm_icc_profile_data = pgs->icc_manager->default_gray;
+ rc_increment(pgs->icc_manager->default_gray);
pcs_notconst->type = &gs_color_space_type_ICC;
code =
(*pcs_notconst->type->remap_color)(gs_currentcolor_inline(pgs),
pcs_notconst,
gs_currentdevicecolor_inline(pgs),
- pis, pgs->device,
+ pgs, pgs->device,
gs_color_select_texture);
return code;
}
@@ -794,19 +793,19 @@ gx_remap_DeviceGray(const gs_client_color * pc, const gs_color_space * pcs,
/* Save orgxiginal color space and color info into dev color */
pdc->ccolor.paint.values[0] = pc->paint.values[0];
pdc->ccolor_valid = true;
- if (pis->alpha == gx_max_color_value)
- (*pis->cmap_procs->map_gray)
- (fgray, pdc, pis, dev, select);
+ if (pgs->alpha == gx_max_color_value)
+ (*pgs->cmap_procs->map_gray)
+ (fgray, pdc, pgs, dev, select);
else
- (*pis->cmap_procs->map_rgb_alpha)
- (fgray, fgray, fgray, cv2frac(pis->alpha), pdc, pis, dev, select);
+ (*pgs->cmap_procs->map_rgb_alpha)
+ (fgray, fgray, fgray, cv2frac(pgs->alpha), pdc, pgs, dev, select);
return 0;
}
/* DeviceRGB */
int
gx_concretize_DeviceRGB(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
pconc[0] = gx_unit_frac(pc->paint.values[0]);
pconc[1] = gx_unit_frac(pc->paint.values[1]);
@@ -815,21 +814,21 @@ gx_concretize_DeviceRGB(const gs_client_color * pc, const gs_color_space * pcs,
}
int
gx_remap_concrete_DRGB(const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
- if (pis->alpha == gx_max_color_value)
+ if (pgs->alpha == gx_max_color_value)
gx_remap_concrete_rgb(pconc[0], pconc[1], pconc[2],
- pdc, pis, dev, select);
+ pdc, pgs, dev, select);
else
gx_remap_concrete_rgb_alpha(pconc[0], pconc[1], pconc[2],
- cv2frac(pis->alpha),
- pdc, pis, dev, select);
+ cv2frac(pgs->alpha),
+ pdc, pgs, dev, select);
return 0;
}
int
gx_remap_DeviceRGB(const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
frac fred = gx_unit_frac(pc->paint.values[0]), fgreen = gx_unit_frac(pc->paint.values[1]),
@@ -840,19 +839,19 @@ gx_remap_DeviceRGB(const gs_client_color * pc, const gs_color_space * pcs,
pdc->ccolor.paint.values[1] = pc->paint.values[1];
pdc->ccolor.paint.values[2] = pc->paint.values[2];
pdc->ccolor_valid = true;
- if (pis->alpha == gx_max_color_value)
+ if (pgs->alpha == gx_max_color_value)
gx_remap_concrete_rgb(fred, fgreen, fblue,
- pdc, pis, dev, select);
+ pdc, pgs, dev, select);
else
- gx_remap_concrete_rgb_alpha(fred, fgreen, fblue, cv2frac(pis->alpha),
- pdc, pis, dev, select);
+ gx_remap_concrete_rgb_alpha(fred, fgreen, fblue, cv2frac(pgs->alpha),
+ pdc, pgs, dev, select);
return 0;
}
/* DeviceCMYK */
int
gx_concretize_DeviceCMYK(const gs_client_color * pc, const gs_color_space * pcs,
- frac * pconc, const gs_imager_state * pis, gx_device *dev)
+ frac * pconc, const gs_gstate * pgs, gx_device *dev)
{
pconc[0] = gx_unit_frac(pc->paint.values[0]);
pconc[1] = gx_unit_frac(pc->paint.values[1]);
@@ -862,17 +861,17 @@ gx_concretize_DeviceCMYK(const gs_client_color * pc, const gs_color_space * pcs,
}
int
gx_remap_concrete_DCMYK(const frac * pconc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
/****** IGNORE alpha ******/
gx_remap_concrete_cmyk(pconc[0], pconc[1], pconc[2], pconc[3], pdc,
- pis, dev, select, pcs);
+ pgs, dev, select, pcs);
return 0;
}
int
gx_remap_DeviceCMYK(const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
/****** IGNORE alpha ******/
@@ -886,7 +885,7 @@ gx_remap_DeviceCMYK(const gs_client_color * pc, const gs_color_space * pcs,
gx_unit_frac(pc->paint.values[1]),
gx_unit_frac(pc->paint.values[2]),
gx_unit_frac(pc->paint.values[3]),
- pdc, pis, dev, select, pcs);
+ pdc, pgs, dev, select, pcs);
return 0;
}
@@ -894,7 +893,7 @@ gx_remap_DeviceCMYK(const gs_client_color * pc, const gs_color_space * pcs,
static void
cmap_gray_halftoned(frac gray, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
@@ -909,7 +908,7 @@ cmap_gray_halftoned(frac gray, gx_device_color * pdc,
/* apply the transfer function(s); convert to color values */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cm_comps[i] = gx_map_color_frac(pis,
+ cm_comps[i] = gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]);
else {
if (dev->color_info.opmode == GX_CINFO_OPMODE_UNKNOWN)
@@ -919,22 +918,22 @@ cmap_gray_halftoned(frac gray, gx_device_color * pdc,
for (i = 0; i < ncomps; i++) {
if (i == k) /* Else ignore transfer, see PLRM3 p. 494 */
- cm_comps[i] = frac_1 - gx_map_color_frac(pis,
+ cm_comps[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]);
}
} else {
for (i = 0; i < ncomps; i++)
- cm_comps[i] = frac_1 - gx_map_color_frac(pis,
+ cm_comps[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]);
}
}
- if (gx_render_device_DeviceN(cm_comps, pdc, dev, pis->dev_ht,
- &pis->screen_phase[select]) == 1)
- gx_color_load_select(pdc, pis, dev, select);
+ if (gx_render_device_DeviceN(cm_comps, pdc, dev, pgs->dev_ht,
+ &pgs->screen_phase[select]) == 1)
+ gx_color_load_select(pdc, pgs, dev, select);
}
static void
-cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_imager_state * pis,
+cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
@@ -952,7 +951,7 @@ cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_imager_state * pis,
/* apply the transfer function(s); convert to color values */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis,
+ cv[i] = frac2cv(gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]));
else {
if (dev->color_info.opmode == GX_CINFO_OPMODE_UNKNOWN)
@@ -962,14 +961,14 @@ cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_imager_state * pis,
for (i = 0; i < ncomps; i++) {
if (i == k)
- cv[i] = frac2cv(frac_1 - gx_map_color_frac(pis,
+ cv[i] = frac2cv(frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
else
cv[i] = frac2cv(cm_comps[i]); /* Ignore transfer, see PLRM3 p. 494 */
}
} else {
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(frac_1 - gx_map_color_frac(pis,
+ cv[i] = frac2cv(frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
}
}
@@ -980,14 +979,14 @@ cmap_gray_direct(frac gray, gx_device_color * pdc, const gs_imager_state * pis,
if (color != gx_no_color_index)
color_set_pure(pdc, color);
else
- cmap_gray_halftoned(gray, pdc, pis, dev, select);
+ cmap_gray_halftoned(gray, pdc, pgs, dev, select);
}
/* ------ Render RGB color. ------ */
static void
cmap_rgb_halftoned(frac r, frac g, frac b, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
@@ -997,26 +996,26 @@ cmap_rgb_halftoned(frac r, frac g, frac b, gx_device_color * pdc,
for (i = 0; i < ncomps; i++)
cm_comps[i] = 0;
pprocs = get_color_mapping_procs_subclass(dev);
- map_rgb_subclass(pprocs, dev, pis, r, g, b, cm_comps);
+ map_rgb_subclass(pprocs, dev, pgs, r, g, b, cm_comps);
/* apply the transfer function(s); convert to color values */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cm_comps[i] = gx_map_color_frac(pis,
+ cm_comps[i] = gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]);
else
for (i = 0; i < ncomps; i++)
- cm_comps[i] = frac_1 - gx_map_color_frac(pis,
+ cm_comps[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]);
- if (gx_render_device_DeviceN(cm_comps, pdc, dev, pis->dev_ht,
- &pis->screen_phase[select]) == 1)
- gx_color_load_select(pdc, pis, dev, select);
+ if (gx_render_device_DeviceN(cm_comps, pdc, dev, pgs->dev_ht,
+ &pgs->screen_phase[select]) == 1)
+ gx_color_load_select(pdc, pgs, dev, select);
}
static void
cmap_rgb_direct(frac r, frac g, frac b, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
@@ -1028,16 +1027,16 @@ cmap_rgb_direct(frac r, frac g, frac b, gx_device_color * pdc,
for (i=0; i < ncomps; i++)
cm_comps[i] = 0;
pprocs = get_color_mapping_procs_subclass(dev);
- map_rgb_subclass(pprocs, dev, pis, r, g, b, cm_comps);
+ map_rgb_subclass(pprocs, dev, pgs, r, g, b, cm_comps);
/* apply the transfer function(s); convert to color values */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis,
+ cv[i] = frac2cv(gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]));
else
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(frac_1 - gx_map_color_frac(pis,
+ cv[i] = frac2cv(frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
/* encode as a color index */
@@ -1047,14 +1046,14 @@ cmap_rgb_direct(frac r, frac g, frac b, gx_device_color * pdc,
if (color != gx_no_color_index)
color_set_pure(pdc, color);
else
- cmap_rgb_halftoned(r, g, b, pdc, pis, dev, select);
+ cmap_rgb_halftoned(r, g, b, pdc, pgs, dev, select);
}
/* ------ Render CMYK color. ------ */
static void
cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select,
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select,
const gs_color_space *source_pcs)
{
uchar i, ncomps = dev->color_info.num_components;
@@ -1076,7 +1075,7 @@ cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
/* apply the transfer function(s); convert to color values */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cm_comps[i] = gx_map_color_frac(pis,
+ cm_comps[i] = gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]);
else {
/* Check if source space is gray. In this case we are to use only the
@@ -1093,12 +1092,12 @@ cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
/* Find the black channel location */
black_index = dev_proc(dev, get_color_comp_index)(dev, "Black",
strlen("Black"), SEPARATION_NAME);
- cm_comps[black_index] = frac_1 - gx_map_color_frac(pis,
+ cm_comps[black_index] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[black_index]),
effective_transfer[black_index]);
} else {
for (i = 0; i < ncomps; i++)
- cm_comps[i] = frac_1 - gx_map_color_frac(pis,
+ cm_comps[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]);
}
}
@@ -1106,8 +1105,8 @@ cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
/* duplicating most of the code of this procedure. */
if (gx_device_must_halftone(dev)) {
if (gx_render_device_DeviceN(cm_comps, pdc, dev,
- pis->dev_ht, &pis->screen_phase[select]) == 1)
- gx_color_load_select(pdc, pis, dev, select);
+ pgs->dev_ht, &pgs->screen_phase[select]) == 1)
+ gx_color_load_select(pdc, pgs, dev, select);
return;
}
/* if output device supports devn, we need to make sure we send it the
@@ -1126,8 +1125,8 @@ cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
color_set_pure(pdc, color);
else {
if (gx_render_device_DeviceN(cm_comps, pdc, dev,
- pis->dev_ht, &pis->screen_phase[select]) == 1)
- gx_color_load_select(pdc, pis, dev, select);
+ pgs->dev_ht, &pgs->screen_phase[select]) == 1)
+ gx_color_load_select(pdc, pgs, dev, select);
}
}
return;
@@ -1135,7 +1134,7 @@ cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
static void
cmap_rgb_alpha_halftoned(frac r, frac g, frac b, frac alpha,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
@@ -1146,7 +1145,7 @@ cmap_rgb_alpha_halftoned(frac r, frac g, frac b, frac alpha,
for (i=0; i < ncomps; i++)
cm_comps[i] = 0;
pprocs = get_color_mapping_procs_subclass(dev);
- map_rgb_subclass(pprocs, dev, pis, r, g, b, cm_comps);
+ map_rgb_subclass(pprocs, dev, pgs, r, g, b, cm_comps);
/* pre-multiply to account for the alpha weighting */
if (alpha != frac_1) {
@@ -1163,21 +1162,21 @@ cmap_rgb_alpha_halftoned(frac r, frac g, frac b, frac alpha,
/* apply the transfer function(s); convert to color values */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cm_comps[i] = gx_map_color_frac(pis,
+ cm_comps[i] = gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]);
else
for (i = 0; i < ncomps; i++)
- cm_comps[i] = frac_1 - gx_map_color_frac(pis,
+ cm_comps[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]);
- if (gx_render_device_DeviceN(cm_comps, pdc, dev, pis->dev_ht,
- &pis->screen_phase[select]) == 1)
- gx_color_load_select(pdc, pis, dev, select);
+ if (gx_render_device_DeviceN(cm_comps, pdc, dev, pgs->dev_ht,
+ &pgs->screen_phase[select]) == 1)
+ gx_color_load_select(pdc, pgs, dev, select);
}
static void
cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
@@ -1189,7 +1188,7 @@ cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color * pdc,
for (i=0; i < ncomps; i++)
cm_comps[i] = 0;
pprocs = get_color_mapping_procs_subclass(dev);
- map_rgb_subclass(pprocs, dev, pis, r, g, b, cm_comps);
+ map_rgb_subclass(pprocs, dev, pgs, r, g, b, cm_comps);
/* pre-multiply to account for the alpha weighting */
if (alpha != frac_1) {
@@ -1206,11 +1205,11 @@ cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color * pdc,
/* apply the transfer function(s); convert to color values */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis,
+ cv[i] = frac2cv(gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]));
else
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(frac_1 - gx_map_color_frac(pis,
+ cv[i] = frac2cv(frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
/* encode as a color index */
@@ -1224,7 +1223,7 @@ cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color * pdc,
if (color != gx_no_color_index)
color_set_pure(pdc, color);
else
- cmap_rgb_alpha_halftoned(r, g, b, alpha, pdc, pis, dev, select);
+ cmap_rgb_alpha_halftoned(r, g, b, alpha, pdc, pgs, dev, select);
}
/* ------ Render Separation All color. ------ */
@@ -1264,7 +1263,7 @@ map_components_to_colorants(const frac * pcc,
static void
cmap_separation_halftoned(frac all, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ const gs_gstate * pgs, gx_device * dev, gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
bool additive = dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE;
@@ -1273,7 +1272,7 @@ cmap_separation_halftoned(frac all, gx_device_color * pdc,
for (i=0; i < ncomps; i++)
cm_comps[i] = 0;
- if (pis->color_component_map.sep_type == SEP_ALL) {
+ if (pgs->color_component_map.sep_type == SEP_ALL) {
/*
* Invert the photometric interpretation for additive
* color spaces because separations are always subtractive.
@@ -1282,31 +1281,31 @@ cmap_separation_halftoned(frac all, gx_device_color * pdc,
comp_value = frac_1 - comp_value;
/* Use the "all" value for all components */
- for (i = 0; i < pis->color_component_map.num_colorants; i++)
+ for (i = 0; i < pgs->color_component_map.num_colorants; i++)
cm_comps[i] = comp_value;
}
else {
/* map to the color model */
- map_components_to_colorants(&all, &(pis->color_component_map), cm_comps);
+ map_components_to_colorants(&all, &(pgs->color_component_map), cm_comps);
}
/* apply the transfer function(s); convert to color values */
if (additive)
for (i = 0; i < ncomps; i++)
- cm_comps[i] = gx_map_color_frac(pis,
+ cm_comps[i] = gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]);
else
for (i = 0; i < ncomps; i++)
- cm_comps[i] = frac_1 - gx_map_color_frac(pis,
+ cm_comps[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]);
- if (gx_render_device_DeviceN(cm_comps, pdc, dev, pis->dev_ht,
- &pis->screen_phase[select]) == 1)
- gx_color_load_select(pdc, pis, dev, select);
+ if (gx_render_device_DeviceN(cm_comps, pdc, dev, pgs->dev_ht,
+ &pgs->screen_phase[select]) == 1)
+ gx_color_load_select(pdc, pgs, dev, select);
}
static void
-cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state * pis,
+cmap_separation_direct(frac all, gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
@@ -1325,7 +1324,7 @@ cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state *
dev_profile, &des_profile, &render_cond);
for (i=0; i < ncomps; i++)
cm_comps[i] = 0;
- if (pis->color_component_map.sep_type == SEP_ALL) {
+ if (pgs->color_component_map.sep_type == SEP_ALL) {
/*
* Invert the photometric interpretation for additive
* color spaces because separations are always subtractive.
@@ -1334,7 +1333,7 @@ cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state *
comp_value = frac_1 - comp_value;
/* Use the "all" value for all components */
- for (i = 0; i < pis->color_component_map.num_colorants; i++)
+ for (i = 0; i < pgs->color_component_map.num_colorants; i++)
cm_comps[i] = comp_value;
/* If our device space is CIELAB then we really want to treat this
as RGB during the fill up here of the separation value and then
@@ -1348,36 +1347,36 @@ cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state *
}
else {
/* map to the color model */
- map_components_to_colorants(&comp_value, &(pis->color_component_map), cm_comps);
+ map_components_to_colorants(&comp_value, &(pgs->color_component_map), cm_comps);
}
/* apply the transfer function(s); convert to color values */
if (additive)
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis,
+ cv[i] = frac2cv(gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]));
else
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(frac_1 - gx_map_color_frac(pis,
+ cv[i] = frac2cv(frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
- if (use_rgb2dev_icc && pis->icc_manager->default_rgb != NULL) {
+ if (use_rgb2dev_icc && pgs->icc_manager->default_rgb != NULL) {
/* After the transfer function go ahead and do the mapping from RGB to
the device profile. */
gsicc_link_t *icc_link;
gsicc_rendering_param_t rendering_params;
unsigned short psrc[GS_CLIENT_COLOR_MAX_COMPONENTS], psrc_cm[GS_CLIENT_COLOR_MAX_COMPONENTS];
- rendering_params.black_point_comp = pis->blackptcomp;
+ rendering_params.black_point_comp = pgs->blackptcomp;
rendering_params.graphics_type_tag = dev->graphics_type_tag;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = pis->renderingintent;
+ rendering_params.rendering_intent = pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
- icc_link = gsicc_get_link_profile(pis, dev, pis->icc_manager->default_rgb,
+ icc_link = gsicc_get_link_profile(pgs, dev, pgs->icc_manager->default_rgb,
des_profile, &rendering_params,
- pis->memory, dev_profile->devicegraytok);
+ pgs->memory, dev_profile->devicegraytok);
/* Transform the color */
for (i = 0; i < ncomps; i++) {
psrc[i] = cv[i];
@@ -1402,7 +1401,7 @@ cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state *
if (color != gx_no_color_index)
color_set_pure(pdc, color);
else
- cmap_separation_halftoned(all, pdc, pis, dev, select);
+ cmap_separation_halftoned(all, pdc, pgs, dev, select);
}
return;
}
@@ -1426,7 +1425,7 @@ devicen_has_cmyk(gx_device * dev)
}
static int
-devicen_icc_cmyk(frac cm_comps[], const gs_imager_state * pis, gx_device *dev)
+devicen_icc_cmyk(frac cm_comps[], const gs_gstate * pgs, gx_device *dev)
{
gsicc_link_t *icc_link;
gsicc_rendering_param_t rendering_params;
@@ -1445,18 +1444,18 @@ devicen_icc_cmyk(frac cm_comps[], const gs_imager_state * pis, gx_device *dev)
gsicc_extract_profile(dev->graphics_type_tag,
dev_profile, &des_profile, &render_cond);
/* Define the rendering intents. */
- rendering_params.black_point_comp = pis->blackptcomp;
+ rendering_params.black_point_comp = pgs->blackptcomp;
rendering_params.graphics_type_tag = dev->graphics_type_tag;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = pis->renderingintent;
+ rendering_params.rendering_intent = pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
/* Sigh, frac to full 16 bit. Need to clean this up */
for (k = 0; k < 4; k++){
psrc[k] = frac2cv(cm_comps[k]);
}
- icc_link = gsicc_get_link_profile(pis, dev, pis->icc_manager->default_cmyk,
- des_profile, &rendering_params, pis->memory,
+ icc_link = gsicc_get_link_profile(pgs, dev, pgs->icc_manager->default_cmyk,
+ des_profile, &rendering_params, pgs->memory,
dev_profile->devicegraytok);
/* Transform the color */
if (icc_link->is_identity) {
@@ -1483,7 +1482,7 @@ devicen_icc_cmyk(frac cm_comps[], const gs_imager_state * pis, gx_device *dev)
*/
static void
cmap_devicen_halftoned(const frac * pcc,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
@@ -1498,26 +1497,26 @@ cmap_devicen_halftoned(const frac * pcc,
/* map to the color model */
for (i=0; i < ncomps; i++)
cm_comps[i] = 0;
- map_components_to_colorants(pcc, &(pis->color_component_map), cm_comps);
+ map_components_to_colorants(pcc, &(pgs->color_component_map), cm_comps);
/* See comments in cmap_devicen_direct for details on below operations */
if (devicen_has_cmyk(dev) &&
des_profile->data_cs == gsCMYK) {
- devicen_icc_cmyk(cm_comps, pis, dev);
+ devicen_icc_cmyk(cm_comps, pgs, dev);
}
/* apply the transfer function(s); convert to color values */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cm_comps[i] = gx_map_color_frac(pis,
+ cm_comps[i] = gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]);
else
for (i = 0; i < ncomps; i++)
- cm_comps[i] = frac_1 - gx_map_color_frac(pis,
+ cm_comps[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]);
/* We need to finish halftoning */
- if (gx_render_device_DeviceN(cm_comps, pdc, dev, pis->dev_ht,
- &pis->screen_phase[select]) == 1)
- gx_color_load_select(pdc, pis, dev, select);
+ if (gx_render_device_DeviceN(cm_comps, pdc, dev, pgs->dev_ht,
+ &pgs->screen_phase[select]) == 1)
+ gx_color_load_select(pdc, pgs, dev, select);
}
/*
@@ -1526,7 +1525,7 @@ cmap_devicen_halftoned(const frac * pcc,
*/
static void
cmap_devicen_direct(const frac * pcc,
- gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+ gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
gs_color_select_t select)
{
uchar i, ncomps = dev->color_info.num_components;
@@ -1548,7 +1547,7 @@ cmap_devicen_direct(const frac * pcc,
map_components_to_colorants(pcc, dev_profile->spotnames->color_map,
cm_comps);
} else {
- map_components_to_colorants(pcc, &(pis->color_component_map), cm_comps);
+ map_components_to_colorants(pcc, &(pgs->color_component_map), cm_comps);
}
/* Check if we have the standard colorants. If yes, then we will apply
ICC color management to those colorants. To understand why, consider
@@ -1568,28 +1567,28 @@ cmap_devicen_direct(const frac * pcc,
and possibly permute the colorants, much as is done on the input
side for the case when we add DeviceN icc source profiles for use
in PDF and PS data. */
- devicen_icc_cmyk(cm_comps, pis, dev);
+ devicen_icc_cmyk(cm_comps, pgs, dev);
}
/* apply the transfer function(s); convert to color values.
assign directly if output device supports devn */
if (dev_proc(dev, dev_spec_op)(dev, gxdso_supports_devn, NULL, 0)) {
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- pdc->colors.devn.values[i] = frac2cv(gx_map_color_frac(pis,
+ pdc->colors.devn.values[i] = frac2cv(gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]));
else
for (i = 0; i < ncomps; i++)
- pdc->colors.devn.values[i] = frac2cv(frac_1 - gx_map_color_frac(pis,
+ pdc->colors.devn.values[i] = frac2cv(frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
pdc->type = gx_dc_type_devn;
} else {
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(gx_map_color_frac(pis,
+ cv[i] = frac2cv(gx_map_color_frac(pgs,
cm_comps[i], effective_transfer[i]));
else
for (i = 0; i < ncomps; i++)
- cv[i] = frac2cv(frac_1 - gx_map_color_frac(pis,
+ cv[i] = frac2cv(frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
/* encode as a color index */
color = dev_proc(dev, encode_color)(dev, cv);
@@ -1597,20 +1596,20 @@ cmap_devicen_direct(const frac * pcc,
if (color != gx_no_color_index)
color_set_pure(pdc, color);
else
- cmap_devicen_halftoned(pcc, pdc, pis, dev, select);
+ cmap_devicen_halftoned(pcc, pdc, pgs, dev, select);
}
}
/* ------ Halftoning check ----- */
static bool
-cmap_halftoned_is_halftoned(const gs_imager_state * pis, gx_device * dev)
+cmap_halftoned_is_halftoned(const gs_gstate * pgs, gx_device * dev)
{
return true;
}
static bool
-cmap_direct_is_halftoned(const gs_imager_state * pis, gx_device * dev)
+cmap_direct_is_halftoned(const gs_gstate * pgs, gx_device * dev)
{
return false;
}
@@ -1959,7 +1958,7 @@ gx_unit_frac(float fvalue)
device color space but in 16bpp color values. */
void
cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, bool has_transfer,
+ const gs_gstate * pgs, gx_device * dev, bool has_transfer,
bool has_halftone, gs_color_select_t select)
{
uchar ncomps = dev->color_info.num_components;
@@ -1974,7 +1973,7 @@ cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE) {
for (i = 0; i < ncomps; i++) {
frac_value = cv2frac(pconc[i]);
- cv_frac[i] = gx_map_color_frac(pis,
+ cv_frac[i] = gx_map_color_frac(pgs,
frac_value, effective_transfer[i]);
}
} else {
@@ -1986,7 +1985,7 @@ cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
for (i = 0; i < ncomps; i++) {
frac_value = cv2frac(pconc[i]);
if (i == k) {
- cv_frac[i] = frac_1 - gx_map_color_frac(pis,
+ cv_frac[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - frac_value), effective_transfer[i]);
} else {
cv_frac[i] = cv2frac(pconc[i]); /* Ignore transfer, see PLRM3 p. 494 */
@@ -1995,7 +1994,7 @@ cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
} else {
for (i = 0; i < ncomps; i++) {
frac_value = cv2frac(pconc[i]);
- cv_frac[i] = frac_1 - gx_map_color_frac(pis,
+ cv_frac[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - frac_value), effective_transfer[i]);
}
}
@@ -2011,8 +2010,8 @@ cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
/* Halftoning */
if (has_halftone) {
if (gx_render_device_DeviceN(&(cv_frac[0]), pdc, dev,
- pis->dev_ht, &pis->screen_phase[select]) == 1)
- gx_color_load_select(pdc, pis, dev, select);
+ pgs->dev_ht, &pgs->screen_phase[select]) == 1)
+ gx_color_load_select(pdc, pgs, dev, select);
} else {
/* We have a frac value from the transfer function. Do the encode.
which does not take a frac value... */
@@ -2030,7 +2029,7 @@ cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
/* This is used by image color render to apply only the transfer function.
We follow this up with threshold rendering. */
void
-cmap_transfer(gx_color_value *pconc, const gs_imager_state * pis, gx_device * dev)
+cmap_transfer(gx_color_value *pconc, const gs_gstate * pgs, gx_device * dev)
{
uchar ncomps = dev->color_info.num_components;
frac frac_value;
@@ -2041,7 +2040,7 @@ cmap_transfer(gx_color_value *pconc, const gs_imager_state * pis, gx_device * de
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE) {
for (i = 0; i < ncomps; i++) {
frac_value = cv2frac(pconc[i]);
- cv_frac[i] = gx_map_color_frac(pis,
+ cv_frac[i] = gx_map_color_frac(pgs,
frac_value, effective_transfer[i]);
pconc[i] = frac2cv(cv_frac[i]);
}
@@ -2054,7 +2053,7 @@ cmap_transfer(gx_color_value *pconc, const gs_imager_state * pis, gx_device * de
for (i = 0; i < ncomps; i++) {
frac_value = cv2frac(pconc[i]);
if (i == k) {
- cv_frac[i] = frac_1 - gx_map_color_frac(pis,
+ cv_frac[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - frac_value), effective_transfer[i]);
} else {
cv_frac[i] = cv2frac(pconc[i]); /* Ignore transfer, see PLRM3 p. 494 */
@@ -2064,7 +2063,7 @@ cmap_transfer(gx_color_value *pconc, const gs_imager_state * pis, gx_device * de
} else {
for (i = 0; i < ncomps; i++) {
frac_value = cv2frac(pconc[i]);
- cv_frac[i] = frac_1 - gx_map_color_frac(pis,
+ cv_frac[i] = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - frac_value), effective_transfer[i]);
pconc[i] = frac2cv(cv_frac[i]);
}
@@ -2074,7 +2073,7 @@ cmap_transfer(gx_color_value *pconc, const gs_imager_state * pis, gx_device * de
/* A planar version which applies only one transfer function */
void
-cmap_transfer_plane(gx_color_value *pconc, const gs_imager_state *pis,
+cmap_transfer_plane(gx_color_value *pconc, const gs_gstate *pgs,
gx_device *dev, int plane)
{
frac frac_value;
@@ -2083,7 +2082,7 @@ cmap_transfer_plane(gx_color_value *pconc, const gs_imager_state *pis,
/* apply the transfer function(s) */
if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE) {
frac_value = cv2frac(pconc[0]);
- cv_frac = gx_map_color_frac(pis, frac_value, effective_transfer[plane]);
+ cv_frac = gx_map_color_frac(pgs, frac_value, effective_transfer[plane]);
pconc[0] = frac2cv(cv_frac);
} else {
if (dev->color_info.opmode == GX_CINFO_OPMODE_UNKNOWN) {
@@ -2093,7 +2092,7 @@ cmap_transfer_plane(gx_color_value *pconc, const gs_imager_state *pis,
uint k = dev->color_info.black_component;
frac_value = cv2frac(pconc[0]);
if (plane == k) {
- cv_frac = frac_1 - gx_map_color_frac(pis,
+ cv_frac = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - frac_value), effective_transfer[plane]);
} else {
cv_frac = cv2frac(pconc[0]); /* Ignore transfer, see PLRM3 p. 494 */
@@ -2101,7 +2100,7 @@ cmap_transfer_plane(gx_color_value *pconc, const gs_imager_state *pis,
pconc[0] = frac2cv(cv_frac);
} else {
frac_value = cv2frac(pconc[0]);
- cv_frac = frac_1 - gx_map_color_frac(pis,
+ cv_frac = frac_1 - gx_map_color_frac(pgs,
(frac)(frac_1 - frac_value), effective_transfer[plane]);
pconc[0] = frac2cv(cv_frac);
}
@@ -2110,7 +2109,7 @@ cmap_transfer_plane(gx_color_value *pconc, const gs_imager_state *pis,
bool
-gx_device_uses_std_cmap_procs(gx_device * dev, const gs_imager_state * pis)
+gx_device_uses_std_cmap_procs(gx_device * dev, const gs_gstate * pgs)
{
const gx_cm_color_map_procs *pprocs;
gsicc_rendering_param_t render_cond;
diff --git a/base/gxcmap.h b/base/gxcmap.h
index d450172e9..016a53d05 100644
--- a/base/gxcmap.h
+++ b/base/gxcmap.h
@@ -32,30 +32,34 @@ typedef struct gx_device_s gx_device;
# define gx_device_color_DEFINED
typedef struct gx_device_color_s gx_device_color;
#endif
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
+#endif
/* Procedures for rendering colors specified by fractions. */
#define cmap_proc_gray(proc)\
- void proc(frac, gx_device_color *, const gs_imager_state *,\
+ void proc(frac, gx_device_color *, const gs_gstate *,\
gx_device *, gs_color_select_t)
#define cmap_proc_rgb(proc)\
- void proc(frac, frac, frac, gx_device_color *, const gs_imager_state *,\
+ void proc(frac, frac, frac, gx_device_color *, const gs_gstate *,\
gx_device *, gs_color_select_t)
#define cmap_proc_cmyk(proc)\
void proc(frac, frac, frac, frac, gx_device_color *,\
- const gs_imager_state *, gx_device *, gs_color_select_t,\
+ const gs_gstate *, gx_device *, gs_color_select_t,\
const gs_color_space *)
#define cmap_proc_rgb_alpha(proc)\
void proc(frac, frac, frac, frac, gx_device_color *,\
- const gs_imager_state *, gx_device *, gs_color_select_t)
+ const gs_gstate *, gx_device *, gs_color_select_t)
#define cmap_proc_separation(proc)\
- void proc(frac, gx_device_color *, const gs_imager_state *,\
+ void proc(frac, gx_device_color *, const gs_gstate *,\
gx_device *, gs_color_select_t)
#define cmap_proc_devicen(proc)\
- void proc(const frac *, gx_device_color *, const gs_imager_state *, \
+ void proc(const frac *, gx_device_color *, const gs_gstate *, \
gx_device *, gs_color_select_t)
#define cmap_proc_is_halftoned(proc)\
- bool proc(const gs_imager_state *, gx_device *)
+ bool proc(const gs_gstate *, gx_device *)
/*
* List of mapping functions from the standard color spaces to the
@@ -67,7 +71,7 @@ typedef struct gx_device_color_s gx_device_color;
#define cm_map_proc_rgb(proc) \
void proc (gx_device * dev, \
- const gs_imager_state *pis, \
+ const gs_gstate *pgs, \
frac r, frac g, frac b, \
frac * out)
@@ -107,7 +111,7 @@ cm_map_proc_cmyk(cmyk_cs_to_cmyk_cm);
* applying the current transfer function or halftone.
*
* The routine pointed to by get_cmap_procs (a field in the image
- * state; see gxistate.h) should initialize the cm_color_map_procs
+ * state; see gxgstate.h) should initialize the cm_color_map_procs
* pointer, using the get_color_mapping_procs method of the device.
*
* Because of a bug in the Watcom C compiler, we have to split the
@@ -126,35 +130,35 @@ typedef struct gx_color_map_procs_s gx_color_map_procs;
/*
* Determine the color mapping procedures for a device. Even though this
- * does not currently use information from the imager state, it must be
+ * does not currently use information from the gs_gstate, it must be
* a virtual procedure of the state for internal reasons.
*/
const gx_color_map_procs *
- gx_get_cmap_procs(const gs_imager_state *, const gx_device *);
+ gx_get_cmap_procs(const gs_gstate *, const gx_device *);
const gx_color_map_procs *
- gx_default_get_cmap_procs(const gs_imager_state *, const gx_device *);
+ gx_default_get_cmap_procs(const gs_gstate *, const gx_device *);
/*
* Set the color mapping procedures in the graphics state. This is
* currently only needed when switching devices, but might be used more
* often in the future.
*/
-void gx_set_cmap_procs(gs_imager_state *, const gx_device *);
+void gx_set_cmap_procs(gs_gstate *, const gx_device *);
/* Remap a concrete (frac) gray, RGB or CMYK color. */
/* These cannot fail, and do not return a value. */
-#define gx_remap_concrete_gray(cgray, pdc, pis, dev, select)\
- ((pis)->cmap_procs->map_gray)(cgray, pdc, pis, dev, select)
-#define gx_remap_concrete_rgb(cr, cg, cb, pdc, pis, dev, select)\
- ((pis)->cmap_procs->map_rgb)(cr, cg, cb, pdc, pis, dev, select)
-#define gx_remap_concrete_cmyk(cc, cm, cy, ck, pdc, pis, dev, select, pcs)\
- ((pis)->cmap_procs->map_cmyk)(cc, cm, cy, ck, pdc, pis, dev, select, pcs)
-#define gx_remap_concrete_rgb_alpha(cr, cg, cb, ca, pdc, pis, dev, select)\
- ((pis)->cmap_procs->map_rgb_alpha)(cr, cg, cb, ca, pdc, pis, dev, select)
-#define gx_remap_concrete_separation(pcc, pdc, pis, dev, select)\
- ((pis)->cmap_procs->map_separation)(pcc, pdc, pis, dev, select)
-#define gx_remap_concrete_devicen(pcc, pdc, pis, dev, select)\
- ((pis)->cmap_procs->map_devicen)(pcc, pdc, pis, dev, select)
+#define gx_remap_concrete_gray(cgray, pdc, pgs, dev, select)\
+ ((pgs)->cmap_procs->map_gray)(cgray, pdc, pgs, dev, select)
+#define gx_remap_concrete_rgb(cr, cg, cb, pdc, pgs, dev, select)\
+ ((pgs)->cmap_procs->map_rgb)(cr, cg, cb, pdc, pgs, dev, select)
+#define gx_remap_concrete_cmyk(cc, cm, cy, ck, pdc, pgs, dev, select, pcs)\
+ ((pgs)->cmap_procs->map_cmyk)(cc, cm, cy, ck, pdc, pgs, dev, select, pcs)
+#define gx_remap_concrete_rgb_alpha(cr, cg, cb, ca, pdc, pgs, dev, select)\
+ ((pgs)->cmap_procs->map_rgb_alpha)(cr, cg, cb, ca, pdc, pgs, dev, select)
+#define gx_remap_concrete_separation(pcc, pdc, pgs, dev, select)\
+ ((pgs)->cmap_procs->map_separation)(pcc, pdc, pgs, dev, select)
+#define gx_remap_concrete_devicen(pcc, pdc, pgs, dev, select)\
+ ((pgs)->cmap_procs->map_devicen)(pcc, pdc, pgs, dev, select)
/* Map a color */
#include "gxcindex.h"
@@ -289,14 +293,14 @@ frac gx_unit_frac(float fvalue);
such a case, we can make use of the faster icc color conversions for
images */
bool gx_device_uses_std_cmap_procs(gx_device * dev,
- const gs_imager_state * pis);
+ const gs_gstate * pgs);
bool fwd_uses_fwd_cmap_procs(gx_device * dev);
const gx_cm_color_map_procs* fwd_get_target_cmap_procs(gx_device * dev);
void cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
- const gs_imager_state * pis, gx_device * dev, bool has_transfer,
+ const gs_gstate * pgs, gx_device * dev, bool has_transfer,
bool has_halftone, gs_color_select_t select);
-void cmap_transfer(gx_color_value *pconc, const gs_imager_state * pis,
+void cmap_transfer(gx_color_value *pconc, const gs_gstate * pgs,
gx_device * dev);
-void cmap_transfer_plane(gx_color_value *pconc, const gs_imager_state *pis,
+void cmap_transfer_plane(gx_color_value *pconc, const gs_gstate *pgs,
gx_device *dev, int plane);
#endif /* gxcmap_INCLUDED */
diff --git a/base/gxcomp.h b/base/gxcomp.h
index ae0f1c407..9fdbabf94 100644
--- a/base/gxcomp.h
+++ b/base/gxcomp.h
@@ -53,9 +53,9 @@
*/
/*typedef struct gs_composite_s gs_composite_t; *//* in gscompt.h */
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gx_device_DEFINED
@@ -75,7 +75,7 @@ typedef struct gs_composite_type_procs_s {
*/
#define composite_create_default_compositor_proc(proc)\
int proc(const gs_composite_t *pcte, gx_device **pcdev,\
- gx_device *dev, gs_imager_state *pis, gs_memory_t *mem)
+ gx_device *dev, gs_gstate *pgs, gs_memory_t *mem)
composite_create_default_compositor_proc((*create_default_compositor));
/*
@@ -112,7 +112,7 @@ typedef struct gs_composite_type_procs_s {
* Adjust CTM before applying the compositor. Used with banding.
*/
#define composite_adjust_ctm_proc(proc)\
- int proc(gs_composite_t *pcte, int x0, int y0, gs_imager_state *pis)
+ int proc(gs_composite_t *pcte, int x0, int y0, gs_gstate *pgs)
composite_adjust_ctm_proc((*adjust_ctm));
/*
@@ -139,7 +139,7 @@ typedef struct gs_composite_type_procs_s {
*/
#define composite_clist_write_update(proc)\
int proc(const gs_composite_t * pcte, gx_device * dev, gx_device ** pcdev,\
- gs_imager_state * pis, gs_memory_t * mem)
+ gs_gstate * pgs, gs_memory_t * mem)
composite_clist_write_update((*clist_compositor_write_update));
/*
@@ -147,7 +147,7 @@ typedef struct gs_composite_type_procs_s {
*/
#define composite_clist_read_update(proc)\
int proc(gs_composite_t * pcte, gx_device * cdev, gx_device * tdev,\
- gs_imager_state * pis, gs_memory_t * mem)
+ gs_gstate * pgs, gs_memory_t * mem)
composite_clist_read_update((*clist_compositor_read_update));
/*
diff --git a/base/gxcoord.h b/base/gxcoord.h
index 553092af0..5f84ff03a 100644
--- a/base/gxcoord.h
+++ b/base/gxcoord.h
@@ -24,10 +24,10 @@
/* Set the translation to a fixed value, and translate any existing path. */
/* Used by gschar.c to prepare for a BuildChar or BuildGlyph procedure. */
-int gx_translate_to_fixed(gs_state *, fixed, fixed);
+int gx_translate_to_fixed(gs_gstate *, fixed, fixed);
/* Scale the CTM and character matrix for oversampling. */
-int gx_scale_char_matrix(gs_state *, int, int);
+int gx_scale_char_matrix(gs_gstate *, int, int);
/* Compute the coefficients for fast fixed-point distance transformations */
/* from a transformation matrix. */
diff --git a/base/gxcpath.c b/base/gxcpath.c
index 99ae23431..0520d7fc5 100644
--- a/base/gxcpath.c
+++ b/base/gxcpath.c
@@ -24,7 +24,7 @@
#include "gxfixed.h"
#include "gxpaint.h"
#include "gscoord.h" /* needs gsmatrix.h */
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gzpath.h"
#include "gzcpath.h"
#include "gzacpath.h"
@@ -586,16 +586,15 @@ gx_path_rectangular_type cpath_is_rectangle(const gx_clip_path * pcpath, gs_fixe
/* Intersect a new clipping path with an old one. */
/* Flatten the new path first (in a copy) if necessary. */
int
-gx_cpath_clip(gs_state *pgs, gx_clip_path *pcpath,
+gx_cpath_clip(gs_gstate *pgs, gx_clip_path *pcpath,
/*const*/ gx_path *ppath_orig, int rule)
{
- return gx_cpath_intersect(pcpath, ppath_orig, rule,
- (gs_imager_state *)pgs);
+ return gx_cpath_intersect(pcpath, ppath_orig, rule, pgs);
}
int
gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_orig,
- int rule, gs_imager_state *pis, const gx_fill_params * params)
+ int rule, gs_gstate *pgs, const gx_fill_params * params)
{
gx_path fpath;
/*const*/ gx_path *ppath = ppath_orig;
@@ -604,10 +603,10 @@ gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_or
/* Flatten the path if necessary. */
if (gx_path_has_curves_inline(ppath)) {
- gx_path_init_local(&fpath, pis->memory);
+ gx_path_init_local(&fpath, pgs->memory);
code = gx_path_add_flattened_accurate(ppath, &fpath,
- gs_currentflat_inline(pis),
- pis->accurate_curves);
+ gs_currentflat_inline(pgs),
+ pgs->accurate_curves);
if (code < 0)
return code;
ppath = &fpath;
@@ -623,14 +622,14 @@ gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_or
/* The new path is void. */
if (gx_path_current_point(ppath, &new_box.p) < 0) {
/* Use the user space origin (arbitrarily). */
- new_box.p.x = float2fixed(pis->ctm.tx);
- new_box.p.y = float2fixed(pis->ctm.ty);
+ new_box.p.x = float2fixed(pgs->ctm.tx);
+ new_box.p.y = float2fixed(pgs->ctm.ty);
}
new_box.q = new_box.p;
changed = 1;
} else {
{ /* Apply same adjustment as for filling the path. */
- gs_fixed_point adjust = params != NULL ? params->adjust : pis->fill_adjust;
+ gs_fixed_point adjust = params != NULL ? params->adjust : pgs->fill_adjust;
fixed adjust_xl, adjust_xu, adjust_yl, adjust_yu;
if (adjust.x == -1)
@@ -691,7 +690,7 @@ gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_or
goto ex;
}
code = gx_cpath_intersect_path_slow(pcpath, (params != NULL ? ppath_orig : ppath),
- rule, pis, params);
+ rule, pgs, params);
if (code < 0)
goto ex;
if (path_valid) {
@@ -710,10 +709,10 @@ ex:
}
int
gx_cpath_intersect(gx_clip_path *pcpath, /*const*/ gx_path *ppath_orig,
- int rule, gs_imager_state *pis)
+ int rule, gs_gstate *pgs)
{
return gx_cpath_intersect_with_params(pcpath, ppath_orig,
- rule, pis, NULL);
+ rule, pgs, NULL);
}
/* Scale a clipping path by a power of 2. */
diff --git a/base/gxcspace.h b/base/gxcspace.h
index f8f6d1b70..7e317d188 100644
--- a/base/gxcspace.h
+++ b/base/gxcspace.h
@@ -104,9 +104,9 @@ struct gs_color_space_type_s {
#define cs_proc_concrete_space(proc)\
const gs_color_space *proc(const gs_color_space *,\
- const gs_imager_state *)
-#define cs_concrete_space(pcs, pis)\
- (*(pcs)->type->concrete_space)(pcs, pis)
+ const gs_gstate *)
+#define cs_concrete_space(pcs, pgs)\
+ (*(pcs)->type->concrete_space)(pcs, pgs)
cs_proc_concrete_space((*concrete_space));
/*
@@ -119,9 +119,9 @@ struct gs_color_space_type_s {
#define cs_proc_concretize_color(proc)\
int proc(const gs_client_color *, const gs_color_space *,\
- frac *, const gs_imager_state *, gx_device *)
-#define cs_concretize_color(pcc, pcs, values, pis, dev)\
- (*(pcs)->type->concretize_color)(pcc, pcs, values, pis, dev)
+ frac *, const gs_gstate *, gx_device *)
+#define cs_concretize_color(pcc, pcs, values, pgs, dev)\
+ (*(pcs)->type->concretize_color)(pcc, pcs, values, pgs, dev)
cs_proc_concretize_color((*concretize_color));
/* Map a concrete color to a device color. */
@@ -129,21 +129,21 @@ struct gs_color_space_type_s {
#define cs_proc_remap_concrete_color(proc)\
int proc(const frac *, const gs_color_space * pcs, gx_device_color *,\
- const gs_imager_state *, gx_device *, gs_color_select_t)
+ const gs_gstate *, gx_device *, gs_color_select_t)
cs_proc_remap_concrete_color((*remap_concrete_color));
/* Map a color directly to a device color. */
#define cs_proc_remap_color(proc)\
int proc(const gs_client_color *, const gs_color_space *,\
- gx_device_color *, const gs_imager_state *, gx_device *,\
+ gx_device_color *, const gs_gstate *, gx_device *,\
gs_color_select_t)
cs_proc_remap_color((*remap_color));
/* Install the color space in a graphics state. */
#define cs_proc_install_cspace(proc)\
- int proc(gs_color_space *, gs_state *)
+ int proc(gs_color_space *, gs_gstate *)
cs_proc_install_cspace((*install_cspace));
/*
@@ -159,7 +159,7 @@ struct gs_color_space_type_s {
*/
#define cs_proc_set_overprint(proc)\
- int proc(const gs_color_space *, gs_state *)
+ int proc(const gs_color_space *, gs_gstate *)
cs_proc_set_overprint((*set_overprint));
/* Free contents of composite colorspace objects. */
@@ -203,13 +203,13 @@ struct gs_color_space_type_s {
/* A color mapping linearity check. */
#define cs_proc_is_linear(proc)\
- int proc(const gs_color_space *cs, const gs_imager_state * pis,\
+ int proc(const gs_color_space *cs, const gs_gstate * pgs,\
gx_device *dev,\
const gs_client_color *c0, const gs_client_color *c1,\
const gs_client_color *c2, const gs_client_color *c3,\
float smoothness, gsicc_link_t *icclink)
-#define cs_is_linear(pcs, pis, dev, c0, c1, c2, c3, smoothness, icclink)\
- (*(pcs)->type->is_linear)(pcs, pis, dev, c0, c1, c2, c3, smoothness, icclink)
+#define cs_is_linear(pcs, pgs, dev, c0, c1, c2, c3, smoothness, icclink)\
+ (*(pcs)->type->is_linear)(pcs, pgs, dev, c0, c1, c2, c3, smoothness, icclink)
cs_proc_is_linear((*is_linear));
/* Define the polarity of a color space. We will use gx_color_polarity_t
@@ -281,7 +281,7 @@ gx_color_index check_cmyk_color_model_comps(gx_device * dev);
gx_color_index check_rgb_color_model_comps(gx_device * dev);
/* Shared code with ICC overprint */
-int gx_set_overprint_cmyk(const gs_color_space * pcs, gs_state * pgs);
-int gx_set_overprint_rgb(const gs_color_space * pcs, gs_state * pgs);
+int gx_set_overprint_cmyk(const gs_color_space * pcs, gs_gstate * pgs);
+int gx_set_overprint_rgb(const gs_color_space * pcs, gs_gstate * pgs);
#endif /* gxcspace_INCLUDED */
diff --git a/base/gxdcconv.c b/base/gxdcconv.c
index d1891171c..e15f286d3 100644
--- a/base/gxdcconv.c
+++ b/base/gxdcconv.c
@@ -22,7 +22,7 @@
#include "gxcmap.h"
#include "gxfarith.h"
#include "gxlum.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gsstate.h" /* for gs_currentcpsimode */
/*
@@ -44,7 +44,7 @@
/* Convert RGB to Gray. */
frac
-color_rgb_to_gray(frac r, frac g, frac b, const gs_imager_state * pis)
+color_rgb_to_gray(frac r, frac g, frac b, const gs_gstate * pgs)
{
return (r * (unsigned long)lum_red_weight +
g * (unsigned long)lum_green_weight +
@@ -56,7 +56,7 @@ color_rgb_to_gray(frac r, frac g, frac b, const gs_imager_state * pis)
/* Convert RGB to CMYK. */
/* Note that this involves black generation and undercolor removal. */
void
-color_rgb_to_cmyk(frac r, frac g, frac b, const gs_imager_state * pis,
+color_rgb_to_cmyk(frac r, frac g, frac b, const gs_gstate * pgs,
frac cmyk[4], gs_memory_t *mem)
{
frac c = frac_1 - r, m = frac_1 - g, y = frac_1 - b;
@@ -67,11 +67,11 @@ color_rgb_to_cmyk(frac r, frac g, frac b, const gs_imager_state * pis,
* but they must agree with the ones in gs_init.ps.
*/
frac bg =
- (pis == NULL ? k : pis->black_generation == NULL ? frac_0 :
- gx_map_color_frac(pis, k, black_generation));
+ (pgs == NULL ? k : pgs->black_generation == NULL ? frac_0 :
+ gx_map_color_frac(pgs, k, black_generation));
signed_frac ucr =
- (pis == NULL ? k : pis->undercolor_removal == NULL ? frac_0 :
- gx_map_color_frac(pis, k, undercolor_removal));
+ (pgs == NULL ? k : pgs->undercolor_removal == NULL ? frac_0 :
+ gx_map_color_frac(pgs, k, undercolor_removal));
if (ucr == frac_1)
cmyk[0] = cmyk[1] = cmyk[2] = 0;
@@ -109,9 +109,9 @@ color_rgb_to_cmyk(frac r, frac g, frac b, const gs_imager_state * pis,
/* Convert CMYK to Gray. */
frac
-color_cmyk_to_gray(frac c, frac m, frac y, frac k, const gs_imager_state * pis)
+color_cmyk_to_gray(frac c, frac m, frac y, frac k, const gs_gstate * pgs)
{
- frac not_gray = color_rgb_to_gray(c, m, y, pis);
+ frac not_gray = color_rgb_to_gray(c, m, y, pgs);
return (not_gray > frac_1 - k ? /* gray + k > 1.0 */
frac_0 : frac_1 - (not_gray + k));
@@ -119,7 +119,7 @@ color_cmyk_to_gray(frac c, frac m, frac y, frac k, const gs_imager_state * pis)
/* Convert CMYK to RGB. */
void
-color_cmyk_to_rgb(frac c, frac m, frac y, frac k, const gs_imager_state * pis,
+color_cmyk_to_rgb(frac c, frac m, frac y, frac k, const gs_gstate * pgs,
frac rgb[3], gs_memory_t *mem)
{
switch (k) {
diff --git a/base/gxdcconv.h b/base/gxdcconv.h
index f39652a01..5be7d96c7 100644
--- a/base/gxdcconv.h
+++ b/base/gxdcconv.h
@@ -23,14 +23,14 @@
/* Color space conversion routines */
frac color_rgb_to_gray(frac r, frac g, frac b,
- const gs_imager_state * pis);
+ const gs_gstate * pgs);
void color_rgb_to_cmyk(frac r, frac g, frac b,
- const gs_imager_state * pis, frac cmyk[4],
+ const gs_gstate * pgs, frac cmyk[4],
gs_memory_t * mem);
frac color_cmyk_to_gray(frac c, frac m, frac y, frac k,
- const gs_imager_state * pis);
+ const gs_gstate * pgs);
void color_cmyk_to_rgb(frac c, frac m, frac y, frac k,
- const gs_imager_state * pis, frac rgb[3],
+ const gs_gstate * pgs, frac rgb[3],
gs_memory_t * mem);
#endif /* gxdcconv_INCLUDED */
diff --git a/base/gxdcolor.c b/base/gxdcolor.c
index 350bed14c..4fdfe93bb 100644
--- a/base/gxdcolor.c
+++ b/base/gxdcolor.c
@@ -260,7 +260,7 @@ gx_dc_no_get_dev_halftone(const gx_device_color * pdevc)
}
static int
-gx_dc_no_load(gx_device_color *pdevc, const gs_imager_state *ignore_pis,
+gx_dc_no_load(gx_device_color *pdevc, const gs_gstate *ignore_pgs,
gx_device *ignore_dev, gs_color_select_t ignore_select)
{
return 0;
@@ -315,7 +315,7 @@ gx_dc_no_write(
static int
gx_dc_no_read(
gx_device_color * pdevc,
- const gs_imager_state * pis, /* ignored */
+ const gs_gstate * pgs, /* ignored */
const gx_device_color * prior_devc, /* ignored */
const gx_device * dev, /* ignored */
int64_t offset, /* ignored */
@@ -342,7 +342,7 @@ gx_dc_cannot_write(
int
gx_dc_cannot_read(
gx_device_color * pdevc,
- const gs_imager_state * pis, /* ignored */
+ const gs_gstate * pgs, /* ignored */
const gx_device_color * prior_devc, /* ignored */
const gx_device * dev, /* ignored */
int64_t offset, /* ignored */
@@ -365,7 +365,7 @@ gx_dc_no_get_nonzero_comps(
/* ------ Null color ------ */
static int
-gx_dc_null_load(gx_device_color *pdevc, const gs_imager_state *ignore_pis,
+gx_dc_null_load(gx_device_color *pdevc, const gs_gstate *ignore_pgs,
gx_device *ignore_dev, gs_color_select_t ignore_select)
{
return 0;
@@ -398,7 +398,7 @@ gx_dc_null_equal(const gx_device_color * pdevc1, const gx_device_color * pdevc2)
static int
gx_dc_null_read(
gx_device_color * pdevc,
- const gs_imager_state * pis, /* ignored */
+ const gs_gstate * pgs, /* ignored */
const gx_device_color * prior_devc, /* ignored */
const gx_device * dev, /* ignored */
int64_t offset, /* ignored */
@@ -422,7 +422,7 @@ gx_dc_devn_save_dc(const gx_device_color * pdevc, gx_device_color_saved * psdc)
}
static int
-gx_dc_devn_load(gx_device_color * pdevc, const gs_imager_state * ignore_pis,
+gx_dc_devn_load(gx_device_color * pdevc, const gs_gstate * ignore_pgs,
gx_device * ignore_dev, gs_color_select_t ignore_select)
{
return 0;
@@ -700,11 +700,11 @@ gx_devn_read_color(
* pdevc pointer to the location in which to write the
* reconstructed device color
*
- * pis pointer to the current imager state (ignored here)
+ * pgs pointer to the current gs_gstate (ignored here)
*
* prior_devc pointer to the current device color (this is provided
* separately because the device color is not part of the
- * imager state; it is ignored here)
+ * gs_gstate; it is ignored here)
*
* dev pointer to the current device, used to retrieve process
* color model information
@@ -724,7 +724,7 @@ gx_devn_read_color(
static int
gx_dc_devn_read(
gx_device_color * pdevc,
- const gs_imager_state * pis, /* ignored */
+ const gs_gstate * pgs, /* ignored */
const gx_device_color * prior_devc, /* ignored */
const gx_device * dev,
int64_t offset, /* ignored */
@@ -771,7 +771,7 @@ gx_dc_pure_save_dc(const gx_device_color * pdevc, gx_device_color_saved * psdc)
}
static int
-gx_dc_pure_load(gx_device_color * pdevc, const gs_imager_state * ignore_pis,
+gx_dc_pure_load(gx_device_color * pdevc, const gs_gstate * ignore_pgs,
gx_device * ignore_dev, gs_color_select_t ignore_select)
{
return 0;
@@ -906,11 +906,11 @@ gx_dc_pure_write(
* pdevc pointer to the location in which to write the
* reconstructed device color
*
- * pis pointer to the current imager state (ignored here)
+ * pgs pointer to the current gs_gstate (ignored here)
*
* prior_devc pointer to the current device color (this is provided
* separately because the device color is not part of the
- * imager state; it is ignored here)
+ * gs_gstate; it is ignored here)
*
* dev pointer to the current device, used to retrieve process
* color model information
@@ -930,7 +930,7 @@ gx_dc_pure_write(
static int
gx_dc_pure_read(
gx_device_color * pdevc,
- const gs_imager_state * pis, /* ignored */
+ const gs_gstate * pgs, /* ignored */
const gx_device_color * prior_devc, /* ignored */
const gx_device * dev,
int64_t offset, /* ignored */
diff --git a/base/gxdcolor.h b/base/gxdcolor.h
index 70b1291f6..b75eb69d9 100644
--- a/base/gxdcolor.h
+++ b/base/gxdcolor.h
@@ -32,9 +32,9 @@
typedef struct gx_device_s gx_device;
#endif
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
/*
@@ -114,7 +114,7 @@ struct gx_device_color_type_s {
*/
#define dev_color_proc_load(proc)\
- int proc(gx_device_color *pdevc, const gs_imager_state *pis,\
+ int proc(gx_device_color *pdevc, const gs_gstate *pgs,\
gx_device *dev, gs_color_select_t select)
dev_color_proc_load((*load));
@@ -202,10 +202,10 @@ struct gx_device_color_type_s {
* changed, so informaition from the prior device color will no
* longer be available.
*
- * For the read method, the imager state is passed as an operand,
+ * For the read method, the gs_gstate is passed as an operand,
* which allows the routine to access the current device halftone
* (always required). Also passed in a pointer to the existing device
- * color, as this is not part of the imager state. If the writer was
+ * color, as this is not part of the gs_gstate. If the writer was
* passed a non-null psdc operand, *prior_devc must reflect the
* information contained in *psdc.
*
@@ -223,7 +223,7 @@ struct gx_device_color_type_s {
dev_color_proc_write((*write));
#define dev_color_proc_read(proc)\
- int proc(gx_device_color *pdevc, const gs_imager_state * pis,\
+ int proc(gx_device_color *pdevc, const gs_gstate * pgs,\
const gx_device_color *prior_devc, const gx_device * dev, int64_t offset,\
const byte *data, uint size, gs_memory_t *mem)
dev_color_proc_read((*read));
@@ -300,10 +300,10 @@ extern dev_color_proc_get_phase(gx_dc_ht_get_phase);
/* Set up device color 1 for writing into a mask cache */
/* (e.g., the character cache). */
-int gx_set_device_color_1(gs_state * pgs);
+int gx_set_device_color_1(gs_gstate * pgs);
/* Remap the color if necessary. */
-int gx_remap_color(gs_state *);
+int gx_remap_color(gs_gstate *);
#define gx_set_dev_color(pgs)\
color_is_set(gs_currentdevicecolor_inline(pgs)) ? 0 :\
@@ -316,12 +316,12 @@ int gx_remap_color(gs_state *);
color_unset(gs_altdevicecolor_inline(pgs))
/* Load the halftone cache in preparation for drawing. */
-#define gx_color_load_select(pdevc, pis, dev, select)\
- (*(pdevc)->type->load)(pdevc, pis, dev, select)
-#define gx_color_load(pdevc, pis, dev)\
- gx_color_load_select(pdevc, pis, dev, gs_color_select_texture)
-#define gs_state_color_load(pgs)\
- gx_color_load(gs_currentdevicecolor_inline(pgs), (const gs_imager_state *)(pgs),\
+#define gx_color_load_select(pdevc, pgs, dev, select)\
+ (*(pdevc)->type->load)(pdevc, pgs, dev, select)
+#define gx_color_load(pdevc, pgs, dev)\
+ gx_color_load_select(pdevc, pgs, dev, gs_color_select_texture)
+#define gs_gstate_color_load(pgs)\
+ gx_color_load(gs_currentdevicecolor_inline(pgs), (const gs_gstate *)(pgs),\
(pgs)->device)
/* Fill a rectangle with a color. */
diff --git a/base/gxdevcli.h b/base/gxdevcli.h
index f701b16cb..b0bb0094f 100644
--- a/base/gxdevcli.h
+++ b/base/gxdevcli.h
@@ -119,9 +119,9 @@ typedef struct gx_device_s gx_device;
/* We need at least an abstract type for a graphics state, */
/* which is passed to the page device procedures. */
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
/* We need abstract types for paths and fill/stroke parameters, */
@@ -142,9 +142,9 @@ typedef struct gx_fill_params_s gx_fill_params;
# define gx_stroke_params_DEFINED
typedef struct gx_stroke_params_s gx_stroke_params;
#endif
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef patch_fill_state_t_DEFINED
# define patch_fill_state_t_DEFINED
@@ -621,15 +621,15 @@ typedef struct gx_device_procs_s gx_device_procs;
typedef struct gx_page_device_procs_s {
#define dev_page_proc_install(proc)\
- int proc(gx_device *dev, gs_state *pgs)
+ int proc(gx_device *dev, gs_gstate *pgs)
dev_page_proc_install((*install));
#define dev_page_proc_begin_page(proc)\
- int proc(gx_device *dev, gs_state *pgs)
+ int proc(gx_device *dev, gs_gstate *pgs)
dev_page_proc_begin_page((*begin_page));
#define dev_page_proc_end_page(proc)\
- int proc(gx_device *dev, int reason, gs_state *pgs)
+ int proc(gx_device *dev, int reason, gs_gstate *pgs)
dev_page_proc_end_page((*end_page));
} gx_page_device_procs;
@@ -1040,7 +1040,7 @@ typedef struct gs_param_list_s gs_param_list;
#define dev_t_proc_fill_path(proc, dev_t)\
int proc(dev_t *dev,\
- const gs_imager_state *pis, gx_path *ppath,\
+ const gs_gstate *pgs, gx_path *ppath,\
const gx_fill_params *params,\
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
#define dev_proc_fill_path(proc)\
@@ -1048,7 +1048,7 @@ typedef struct gs_param_list_s gs_param_list;
#define dev_t_proc_stroke_path(proc, dev_t)\
int proc(dev_t *dev,\
- const gs_imager_state *pis, gx_path *ppath,\
+ const gs_gstate *pgs, gx_path *ppath,\
const gx_stroke_params *params,\
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath)
#define dev_proc_stroke_path(proc)\
@@ -1109,7 +1109,7 @@ typedef struct gs_param_list_s gs_param_list;
#define dev_t_proc_begin_image(proc, dev_t)\
int proc(dev_t *dev,\
- const gs_imager_state *pis, const gs_image_t *pim,\
+ const gs_gstate *pgs, const gs_image_t *pim,\
gs_image_format_t format, const gs_int_rect *prect,\
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,\
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
@@ -1164,7 +1164,7 @@ typedef struct gs_param_list_s gs_param_list;
#define dev_t_proc_begin_typed_image(proc, dev_t)\
int proc(dev_t *dev,\
- const gs_imager_state *pis, const gs_matrix *pmat,\
+ const gs_gstate *pgs, const gs_matrix *pmat,\
const gs_image_common_t *pim, const gs_int_rect *prect,\
const gx_drawing_color *pdcolor, const gx_clip_path *pcpath,\
gs_memory_t *memory, gx_image_enum_common_t **pinfo)
@@ -1188,7 +1188,7 @@ typedef struct gs_param_list_s gs_param_list;
#define dev_t_proc_create_compositor(proc, dev_t)\
int proc(dev_t *dev,\
gx_device **pcdev, const gs_composite_t *pcte,\
- gs_imager_state *pis, gs_memory_t *memory, gx_device *cdev)
+ gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev)
#define dev_proc_create_compositor(proc)\
dev_t_proc_create_compositor(proc, gx_device)\
@@ -1220,7 +1220,7 @@ typedef struct gs_param_list_s gs_param_list;
/*
Push the current transparency state (*ppts) onto the associated stack,
and set *ppts to a new transparency state of the given dimension. The
- transparency state may copy some or all of the imager state, such as the
+ transparency state may copy some or all of the gs_gstate, such as the
current alpha and/or transparency mask values, and definitely copies the
parameters.
*/
@@ -1228,7 +1228,7 @@ typedef struct gs_param_list_s gs_param_list;
int proc(gx_device *dev,\
const gs_transparency_group_params_t *ptgp,\
const gs_rect *pbbox,\
- gs_imager_state *pis,\
+ gs_gstate *pgs,\
gs_memory_t *mem)
#define dev_proc_begin_transparency_group(proc)\
dev_t_proc_begin_transparency_group(proc, gx_device)
@@ -1242,7 +1242,7 @@ typedef struct gs_param_list_s gs_param_list;
*/
#define dev_t_proc_end_transparency_group(proc, dev_t)\
int proc(gx_device *dev,\
- gs_imager_state *pis)
+ gs_gstate *pgs)
#define dev_proc_end_transparency_group(proc)\
dev_t_proc_end_transparency_group(proc, gx_device)
@@ -1255,7 +1255,7 @@ typedef struct gs_param_list_s gs_param_list;
int proc(gx_device *dev,\
const gx_transparency_mask_params_t *ptmp,\
const gs_rect *pbbox,\
- gs_imager_state *pis,\
+ gs_gstate *pgs,\
gs_memory_t *mem)
#define dev_proc_begin_transparency_mask(proc)\
dev_t_proc_begin_transparency_mask(proc, gx_device)
@@ -1263,12 +1263,12 @@ typedef struct gs_param_list_s gs_param_list;
/*
Store a pointer to the rendered transparency mask into *pptm, popping the
stack like end_group. Normally, the client will follow this by using
- rc_assign to store the rendered mask into pis->{opacity,shape}.mask. If
+ rc_assign to store the rendered mask into pgs->{opacity,shape}.mask. If
end_mask fails, the stack is *not* popped.
*/
#define dev_t_proc_end_transparency_mask(proc, dev_t)\
int proc(gx_device *dev,\
- gs_imager_state *pis)
+ gs_gstate *pgs)
#define dev_proc_end_transparency_mask(proc)\
dev_t_proc_end_transparency_mask(proc, gx_device)
@@ -1279,7 +1279,7 @@ typedef struct gs_param_list_s gs_param_list;
*/
#define dev_t_proc_discard_transparency_layer(proc, dev_t)\
int proc(gx_device *dev,\
- gs_imager_state *pis)
+ gs_gstate *pgs)
#define dev_proc_discard_transparency_layer(proc)\
dev_t_proc_discard_transparency_layer(proc, gx_device)
@@ -1349,7 +1349,7 @@ typedef enum {
#define dev_t_proc_fill_rectangle_hl_color(proc, dev_t)\
int proc(dev_t *dev, const gs_fixed_rect *rect, \
- const gs_imager_state *pis, const gx_drawing_color *pdcolor, \
+ const gs_gstate *pgs, const gx_drawing_color *pdcolor, \
const gx_clip_path *pcpath)
#define dev_proc_fill_rectangle_hl_color(proc)\
dev_t_proc_fill_rectangle_hl_color(proc, gx_device)
@@ -1438,7 +1438,7 @@ typedef struct gs_fill_attributes_s {
* start of src/gsequivc.c.
*/
#define dev_t_proc_update_spot_equivalent_colors(proc, dev_t)\
- int proc(dev_t *dev, const gs_state * pgs)
+ int proc(dev_t *dev, const gs_gstate * pgs)
#define dev_proc_update_spot_equivalent_colors(proc)\
dev_t_proc_update_spot_equivalent_colors(proc, gx_device)
@@ -1461,19 +1461,19 @@ typedef struct gs_devn_params_s gs_devn_params;
*/
#define dev_t_proc_fillpage(proc, dev_t)\
- int proc(gx_device *dev, gs_imager_state * pis, gx_device_color *pdevc)
+ int proc(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
#define dev_proc_fillpage(proc)\
dev_t_proc_fillpage(proc, gx_device)
#define dev_t_proc_push_transparency_state(proc, dev_t)\
int proc(gx_device *dev,\
- gs_imager_state *pis)
+ gs_gstate *pgs)
#define dev_proc_push_transparency_state(proc)\
dev_t_proc_push_transparency_state(proc, gx_device)
#define dev_t_proc_pop_transparency_state(proc, dev_t)\
int proc(gx_device *dev,\
- gs_imager_state *pis)
+ gs_gstate *pgs)
#define dev_proc_pop_transparency_state(proc)\
dev_t_proc_pop_transparency_state(proc, gx_device)
@@ -1644,12 +1644,12 @@ typedef struct gx_image_plane_s {
uint raster;
} gx_image_plane_t;
-#define gx_device_begin_image(dev, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo)\
+#define gx_device_begin_image(dev, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo)\
((*dev_proc(dev, begin_image))\
- (dev, pis, pim, format, prect, pdcolor, pcpath, memory, pinfo))
-#define gx_device_begin_typed_image(dev, pis, pmat, pim, prect, pdcolor, pcpath, memory, pinfo)\
+ (dev, pgs, pim, format, prect, pdcolor, pcpath, memory, pinfo))
+#define gx_device_begin_typed_image(dev, pgs, pmat, pim, prect, pdcolor, pcpath, memory, pinfo)\
((*dev_proc(dev, begin_typed_image))\
- (dev, pis, pmat, pim, prect, pdcolor, pcpath, memory, pinfo))
+ (dev, pgs, pmat, pim, prect, pdcolor, pcpath, memory, pinfo))
/*
* The driver-like procedures gx_device_{image_data, image_plane_data,
@@ -1774,7 +1774,7 @@ gx_cm_color_map_procs *get_color_mapping_procs_subclass(const gx_device *dev)
}
static inline
-void map_rgb_subclass(const gx_cm_color_map_procs *procs, gx_device *dev, const gs_imager_state *pis, frac r, frac g, frac b, frac out[])
+void map_rgb_subclass(const gx_cm_color_map_procs *procs, gx_device *dev, const gs_gstate *pgs, frac r, frac g, frac b, frac out[])
{
if (dev == NULL)
return;
@@ -1782,7 +1782,7 @@ void map_rgb_subclass(const gx_cm_color_map_procs *procs, gx_device *dev, const
{
dev = dev->parent;
}
- procs->map_rgb(dev, pis, r, g, b, out);
+ procs->map_rgb(dev, pgs, r, g, b, out);
}
static inline
@@ -1900,7 +1900,7 @@ void gx_device_set_media_size(gx_device * dev, double media_width, double media_
* Temporarily install a null device, or a special device such as
* a clipping or cache device.
*/
-void gx_set_device_only(gs_state *, gx_device *);
+void gx_set_device_only(gs_gstate *, gx_device *);
/* Close a device. */
int gs_closedevice(gx_device *);
diff --git a/base/gxdevice.h b/base/gxdevice.h
index aa4266d6e..534d47dc2 100644
--- a/base/gxdevice.h
+++ b/base/gxdevice.h
@@ -495,7 +495,7 @@ int gx_device_delete_output_file(const gx_device * dev, const char *fname);
/*
* Determine whether a given device needs to halftone. Eventually this
- * should take an imager state as an additional argument.
+ * should take a gs_gstate as an additional argument.
*/
#define gx_device_must_halftone(dev)\
((gx_device_has_color(dev) ? (dev)->color_info.max_color :\
@@ -645,7 +645,7 @@ int gs_is_pdf14trans_compositor(const gs_composite_t * pct);
#define subclass_common\
t_dev_proc_create_compositor *saved_compositor_method
-typedef int (t_dev_proc_create_compositor) (gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory, gx_device *cdev);
+typedef int (t_dev_proc_create_compositor) (gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev);
typedef struct {
t_dev_proc_create_compositor *saved_compositor_method;
@@ -657,7 +657,7 @@ int gx_device_subclass(gx_device *dev_to_subclass, gx_device *new_prototype, uns
int gx_device_unsubclass(gx_device *dev);
int gx_update_from_subclass(gx_device *dev);
int gx_subclass_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte,
- gs_imager_state *pis, gs_memory_t *memory, gx_device *cdev);
+ gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev);
#endif /* gxdevice_INCLUDED */
diff --git a/base/gxdevmem.h b/base/gxdevmem.h
index 410088a91..7baa2f372 100644
--- a/base/gxdevmem.h
+++ b/base/gxdevmem.h
@@ -289,6 +289,6 @@ bool gs_device_is_memory(const gx_device *);
bool gs_device_is_abuf(const gx_device *);
/* Check for getting the antialiasing bit depth */
-int alpha_buffer_bits(gs_state * pgs);
+int alpha_buffer_bits(gs_gstate * pgs);
#endif /* gxdevmem_INCLUDED */
diff --git a/base/gxdht.h b/base/gxdht.h
index fa42c8aa6..1030b6c39 100644
--- a/base/gxdht.h
+++ b/base/gxdht.h
@@ -283,7 +283,7 @@ typedef struct gx_device_halftone_s gx_device_halftone;
/*
* Device Halftone Structure definition. See comments before
- * gx_imager_dev_ht_install() for more information on this structure and its
+ * gx_gstate_dev_ht_install() for more information on this structure and its
* fields.
*/
struct gx_device_halftone_s {
@@ -292,7 +292,7 @@ struct gx_device_halftone_s {
gs_id id; /* the id changes whenever the data change */
/*
* We have to keep the halftone type so that we can pass it
- * through the band list for gx_imager_dev_ht_install.
+ * through the band list for gx_gstate_dev_ht_install.
*/
gs_halftone_type type;
gx_ht_order_component *components;
diff --git a/base/gxdhtserial.c b/base/gxdhtserial.c
index e852e1b12..c6580111d 100644
--- a/base/gxdhtserial.c
+++ b/base/gxdhtserial.c
@@ -537,7 +537,7 @@ gx_ht_write(
*/
int
gx_ht_read_and_install(
- gs_imager_state * pis,
+ gs_gstate * pgs,
const gx_device * dev,
const byte * data,
uint size,
@@ -583,7 +583,7 @@ gx_ht_read_and_install(
/* save since the 'install' copies the order, but then clears the source order */
for (i = 0; i < num_dev_comps; i++)
components_save[i] = components[i];
- code = gx_imager_dev_ht_install(pis, &dht, dht.type, dev);
+ code = gx_gstate_dev_ht_install(pgs, &dht, dht.type, dev);
for (i = 0; i < num_dev_comps; i++)
gx_ht_order_release(&components_save[i].corder, mem, false);
}
diff --git a/base/gxdhtserial.h b/base/gxdhtserial.h
index d901a53ef..60ede33c7 100644
--- a/base/gxdhtserial.h
+++ b/base/gxdhtserial.h
@@ -34,9 +34,9 @@ typedef struct gx_device_s gx_device;
typedef struct gx_device_halftone_s gx_device_halftone;
#endif
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
/*
@@ -70,7 +70,7 @@ extern int gx_ht_write( const gx_device_halftone * pdht,
*
* Returns the number of bytes read, or < 0 in the event of an error.
*/
-extern int gx_ht_read_and_install( gs_imager_state * pis,
+extern int gx_ht_read_and_install( gs_gstate * pgs,
const gx_device * dev,
const byte * data,
uint size,
diff --git a/base/gxfapi.c b/base/gxfapi.c
index c4eb3c233..7ab812189 100644
--- a/base/gxfapi.c
+++ b/base/gxfapi.c
@@ -256,7 +256,7 @@ fapi_gs_char_show_width_only(const gs_text_enum_t *penum)
* a path outline, and not a bitmap.
*/
static bool
-using_transparency_pattern(gs_state *pgs)
+using_transparency_pattern(gs_gstate *pgs)
{
gx_device *dev = gs_currentdevice_inline(pgs);
@@ -270,7 +270,7 @@ produce_outline_char(gs_show_enum *penum_s,
gs_font_base *pbfont, int abits,
gs_log2_scale_point *log2_scale)
{
- gs_state *pgs = (gs_state *) penum_s->pis;
+ gs_gstate *pgs = (gs_gstate *) penum_s->pgs;
log2_scale->x = 0;
log2_scale->y = 0;
@@ -286,7 +286,7 @@ produce_outline_char(gs_show_enum *penum_s,
return (pgs->in_charpath || pbfont->PaintType != 0 ||
(pgs->in_cachedevice != CACHE_DEVICE_CACHING
- && using_transparency_pattern((gs_state *) penum_s->pis))
+ && using_transparency_pattern((gs_gstate *) penum_s->pgs))
|| (pgs->in_cachedevice != CACHE_DEVICE_CACHING
&& (log2_scale->x > 0 || log2_scale->y > 0))
|| (pgs->in_cachedevice != CACHE_DEVICE_CACHING && abits > 1));
@@ -526,17 +526,17 @@ outline_char(gs_memory_t *mem, gs_fapi_server *I, int import_shift_v,
gs_fapi_path path_interface = path_interface_stub;
gs_fapi_outline_handler olh;
int code;
- gs_state *pgs;
+ gs_gstate *pgs;
extern_st(st_gs_show_enum);
- extern_st(st_gs_state);
+ extern_st(st_gs_gstate);
if (gs_object_type(penum_s->memory, penum_s) == &st_gs_show_enum) {
pgs = penum_s->pgs;
}
else {
- if (gs_object_type(penum_s->memory, penum_s->pis) == &st_gs_state) {
- pgs = (gs_state *) penum_s->pis;
+ if (gs_object_type(penum_s->memory, penum_s->pgs) == &st_gs_gstate) {
+ pgs = (gs_gstate *) penum_s->pgs;
}
else
/* No graphics state, give up... */
@@ -747,11 +747,11 @@ static const int frac_pixel_shift = 4;
* validation, or fapi_image_uncached_glyph() must be changed to include the validation.
*/
static int
-fapi_image_uncached_glyph(gs_font *pfont, gs_state *pgs, gs_show_enum *penum,
+fapi_image_uncached_glyph(gs_font *pfont, gs_gstate *pgs, gs_show_enum *penum,
gs_fapi_raster *rast, const int import_shift_v)
{
gx_device *dev = penum->dev;
- gs_state *penum_pgs = (gs_state *) penum->pis;
+ gs_gstate *penum_pgs = (gs_gstate *) penum->pgs;
int code;
const gx_clip_path *pcpath = pgs->clip_path;
const gx_drawing_color *pdcolor = penum->pdcolor;
@@ -975,10 +975,10 @@ fapi_image_uncached_glyph(gs_font *pfont, gs_state *pgs, gs_show_enum *penum,
}
int
-gs_fapi_finish_render(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, gs_fapi_server *I)
+gs_fapi_finish_render(gs_font *pfont, gs_gstate *pgs, gs_text_enum_t *penum, gs_fapi_server *I)
{
gs_show_enum *penum_s = (gs_show_enum *) penum;
- gs_state *penum_pgs;
+ gs_gstate *penum_pgs;
gx_device *dev1;
const int import_shift_v = _fixed_shift - 32; /* we always 32.32 values for the outline interface now */
gs_fapi_raster rast;
@@ -987,15 +987,15 @@ gs_fapi_finish_render(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, gs_f
gs_font_base *pbfont = (gs_font_base *)pfont;
extern_st(st_gs_show_enum);
- extern_st(st_gs_state);
+ extern_st(st_gs_gstate);
if (penum == NULL) {
return_error(gs_error_undefined);
}
- /* Ensure that pis points to a st_gs_gstate (graphics state) structure */
- if (gs_object_type(penum->memory, penum->pis) != &st_gs_state) {
- /* If pis is not a graphics state, see if the text enumerator is a
+ /* Ensure that pgs points to a st_gs_gstate (graphics state) structure */
+ if (gs_object_type(penum->memory, penum->pgs) != &st_gs_gstate) {
+ /* If pgs is not a graphics state, see if the text enumerator is a
* show enumerator, in which case we have a pointer to the graphics state there
*/
if (gs_object_type(penum->memory, penum) == &st_gs_show_enum) {
@@ -1006,7 +1006,7 @@ gs_fapi_finish_render(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, gs_f
return_error(gs_error_undefined);
}
else
- penum_pgs = (gs_state *) penum->pis;
+ penum_pgs = (gs_gstate *) penum->pgs;
dev1 = gs_currentdevice_inline(penum_pgs); /* Possibly changed by zchar_set_cache. */
@@ -1043,7 +1043,6 @@ gs_fapi_finish_render(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, gs_f
if (!SHOW_IS(penum, TEXT_DO_NONE) && I->use_outline) {
/* The server provides an outline instead the raster. */
- gs_imager_state *pis = (gs_imager_state *) penum_pgs->show_gstate;
gs_point pt;
/* This mimics code which is used below in the case where I->Use_outline is set.
@@ -1060,8 +1059,8 @@ gs_fapi_finish_render(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, gs_f
penum_pgs->path, !pbfont->PaintType)) < 0)
return code;
if ((code =
- gs_imager_setflat((gs_imager_state *) penum_pgs,
- gs_char_flatness(pis, 1.0))) < 0)
+ gs_gstate_setflat((gs_gstate *) penum_pgs,
+ gs_char_flatness(penum_pgs->show_gstate, 1.0))) < 0)
return code;
if (pbfont->PaintType) {
float lw = gs_currentlinewidth(penum_pgs);
@@ -1187,7 +1186,7 @@ gs_fapi_finish_render(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, gs_f
mtx1->yx == mtx2->yx && mtx1->yy == mtx2->yy)
int
-gs_fapi_do_char(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, char *font_file_path,
+gs_fapi_do_char(gs_font *pfont, gs_gstate *pgs, gs_text_enum_t *penum, char *font_file_path,
bool bBuildGlyph, gs_string *charstring, gs_string *glyphname,
gs_char chr, gs_glyph index, int subfont)
{ /* Stack : <font> <code|name> --> - */
diff --git a/base/gxfapi.h b/base/gxfapi.h
index dcfddabba..242bc7e97 100644
--- a/base/gxfapi.h
+++ b/base/gxfapi.h
@@ -26,9 +26,9 @@
typedef struct gs_font_base_s gs_font_base;
#endif
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gs_text_enum_DEFINED
@@ -403,10 +403,10 @@ gs_fapi_prepare_font(gs_font *pfont, gs_fapi_server *I, int subfont, const char
gs_string *full_font_buf, const char *xlatmap, const char **decodingID);
int
-gs_fapi_finish_render(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, gs_fapi_server *I);
+gs_fapi_finish_render(gs_font *pfont, gs_gstate *pgs, gs_text_enum_t *penum, gs_fapi_server *I);
int
-gs_fapi_do_char(gs_font *pfont, gs_state *pgs, gs_text_enum_t *penum, char *font_file_path,
+gs_fapi_do_char(gs_font *pfont, gs_gstate *pgs, gs_text_enum_t *penum, char *font_file_path,
bool bBuildGlyph, gs_string *charstring, gs_string *glyphname,
gs_char chr, gs_glyph index, int subfont);
diff --git a/base/gxfcache.h b/base/gxfcache.h
index 82639b029..1f0c64aa3 100644
--- a/base/gxfcache.h
+++ b/base/gxfcache.h
@@ -62,9 +62,9 @@ typedef struct gx_ttfMemory_s gx_ttfMemory;
# define gx_device_spot_analyzer_DEFINED
typedef struct gx_device_spot_analyzer_s gx_device_spot_analyzer;
#endif
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
/*
diff --git a/base/gxfill.c b/base/gxfill.c
index 56823ae33..887c53b99 100644
--- a/base/gxfill.c
+++ b/base/gxfill.c
@@ -39,7 +39,7 @@
#include "gzcpath.h"
#include "gxdcolor.h"
#include "gxhttile.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpaint.h" /* for prototypes */
#include "gxfdrop.h"
#include "gxfill.h"
@@ -289,12 +289,12 @@ unclose_path(gx_path * ppath, int count)
* The general fill path algorithm.
*/
static int
-gx_general_fill_path(gx_device * pdev, const gs_imager_state * pis,
+gx_general_fill_path(gx_device * pdev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_device_color * pdevc, const gx_clip_path * pcpath)
{
gs_fixed_point adjust;
- gs_logical_operation_t lop = pis->log_op;
+ gs_logical_operation_t lop = pgs->log_op;
gs_fixed_rect ibox, bbox, sbox;
gx_device_clip cdev;
gx_device *dev = pdev;
@@ -304,7 +304,7 @@ gx_general_fill_path(gx_device * pdev, const gs_imager_state * pis,
int code;
int max_fill_band = dev->max_fill_band;
#define NO_BAND_MASK ((fixed)(-1) << (sizeof(fixed) * 8 - 1))
- const bool is_character = params->adjust.x == -1; /* See gxistate.h */
+ const bool is_character = params->adjust.x == -1; /* See gxgstate.h */
bool fill_by_trapezoids;
bool pseudo_rasterization;
bool big_path = ppath->subpath_count > 50;
@@ -465,11 +465,11 @@ gx_general_fill_path(gx_device * pdev, const gs_imager_state * pis,
pfpath = ppath;
else if (is_spotan_device(dev))
pfpath = ppath;
- else if (!big_path && !pis->accurate_curves && gx_path__check_curves(ppath, pco_small_curves, fo.fixed_flat))
+ else if (!big_path && !pgs->accurate_curves && gx_path__check_curves(ppath, pco_small_curves, fo.fixed_flat))
pfpath = ppath;
else {
code = gx_path_copy_reducing(ppath, &ffpath, fo.fixed_flat, NULL,
- pco_small_curves | (pis->accurate_curves ? pco_accurate : 0));
+ pco_small_curves | (pgs->accurate_curves ? pco_accurate : 0));
if (code < 0)
return code;
pfpath = &ffpath;
@@ -508,7 +508,7 @@ gx_general_fill_path(gx_device * pdev, const gs_imager_state * pis,
init_section(lst.margin_set0.sect, 0, lst.bbox_width);
init_section(lst.margin_set1.sect, 0, lst.bbox_width);
}
- if (gs_currentcpsimode(pis->memory) && is_character) {
+ if (gs_currentcpsimode(pgs->memory) && is_character) {
if (lst.contour_count > countof(lst.local_windings)) {
lst.windings = (int *)gs_alloc_byte_array(pdev->memory, lst.contour_count,
sizeof(int), "gx_general_fill_path");
@@ -556,17 +556,17 @@ gx_general_fill_path(gx_device * pdev, const gs_imager_state * pis,
}
static int
-pass_shading_area_through_clip_path_device(gx_device * pdev, const gs_imager_state * pis,
+pass_shading_area_through_clip_path_device(gx_device * pdev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_device_color * pdevc, const gx_clip_path * pcpath)
{
if (pdevc == NULL) {
gx_device_clip *cdev = (gx_device_clip *)pdev;
- return dev_proc(cdev->target, fill_path)(cdev->target, pis, ppath, params, pdevc, pcpath);
+ return dev_proc(cdev->target, fill_path)(cdev->target, pgs, ppath, params, pdevc, pcpath);
}
/* We know that tha clip path device implements fill_path with default proc. */
- return gx_default_fill_path(pdev, pis, ppath, params, pdevc, pcpath);
+ return gx_default_fill_path(pdev, pgs, ppath, params, pdevc, pcpath);
}
/*
@@ -574,7 +574,7 @@ pass_shading_area_through_clip_path_device(gx_device * pdev, const gs_imager_sta
* fill_path procedure.
*/
int
-gx_default_fill_path(gx_device * pdev, const gs_imager_state * pis,
+gx_default_fill_path(gx_device * pdev, const gs_gstate * pgs,
gx_path * ppath, const gx_fill_params * params,
const gx_device_color * pdevc, const gx_clip_path * pcpath)
{
@@ -600,7 +600,7 @@ gx_default_fill_path(gx_device * pdev, const gs_imager_state * pis,
*/
gx_clip_path cpath_intersection, cpath_with_shading_bbox;
const gx_clip_path *pcpath1, *pcpath2;
- gs_imager_state *pis_noconst = (gs_imager_state *)pis; /* Break const. */
+ gs_gstate *pgs_noconst = (gs_gstate *)pgs; /* Break const. */
if (ppath != NULL) {
code = gx_cpath_init_local_shared_nested(&cpath_intersection, pcpath, pdev->memory, 1);
@@ -614,7 +614,7 @@ gx_default_fill_path(gx_device * pdev, const gs_imager_state * pis,
}
if (code >= 0)
code = gx_cpath_intersect_with_params(&cpath_intersection, ppath, params->rule,
- pis_noconst, params);
+ pgs_noconst, params);
pcpath1 = &cpath_intersection;
} else
pcpath1 = pcpath;
@@ -640,7 +640,7 @@ gx_default_fill_path(gx_device * pdev, const gs_imager_state * pis,
/* A special interaction with clist writer device :
pass the intersected clipping path. It uses an unusual call to
fill_path with NULL device color. */
- code = (*dev_proc(pdev, fill_path))(pdev, pis, ppath, params, NULL, pcpath1);
+ code = (*dev_proc(pdev, fill_path))(pdev, pgs, ppath, params, NULL, pcpath1);
dev = pdev;
} else {
gx_make_clip_device_on_stack(&cdev, pcpath1, pdev);
@@ -653,7 +653,7 @@ gx_default_fill_path(gx_device * pdev, const gs_imager_state * pis,
if (code >= 0)
code = pdevc->type->fill_rectangle(pdevc,
cb.p.x, cb.p.y, cb.q.x - cb.p.x, cb.q.y - cb.p.y,
- dev, pis->log_op, rs);
+ dev, pgs->log_op, rs);
}
if (ppath != NULL)
gx_cpath_free(&cpath_intersection, "shading_fill_cpath_intersection");
@@ -678,7 +678,7 @@ gx_default_fill_path(gx_device * pdev, const gs_imager_state * pis,
vd_disable;
#endif
- code = gx_general_fill_path(pdev, pis, ppath, params, pdevc, pcpath);
+ code = gx_general_fill_path(pdev, pgs, ppath, params, pdevc, pcpath);
#ifndef GS_THREADSAFE
if (got_dc)
diff --git a/base/gxfont.h b/base/gxfont.h
index 8fa381d31..dfc3dec91 100644
--- a/base/gxfont.h
+++ b/base/gxfont.h
@@ -341,7 +341,7 @@ typedef struct gs_font_procs_s {
*/
#define font_proc_build_char(proc)\
- int proc(gs_show_enum *, gs_state *, gs_font *, gs_char, gs_glyph)
+ int proc(gs_show_enum *, gs_gstate *, gs_font *, gs_char, gs_glyph)
font_proc_build_char((*build_char));
} gs_font_procs;
diff --git a/base/gxfont42.h b/base/gxfont42.h
index 7bdafe1e2..7b74828ce 100644
--- a/base/gxfont42.h
+++ b/base/gxfont42.h
@@ -159,7 +159,7 @@ int gs_type42_read_data(gs_font_type42 * pfont, ulong pos, uint length, byte *bu
#define MAX_NUM_TT_TABLES 40
/* Append the outline of a TrueType character to a path. */
-int gs_type42_append(uint glyph_index, gs_state * pgs,
+int gs_type42_append(uint glyph_index, gs_gstate * pgs,
gx_path * ppath, gs_text_enum_t *penum, gs_font *pfont,
bool charpath_flag);
diff --git a/base/gxgstate.h b/base/gxgstate.h
new file mode 100644
index 000000000..689c7a26f
--- /dev/null
+++ b/base/gxgstate.h
@@ -0,0 +1,507 @@
+/* Copyright (C) 2001-2012 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
+ CA 94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+
+/* graphics state definition */
+
+#ifndef gxistate_INCLUDED
+# define gxistate_INCLUDED
+
+#include "gscsel.h"
+#include "gsrefct.h"
+#include "gsropt.h"
+#include "gstparam.h"
+#include "gxcvalue.h"
+#include "gxcmap.h"
+#include "gxfixed.h"
+#include "gxline.h"
+#include "gxmatrix.h"
+#include "gxtmap.h"
+#include "gscspace.h"
+#include "gstrans.h"
+#include "gsnamecl.h"
+#include "gscms.h"
+#include "gscpm.h"
+#include "gscspace.h"
+#include "gxdcolor.h"
+#include "gxstate.h"
+
+
+/*
+ * Define the color rendering state information.
+ * This should be a separate object (or at least a substructure),
+ * but making this change would require editing too much code.
+ */
+
+/* Opaque types referenced by the color rendering state. */
+#ifndef gs_halftone_DEFINED
+# define gs_halftone_DEFINED
+typedef struct gs_halftone_s gs_halftone;
+#endif
+#ifndef gx_device_color_DEFINED
+# define gx_device_color_DEFINED
+typedef struct gx_device_color_s gx_device_color;
+#endif
+#ifndef gx_device_halftone_DEFINED
+# define gx_device_halftone_DEFINED
+typedef struct gx_device_halftone_s gx_device_halftone;
+#endif
+#ifndef gs_color_space_DEFINED
+# define gs_color_space_DEFINED
+typedef struct gs_color_space_s gs_color_space;
+#endif
+
+/*
+ * We need some special memory management for the components of a
+ * c.r. state, as indicated by the following notations on the elements:
+ * (RC) means the element is reference-counted.
+ * (Shared) means the element is shared among an arbitrary number of
+ * c.r. states and is never freed.
+ * (Owned) means exactly one c.r. state references the element,
+ * and it is guaranteed that no references to it will outlive
+ * the c.r. state itself.
+ */
+
+/* Define the interior structure of a transfer function. */
+typedef struct gx_transfer_s {
+ int red_component_num;
+ gx_transfer_map *red; /* (RC) */
+ int green_component_num;
+ gx_transfer_map *green; /* (RC) */
+ int blue_component_num;
+ gx_transfer_map *blue; /* (RC) */
+ int gray_component_num;
+ gx_transfer_map *gray; /* (RC) */
+} gx_transfer;
+
+#define gs_color_rendering_state_common\
+\
+ /* Halftone screen: */\
+\
+ gs_halftone *halftone; /* (RC) */\
+ gs_int_point screen_phase[gs_color_select_count];\
+ /* dev_ht depends on halftone and device resolution. */\
+ gx_device_halftone *dev_ht; /* (RC) */\
+\
+ /* Color (device-dependent): */\
+\
+ struct gs_cie_render_s *cie_render; /* (RC) may be 0 */\
+ bool cie_to_xyz; /* flag for conversion to XYZ, no CRD req'd */\
+ gx_transfer_map *black_generation; /* (RC) may be 0 */\
+ gx_transfer_map *undercolor_removal; /* (RC) may be 0 */\
+ /* set_transfer holds the transfer functions specified by */\
+ /* set[color]transfer; effective_transfer includes the */\
+ /* effects of overrides by TransferFunctions in halftone */\
+ /* dictionaries. (In Level 1 systems, set_transfer and */\
+ /* effective_transfer are always the same.) */\
+ gx_transfer set_transfer; /* members are (RC) */\
+ gx_transfer_map *effective_transfer[GX_DEVICE_COLOR_MAX_COMPONENTS]; /* see below */\
+\
+ /* Color caches: */\
+\
+ /* cie_joint_caches depend on cie_render and */\
+ /* the color space. */\
+ struct gx_cie_joint_caches_s *cie_joint_caches; /* (RC) */\
+ /* cmap_procs depend on the device's color_info. */\
+ const struct gx_color_map_procs_s *cmap_procs; /* static */\
+ /* DeviceN component map for current color space */\
+ gs_devicen_color_map color_component_map;\
+ /* The contents of pattern_cache depend on the */\
+ /* the color space and the device's color_info and */\
+ /* resolution. */\
+ struct gx_pattern_cache_s *pattern_cache; /* (Shared) by all gstates */\
+\
+ /* Simple color spaces, stored here for easy access from */ \
+ /* gx_concrete_space_CIE */ \
+ gs_color_space *devicergb_cs;\
+ gs_color_space *devicecmyk_cs;\
+\
+ /* Stores for cached values which correspond to whichever */\
+ /* color isn't in force at the moment */\
+ struct gx_cie_joint_caches_s *cie_joint_caches_alt;\
+ gs_devicen_color_map color_component_map_alt
+
+
+/* Current colors (non-stroking, and stroking) */
+typedef struct gs_gstate_color_s {
+ gs_color_space *color_space; /* after substitution */
+ gs_client_color *ccolor;
+ gx_device_color *dev_color;
+} gs_gstate_color;
+
+/*
+ * Enumerate the reference-counted pointers in a c.r. state. Note that
+ * effective_transfer doesn't contribute to the reference count: it points
+ * either to the same objects as set_transfer, or to objects in a halftone
+ * structure that someone else worries about.
+ */
+#define gs_cr_state_do_rc_ptrs(m)\
+ m(halftone) \
+ m(dev_ht) \
+ m(cie_render) \
+ m(black_generation) \
+ m(undercolor_removal) \
+ m(set_transfer.red) \
+ m(set_transfer.green) \
+ m(set_transfer.blue) \
+ m(set_transfer.gray) \
+ m(cie_joint_caches) \
+ m(devicergb_cs) \
+ m(devicecmyk_cs)\
+ m(cie_joint_caches_alt)
+
+/* Enumerate the pointers in a c.r. state. */
+#define gs_cr_state_do_ptrs(m)\
+ m(0,halftone) \
+ m(1,dev_ht) \
+ m(2,cie_render) \
+ m(3,black_generation) \
+ m(4,undercolor_removal) \
+ m(5,set_transfer.red) \
+ m(6,set_transfer.green) \
+ m(7,set_transfer.blue) \
+ m(8,set_transfer.gray)\
+ m(9,cie_joint_caches) \
+ m(10,pattern_cache) \
+ m(11,devicergb_cs) \
+ m(12,devicecmyk_cs)\
+ m(13,cie_joint_caches_alt)
+ /*
+ * We handle effective_transfer specially in gsistate.c since its pointers
+ * are not enumerated for garbage collection but they are are relocated.
+ */
+/*
+ * This count does not include the effective_transfer pointers since they
+ * are not enumerated for GC.
+ */
+#define st_cr_state_num_ptrs 14
+
+#ifndef gs_devicen_color_map_DEFINED
+# define gs_devicen_color_map_DEFINED
+typedef struct gs_devicen_color_map_s gs_devicen_color_map;
+#endif
+
+struct gs_devicen_color_map_s {
+ bool use_alt_cspace;
+ separation_type sep_type;
+ uint num_components; /* Input - Duplicate of value in gs_device_n_params */
+ uint num_colorants; /* Number of colorants - output */
+ gs_id cspace_id; /* Used to verify color space and map match */
+ int color_map[GS_CLIENT_COLOR_MAX_COMPONENTS];
+};
+
+
+/* These flags are used to keep track of qQ
+ combinations surrounding a graphic state
+ change that includes a softmask setting.
+ The transparency compositor must be notified
+ when a Q event occurs following a softmask */
+
+typedef struct gs_xstate_trans_flags {
+ bool xstate_pending;
+ bool xstate_change;
+} gs_xstate_trans_flags_t;
+
+#define gs_currentdevicecolor_inline(pgs) ((pgs)->color[0].dev_color)
+#define gs_currentcolor_inline(pgs) ((pgs)->color[0].ccolor)
+#define gs_currentcolorspace_inline(pgs) ((pgs)->color[0].color_space)
+#define gs_altdevicecolor_inline(pgs) ((pgs)->color[1].dev_color)
+
+#define char_tm_only(pgs) *(gs_matrix *)&(pgs)->char_tm
+
+#undef gs_currentdevice_inline /* remove definition in gsdevice.h?? */
+#define gs_currentdevice_inline(pgs) ((pgs)->device)
+
+#define gs_gstate_client_data(pgs) ((pgs)->client_data)
+
+/* Opaque types referenced by the graphics state. */
+#ifndef gx_path_DEFINED
+# define gx_path_DEFINED
+typedef struct gx_path_s gx_path;
+#endif
+#ifndef gx_clip_path_DEFINED
+# define gx_clip_path_DEFINED
+typedef struct gx_clip_path_s gx_clip_path;
+#endif
+#ifndef gx_clip_stack_DEFINED
+# define gx_clip_stack_DEFINED
+typedef struct gx_clip_stack_s gx_clip_stack_t;
+#endif
+#ifndef gs_color_space_DEFINED
+# define gs_color_space_DEFINED
+typedef struct gs_color_space_s gs_color_space;
+#endif
+#ifndef gs_client_color_DEFINED
+# define gs_client_color_DEFINED
+typedef struct gs_client_color_s gs_client_color;
+#endif
+#ifndef gs_font_DEFINED
+# define gs_font_DEFINED
+typedef struct gs_font_s gs_font;
+#endif
+#ifndef gs_device_filter_stack_DEFINED
+# define gs_device_filter_stack_DEFINED
+typedef struct gs_device_filter_stack_s gs_device_filter_stack_t;
+#endif
+
+/* Device filter stack structure is defined here so that gstate
+ lifecycle operations can access reference count; implementation is
+ in gsdfilt.c.
+ */
+
+#ifndef gs_device_filter_DEFINED
+# define gs_device_filter_DEFINED
+typedef struct gs_device_filter_s gs_device_filter_t;
+#endif
+
+/* This is the base structure from which device filters are derived. */
+struct gs_device_filter_stack_s {
+ gs_device_filter_stack_t *next;
+ gs_device_filter_t *df;
+ gx_device *next_device;
+ rc_header rc;
+};
+
+
+/* Define the graphics state structure itself. */
+/*
+ * Note that the ctm member is a gs_matrix_fixed. As such, it cannot be
+ * used directly as the argument for procedures like gs_point_transform.
+ * Instead, one must use the ctm_only macro, e.g., &ctm_only(pgs) rather
+ * than &pgs->ctm.
+ */
+
+/* Access macros */
+#define ctm_only(pgs) (*(const gs_matrix *)&(pgs)->ctm)
+#define ctm_only_writable(pgs) (*(gs_matrix *)&(pgs)->ctm)
+#define set_ctm_only(pgs, mat) (*(gs_matrix *)&(pgs)->ctm = (mat))
+#define gs_init_rop(pgs) ((pgs)->log_op = lop_default)
+#define gs_currentflat_inline(pgs) ((pgs)->flatness)
+#define gs_currentlineparams_inline(pgs) (&(pgs)->line_params)
+#define gs_current_logical_op_inline(pgs) ((pgs)->log_op)
+#define gs_set_logical_op_inline(pgs, lop) ((pgs)->log_op = (lop))
+
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
+#endif
+
+struct gs_gstate_s {
+ gs_memory_t *memory;
+ void *client_data;
+ gx_line_params line_params;
+ bool hpgl_path_mode;
+ gs_matrix_fixed ctm;
+ bool current_point_valid;
+ gs_point current_point;
+ gs_point subpath_start;
+ bool clamp_coordinates;
+ gs_logical_operation_t log_op;
+ gx_color_value alpha;
+ gs_blend_mode_t blend_mode;
+ gs_transparency_source_t opacity, shape;
+ gs_xstate_trans_flags_t trans_flags;
+ gs_id soft_mask_id;
+ bool text_knockout;
+ uint text_rendering_mode;
+ bool has_transparency; /* used to keep from doing shading fills in device color space */
+ gx_device *trans_device; /* trans device has all mappings to group color space */
+ bool overprint;
+ int overprint_mode;
+ int effective_overprint_mode;
+ bool overprint_alt;
+ int overprint_mode_alt;
+ int effective_overprint_mode_alt;
+ float flatness;
+ gs_fixed_point fill_adjust; /* A path expansion for fill; -1 = dropout prevention*/
+ bool stroke_adjust;
+ bool accurate_curves;
+ bool have_pattern_streams;
+ float smoothness;
+ int renderingintent; /* See gsstate.c */
+ bool blackptcomp;
+ gsicc_manager_t *icc_manager; /* ICC color manager, profile */
+ gsicc_link_cache_t *icc_link_cache; /* ICC linked transforms */
+ gsicc_profile_cache_t *icc_profile_cache; /* ICC profiles from PS. */
+ CUSTOM_COLOR_PTR /* Pointer to custom color callback struct */
+ const gx_color_map_procs *
+ (*get_cmap_procs)(const gs_gstate *, const gx_device *);
+ gs_color_rendering_state_common;
+
+ gs_gstate *saved; /* previous state from gsave */
+
+ /* Transformation: */
+ gs_matrix ctm_inverse;
+ bool ctm_inverse_valid; /* true if ctm_inverse = ctm^-1 */
+ gs_matrix ctm_default;
+ bool ctm_default_set; /* if true, use ctm_default; */
+ /* if false, ask device */
+ /* Paths: */
+
+ gx_path *path;
+ gx_clip_path *clip_path;
+ gx_clip_stack_t *clip_stack; /* (LanguageLevel 3 only) */
+ gx_clip_path *view_clip; /* (may be 0, or have rule = 0) */
+
+ /* Effective clip path cache */
+ gs_id effective_clip_id; /* (key) clip path id */
+ gs_id effective_view_clip_id; /* (key) view clip path id */
+ gx_clip_path *effective_clip_path; /* (value) effective clip path, */
+ /* possibly = clip_path or view_clip */
+ bool effective_clip_shared; /* true iff e.c.p. = c.p. or v.c. */
+
+ /* Current colors (non-stroking, and stroking) */
+ gs_gstate_color color[2];
+
+ /* Font: */
+ gs_font *font;
+ gs_font *root_font;
+ gs_matrix_fixed char_tm; /* font matrix * ctm */
+ bool char_tm_valid; /* true if char_tm is valid */
+ gs_in_cache_device_t in_cachedevice; /* (see gscpm.h) */
+ gs_char_path_mode in_charpath; /* (see gscpm.h) */
+ gs_gstate *show_gstate; /* gstate when show was invoked */
+ /* (so charpath can append to path) */
+ /* Other stuff: */
+ int level; /* incremented by 1 per gsave */
+ gx_device *device;
+ gs_device_filter_stack_t *dfilter_stack;
+ gs_gstate_client_procs client_procs;
+};
+
+/* Initialization for gs_gstate */
+#define gs_gstate_initial(scale)\
+ 0, 0, { gx_line_params_initial }, 0,\
+ { (float)(scale), 0.0, 0.0, (float)(-(scale)), 0.0, 0.0 },\
+ false, {0, 0}, {0, 0}, false, \
+ lop_default, gx_max_color_value, BLEND_MODE_Compatible,\
+{ 1.0 }, { 1.0 }, {0, 0}, 0, 0/*false*/, 0, 0, 0, 0/*false*/, 0, 0, 0/*false*/, 0, 0, 1.0, \
+ { fixed_half, fixed_half }, 0/*false*/, 1/*true*/, 0/*false*/, 1.0,\
+ 1, 1/* bpt true */, 0, 0, 0, INIT_CUSTOM_COLOR_PTR /* 'Custom color' callback pointer */ \
+ gx_default_get_cmap_procs
+
+#define GS_STATE_INIT_VALUES(s, scale) \
+ do { \
+ static const struct gs_gstate_s __state_init = {gs_gstate_initial(scale)}; \
+ s->memory = __state_init.memory; \
+ s->client_data = __state_init.client_data; \
+ s->line_params = __state_init.line_params; \
+ s->hpgl_path_mode = __state_init.hpgl_path_mode; \
+ s->ctm = __state_init.ctm; \
+ s->current_point_valid = __state_init.current_point_valid; \
+ s->current_point = __state_init.current_point; \
+ s->subpath_start = __state_init.subpath_start; \
+ s->clamp_coordinates = __state_init.clamp_coordinates; \
+ s->log_op = __state_init.log_op; \
+ s->alpha = __state_init.alpha; \
+ s->blend_mode = __state_init.blend_mode; \
+ s->opacity = __state_init.opacity; \
+ s->shape = __state_init.shape; \
+ s->trans_flags = __state_init.trans_flags; \
+ s->soft_mask_id = __state_init.soft_mask_id; \
+ s->text_knockout = __state_init.text_knockout; \
+ s->text_rendering_mode = __state_init.text_rendering_mode; \
+ s->has_transparency = __state_init.has_transparency; \
+ s->trans_device = __state_init.trans_device; \
+ s->overprint = __state_init.overprint; \
+ s->overprint_mode = __state_init.overprint_mode; \
+ s->effective_overprint_mode = __state_init.effective_overprint_mode; \
+ s->overprint_alt = __state_init.overprint_alt; \
+ s->overprint_mode_alt = __state_init.overprint_mode_alt; \
+ s->effective_overprint_mode_alt = __state_init.effective_overprint_mode_alt; \
+ s->flatness = __state_init.flatness; \
+ s->fill_adjust = __state_init.fill_adjust; \
+ s->stroke_adjust = __state_init.stroke_adjust; \
+ s->accurate_curves = __state_init.accurate_curves; \
+ s->have_pattern_streams = __state_init.have_pattern_streams; \
+ s->smoothness = __state_init.smoothness; \
+ s->renderingintent = __state_init.renderingintent; \
+ s->blackptcomp = __state_init.blackptcomp; \
+ s->icc_manager = __state_init.icc_manager; \
+ s->icc_link_cache = __state_init.icc_link_cache; \
+ s->icc_profile_cache = __state_init.icc_profile_cache; \
+ s->get_cmap_procs = __state_init.get_cmap_procs; \
+ s->show_gstate = NULL; \
+ } while (0)
+
+#define public_st_gs_gstate() /* in gsstate.c */\
+ gs_public_st_composite(st_gs_gstate, gs_gstate, "gs_gstate",\
+ gs_gstate_enum_ptrs, gs_gstate_reloc_ptrs)
+
+/*
+ * Enumerate the pointers in a graphics state
+ * except device and dfilter_stack which must
+ * be handled specially.
+ */
+#define gs_gstate_do_ptrs(m)\
+ m(0, client_data) \
+ m(1, trans_device) \
+ m(2, icc_manager) \
+ m(3, icc_link_cache) \
+ m(4, icc_profile_cache) \
+ m(5, saved) \
+ m(6, path) \
+ m(7, clip_path) \
+ m(8, clip_stack) \
+ m(9, view_clip) \
+ m(10, effective_clip_path) \
+ m(11, color[0].color_space) \
+ m(12, color[0].ccolor) \
+ m(13, color[0].dev_color) \
+ m(14, color[1].color_space) \
+ m(15, color[1].ccolor) \
+ m(16, color[1].dev_color)\
+ m(17, font) \
+ m(18, root_font) \
+ m(19, show_gstate)
+
+#define gs_gstate_num_ptrs 20
+
+/* The '+2' in the following is because gs_gstate.device
+ * and gs_gstate.dfilter_stack are handled specially
+ */
+#define st_gs_gstate_num_ptrs\
+ (st_line_params_num_ptrs + st_cr_state_num_ptrs + gs_gstate_num_ptrs + 2)
+
+/* Initialize an graphics state, other than the parts covered by */
+/* gs_gstate_initial. */
+int gs_gstate_initialize(gs_gstate * pgs, gs_memory_t * mem);
+
+/* Make a temporary copy of a gs_gstate. Note that this does not */
+/* do all the necessary reference counting, etc. */
+gs_gstate * gs_gstate_copy_temp(const gs_gstate * pgs, gs_memory_t * mem);
+
+/* Increment reference counts to note that a graphics state has been copied. */
+void gs_gstate_copied(gs_gstate * pgs);
+
+/* Adjust reference counts before assigning one gs_gstate to another. */
+void gs_gstate_pre_assign(gs_gstate *to, const gs_gstate *from);
+
+/* Release an gs_gstate. */
+void gs_gstate_release(gs_gstate * pgs);
+int gs_currentscreenphase_pgs(const gs_gstate *, gs_int_point *, gs_color_select_t);
+
+
+/* The following macro is used for development purpose for designating places
+ where current point is changed. Clients must not use it. */
+#define gx_setcurrentpoint(pgs, xx, yy)\
+ (pgs)->current_point.x = xx;\
+ (pgs)->current_point.y = yy;
+
+int gs_swapcolors(gs_gstate *);
+void gs_swapcolors_quick(gs_gstate *);
+
+
+#endif /* gxistate_INCLUDED */
diff --git a/base/gxhintn.c b/base/gxhintn.c
index fd0d19cae..18ac9d6d5 100644
--- a/base/gxhintn.c
+++ b/base/gxhintn.c
@@ -1121,11 +1121,12 @@ static void t1_hinter__adjust_stem_hints_by_missed_flex(t1_hinter * self, t1_gly
t1_glyph_space_coord gg = g0;
int i;
+ k = !k;
if (gm < g0) {
g0 ^= gm; gm ^= g0; g0 ^= gm;
}
for (i = 0; i < self->hint_count; i++)
- if (!k == (self->hint[i].type != hstem)) {
+ if (k == (self->hint[i].type != hstem)) {
t1_hint *hint = &self->hint[i];
if (g0 <= hint->g0 && hint->g0 <= gm)
diff --git a/base/gxhldevc.c b/base/gxhldevc.c
index 1aeaa3707..b3c8af022 100644
--- a/base/gxhldevc.c
+++ b/base/gxhldevc.c
@@ -43,29 +43,15 @@ void gx_hld_saved_color_init(gx_hl_saved_color * psc)
}
/*
- * Get graphics state pointer (from imager state pointer)
- */
-const gs_state * gx_hld_get_gstate_ptr(const gs_imager_state * pis)
-{
-
- /* Check to verify the structure type is really (gs_state *) */
- if (pis == NULL || pis->is_gstate == false)
- return NULL;
-
- return (const gs_state *) pis;
-}
-
-/*
* Save the device color information including the color space id and
* client color data (if available).
*
* More description in src/gxhldevc.h
*/
bool
-gx_hld_save_color(const gs_imager_state * pis, const gx_device_color * pdevc,
+gx_hld_save_color(const gs_gstate * pgs, const gx_device_color * pdevc,
gx_hl_saved_color * psc)
{
- const gs_state * pgs = gx_hld_get_gstate_ptr(pis);
memset(psc, 0, sizeof(*psc)); /* clear the entire structure */
if (pdevc == NULL) {
@@ -209,11 +195,9 @@ bool gx_hld_saved_color_same_cspace(const gx_hl_saved_color * psc1,
* Check if a high level color is availavble.
*/
bool
-gx_hld_is_hl_color_available(const gs_imager_state * pis,
+gx_hld_is_hl_color_available(const gs_gstate * pgs,
const gx_device_color * pdevc)
{
- const gs_state * pgs = gx_hld_get_gstate_ptr(pis);
-
if (pgs != NULL && pdevc != NULL && pdevc->ccolor_valid)
return true;
return false;
@@ -225,13 +209,12 @@ gx_hld_is_hl_color_available(const gs_imager_state * pis,
* More description in src/gxhldevc.h
*/
gx_hld_get_color_space_and_ccolor_status
-gx_hld_get_color_space_and_ccolor(const gs_imager_state * pis,
+gx_hld_get_color_space_and_ccolor(const gs_gstate * pgs,
const gx_device_color * pdevc, const gs_color_space ** ppcs,
const gs_client_color ** ppcc)
{
/* Check if the current color space was used to build the device color */
- if (gx_hld_is_hl_color_available(pis, pdevc)) {
- const gs_state * pgs = gx_hld_get_gstate_ptr(pis);
+ if (gx_hld_is_hl_color_available(pgs, pdevc)) {
const gs_color_space * pcs = gs_currentcolorspace_inline(pgs);
*ppcs = pcs;
@@ -256,10 +239,8 @@ gx_hld_get_color_space_and_ccolor(const gs_imager_state * pis,
* More description in src/gxhldevc.h
*/
int
-gx_hld_get_number_color_components(const gs_imager_state * pis)
+gx_hld_get_number_color_components(const gs_gstate * pgs)
{
- const gs_state * pgs = gx_hld_get_gstate_ptr(pis);
-
if (pgs != NULL) {
const gs_color_space * pcs = gs_currentcolorspace_inline(pgs);
int n = gs_color_space_num_components(pcs);
@@ -275,12 +256,12 @@ gx_hld_get_number_color_components(const gs_imager_state * pis)
* More description in src/gxhldevc.h
*/
gx_hld_get_color_component_status
-gx_hld_get_color_component(const gs_imager_state * pis,
+gx_hld_get_color_component(const gs_gstate * pgs,
const gx_device_color * pdevc,
int comp_num, float * output)
{
if (pdevc != NULL && pdevc->ccolor_valid) {
- int ncomp = gx_hld_get_number_color_components(pis);
+ int ncomp = gx_hld_get_number_color_components(pgs);
if (ncomp < 0)
return invalid_color_info;
diff --git a/base/gxhldevc.h b/base/gxhldevc.h
index c6b939df4..5e7fd0953 100644
--- a/base/gxhldevc.h
+++ b/base/gxhldevc.h
@@ -51,9 +51,9 @@
* saving, comparing, and getting high level color information.
*/
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gx_device_color_DEFINED
@@ -78,12 +78,6 @@ typedef struct gx_hl_saved_color_s {
void gx_hld_saved_color_init(gx_hl_saved_color * psc);
/*
- * Get graphics state pointer (from imager state pointer)
- * Return NULL if the imager state is not also a graphics state.
- */
-const gs_state * gx_hld_get_gstate_ptr(const gs_imager_state * pis);
-
-/*
* Save the device color information including the color space id and
* client color data (if available). The pattern id is also saved for
* detection of changes in the pattern.
@@ -94,9 +88,9 @@ const gs_state * gx_hld_get_gstate_ptr(const gs_imager_state * pis);
* a save and test on the given color.
*
* If the device can't handle high level colors, it must pass NULL to
- * the 'pis' argument.
+ * the 'pgs' argument.
*/
-bool gx_hld_save_color(const gs_imager_state * pis,
+bool gx_hld_save_color(const gs_gstate * pgs,
const gx_device_color * pdevc, gx_hl_saved_color * psc);
/*
@@ -117,7 +111,7 @@ bool gx_hld_saved_color_same_cspace(const gx_hl_saved_color * psc1,
* Check if a high level color is availavble.
*/
bool
-gx_hld_is_hl_color_available(const gs_imager_state * pis,
+gx_hld_is_hl_color_available(const gs_gstate * pgs,
const gx_device_color * pdevc);
/*
@@ -137,7 +131,7 @@ typedef enum {
* Get pointers to the current color space and client color.
*
* There are four possible cases:
- * 1. Either the device color or imager state pointer is NULL. If so then
+ * 1. Either the device color or gs_gstate pointer is NULL. If so then
* we do not have enough information. Thus we need to fall back to the
* process color model color. Return NULL for both pointers.
* 2. The device color was not created from a color space and a client color.
@@ -157,17 +151,17 @@ typedef enum {
* a pattern or non pattern).
*/
gx_hld_get_color_space_and_ccolor_status gx_hld_get_color_space_and_ccolor(
- const gs_imager_state * pis, const gx_device_color * pdevc,
+ const gs_gstate * pgs, const gx_device_color * pdevc,
const gs_color_space ** ppcs, const gs_client_color ** ppcc);
/*
* This routine will return the number of components in the current color
* space.
*
- * The routine will return -1 if the imager state does not point to a
+ * The routine will return -1 if the gs_gstate does not point to a
* graphics state (and thus we cannot get the current color space).
*/
-int gx_hld_get_number_color_components(const gs_imager_state * pis);
+int gx_hld_get_number_color_components(const gs_gstate * pgs);
/*
* This defines sthe possible status to be returned from get_color_component.
@@ -187,7 +181,7 @@ typedef enum {
* device fall back to using the process color model.
*/
gx_hld_get_color_component_status gx_hld_get_color_component(
- const gs_imager_state * pis, const gx_device_color * pdevc,
+ const gs_gstate * pgs, const gx_device_color * pdevc,
int comp_numi, float * output);
#endif
diff --git a/base/gxht.c b/base/gxht.c
index abe9920d3..7c77408fc 100644
--- a/base/gxht.c
+++ b/base/gxht.c
@@ -24,7 +24,7 @@
#include "gxdcolor.h"
#include "gxfixed.h"
#include "gxdevice.h" /* for gzht.h */
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gzht.h"
#include "gsserial.h"
@@ -215,7 +215,7 @@ gx_dc_ht_binary_get_dev_halftone(const gx_device_color * pdevc)
/* Load the device color into the halftone cache if needed. */
static int
-gx_dc_ht_binary_load(gx_device_color * pdevc, const gs_imager_state * pis,
+gx_dc_ht_binary_load(gx_device_color * pdevc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
int component_index = pdevc->colors.binary.b_index;
@@ -226,7 +226,7 @@ gx_dc_ht_binary_load(gx_device_color * pdevc, const gs_imager_state * pis,
gx_ht_cache *pcache = porder->cache;
if (pcache->order.bit_data != porder->bit_data)
- gx_ht_init_cache(pis->memory, pcache, porder);
+ gx_ht_init_cache(pgs->memory, pcache, porder);
/*
* We do not load the cache now. Instead we wait until we are ready
* to actually render the color. This allows multiple colors to be
@@ -506,12 +506,12 @@ gx_dc_ht_binary_write(
* pdevc pointer to the location in which to write the
* reconstructed device color
*
- * pis pointer to the current imager state (to access the
+ * pgs pointer to the current gs_gstate (to access the
* current halftone)
*
* prior_devc pointer to the current device color (this is provided
* separately because the device color is not part of the
- * imager state)
+ * gs_gstate)
*
* dev pointer to the current device, used to retrieve process
* color model information
@@ -531,7 +531,7 @@ gx_dc_ht_binary_write(
static int
gx_dc_ht_binary_read(
gx_device_color * pdevc,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_device_color * prior_devc,
const gx_device * dev, /* ignored */
int64_t offset,
@@ -553,8 +553,8 @@ gx_dc_ht_binary_read(
memset(&devc, 0, sizeof(devc)); /* clear pointers */
devc.type = gx_dc_type_ht_binary;
- /* the halftone is always taken from the imager state */
- devc.colors.binary.b_ht = pis->dev_ht;
+ /* the halftone is always taken from the gs_gstate */
+ devc.colors.binary.b_ht = pgs->dev_ht;
/* cache is not porvided until the device color is used */
devc.colors.binary.b_tile = 0;
@@ -601,14 +601,14 @@ gx_dc_ht_binary_read(
devc.colors.binary.b_index = *pdata++;
}
- if (pis->dev_ht == NULL)
+ if (pgs->dev_ht == NULL)
return_error(gs_error_unregistered); /* Must not happen. */
/* set the phase as required (select value is arbitrary) */
color_set_phase_mod( &devc,
- pis->screen_phase[0].x,
- pis->screen_phase[0].y,
- pis->dev_ht->lcm_width,
- pis->dev_ht->lcm_height );
+ pgs->screen_phase[0].x,
+ pgs->screen_phase[0].y,
+ pgs->dev_ht->lcm_width,
+ pgs->dev_ht->lcm_height );
/* everything looks good */
*pdevc = devc;
diff --git a/base/gxht.h b/base/gxht.h
index 8c5ec9443..7962a949b 100644
--- a/base/gxht.h
+++ b/base/gxht.h
@@ -118,7 +118,7 @@ typedef struct gs_client_order_ht_procs_s {
*/
int (*create_order) (gx_ht_order * porder,
- gs_state * pgs,
+ gs_gstate * pgs,
const gs_client_order_halftone * phcop,
gs_memory_t * mem);
@@ -213,7 +213,7 @@ void gs_setaccuratescreens(gs_memory_t *, bool);
bool gs_currentaccuratescreens(gs_memory_t *);
/* Initiate screen sampling with optional AccurateScreens. */
-int gs_screen_init_memory(gs_screen_enum *, gs_state *,
+int gs_screen_init_memory(gs_screen_enum *, gs_gstate *,
gs_screen_halftone *, bool, gs_memory_t *);
#define gs_screen_init_accurate(penum, pgs, phsp, accurate)\
diff --git a/base/gxht_thresh.c b/base/gxht_thresh.c
index f31ad1b2a..953a260ad 100644
--- a/base/gxht_thresh.c
+++ b/base/gxht_thresh.c
@@ -19,7 +19,7 @@
#include "memory_.h"
#include "gx.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gsiparam.h"
#include "math_.h"
#include "gxfixed.h" /* needed for gximage.h */
@@ -584,11 +584,11 @@ gxht_thresh_image_init(gx_image_enum *penum)
gx_dda_fixed dda_ht;
if (gx_device_must_halftone(penum->dev)) {
- if (penum->pis != NULL && penum->pis->dev_ht != NULL) {
- for (k = 0; k < penum->pis->dev_ht->num_comp; k++) {
- d_order = &(penum->pis->dev_ht->components[k].corder);
+ if (penum->pgs != NULL && penum->pgs->dev_ht != NULL) {
+ for (k = 0; k < penum->pgs->dev_ht->num_comp; k++) {
+ d_order = &(penum->pgs->dev_ht->components[k].corder);
code = gx_ht_construct_threshold(d_order, penum->dev,
- penum->pis, k);
+ penum->pgs, k);
if (code < 0 ) {
return gs_rethrow(code, "threshold creation failed");
}
@@ -872,13 +872,13 @@ gxht_thresh_planes(gx_image_enum *penum, fixed xrun,
/* Iterate over the vdi and fill up our threshold buffer. We
also need to loop across the planes of data */
for (j = 0; j < spp_out; j++) {
- bool threshold_inverted = penum->pis->dev_ht->components[j].corder.threshold_inverted;
+ bool threshold_inverted = penum->pgs->dev_ht->components[j].corder.threshold_inverted;
- thresh_width = penum->pis->dev_ht->components[j].corder.width;
- thresh_height = penum->pis->dev_ht->components[j].corder.full_height;
+ thresh_width = penum->pgs->dev_ht->components[j].corder.width;
+ thresh_height = penum->pgs->dev_ht->components[j].corder.full_height;
halftone = penum->ht_buffer + j * vdi * dithered_stride;
/* Compute the tiling positions with dest_width */
- dx = (fixed2int_var_rounded(xrun) + penum->pis->screen_phase[0].x) % thresh_width;
+ dx = (fixed2int_var_rounded(xrun) + penum->pgs->screen_phase[0].x) % thresh_width;
/* Left remainder part */
left_rem_end = min(dx + dest_width, thresh_width);
/* The left width of our tile part */
@@ -890,7 +890,7 @@ gxht_thresh_planes(gx_image_enum *penum, fixed xrun,
right_tile_width = dest_width - num_full_tiles * thresh_width -
left_width;
/* Get the proper threshold for the colorant count */
- threshold = penum->pis->dev_ht->components[j].corder.threshold;
+ threshold = penum->pgs->dev_ht->components[j].corder.threshold;
/* Point to the proper contone data */
contone_align = penum->line + contone_stride * j +
offset_contone[j];
@@ -983,11 +983,11 @@ gxht_thresh_planes(gx_image_enum *penum, fixed xrun,
for (j = 0; j < spp_out; j++) {
halftone = penum->ht_buffer +
j * penum->ht_plane_height * (LAND_BITS>>3);
- thresh_width = penum->pis->dev_ht->components[j].corder.width;
+ thresh_width = penum->pgs->dev_ht->components[j].corder.width;
thresh_height =
- penum->pis->dev_ht->components[j].corder.full_height;
+ penum->pgs->dev_ht->components[j].corder.full_height;
/* Get the proper threshold for the colorant count */
- threshold = penum->pis->dev_ht->components[j].corder.threshold;
+ threshold = penum->pgs->dev_ht->components[j].corder.threshold;
/* Point to the proper contone data */
contone_align = penum->line + offset_contone[j] +
LAND_BITS * j * contone_stride;
@@ -1001,7 +1001,7 @@ gxht_thresh_planes(gx_image_enum *penum, fixed xrun,
} else {
dx = penum->ht_landscape.xstart;
}
- dx = (dx + penum->pis->screen_phase[0].x) % thresh_width;
+ dx = (dx + penum->pgs->screen_phase[0].x) % thresh_width;
dy = (penum->ht_landscape.y_pos +
penum->dev->band_offset_y) % thresh_height;
if (dy < 0)
diff --git a/base/gxi12bit.c b/base/gxi12bit.c
index c7f3df167..710fd7e90 100644
--- a/base/gxi12bit.c
+++ b/base/gxi12bit.c
@@ -28,7 +28,7 @@
#include "gxdevice.h"
#include "gxcmap.h"
#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxdevmem.h"
#include "gxcpath.h"
#include "gximage.h"
@@ -125,7 +125,7 @@ gs_image_class_2_fracs(gx_image_enum * penum)
then we will need to use those and go through pixel by pixel instead
of blasting through buffers. This is true for example with many of
the color spaces for CUPs */
- std_cmap_procs = gx_device_uses_std_cmap_procs(penum->dev, penum->pis);
+ std_cmap_procs = gx_device_uses_std_cmap_procs(penum->dev, penum->pgs);
if ( (gs_color_space_get_index(penum->pcs) == gs_color_space_index_DeviceN &&
penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color ||
penum->bps != 16 || !std_cmap_procs ||
@@ -158,11 +158,11 @@ gs_image_class_2_fracs(gx_image_enum * penum)
}
}
/* Define the rendering intents */
- rendering_params.black_point_comp = penum->pis->blackptcomp;
+ rendering_params.black_point_comp = penum->pgs->blackptcomp;
rendering_params.graphics_type_tag = GS_IMAGE_TAG;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = penum->pis->renderingintent;
+ rendering_params.rendering_intent = penum->pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) {
pcs = penum->pcs->icc_equivalent;
@@ -172,10 +172,10 @@ gs_image_class_2_fracs(gx_image_enum * penum)
penum->icc_setup.is_lab = pcs->cmm_icc_profile_data->islab;
penum->icc_setup.must_halftone = gx_device_must_halftone(penum->dev);
penum->icc_setup.has_transfer =
- gx_has_transfer(penum->pis, num_des_comps);
+ gx_has_transfer(penum->pgs, num_des_comps);
if (penum->icc_setup.is_lab) penum->icc_setup.need_decode = false;
if (penum->icc_link == NULL) {
- penum->icc_link = gsicc_get_link(penum->pis, penum->dev, pcs, NULL,
+ penum->icc_link = gsicc_get_link(penum->pgs, penum->dev, pcs, NULL,
&rendering_params, penum->memory);
}
/* Use the direct unpacking proc */
@@ -231,7 +231,7 @@ static int
image_render_frac(gx_image_enum * penum, const byte * buffer, int data_x,
uint w, int h, gx_device * dev)
{
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
gs_logical_operation_t lop = penum->log_op;
gx_dda_fixed_point pnext;
image_posture posture = penum->posture;
@@ -242,7 +242,7 @@ image_render_frac(gx_image_enum * penum, const byte * buffer, int data_x,
cs_proc_remap_color((*remap_color)) = pcs->type->remap_color;
gs_client_color cc;
bool device_color = penum->device_color;
- const gx_color_map_procs *cmap_procs = gx_get_cmap_procs(pis, dev);
+ const gx_color_map_procs *cmap_procs = gx_get_cmap_procs(pgs, dev);
cmap_proc_rgb((*map_rgb)) = cmap_procs->map_rgb;
cmap_proc_cmyk((*map_cmyk)) = cmap_procs->map_cmyk;
bool use_mask_color = penum->use_mask_color;
@@ -307,7 +307,7 @@ image_render_frac(gx_image_enum * penum, const byte * buffer, int data_x,
if (device_color) {
(*map_cmyk) (next.v[0], next.v[1],
next.v[2], next.v[3],
- pdevc_next, pis, dev,
+ pdevc_next, pgs, dev,
gs_color_select_source, NULL);
goto f;
}
@@ -331,7 +331,7 @@ image_render_frac(gx_image_enum * penum, const byte * buffer, int data_x,
}
if (device_color) {
(*map_rgb) (next.v[0], next.v[1],
- next.v[2], pdevc_next, pis, dev,
+ next.v[2], pdevc_next, pgs, dev,
gs_color_select_source);
goto f;
}
@@ -365,7 +365,7 @@ image_render_frac(gx_image_enum * penum, const byte * buffer, int data_x,
}
if (device_color) {
(*map_rgb) (next.v[0], next.v[0],
- next.v[0], pdevc_next, pis, dev,
+ next.v[0], pdevc_next, pgs, dev,
gs_color_select_source);
goto f;
}
@@ -403,7 +403,7 @@ image_render_frac(gx_image_enum * penum, const byte * buffer, int data_x,
}
break;
}
- mcode = remap_color(&cc, pcs, pdevc_next, pis, dev,
+ mcode = remap_color(&cc, pcs, pdevc_next, pgs, dev,
gs_color_select_source);
if (mcode < 0)
goto fill;
@@ -586,7 +586,7 @@ static int
image_render_icc16(gx_image_enum * penum, const byte * buffer, int data_x,
uint w, int h, gx_device * dev)
{
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
gs_logical_operation_t lop = penum->log_op;
gx_dda_fixed_point pnext;
image_posture posture = penum->posture;
@@ -647,7 +647,7 @@ image_render_icc16(gx_image_enum * penum, const byte * buffer, int data_x,
psrc_cm_start = NULL;
} else {
spp_cm = num_des_comps;
- psrc_cm = (unsigned short*) gs_alloc_bytes(pis->memory,
+ psrc_cm = (unsigned short*) gs_alloc_bytes(pgs->memory,
sizeof(unsigned short) * w * spp_cm/spp,
"image_render_icc16");
psrc_cm_start = psrc_cm;
@@ -671,7 +671,7 @@ image_render_icc16(gx_image_enum * penum, const byte * buffer, int data_x,
less than or equal to the new one. */
if (need_decode) {
/* Need decode and CM. This is slow but does not happen that often */
- psrc_decode = (unsigned short*) gs_alloc_bytes(pis->memory,
+ psrc_decode = (unsigned short*) gs_alloc_bytes(pgs->memory,
sizeof(unsigned short) * w * spp_cm/spp,
"image_render_icc16");
if (!penum->use_cie_range) {
@@ -688,7 +688,7 @@ image_render_icc16(gx_image_enum * penum, const byte * buffer, int data_x,
&output_buff_desc,
(void*) psrc_decode,
(void*) psrc_cm);
- gs_free_object(pis->memory, (byte *)psrc_decode, "image_render_color_icc");
+ gs_free_object(pgs->memory, (byte *)psrc_decode, "image_render_color_icc");
} else {
/* CM only. No decode */
(penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
@@ -742,7 +742,7 @@ image_render_icc16(gx_image_enum * penum, const byte * buffer, int data_x,
and or halftoning */
if (must_halftone || has_transfer) {
/* We need to do the tranfer function and/or the halftoning */
- cmap_transfer_halftone(&(conc[0]), pdevc_next, pis, dev,
+ cmap_transfer_halftone(&(conc[0]), pdevc_next, pgs, dev,
has_transfer, must_halftone, gs_color_select_source);
} else {
/* encode as a color index. avoid all the cv to frac to cv
@@ -798,13 +798,13 @@ inc: xprev = dda_current(pnext.x);
}
/* Free cm buffer, if it was used */
if (psrc_cm_start != NULL) {
- gs_free_object(pis->memory, (byte *)psrc_cm_start, "image_render_icc16");
+ gs_free_object(pgs->memory, (byte *)psrc_cm_start, "image_render_icc16");
}
return (code < 0 ? code : 1);
/* Save position if error, in case we resume. */
err:
- gs_free_object(pis->memory, (byte *)psrc_cm_start, "image_render_icc16");
+ gs_free_object(pgs->memory, (byte *)psrc_cm_start, "image_render_icc16");
penum->used.x = (rsrc - spp - psrc_initial) / spp;
penum->used.y = 0;
return code;
diff --git a/base/gxi16bit.c b/base/gxi16bit.c
index 699ed504f..1f6a4356f 100644
--- a/base/gxi16bit.c
+++ b/base/gxi16bit.c
@@ -28,7 +28,7 @@
#include "gxdevice.h"
#include "gxcmap.h"
#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxdevmem.h"
#include "gxcpath.h"
#include "gximage.h"
diff --git a/base/gxicolor.c b/base/gxicolor.c
index 98cd7f9f9..ec67f3cbe 100644
--- a/base/gxicolor.c
+++ b/base/gxicolor.c
@@ -31,7 +31,7 @@
#include "gxcmap.h"
#include "gxdcconv.h"
#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxdevmem.h"
#include "gxcpath.h"
#include "gximage.h"
@@ -107,7 +107,7 @@ gs_image_class_4_color(gx_image_enum * penum)
then we will need to use those and go through pixel by pixel instead
of blasting through buffers. This is true for example with many of
the color spaces for CUPs */
- std_cmap_procs = gx_device_uses_std_cmap_procs(penum->dev, penum->pis);
+ std_cmap_procs = gx_device_uses_std_cmap_procs(penum->dev, penum->pgs);
if ( (gs_color_space_get_index(penum->pcs) == gs_color_space_index_DeviceN &&
penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color ||
!std_cmap_procs) {
@@ -133,11 +133,11 @@ gs_image_class_4_color(gx_image_enum * penum)
}
}
/* Define the rendering intents */
- rendering_params.black_point_comp = penum->pis->blackptcomp;
+ rendering_params.black_point_comp = penum->pgs->blackptcomp;
rendering_params.graphics_type_tag = GS_IMAGE_TAG;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = penum->pis->renderingintent;
+ rendering_params.rendering_intent = penum->pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) {
pcs = penum->pcs->icc_equivalent;
@@ -146,11 +146,11 @@ gs_image_class_4_color(gx_image_enum * penum)
}
penum->icc_setup.is_lab = pcs->cmm_icc_profile_data->islab;
penum->icc_setup.must_halftone = gx_device_must_halftone(penum->dev);
- penum->icc_setup.has_transfer = gx_has_transfer(penum->pis, des_num_comp);
+ penum->icc_setup.has_transfer = gx_has_transfer(penum->pgs, des_num_comp);
if (penum->icc_setup.is_lab)
penum->icc_setup.need_decode = false;
if (penum->icc_link == NULL) {
- penum->icc_link = gsicc_get_link(penum->pis, penum->dev, pcs, NULL,
+ penum->icc_link = gsicc_get_link(penum->pgs, penum->dev, pcs, NULL,
&rendering_params, penum->memory);
}
/* PS CIE color spaces may have addition decoding that needs to
@@ -173,7 +173,7 @@ gs_image_class_4_color(gx_image_enum * penum)
bool transfer_is_monotonic = true;
for (k=0; k<des_num_comp; k++) {
- if (!gx_transfer_is_monotonic(penum->pis, k)) {
+ if (!gx_transfer_is_monotonic(penum->pgs, k)) {
transfer_is_monotonic = false;
break;
}
@@ -304,7 +304,7 @@ image_color_icc_prep(gx_image_enum *penum_orig, const byte *psrc, uint w,
byte **psrc_cm_start, byte **bufend, bool planar_out)
{
const gx_image_enum *const penum = penum_orig; /* const within proc */
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
bool need_decode = penum->icc_setup.need_decode;
gsicc_bufferdesc_t input_buff_desc;
gsicc_bufferdesc_t output_buff_desc;
@@ -342,7 +342,7 @@ image_color_icc_prep(gx_image_enum *penum_orig, const byte *psrc, uint w,
*psrc_cm_start = NULL;
} else {
spp_cm = num_des_comps;
- *psrc_cm = gs_alloc_bytes(pis->memory, w * spp_cm/spp,
+ *psrc_cm = gs_alloc_bytes(pgs->memory, w * spp_cm/spp,
"image_color_icc_prep");
*psrc_cm_start = *psrc_cm;
*bufend = *psrc_cm + w * spp_cm/spp;
@@ -356,7 +356,7 @@ image_color_icc_prep(gx_image_enum *penum_orig, const byte *psrc, uint w,
imager_render_color_thresh, which is limited to 8 bit case */
if (need_decode) {
/* Need decode and then to planar */
- psrc_decode = gs_alloc_bytes(pis->memory, w,
+ psrc_decode = gs_alloc_bytes(pgs->memory, w,
"image_color_icc_prep");
if (!penum->use_cie_range) {
decode_row(penum, psrc, spp, psrc_decode, psrc_decode+w);
@@ -381,7 +381,7 @@ image_color_icc_prep(gx_image_enum *penum_orig, const byte *psrc, uint w,
}
/* Free up decode if we used it */
if (psrc_decode != NULL) {
- gs_free_object(pis->memory, (byte *) psrc_decode,
+ gs_free_object(pgs->memory, (byte *) psrc_decode,
"image_render_color_icc");
}
}
@@ -407,7 +407,7 @@ image_color_icc_prep(gx_image_enum *penum_orig, const byte *psrc, uint w,
less than or equal to the new one. */
if (need_decode) {
/* Need decode and CM. This is slow but does not happen that often */
- psrc_decode = gs_alloc_bytes(pis->memory, w,
+ psrc_decode = gs_alloc_bytes(pgs->memory, w,
"image_color_icc_prep");
if (!penum->use_cie_range) {
decode_row(penum, psrc, spp, psrc_decode, psrc_decode+w);
@@ -421,7 +421,7 @@ image_color_icc_prep(gx_image_enum *penum_orig, const byte *psrc, uint w,
&output_buff_desc,
(void*) psrc_decode,
(void*) *psrc_cm);
- gs_free_object(pis->memory, psrc_decode, "image_color_icc_prep");
+ gs_free_object(pgs->memory, psrc_decode, "image_color_icc_prep");
} else {
/* CM only. No decode */
(penum->icc_link->procs.map_buffer)(dev, penum->icc_link,
@@ -856,7 +856,7 @@ flush:
contone_stride);
/* Free cm buffer, if it was used */
if (psrc_cm_start != NULL) {
- gs_free_object(penum->pis->memory, (byte *)psrc_cm_start,
+ gs_free_object(penum->pgs->memory, (byte *)psrc_cm_start,
"image_render_color_thresh");
}
return code;
@@ -868,7 +868,7 @@ image_render_color_icc(gx_image_enum *penum_orig, const byte *buffer, int data_x
uint w, int h, gx_device * dev)
{
const gx_image_enum *const penum = penum_orig; /* const within proc */
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
gs_logical_operation_t lop = penum->log_op;
gx_dda_fixed_point pnext;
image_posture posture = penum->posture;
@@ -953,7 +953,7 @@ image_render_color_icc(gx_image_enum *penum_orig, const byte *buffer, int data_x
and or halftoning */
if (must_halftone || has_transfer) {
/* We need to do the tranfer function and/or the halftoning */
- cmap_transfer_halftone(&(conc[0]), pdevc_next, pis, dev,
+ cmap_transfer_halftone(&(conc[0]), pdevc_next, pgs, dev,
has_transfer, must_halftone, gs_color_select_source);
} else {
/* encode as a color index. avoid all the cv to frac to cv
@@ -1057,12 +1057,12 @@ inc: xprev = dda_current(pnext.x);
}
/* Free cm buffer, if it was used */
if (psrc_cm_start != NULL) {
- gs_free_object(pis->memory, (byte *)psrc_cm_start, "image_render_color_icc");
+ gs_free_object(pgs->memory, (byte *)psrc_cm_start, "image_render_color_icc");
}
return (code < 0 ? code : 1);
/* Save position if error, in case we resume. */
err:
- gs_free_object(pis->memory, (byte *)psrc_cm_start, "image_render_color_icc");
+ gs_free_object(pgs->memory, (byte *)psrc_cm_start, "image_render_color_icc");
penum_orig->used.x = (rsrc - spp - psrc_initial) / spp;
penum_orig->used.y = 0;
return code;
@@ -1076,7 +1076,7 @@ image_render_color_DeviceN(gx_image_enum *penum_orig, const byte *buffer, int da
uint w, int h, gx_device * dev)
{
const gx_image_enum *const penum = penum_orig; /* const within proc */
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
gs_logical_operation_t lop = penum->log_op;
gx_dda_fixed_point pnext;
image_posture posture = penum->posture;
@@ -1185,7 +1185,7 @@ image_render_color_DeviceN(gx_image_enum *penum_orig, const byte *buffer, int da
dmputs(dev->memory, "\n");
}
#endif
- mcode = remap_color(&cc, pcs, pdevc_next, pis, dev,
+ mcode = remap_color(&cc, pcs, pdevc_next, pgs, dev,
gs_color_select_source);
mapped: if (mcode < 0)
goto fill;
diff --git a/base/gxifast.c b/base/gxifast.c
index 9d9c842ec..1ef661d35 100644
--- a/base/gxifast.c
+++ b/base/gxifast.c
@@ -29,7 +29,7 @@
#include "gxdevice.h"
#include "gxcmap.h"
#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxdevmem.h"
#include "gdevmem.h" /* for mem_mono_device */
#include "gxcpath.h"
@@ -554,9 +554,9 @@ image_render_simple(gx_image_enum * penum, const byte * buffer, int data_x,
if (h == 0)
return 0;
if ((!DC_IS_NULL(pdc0) &&
- (code = gx_color_load(pdc0, penum->pis, dev)) < 0) ||
+ (code = gx_color_load(pdc0, penum->pgs, dev)) < 0) ||
(!DC_IS_NULL(pdc1) &&
- (code = gx_color_load(pdc1, penum->pis, dev)) < 0)
+ (code = gx_color_load(pdc1, penum->pgs, dev)) < 0)
)
return code;
if (penum->line == 0) { /* A direct BitBlt is possible. */
diff --git a/base/gximag3x.c b/base/gximag3x.c
index 3cd8e5ec4..2e6adc2a4 100644
--- a/base/gximag3x.c
+++ b/base/gximag3x.c
@@ -27,7 +27,7 @@
#include "gxdevice.h"
#include "gxdevmem.h"
#include "gximag3x.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gdevbbox.h"
extern_st(st_color_space);
@@ -125,7 +125,7 @@ static int check_image3x_mask(const gs_image3x_t *pim,
gs_memory_t *mem);
int
gx_begin_image3x_generic(gx_device * dev,
- const gs_imager_state *pis, const gs_matrix *pmat,
+ const gs_gstate *pgs, const gs_matrix *pmat,
const gs_image_common_t *pic, const gs_int_rect *prect,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath, gs_memory_t *mem,
@@ -198,7 +198,7 @@ gx_begin_image3x_generic(gx_device * dev,
penum->bpc = pim->BitsPerComponent;
penum->memory = mem;
if (pmat == 0)
- pmat = &ctm_only(pis);
+ pmat = &ctm_only(pgs);
for (i = 0; i < NUM_MASKS; ++i) {
gs_rect mrect;
gx_device *mdev;
@@ -263,15 +263,15 @@ gx_begin_image3x_generic(gx_device * dev,
m_mat.tx -= origin[i].x;
m_mat.ty -= origin[i].y;
/*
- * Peter put in a comment that said " Note that pis = NULL here,
- * since we don't want to have to create another imager state with
- * default log_op, etc." and passed NULL instead of pis to this
- * routine. However Image type 1 need the imager state (see
+ * Peter put in a comment that said " Note that pgs = NULL here,
+ * since we don't want to have to create another gs_gstate with
+ * default log_op, etc." and passed NULL instead of pgs to this
+ * routine. However Image type 1 need the gs_gstate (see
* bug 688348) thus his optimization was removed.
* dcolor = NULL is OK because this is an opaque image with
* CombineWithColor = false.
*/
- code = gx_device_begin_typed_image(mdev, pis, &m_mat,
+ code = gx_device_begin_typed_image(mdev, pgs, &m_mat,
(const gs_image_common_t *)&mask[i].image,
&mask[i].rect, NULL, NULL,
mem, &penum->mask[i].info);
@@ -289,7 +289,7 @@ gx_begin_image3x_generic(gx_device * dev,
pixel.image.type = type1;
pixel.image.image_parent_type = gs_image_type3x;
}
- code = make_mcde(dev, pis, pmat, (const gs_image_common_t *)&pixel.image,
+ code = make_mcde(dev, pgs, pmat, (const gs_image_common_t *)&pixel.image,
prect, pdcolor, pcpath, mem, &penum->pixel.info,
&pcdev, midev, minfo, origin, pim);
if (code < 0)
@@ -526,7 +526,7 @@ make_midx_default(gx_device **pmidev, gx_device *dev, int width, int height,
}
static IMAGE3X_MAKE_MCDE_PROC(make_mcdex_default); /* check prototype */
static int
-make_mcdex_default(gx_device *dev, const gs_imager_state *pis,
+make_mcdex_default(gx_device *dev, const gs_gstate *pgs,
const gs_matrix *pmat, const gs_image_common_t *pic,
const gs_int_rect *prect, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath, gs_memory_t *mem,
@@ -567,7 +567,7 @@ make_mcdex_default(gx_device *dev, const gs_imager_state *pis,
gx_device_bbox_fwd_open_close(bbdev, false);
code = dev_proc(bbdev, begin_typed_image)
- ((gx_device *)bbdev, pis, pmat, pic, prect, pdcolor, pcpath, mem,
+ ((gx_device *)bbdev, pgs, pmat, pic, prect, pdcolor, pcpath, mem,
pinfo);
if (code < 0) {
gs_free_object(mem, bbdev, "make_mcdex_default");
@@ -578,12 +578,12 @@ make_mcdex_default(gx_device *dev, const gs_imager_state *pis,
}
static int
gx_begin_image3x(gx_device * dev,
- const gs_imager_state * pis, const gs_matrix * pmat,
+ const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, gx_image_enum_common_t ** pinfo)
{
- return gx_begin_image3x_generic(dev, pis, pmat, pic, prect, pdcolor,
+ return gx_begin_image3x_generic(dev, pgs, pmat, pic, prect, pdcolor,
pcpath, mem, make_midx_default,
make_mcdex_default, pinfo);
}
diff --git a/base/gximag3x.h b/base/gximag3x.h
index 1ae1233d8..4dd4fccb2 100644
--- a/base/gximag3x.h
+++ b/base/gximag3x.h
@@ -46,7 +46,7 @@ typedef IMAGE3X_MAKE_MID_PROC((*image3x_make_mid_proc_t));
#define IMAGE3X_MAKE_MCDE_PROC(proc)\
int proc(/* The initial arguments are those of begin_typed_image. */\
gx_device *dev,\
- const gs_imager_state *pis,\
+ const gs_gstate *pgs,\
const gs_matrix *pmat,\
const gs_image_common_t *pic,\
const gs_int_rect *prect,\
@@ -65,7 +65,7 @@ typedef IMAGE3X_MAKE_MCDE_PROC((*image3x_make_mcde_proc_t));
* procedures as additional parameters.
*/
int gx_begin_image3x_generic(gx_device * dev,
- const gs_imager_state *pis,
+ const gs_gstate *pgs,
const gs_matrix *pmat,
const gs_image_common_t *pic,
const gs_int_rect *prect,
diff --git a/base/gximage.c b/base/gximage.c
index 0a70b12bc..c2a57f8d1 100644
--- a/base/gximage.c
+++ b/base/gximage.c
@@ -113,7 +113,7 @@ gx_image_enum_common_init(gx_image_enum_common_t * piec,
/* Compute the source size of an ordinary image with explicit data. */
int
-gx_data_image_source_size(const gs_imager_state * pis,
+gx_data_image_source_size(const gs_gstate * pgs,
const gs_image_common_t * pim, gs_int_point * psize)
{
const gs_data_image_t *pdi = (const gs_data_image_t *)pim;
diff --git a/base/gximage.h b/base/gximage.h
index a52595ab5..d6326673d 100644
--- a/base/gximage.h
+++ b/base/gximage.h
@@ -215,7 +215,7 @@ struct gx_image_enum_s {
gs_fixed_point x_extent, y_extent; /* extent of one row of rect */
SAMPLE_UNPACK_PROC((*unpack));
irender_proc((*render));
- const gs_imager_state *pis;
+ const gs_gstate *pgs;
const gs_color_space *pcs; /* color space of image */
byte *buffer; /* for expanding samples to a */
/* byte or frac */
@@ -297,7 +297,7 @@ struct gx_image_enum_s {
/* Enumerate the pointers in an image enumerator. */
#define gx_image_enum_do_ptrs(m)\
- m(0,pis) m(1,pcs) m(2,dev) m(3,buffer) m(4,line)\
+ m(0,pgs) m(1,pcs) m(2,dev) m(3,buffer) m(4,line)\
m(5,clip_dev) m(6,rop_dev) m(7,scaler) m(8,icc_link)\
m(9,color_cache) m(10,ht_buffer) m(11,thresh_buffer) \
m(12,clues)
@@ -319,7 +319,7 @@ struct gx_image_enum_s {
void gx_image_scale_mask_colors(gx_image_enum *penum,
int component_index);
/* Used by icc processing to detect decode cases */
-bool gx_has_transfer(const gs_imager_state *pis, int num_comps);
+bool gx_has_transfer(const gs_gstate *pgs, int num_comps);
/*
* Do common initialization for processing an ImageType 1 or 4 image.
* Allocate the enumerator and fill in the following members:
@@ -338,7 +338,7 @@ gx_image_enum_alloc(const gs_image_common_t * pic,
* masked, adjust
*/
int
-gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
+gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs,
const gs_matrix *pmat, const gs_image_common_t * pic,
const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath,
diff --git a/base/gximage1.c b/base/gximage1.c
index 6e8e3103b..596955429 100644
--- a/base/gximage1.c
+++ b/base/gximage1.c
@@ -74,7 +74,7 @@ gs_image_t_init_mask_adjust(gs_image_t * pim, bool write_1s, bool adjust)
/* Start processing an ImageType 1 image. */
int
gx_begin_image1(gx_device * dev,
- const gs_imager_state * pis, const gs_matrix * pmat,
+ const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, gx_image_enum_common_t ** pinfo)
@@ -91,7 +91,7 @@ gx_begin_image1(gx_device * dev,
penum->masked = pim->ImageMask;
penum->adjust =
(pim->ImageMask && pim->adjust ? float2fixed(0.25) : fixed_0);
- code = gx_image_enum_begin(dev, pis, pmat, pic, pdcolor, pcpath, mem,
+ code = gx_image_enum_begin(dev, pgs, pmat, pic, pdcolor, pcpath, mem,
penum);
if (code >= 0)
*pinfo = (gx_image_enum_common_t *)penum;
diff --git a/base/gximage2.c b/base/gximage2.c
index 013acb6dc..26ee69b1f 100644
--- a/base/gximage2.c
+++ b/base/gximage2.c
@@ -65,7 +65,7 @@ typedef struct image2_data_s {
static int
image2_set_data(const gs_image2_t * pim, image2_data_t * pid)
{
- gs_state *pgs = pim->DataSource;
+ gs_gstate *pgs = pim->DataSource;
gs_matrix smat;
gs_rect sbox, dbox;
@@ -87,7 +87,7 @@ image2_set_data(const gs_image2_t * pim, image2_data_t * pid)
/* Compute the source size of an ImageType 2 image. */
static int
-gx_image2_source_size(const gs_imager_state * pis, const gs_image_common_t * pim,
+gx_image2_source_size(const gs_gstate * pgs, const gs_image_common_t * pim,
gs_int_point * psize)
{
image2_data_t idata;
@@ -103,13 +103,13 @@ gx_image2_source_size(const gs_imager_state * pis, const gs_image_common_t * pim
/* this procedure does all the work. */
static int
gx_begin_image2(gx_device * dev,
- const gs_imager_state * pis, const gs_matrix * pmat,
+ const gs_gstate * pgs1, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, gx_image_enum_common_t ** pinfo)
{
const gs_image2_t *pim = (const gs_image2_t *)pic;
- gs_state *pgs = pim->DataSource;
+ gs_gstate *pgs = pim->DataSource;
gx_device *sdev = gs_currentdevice(pgs);
int depth = sdev->color_info.depth;
bool pixel_copy = pim->PixelCopy;
@@ -133,13 +133,13 @@ gx_begin_image2(gx_device * dev,
if (pixel_copy && depth <= 8)
return_error(gs_error_unregistered);
- gs_image_t_init(&idata.image, gs_currentcolorspace((const gs_state *)pis));
+ gs_image_t_init(&idata.image, gs_currentcolorspace((const gs_gstate *)pgs1));
/* Add Decode entries for K and alpha */
idata.image.Decode[6] = idata.image.Decode[8] = 0.0;
idata.image.Decode[7] = idata.image.Decode[9] = 1.0;
if (pmat == 0) {
- gs_currentmatrix((const gs_state *)pis, &dmat);
+ gs_currentmatrix((const gs_gstate *)pgs1, &dmat);
pmat = &dmat;
} else
dmat = *pmat;
@@ -229,7 +229,7 @@ gx_begin_image2(gx_device * dev,
}
if (!direct_copy)
code = (*dev_proc(dev, begin_typed_image))
- (dev, pis, pmat, (const gs_image_common_t *)&idata.image, NULL,
+ (dev, pgs1, pmat, (const gs_image_common_t *)&idata.image, NULL,
pdcolor, pcpath, mem, &info);
if (code >= 0) {
int y;
diff --git a/base/gximage3.c b/base/gximage3.c
index a26a8c253..78dedcf27 100644
--- a/base/gximage3.c
+++ b/base/gximage3.c
@@ -26,7 +26,7 @@
#include "gxdevmem.h"
#include "gxclipm.h"
#include "gximage3.h"
-#include "gxistate.h"
+#include "gxgstate.h"
/* Forward references */
static dev_proc_begin_typed_image(gx_begin_image3);
@@ -124,7 +124,7 @@ make_mid_default(gx_device **pmidev, gx_device *dev, int width, int height,
}
static IMAGE3_MAKE_MCDE_PROC(make_mcde_default); /* check prototype */
static int
-make_mcde_default(gx_device *dev, const gs_imager_state *pis,
+make_mcde_default(gx_device *dev, const gs_gstate *pgs,
const gs_matrix *pmat, const gs_image_common_t *pic,
const gs_int_rect *prect, const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath, gs_memory_t *mem,
@@ -157,7 +157,7 @@ make_mcde_default(gx_device *dev, const gs_imager_state *pis,
}
mcdev->tiles = bits;
code = dev_proc(mcdev, begin_typed_image)
- ((gx_device *)mcdev, pis, pmat, pic, prect, pdcolor, pcpath, mem,
+ ((gx_device *)mcdev, pgs, pmat, pic, prect, pdcolor, pcpath, mem,
pinfo);
if (code < 0) {
gs_free_object(mem, mcdev, "make_mcde_default");
@@ -168,12 +168,12 @@ make_mcde_default(gx_device *dev, const gs_imager_state *pis,
}
static int
gx_begin_image3(gx_device * dev,
- const gs_imager_state * pis, const gs_matrix * pmat,
+ const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, gx_image_enum_common_t ** pinfo)
{
- return gx_begin_image3_generic(dev, pis, pmat, pic, prect, pdcolor,
+ return gx_begin_image3_generic(dev, pgs, pmat, pic, prect, pdcolor,
pcpath, mem, make_mid_default,
make_mcde_default, pinfo);
}
@@ -185,7 +185,7 @@ gx_begin_image3(gx_device * dev,
static bool check_image3_extent(double mask_coeff, double data_coeff);
int
gx_begin_image3_generic(gx_device * dev,
- const gs_imager_state *pis, const gs_matrix *pmat,
+ const gs_gstate *pgs, const gs_matrix *pmat,
const gs_image_common_t *pic, const gs_int_rect *prect,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath, gs_memory_t *mem,
@@ -349,7 +349,7 @@ gx_begin_image3_generic(gx_device * dev,
mrect.q.x = pim->MaskDict.Width;
mrect.q.y = pim->MaskDict.Height;
if (pmat == 0)
- pmat = &ctm_only(pis);
+ pmat = &ctm_only(pgs);
if ((code = gs_matrix_multiply(&mi_mask, pmat, &mat)) < 0 ||
(code = gs_bbox_transform(&mrect, &mat, &mrect)) < 0
)
@@ -385,8 +385,8 @@ gx_begin_image3_generic(gx_device * dev,
m_mat.tx -= origin.x;
m_mat.ty -= origin.y;
/*
- * Note that pis = NULL here, since we don't want to have to
- * create another imager state with default log_op, etc.
+ * Note that pgs = NULL here, since we don't want to have to
+ * create another gs_gstate with default log_op, etc.
*/
code = gx_device_begin_typed_image(mdev, NULL, &m_mat,
(const gs_image_common_t *)&i_mask,
@@ -403,7 +403,7 @@ gx_begin_image3_generic(gx_device * dev,
i_pixel.type = type1;
i_pixel.image_parent_type = gs_image_type3;
}
- code = make_mcde(dev, pis, pmat, (const gs_image_common_t *)&i_pixel,
+ code = make_mcde(dev, pgs, pmat, (const gs_image_common_t *)&i_pixel,
prect, pdcolor, pcpath, mem, &penum->pixel_info,
&pcdev, mdev, penum->mask_info, &origin);
if (code < 0)
diff --git a/base/gximage3.h b/base/gximage3.h
index cdb8337ad..70c4809bc 100644
--- a/base/gximage3.h
+++ b/base/gximage3.h
@@ -46,7 +46,7 @@ typedef IMAGE3_MAKE_MID_PROC((*image3_make_mid_proc_t));
#define IMAGE3_MAKE_MCDE_PROC(proc)\
int proc(/* The initial arguments are those of begin_typed_image. */\
gx_device *dev,\
- const gs_imager_state *pis,\
+ const gs_gstate *pgs,\
const gs_matrix *pmat,\
const gs_image_common_t *pic,\
const gs_int_rect *prect,\
@@ -64,7 +64,7 @@ typedef IMAGE3_MAKE_MCDE_PROC((*image3_make_mcde_proc_t));
* procedures as additional parameters.
*/
int gx_begin_image3_generic(gx_device * dev,
- const gs_imager_state *pis,
+ const gs_gstate *pgs,
const gs_matrix *pmat,
const gs_image_common_t *pic,
const gs_int_rect *prect,
diff --git a/base/gximage4.c b/base/gximage4.c
index f9381c7b1..8a65e17e7 100644
--- a/base/gximage4.c
+++ b/base/gximage4.c
@@ -61,7 +61,7 @@ gs_image4_t_init(gs_image4_t * pim, gs_color_space * color_space)
/* Start processing an ImageType 4 image. */
static int
gx_begin_image4(gx_device * dev,
- const gs_imager_state * pis, const gs_matrix * pmat,
+ const gs_gstate * pgs, const gs_matrix * pmat,
const gs_image_common_t * pic, const gs_int_rect * prect,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, gx_image_enum_common_t ** pinfo)
@@ -104,7 +104,7 @@ gx_begin_image4(gx_device * dev,
}
penum->use_mask_color = !opaque;
}
- code = gx_image_enum_begin(dev, pis, pmat, pic, pdcolor, pcpath, mem,
+ code = gx_image_enum_begin(dev, pgs, pmat, pic, pdcolor, pcpath, mem,
penum);
if (code >= 0)
*pinfo = (gx_image_enum_common_t *)penum;
diff --git a/base/gximono.c b/base/gximono.c
index fdc9ead57..0c9b73076 100644
--- a/base/gximono.c
+++ b/base/gximono.c
@@ -28,7 +28,7 @@
#include "gxdevice.h"
#include "gxcmap.h"
#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxdevmem.h"
#include "gdevmem.h" /* for mem_mono_device */
#include "gxcpath.h"
@@ -101,7 +101,7 @@ gs_image_class_3_mono(gx_image_enum * penum)
penum->bps == 8 && (penum->posture == image_portrait
|| penum->posture == image_landscape) &&
penum->image_parent_type == gs_image_type1 &&
- gx_transfer_is_monotonic(penum->pis, 0)) {
+ gx_transfer_is_monotonic(penum->pgs, 0)) {
penum->icc_setup.need_decode = false;
/* Check if we need to do any decoding. */
if ( penum->map[0].decoding != sd_none ) {
@@ -113,11 +113,11 @@ gs_image_class_3_mono(gx_image_enum * penum)
}
code = dev_proc(penum->dev, get_profile)(penum->dev, &dev_profile);
/* Define the rendering intents */
- rendering_params.black_point_comp = penum->pis->blackptcomp;
+ rendering_params.black_point_comp = penum->pgs->blackptcomp;
rendering_params.graphics_type_tag = GS_IMAGE_TAG;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = penum->pis->renderingintent;
+ rendering_params.rendering_intent = penum->pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
if (gs_color_space_get_index(penum->pcs) ==
gs_color_space_index_Indexed) {
@@ -142,7 +142,7 @@ gs_image_class_3_mono(gx_image_enum * penum)
if (penum->icc_setup.is_lab)
penum->icc_setup.need_decode = false;
if (penum->icc_link == NULL) {
- penum->icc_link = gsicc_get_link(penum->pis, penum->dev, pcs, NULL,
+ penum->icc_link = gsicc_get_link(penum->pgs, penum->dev, pcs, NULL,
&rendering_params, penum->memory);
}
/* PS CIE color spaces may have addition decoding that needs to
@@ -213,7 +213,7 @@ not_fast_halftoning:
static inline int
image_set_gray(byte sample_value, const bool masked, uint mask_base,
uint mask_limit, gx_device_color **ppdevc, gs_client_color *cc,
- const gs_color_space *pcs, const gs_imager_state *pis,
+ const gs_color_space *pcs, const gs_gstate *pgs,
gx_device * dev, gs_color_select_t gs_color_select_source,
gx_image_enum * penum)
{
@@ -240,11 +240,11 @@ image_set_gray(byte sample_value, const bool masked, uint mask_base,
penum->map[0].decode_base + (sample_value) * penum->map[0].decode_factor;
}
remap_color = pcs->type->remap_color;
- code = (*remap_color)(cc, pcs, pdevc, pis, dev, gs_color_select_source);
+ code = (*remap_color)(cc, pcs, pdevc, pgs, dev, gs_color_select_source);
return(code);
}
} else if (!color_is_pure(pdevc)) {
- code = gx_color_load_select(pdevc, pis, dev, gs_color_select_source);
+ code = gx_color_load_select(pdevc, pgs, dev, gs_color_select_source);
if (code < 0)
return(code);
}
@@ -263,7 +263,7 @@ static int
image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
uint w, int h, gx_device * dev)
{
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
gs_logical_operation_t lop = penum->log_op;
const bool masked = penum->masked;
const gs_color_space *pcs = NULL; /* only set for non-masks */
@@ -277,7 +277,7 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
penum->mask_color.values[1] - mask_base + 1 : 0);
/*
* Free variables of IMAGE_SET_GRAY:
- * Read: penum, pis, dev, mask_base, mask_limit
+ * Read: penum, pgs, dev, mask_base, mask_limit
* Set: pdevc, code, cc
*/
#define IMAGE_SET_GRAY(sample_value)\
@@ -288,12 +288,12 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
color_set_null(pdevc);\
else {\
decode_sample(sample_value, cc, 0);\
- code = (*remap_color)(&cc, pcs, pdevc, pis, dev, gs_color_select_source);\
+ code = (*remap_color)(&cc, pcs, pdevc, pgs, dev, gs_color_select_source);\
if (code < 0)\
goto err;\
}\
} else if (!color_is_pure(pdevc)) {\
- code = gx_color_load_select(pdevc, pis, dev, gs_color_select_source);\
+ code = gx_color_load_select(pdevc, pgs, dev, gs_color_select_source);\
if (code < 0)\
goto err;\
}\
@@ -358,7 +358,7 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
**********************/
pdevc = penum->icolor1;
- code = gx_color_load(pdevc, pis, dev);
+ code = gx_color_load(pdevc, pgs, dev);
if (code < 0)
return code;
if ((stop <= psrc) && (penum->adjust == 0) &&
@@ -541,7 +541,7 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
htrun = run;
#if USE_SET_GRAY_FUNCTION
code = image_set_gray(run,masked,mask_base,mask_limit,&pdevc,
- &cc,pcs,pis,dev,gs_color_select_source,penum);
+ &cc,pcs,pgs,dev,gs_color_select_source,penum);
if (code < 0)
goto err;
#else
@@ -585,7 +585,7 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
htrun = run;
#if USE_SET_GRAY_FUNCTION
code = image_set_gray(run,masked,mask_base,mask_limit,&pdevc,
- &cc,pcs,pis,dev,gs_color_select_source,penum);
+ &cc,pcs,pgs,dev,gs_color_select_source,penum);
if (code < 0)
goto err;
#else
@@ -612,7 +612,7 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
if (!masked) {
#if USE_SET_GRAY_FUNCTION
code = image_set_gray(*stop, masked,mask_base,mask_limit,&pdevc,
- &cc,pcs,pis,dev,gs_color_select_source,penum);
+ &cc,pcs,pgs,dev,gs_color_select_source,penum);
if (code < 0)
goto err;
#else
@@ -722,7 +722,7 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
if (run != htrun) {
#if USE_SET_GRAY_FUNCTION
code = image_set_gray(run, masked,mask_base,mask_limit,&pdevc,
- &cc,pcs,pis,dev,gs_color_select_source,penum);
+ &cc,pcs,pgs,dev,gs_color_select_source,penum);
if (code < 0)
goto err;
#else
@@ -769,7 +769,7 @@ image_render_mono(gx_image_enum * penum, const byte * buffer, int data_x,
}
#if USE_SET_GRAY_FUNCTION
code = image_set_gray(*stop, masked,mask_base,mask_limit,&pdevc,
- &cc,pcs,pis,dev,gs_color_select_source,penum);
+ &cc,pcs,pgs,dev,gs_color_select_source,penum);
if (code < 0)
goto err;
#else
diff --git a/base/gxiparam.h b/base/gxiparam.h
index e68b4d3c8..afdc8ff35 100644
--- a/base/gxiparam.h
+++ b/base/gxiparam.h
@@ -55,7 +55,7 @@ struct gx_image_type_s {
* structure, but ImageType 2 images must compute it.
*/
#define image_proc_source_size(proc)\
- int proc(const gs_imager_state *pis, const gs_image_common_t *pic,\
+ int proc(const gs_gstate *pgs, const gs_image_common_t *pic,\
gs_int_point *psize)
image_proc_source_size((*source_size));
diff --git a/base/gxipixel.c b/base/gxipixel.c
index 9442c185a..071ec7068 100644
--- a/base/gxipixel.c
+++ b/base/gxipixel.c
@@ -132,7 +132,7 @@ static int color_draws_b_w(gx_device * dev,
static int image_init_colors(gx_image_enum * penum, int bps, int spp,
gs_image_format_t format,
const float *decode,
- const gs_imager_state * pis, gx_device * dev,
+ const gs_gstate * pgs, gx_device * dev,
const gs_color_space * pcs, bool * pdcb);
/* Procedures for unpacking the input data into bytes or fracs. */
@@ -223,7 +223,7 @@ static inline fixed float2fixed_rounded_boxed(double src) {
* masked, adjust
*/
int
-gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
+gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs,
const gs_matrix *pmat, const gs_image_common_t * pic,
const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
gs_memory_t * mem, gx_image_enum *penum)
@@ -238,7 +238,7 @@ gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
gs_matrix_double mat;
int index_bps;
const gs_color_space *pcs = pim->ColorSpace;
- gs_logical_operation_t lop = (pis ? pis->log_op : lop_default);
+ gs_logical_operation_t lop = (pgs ? pgs->log_op : lop_default);
int code;
int log2_xbytes = (bps <= 8 ? 0 : arch_log2_sizeof_frac);
int spp, nplanes, spread;
@@ -261,7 +261,7 @@ gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
penum->Width = width;
penum->Height = height;
if (pmat == 0)
- pmat = &ctm_only(pis);
+ pmat = &ctm_only(pgs);
if (pim->ImageMatrix.xx == pmat->xx && pim->ImageMatrix.xy == pmat->xy &&
pim->ImageMatrix.yx == pmat->yx && pim->ImageMatrix.yy == pmat->yy) {
/* Process common special case separately to accept singular matrix. */
@@ -315,7 +315,7 @@ gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
*/
gridfitimages = in_pattern_accumulator && orthogonal;
- if (pis != NULL && pis->is_gstate && ((gs_state *)pis)->show_gstate != NULL) {
+ if (pgs != NULL && pgs->show_gstate != NULL) {
/* If we're a graphics state, and we're in a text object, then we
* must be in a type3 font. Don't fiddle with it. */
} else if (!gridfitimages &&
@@ -324,7 +324,7 @@ gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
* ones in a pattern device), we only grid fit imagemasks */
} else if (gridfitimages && (penum->masked && penum->image_parent_type == 0)) {
/* We don't gridfit imagemasks in a pattern accumulator */
- } else if (pis != NULL && pis->fill_adjust.x == 0 && pis->fill_adjust.y == 0) {
+ } else if (pgs != NULL && pgs->fill_adjust.x == 0 && pgs->fill_adjust.y == 0) {
/* If fill adjust is disabled, so is grid fitting */
} else if (orthogonal == 1) {
if (width == 1 || gridfitimages) {
@@ -412,7 +412,7 @@ gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
gs_matrix mi;
gs_fixed_rect obox;
gs_int_rect irect;
- if ((code = gs_matrix_invert(&ctm_only(pis), &mi)) < 0 ||
+ if ((code = gs_matrix_invert(&ctm_only(pgs), &mi)) < 0 ||
(code = gs_matrix_multiply(&mi, &pic->ImageMatrix, &mi)) < 0) {
/* Give up trying to shrink the render box, but continue processing */
break;
@@ -608,10 +608,10 @@ gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
if (pcs->cmm_icc_profile_data != NULL) {
device_color = false;
} else {
- device_color = (*pcst->concrete_space) (pcs, pis) == pcs;
+ device_color = (*pcst->concrete_space) (pcs, pgs) == pcs;
}
- code = image_init_colors(penum, bps, spp, format, decode, pis, dev,
+ code = image_init_colors(penum, bps, spp, format, decode, pgs, dev,
pcs, &device_color);
if (code < 0)
return gs_throw(code, "Image colors initialization failed");
@@ -620,14 +620,14 @@ gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
be done due to the above init_colors which may go through remap. */
if (gs_color_space_is_PSCIE(pcs) && pcs->icc_equivalent == NULL) {
gs_colorspace_set_icc_equivalent((gs_color_space *)pcs, &(penum->icc_setup.is_lab),
- pis->memory);
+ pgs->memory);
if (penum->icc_setup.is_lab) {
/* Free what ever profile was created and use the icc manager's
cielab profile */
gs_color_space *curr_pcs = (gs_color_space *)pcs;
rc_decrement(curr_pcs->icc_equivalent,"gx_image_enum_begin");
rc_decrement(curr_pcs->cmm_icc_profile_data,"gx_image_enum_begin");
- curr_pcs->cmm_icc_profile_data = pis->icc_manager->lab_profile;
+ curr_pcs->cmm_icc_profile_data = pgs->icc_manager->lab_profile;
rc_increment(curr_pcs->cmm_icc_profile_data);
}
}
@@ -734,7 +734,7 @@ gx_image_enum_begin(gx_device * dev, const gs_imager_state * pis,
((x_extent.y | y_extent.x) == 0 ? image_portrait :
(x_extent.x | y_extent.y) == 0 ? image_landscape :
image_skewed);
- penum->pis = pis;
+ penum->pgs = pgs;
penum->pcs = pcs;
penum->memory = mem;
penum->buffer = buffer;
@@ -1111,7 +1111,7 @@ image_init_color_cache(gx_image_enum * penum, int bps, int spp)
for (kk = 0; kk < num_des_comp; kk++) {
conc[kk] = gx_color_value_from_byte(psrc[kk]);
}
- cmap_transfer(&(conc[0]), penum->pis, penum->dev);
+ cmap_transfer(&(conc[0]), penum->pgs, penum->dev);
for (kk = 0; kk < num_des_comp; kk++) {
psrc[kk] = gx_color_value_to_byte(conc[kk]);
}
@@ -1195,7 +1195,7 @@ image_init_color_cache(gx_image_enum * penum, int bps, int spp)
for (kk = 0; kk < num_des_comp; kk++) {
conc[kk] = gx_color_value_from_byte(byte_ptr[kk]);
}
- cmap_transfer(&(conc[0]), penum->pis, penum->dev);
+ cmap_transfer(&(conc[0]), penum->pgs, penum->dev);
for (kk = 0; kk < num_des_comp; kk++) {
byte_ptr[kk] = gx_color_value_to_byte(conc[kk]);
}
@@ -1252,7 +1252,7 @@ image_init_clues(gx_image_enum * penum, int bps, int spp)
static int
image_init_colors(gx_image_enum * penum, int bps, int spp,
gs_image_format_t format, const float *decode /*[spp*2] */ ,
- const gs_imager_state * pis, gx_device * dev,
+ const gs_gstate * pgs, gx_device * dev,
const gs_color_space * pcs, bool * pdcb)
{
int ci, decode_type, code;
@@ -1356,12 +1356,12 @@ image_init_colors(gx_image_enum * penum, int bps, int spp,
/* Image clues are used in this case */
cc.paint.values[0] = real_decode[0];
code = (*pcs->type->remap_color) (&cc, pcs, penum->icolor0,
- pis, dev, gs_color_select_source);
+ pgs, dev, gs_color_select_source);
if (code < 0)
return code;
cc.paint.values[0] = real_decode[1];
code = (*pcs->type->remap_color) (&cc, pcs, penum->icolor1,
- pis, dev, gs_color_select_source);
+ pgs, dev, gs_color_select_source);
if (code < 0)
return code;
}
@@ -1418,12 +1418,12 @@ gx_image_scale_mask_colors(gx_image_enum *penum, int component_index)
/* Used to indicate for ICC procesing if we have decoding to do */
bool
-gx_has_transfer(const gs_imager_state *pis, int num_comps)
+gx_has_transfer(const gs_gstate *pgs, int num_comps)
{
int k;
for (k = 0; k < num_comps; k++) {
- if (pis->effective_transfer[k]->proc != gs_identity_transfer) {
+ if (pgs->effective_transfer[k]->proc != gs_identity_transfer) {
return(true);
}
}
diff --git a/base/gxiscale.c b/base/gxiscale.c
index 840efd238..e18af4664 100644
--- a/base/gxiscale.c
+++ b/base/gxiscale.c
@@ -30,7 +30,7 @@
#include "gxdevice.h"
#include "gxcmap.h"
#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxdevmem.h"
#include "gxcpath.h"
#include "gximage.h"
@@ -156,7 +156,7 @@ static int mask_suitable_for_interpolation(gx_image_enum *penum)
} else if (dev_proc(penum->dev, copy_alpha_hl_color) == NULL) {
/* No copy_alpha_hl_color. We're out of luck. */
return -1;
- } else if ((code = gx_color_load(pdc1, penum->pis, penum->dev)) < 0) {
+ } else if ((code = gx_color_load(pdc1, penum->pgs, penum->dev)) < 0) {
/* Otherwise we'll need to load the color value. If this gives an
* error, we can't cope. */
return -1;
@@ -256,7 +256,7 @@ gs_image_class_0_interpolate(gx_image_enum * penum)
then we will need to use those and go through pixel by pixel instead
of blasting through buffers. This is true for example with many of
the color spaces for CUPs */
- if(!gx_device_uses_std_cmap_procs(penum->dev, penum->pis)) {
+ if(!gx_device_uses_std_cmap_procs(penum->dev, penum->pgs)) {
use_icc = false;
}
}
@@ -543,11 +543,11 @@ gs_image_class_0_interpolate(gx_image_enum * penum)
}
}
/* Define the rendering intents */
- rendering_params.black_point_comp = penum->pis->blackptcomp;
+ rendering_params.black_point_comp = penum->pgs->blackptcomp;
rendering_params.graphics_type_tag = GS_IMAGE_TAG;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = penum->pis->renderingintent;
+ rendering_params.rendering_intent = penum->pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) {
pcs = penum->pcs->icc_equivalent;
@@ -563,9 +563,9 @@ gs_image_class_0_interpolate(gx_image_enum * penum)
if (penum->icc_setup.is_lab) penum->icc_setup.need_decode = false;
penum->icc_setup.must_halftone = gx_device_must_halftone(penum->dev);
penum->icc_setup.has_transfer =
- gx_has_transfer(penum->pis, num_des_comps);
+ gx_has_transfer(penum->pgs, num_des_comps);
if (penum->icc_link == NULL) {
- penum->icc_link = gsicc_get_link(penum->pis, penum->dev, pcs, NULL,
+ penum->icc_link = gsicc_get_link(penum->pgs, penum->dev, pcs, NULL,
&rendering_params, penum->memory);
}
/* We need to make sure that we do the proper unpacking proc if we
@@ -858,7 +858,7 @@ static int handle_colors(gx_image_enum *penum, const frac *psrc, int spp_decode,
{
const gs_color_space *pactual_cs;
const gs_color_space *pconcs;
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
const gs_color_space *pcs = penum->pcs;
bool device_color;
bool is_index_space;
@@ -884,7 +884,7 @@ static int handle_colors(gx_image_enum *penum, const frac *psrc, int spp_decode,
} else {
pactual_cs = pcs;
}
- pconcs = cs_concrete_space(pactual_cs, pis);
+ pconcs = cs_concrete_space(pactual_cs, pgs);
if (pconcs->cmm_icc_profile_data != NULL) {
device_color = false;
} else {
@@ -893,7 +893,7 @@ static int handle_colors(gx_image_enum *penum, const frac *psrc, int spp_decode,
if (device_color) {
/* Use the underlying concrete space remap */
code = (*pconcs->type->remap_concrete_color)
- (psrc, pconcs, devc, pis, dev, gs_color_select_source);
+ (psrc, pconcs, devc, pgs, dev, gs_color_select_source);
} else {
/* If we are device dependent we need to get back to float prior to remap.*/
gs_client_color cc;
@@ -914,11 +914,11 @@ static int handle_colors(gx_image_enum *penum, const frac *psrc, int spp_decode,
if (gs_color_space_is_ICC(pactual_cs) &&
pactual_cs->cmm_icc_profile_data != NULL &&
pactual_cs->cmm_icc_profile_data->islab) {
- code = gx_remap_ICC_imagelab(&cc, pactual_cs, devc, pis, dev,
+ code = gx_remap_ICC_imagelab(&cc, pactual_cs, devc, pgs, dev,
gs_color_select_source);
} else {
code = (pactual_cs->type->remap_color)
- (&cc, pactual_cs, devc, pis, dev, gs_color_select_source);
+ (&cc, pactual_cs, devc, pgs, dev, gs_color_select_source);
}
}
return code;
@@ -1282,7 +1282,7 @@ gx_device_color *devc, gx_color_index *color, gx_device * dev)
if (must_halftone || has_transfer) {
/* We need to do the tranfer function and/or the halftoning */
- cmap_transfer_halftone(p_cm_interp, devc, penum->pis, dev,
+ cmap_transfer_halftone(p_cm_interp, devc, penum->pgs, dev,
has_transfer, must_halftone, gs_color_select_source);
} else {
/* encode as a color index. avoid all the cv to frac to cv conversions */
@@ -1301,7 +1301,7 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer,
int data_x, uint iw, int h, gx_device * dev)
{
stream_image_scale_state *pss = penum->scaler;
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
gs_logical_operation_t lop = penum->log_op;
byte *out = penum->line;
stream_cursor_read stream_r;
@@ -1351,7 +1351,7 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer,
&& stream_r.ptr != stream_r.limit) {
/* Get the buffers set up. */
p_cm_buff =
- (byte *) gs_alloc_bytes(pis->memory,
+ (byte *) gs_alloc_bytes(pgs->memory,
num_bytes_decode * width_in * spp_cm,
"image_render_interpolate_icc");
/* Set up the buffer descriptors. We keep the bytes the same */
@@ -1373,7 +1373,7 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer,
/* CM after interpolation (or none). Just set up the buffers
if needed. 16 bit operations if CM takes place. */
if (!penum->icc_link->is_identity) {
- p_cm_buff = (byte *) gs_alloc_bytes(pis->memory,
+ p_cm_buff = (byte *) gs_alloc_bytes(pgs->memory,
sizeof(unsigned short) * width * spp_cm,
"image_render_interpolate_icc");
/* Set up the buffer descriptors. */
@@ -1574,7 +1574,7 @@ inactive:
}
/* Free cm buffer, if it was used */
if (p_cm_buff != NULL) {
- gs_free_object(pis->memory, (byte *)p_cm_buff,
+ gs_free_object(pgs->memory, (byte *)p_cm_buff,
"image_render_interpolate_icc");
}
}
@@ -1838,7 +1838,7 @@ image_render_interpolate_landscape_icc(gx_image_enum * penum,
gx_device * dev)
{
stream_image_scale_state *pss = penum->scaler;
- const gs_imager_state *pis = penum->pis;
+ const gs_gstate *pgs = penum->pgs;
gs_logical_operation_t lop = penum->log_op;
byte *out = penum->line;
stream_cursor_read stream_r;
@@ -1888,7 +1888,7 @@ image_render_interpolate_landscape_icc(gx_image_enum * penum,
&& stream_r.ptr != stream_r.limit) {
/* Get the buffers set up. */
p_cm_buff =
- (byte *) gs_alloc_bytes(pis->memory,
+ (byte *) gs_alloc_bytes(pgs->memory,
num_bytes_decode * width_in * spp_cm,
"image_render_interpolate_icc");
/* Set up the buffer descriptors. We keep the bytes the same */
@@ -1910,7 +1910,7 @@ image_render_interpolate_landscape_icc(gx_image_enum * penum,
/* CM after interpolation (or none). Just set up the buffers
if needed. 16 bit operations if CM takes place. */
if (!penum->icc_link->is_identity) {
- p_cm_buff = (byte *) gs_alloc_bytes(pis->memory,
+ p_cm_buff = (byte *) gs_alloc_bytes(pgs->memory,
sizeof(unsigned short) * width * spp_cm,
"image_render_interpolate_icc");
/* Set up the buffer descriptors. */
@@ -2001,7 +2001,7 @@ inactive:
}
/* Free cm buffer, if it was used */
if (p_cm_buff != NULL) {
- gs_free_object(pis->memory, (byte *)p_cm_buff,
+ gs_free_object(pgs->memory, (byte *)p_cm_buff,
"image_render_interpolate_icc");
}
}
diff --git a/base/gxistate.h b/base/gxistate.h
deleted file mode 100644
index 8fb30120d..000000000
--- a/base/gxistate.h
+++ /dev/null
@@ -1,340 +0,0 @@
-/* Copyright (C) 2001-2012 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied,
- modified or distributed except as expressly authorized under the terms
- of the license contained in the file LICENSE in this distribution.
-
- Refer to licensing information at http://www.artifex.com or contact
- Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
- CA 94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-
-/* Imager state definition */
-
-#ifndef gxistate_INCLUDED
-# define gxistate_INCLUDED
-
-#include "gscsel.h"
-#include "gsrefct.h"
-#include "gsropt.h"
-#include "gstparam.h"
-#include "gxcvalue.h"
-#include "gxcmap.h"
-#include "gxfixed.h"
-#include "gxline.h"
-#include "gxmatrix.h"
-#include "gxtmap.h"
-#include "gscspace.h"
-#include "gstrans.h"
-#include "gsnamecl.h"
-#include "gscms.h"
-
-/*
- Define the subset of the PostScript graphics state that the imager library
- API needs. The intended division between the two state structures is that
- the imager state contain only information that (1) is not part of the
- parameters for individual drawing commands at the gx_ interface (i.e.,
- will likely be different for each drawing call), and (2) is not an
- artifact of the PostScript language (i.e., doesn't need to burden the
- structure when it is being used for other imaging, specifically for
- imaging a command list). While this criterion is somewhat fuzzy, it leads
- us to INCLUDE the following state elements:
- line parameters: cap, join, miter limit, dash pattern
- transformation matrix (CTM)
- logical operation: RasterOp, transparency
- color modification: alpha, rendering algorithm
- transparency information:
- blend mode
- (opacity + shape) (alpha + cached mask)
- text knockout flag
- rendering stack
- overprint control: overprint flag, mode, and effective mode
- rendering tweaks: flatness, fill adjustment, stroke adjust flag,
- accurate curves flag, shading smoothness
- color rendering information:
- halftone, halftone phases
- transfer functions
- black generation, undercolor removal
- CIE rendering tables
- halftone and pattern caches
- shared (constant) device color spaces
- We EXCLUDE the following for reason #1 (drawing command parameters):
- path
- clipping path and stack
- color specification: color, color space, substitute color spaces
- font
- device
- We EXCLUDE the following for reason #2 (specific to PostScript):
- graphics state stack
- default CTM
- clipping path stack
- In retrospect, perhaps the device should have been included in the
- imager state, but we don't think this change is worth the trouble now.
- */
-
-/*
- * Define the color rendering state information.
- * This should be a separate object (or at least a substructure),
- * but making this change would require editing too much code.
- */
-
-/* Opaque types referenced by the color rendering state. */
-#ifndef gs_halftone_DEFINED
-# define gs_halftone_DEFINED
-typedef struct gs_halftone_s gs_halftone;
-#endif
-#ifndef gx_device_color_DEFINED
-# define gx_device_color_DEFINED
-typedef struct gx_device_color_s gx_device_color;
-#endif
-#ifndef gx_device_halftone_DEFINED
-# define gx_device_halftone_DEFINED
-typedef struct gx_device_halftone_s gx_device_halftone;
-#endif
-#ifndef gs_color_space_DEFINED
-# define gs_color_space_DEFINED
-typedef struct gs_color_space_s gs_color_space;
-#endif
-
-/*
- * We need some special memory management for the components of a
- * c.r. state, as indicated by the following notations on the elements:
- * (RC) means the element is reference-counted.
- * (Shared) means the element is shared among an arbitrary number of
- * c.r. states and is never freed.
- * (Owned) means exactly one c.r. state references the element,
- * and it is guaranteed that no references to it will outlive
- * the c.r. state itself.
- */
-
-/* Define the interior structure of a transfer function. */
-typedef struct gx_transfer_s {
- int red_component_num;
- gx_transfer_map *red; /* (RC) */
- int green_component_num;
- gx_transfer_map *green; /* (RC) */
- int blue_component_num;
- gx_transfer_map *blue; /* (RC) */
- int gray_component_num;
- gx_transfer_map *gray; /* (RC) */
-} gx_transfer;
-
-#define gs_color_rendering_state_common\
-\
- /* Halftone screen: */\
-\
- gs_halftone *halftone; /* (RC) */\
- gs_int_point screen_phase[gs_color_select_count];\
- /* dev_ht depends on halftone and device resolution. */\
- gx_device_halftone *dev_ht; /* (RC) */\
-\
- /* Color (device-dependent): */\
-\
- struct gs_cie_render_s *cie_render; /* (RC) may be 0 */\
- bool cie_to_xyz; /* flag for conversion to XYZ, no CRD req'd */\
- gx_transfer_map *black_generation; /* (RC) may be 0 */\
- gx_transfer_map *undercolor_removal; /* (RC) may be 0 */\
- /* set_transfer holds the transfer functions specified by */\
- /* set[color]transfer; effective_transfer includes the */\
- /* effects of overrides by TransferFunctions in halftone */\
- /* dictionaries. (In Level 1 systems, set_transfer and */\
- /* effective_transfer are always the same.) */\
- gx_transfer set_transfer; /* members are (RC) */\
- gx_transfer_map *effective_transfer[GX_DEVICE_COLOR_MAX_COMPONENTS]; /* see below */\
-\
- /* Color caches: */\
-\
- /* cie_joint_caches depend on cie_render and */\
- /* the color space. */\
- struct gx_cie_joint_caches_s *cie_joint_caches; /* (RC) */\
- /* cmap_procs depend on the device's color_info. */\
- const struct gx_color_map_procs_s *cmap_procs; /* static */\
- /* DeviceN component map for current color space */\
- gs_devicen_color_map color_component_map;\
- /* The contents of pattern_cache depend on the */\
- /* the color space and the device's color_info and */\
- /* resolution. */\
- struct gx_pattern_cache_s *pattern_cache; /* (Shared) by all gstates */\
-\
- /* Simple color spaces, stored here for easy access from */ \
- /* gx_concrete_space_CIE */ \
- gs_color_space *devicergb_cs;\
- gs_color_space *devicecmyk_cs;\
-\
- /* Stores for cached values which correspond to whichever */\
- /* color isn't in force at the moment */\
- struct gx_cie_joint_caches_s *cie_joint_caches_alt;\
- gs_devicen_color_map color_component_map_alt
-
-/*
- * Enumerate the reference-counted pointers in a c.r. state. Note that
- * effective_transfer doesn't contribute to the reference count: it points
- * either to the same objects as set_transfer, or to objects in a halftone
- * structure that someone else worries about.
- */
-#define gs_cr_state_do_rc_ptrs(m)\
- m(halftone) m(dev_ht) m(cie_render)\
- m(black_generation) m(undercolor_removal)\
- m(set_transfer.red) m(set_transfer.green)\
- m(set_transfer.blue) m(set_transfer.gray)\
- m(cie_joint_caches)\
- m(devicergb_cs) m(devicecmyk_cs)\
- m(cie_joint_caches_alt)
-
-/* Enumerate the pointers in a c.r. state. */
-#define gs_cr_state_do_ptrs(m)\
- m(0,halftone) m(1,dev_ht)\
- m(2,cie_render) m(3,black_generation) m(4,undercolor_removal)\
- m(5,set_transfer.red) m(6,set_transfer.green)\
- m(7,set_transfer.blue) m(8,set_transfer.gray)\
- m(9,cie_joint_caches) m(10,pattern_cache)\
- m(11,devicergb_cs) m(12,devicecmyk_cs)\
- m(13,cie_joint_caches_alt)
- /*
- * We handle effective_transfer specially in gsistate.c since its pointers
- * are not enumerated for garbage collection but they are are relocated.
- */
-/*
- * This count does not include the effective_transfer pointers since they
- * are not enumerated for GC.
- */
-#define st_cr_state_num_ptrs 14
-
-#ifndef gs_devicen_color_map_DEFINED
-# define gs_devicen_color_map_DEFINED
-typedef struct gs_devicen_color_map_s gs_devicen_color_map;
-#endif
-
-struct gs_devicen_color_map_s {
- bool use_alt_cspace;
- separation_type sep_type;
- uint num_components; /* Input - Duplicate of value in gs_device_n_params */
- uint num_colorants; /* Number of colorants - output */
- gs_id cspace_id; /* Used to verify color space and map match */
- int color_map[GS_CLIENT_COLOR_MAX_COMPONENTS];
-};
-
-
-/* These flags are used to keep track of qQ
- combinations surrounding a graphic state
- change that includes a softmask setting.
- The transparency compositor must be notified
- when a Q event occurs following a softmask */
-
-typedef struct gs_xstate_trans_flags {
- bool xstate_pending;
- bool xstate_change;
-} gs_xstate_trans_flags_t;
-
-/* Define the imager state structure itself. */
-/*
- * Note that the ctm member is a gs_matrix_fixed. As such, it cannot be
- * used directly as the argument for procedures like gs_point_transform.
- * Instead, one must use the ctm_only macro, e.g., &ctm_only(pis) rather
- * than &pis->ctm.
- */
-#define gs_imager_state_common\
- bool is_gstate; /* is this imager state part of gstate ? */\
- gs_memory_t *memory;\
- void *client_data;\
- gx_line_params line_params;\
- bool hpgl_path_mode;\
- gs_matrix_fixed ctm;\
- bool current_point_valid;\
- gs_point current_point;\
- gs_point subpath_start;\
- bool clamp_coordinates;\
- gs_logical_operation_t log_op;\
- gx_color_value alpha;\
- gs_blend_mode_t blend_mode;\
- gs_transparency_source_t opacity, shape;\
- gs_xstate_trans_flags_t trans_flags;\
- gs_id soft_mask_id;\
- bool text_knockout;\
- uint text_rendering_mode;\
- bool has_transparency; /* used to keep from doing shading fills in device color space */\
- gx_device *trans_device; /* trans device has all mappings to group color space */\
- bool overprint;\
- int overprint_mode;\
- int effective_overprint_mode;\
- bool overprint_alt;\
- int overprint_mode_alt;\
- int effective_overprint_mode_alt;\
- float flatness;\
- gs_fixed_point fill_adjust; /* A path expansion for fill; -1 = dropout prevention*/\
- bool stroke_adjust;\
- bool accurate_curves;\
- bool have_pattern_streams;\
- float smoothness;\
- int renderingintent; /* See gsstate.c */\
- bool blackptcomp;\
- gsicc_manager_t *icc_manager; /* ICC color manager, profile */\
- gsicc_link_cache_t *icc_link_cache; /* ICC linked transforms */\
- gsicc_profile_cache_t *icc_profile_cache; /* ICC profiles from PS. */\
- CUSTOM_COLOR_PTR /* Pointer to custom color callback struct */\
- const gx_color_map_procs *\
- (*get_cmap_procs)(const gs_imager_state *, const gx_device *);\
- gs_color_rendering_state_common
-#define st_imager_state_num_ptrs\
- (st_line_params_num_ptrs + st_cr_state_num_ptrs + 5)
-/* Access macros */
-#define ctm_only(pis) (*(const gs_matrix *)&(pis)->ctm)
-#define ctm_only_writable(pis) (*(gs_matrix *)&(pis)->ctm)
-#define set_ctm_only(pis, mat) (*(gs_matrix *)&(pis)->ctm = (mat))
-#define gs_init_rop(pis) ((pis)->log_op = lop_default)
-#define gs_currentflat_inline(pis) ((pis)->flatness)
-#define gs_currentlineparams_inline(pis) (&(pis)->line_params)
-#define gs_current_logical_op_inline(pis) ((pis)->log_op)
-#define gs_set_logical_op_inline(pis, lop) ((pis)->log_op = (lop))
-
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
-#endif
-
-struct gs_imager_state_s {
- gs_imager_state_common;
-};
-
-/* Initialization for gs_imager_state */
-#define gs_imager_state_initial(scale, is_gstate)\
- is_gstate, 0, 0, { gx_line_params_initial }, 0,\
- { (float)(scale), 0.0, 0.0, (float)(-(scale)), 0.0, 0.0 },\
- false, {0, 0}, {0, 0}, false, \
- lop_default, gx_max_color_value, BLEND_MODE_Compatible,\
-{ 1.0 }, { 1.0 }, {0, 0}, 0, 0/*false*/, 0, 0, 0, 0/*false*/, 0, 0, 0/*false*/, 0, 0, 1.0, \
- { fixed_half, fixed_half }, 0/*false*/, 1/*true*/, 0/*false*/, 1.0,\
- 1, 1/* bpt true */, 0, 0, 0, INIT_CUSTOM_COLOR_PTR /* 'Custom color' callback pointer */ \
- gx_default_get_cmap_procs
-
-/* The imager state structure is public only for subclassing. */
-#define public_st_imager_state() /* in gsistate.c */\
- gs_public_st_composite(st_imager_state, gs_imager_state, "gs_imager_state",\
- imager_state_enum_ptrs, imager_state_reloc_ptrs)
-
-/* Initialize an imager state, other than the parts covered by */
-/* gs_imager_state_initial. */
-int gs_imager_state_initialize(gs_imager_state * pis, gs_memory_t * mem);
-
-/* Make a temporary copy of a gs_imager_state. Note that this does not */
-/* do all the necessary reference counting, etc. */
-gs_imager_state *
- gs_imager_state_copy(const gs_imager_state * pis, gs_memory_t * mem);
-
-/* Increment reference counts to note that an imager state has been copied. */
-void gs_imager_state_copied(gs_imager_state * pis);
-
-/* Adjust reference counts before assigning one imager state to another. */
-void gs_imager_state_pre_assign(gs_imager_state *to,
- const gs_imager_state *from);
-
-/* Release an imager state. */
-void gs_imager_state_release(gs_imager_state * pis);
-int gs_currentscreenphase_pis(const gs_imager_state *, gs_int_point *, gs_color_select_t);
-
-#endif /* gxistate_INCLUDED */
diff --git a/base/gxp1impl.h b/base/gxp1impl.h
index 84ef51466..865aa237f 100644
--- a/base/gxp1impl.h
+++ b/base/gxp1impl.h
@@ -35,7 +35,7 @@ dev_color_proc_fill_rectangle(gx_dc_pat_trans_fill_rectangle);
/*
* Declare the Pattern color mapping procedures exported by gxpcmap.c.
*/
-int gx_pattern_load(gx_device_color *, const gs_imager_state *,
+int gx_pattern_load(gx_device_color *, const gs_gstate *,
gx_device *, gs_color_select_t);
pattern_proc_remap_color(gs_pattern1_remap_color);
diff --git a/base/gxpaint.c b/base/gxpaint.c
index de63a57c8..88776e317 100644
--- a/base/gxpaint.c
+++ b/base/gxpaint.c
@@ -23,7 +23,7 @@
#include "gxpath.h"
#include "gxfont.h"
-static bool caching_an_outline_font(const gs_state * pgs)
+static bool caching_an_outline_font(const gs_gstate * pgs)
{
return pgs->in_cachedevice > 1 &&
pgs->font != NULL &&
@@ -35,7 +35,7 @@ static bool caching_an_outline_font(const gs_state * pgs)
/* Fill a path. */
int
-gx_fill_path(gx_path * ppath, gx_device_color * pdevc, gs_state * pgs,
+gx_fill_path(gx_path * ppath, gx_device_color * pdevc, gs_gstate * pgs,
int rule, fixed adjust_x, fixed adjust_y)
{
gx_device *dev = gs_currentdevice_inline(pgs);
@@ -50,12 +50,12 @@ gx_fill_path(gx_path * ppath, gx_device_color * pdevc, gs_state * pgs,
params.adjust.y = adjust_y;
params.flatness = (caching_an_outline_font(pgs) ? 0.0 : pgs->flatness);
return (*dev_proc(dev, fill_path))
- (dev, (const gs_imager_state *)pgs, ppath, &params, pdevc, pcpath);
+ (dev, (const gs_gstate *)pgs, ppath, &params, pdevc, pcpath);
}
/* Stroke a path for drawing or saving. */
int
-gx_stroke_fill(gx_path * ppath, gs_state * pgs)
+gx_stroke_fill(gx_path * ppath, gs_gstate * pgs)
{
gx_device *dev = gs_currentdevice_inline(pgs);
gx_clip_path *pcpath;
@@ -67,31 +67,31 @@ gx_stroke_fill(gx_path * ppath, gs_state * pgs)
params.flatness = (caching_an_outline_font(pgs) ? 0.0 : pgs->flatness);
params.traditional = false;
return (*dev_proc(dev, stroke_path))
- (dev, (const gs_imager_state *)pgs, ppath, &params,
+ (dev, (const gs_gstate *)pgs, ppath, &params,
gs_currentdevicecolor_inline(pgs), pcpath);
}
int
gx_stroke_add(gx_path * ppath, gx_path * to_path,
- const gs_state * pgs, bool traditional)
+ const gs_gstate * pgs, bool traditional)
{
gx_stroke_params params;
params.flatness = (caching_an_outline_font(pgs) ? 0.0 : pgs->flatness);
params.traditional = traditional;
return gx_stroke_path_only(ppath, to_path, pgs->device,
- (const gs_imager_state *)pgs,
+ (const gs_gstate *)pgs,
&params, NULL, NULL);
}
int
-gx_imager_stroke_add(gx_path *ppath, gx_path *to_path,
- gx_device *dev, const gs_imager_state *pis)
+gx_gstate_stroke_add(gx_path *ppath, gx_path *to_path,
+ gx_device *dev, const gs_gstate *pgs)
{
gx_stroke_params params;
- params.flatness = pis->flatness;
+ params.flatness = pgs->flatness;
params.traditional = false;
- return gx_stroke_path_only(ppath, to_path, dev, pis,
+ return gx_stroke_path_only(ppath, to_path, dev, pgs,
&params, NULL, NULL);
}
diff --git a/base/gxpaint.h b/base/gxpaint.h
index 255db4cd0..2e60a978b 100644
--- a/base/gxpaint.h
+++ b/base/gxpaint.h
@@ -20,14 +20,14 @@
#ifndef gxpaint_INCLUDED
# define gxpaint_INCLUDED
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#ifndef gx_device_DEFINED
@@ -47,16 +47,16 @@ typedef struct gx_device_color_s gx_device_color;
* They are implemented in gxpaint.c.
*/
-int gx_fill_path(gx_path * ppath, gx_device_color * pdevc, gs_state * pgs,
+int gx_fill_path(gx_path * ppath, gx_device_color * pdevc, gs_gstate * pgs,
int rule, fixed adjust_x, fixed adjust_y);
-int gx_stroke_fill(gx_path * ppath, gs_state * pgs);
-int gx_stroke_add(gx_path *ppath, gx_path *to_path, const gs_state * pgs, bool traditional);
+int gx_stroke_fill(gx_path * ppath, gs_gstate * pgs);
+int gx_stroke_add(gx_path *ppath, gx_path *to_path, const gs_gstate * pgs, bool traditional);
/*
- * gx_imager_stroke_add needs a device for the sake of absolute-length
+ * gx_gstate_stroke_add needs a device for the sake of absolute-length
* dots (and for no other reason).
*/
-int gx_imager_stroke_add(gx_path *ppath, gx_path *to_path,
- gx_device *dev, const gs_imager_state *pis);
+int gx_gstate_stroke_add(gx_path *ppath, gx_path *to_path,
+ gx_device *dev, const gs_gstate *pgs);
/* ------ Imager procedures ------ */
@@ -76,12 +76,12 @@ void gx_adjust_if_empty(const gs_fixed_rect *, gs_fixed_point *);
* amount if the miter limit is large. If this matters, use strokepath +
* pathbbox.
*/
-int gx_stroke_path_expansion(const gs_imager_state *pis,
+int gx_stroke_path_expansion(const gs_gstate *pgs,
const gx_path *ppath, gs_fixed_point *ppt);
/* Backward compatibility */
-#define gx_stroke_expansion(pis, ppt)\
- gx_stroke_path_expansion(pis, (const gx_path *)0, ppt)
+#define gx_stroke_expansion(pgs, ppt)\
+ gx_stroke_path_expansion(pgs, (const gx_path *)0, ppt)
/*
* The following procedures do not need a graphics state.
@@ -99,8 +99,8 @@ struct gx_fill_params_s {
float flatness;
};
-#define gx_fill_path_only(ppath, dev, pis, params, pdevc, pcpath)\
- (*dev_proc(dev, fill_path))(dev, pis, ppath, params, pdevc, pcpath)
+#define gx_fill_path_only(ppath, dev, pgs, params, pdevc, pcpath)\
+ (*dev_proc(dev, fill_path))(dev, pgs, ppath, params, pdevc, pcpath)
/* Define the parameters passed to the imager's stroke routine. */
#ifndef gx_stroke_params_DEFINED
@@ -113,7 +113,7 @@ struct gx_stroke_params_s {
};
int gx_stroke_path_only(gx_path * ppath, gx_path * to_path, gx_device * dev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_stroke_params * params,
const gx_device_color * pdevc,
const gx_clip_path * pcpath);
diff --git a/base/gxpath.h b/base/gxpath.h
index 805657ba7..36fcf631a 100644
--- a/base/gxpath.h
+++ b/base/gxpath.h
@@ -205,7 +205,7 @@ typedef enum {
/* Path accessors */
-gx_path *gx_current_path(const gs_state *);
+gx_path *gx_current_path(const gs_gstate *);
int gx_path_current_point(const gx_path *, gs_fixed_point *),
gx_path_bbox(gx_path *, gs_fixed_rect *),
gx_path_bbox_set(gx_path *, gs_fixed_rect *);
@@ -233,13 +233,13 @@ gx_path_is_rectangular(const gx_path *, gs_fixed_rect *);
/* Path transformers */
-/* The imager state is only needed when flattening for stroke. */
-#ifndef gs_imager_state_DEFINED
-# define gs_imager_state_DEFINED
-typedef struct gs_imager_state_s gs_imager_state;
+/* The gs_gstate is only needed when flattening for stroke. */
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
int gx_path_copy_reducing(const gx_path * ppath_old, gx_path * ppath_new,
- fixed fixed_flatness, const gs_imager_state *pis,
+ fixed fixed_flatness, const gs_gstate *pgs,
gx_path_copy_options options);
#define gx_path_copy(old, new)\
@@ -247,12 +247,12 @@ int gx_path_copy_reducing(const gx_path * ppath_old, gx_path * ppath_new,
#define gx_path_add_flattened_accurate(old, new, flatness, accurate)\
gx_path_copy_reducing(old, new, float2fixed(flatness), NULL,\
(accurate ? pco_accurate : pco_none))
-#define gx_path_add_flattened_for_stroke(old, new, flatness, pis)\
- gx_path_copy_reducing(old, new, float2fixed(flatness), pis,\
- (pis->accurate_curves ?\
+#define gx_path_add_flattened_for_stroke(old, new, flatness, pgs)\
+ gx_path_copy_reducing(old, new, float2fixed(flatness), pgs,\
+ (pgs->accurate_curves ?\
pco_accurate | pco_for_stroke : pco_for_stroke))
int gx_path_add_dash_expansion(const gx_path * /*old*/, gx_path * /*new*/,
- const gs_imager_state *),
+ const gs_gstate *),
gx_path_copy_reversed(const gx_path * /*old*/, gx_path * /*new*/),
gx_path_append_reversed(const gx_path * /*orig*/, gx_path * /*rev*/),
gx_path_translate(gx_path *, fixed, fixed),
@@ -273,8 +273,8 @@ gx_path_enum_notes(const gs_path_enum *);
bool gx_path_enum_backup(gs_path_enum *);
/* An auxiliary function to add a path point with a specified transformation. */
-int gs_moveto_aux(gs_imager_state *pis, gx_path *ppath, double x, double y);
-int gx_setcurrentpoint_from_path(gs_imager_state *pis, gx_path *path);
+int gs_moveto_aux(gs_gstate *pgs, gx_path *ppath, double x, double y);
+int gx_setcurrentpoint_from_path(gs_gstate *pgs, gx_path *path);
/* Path optimization for the filling algorithm. */
@@ -289,11 +289,11 @@ typedef struct gx_clip_path_s gx_clip_path;
#endif
/* Graphics state clipping */
-int gx_clip_to_rectangle(gs_state *, gs_fixed_rect *);
-int gx_clip_to_path(gs_state *);
-int gx_default_clip_box(const gs_state *, gs_fixed_rect *);
-int gx_effective_clip_path(gs_state *, gx_clip_path **);
-int gx_curr_bbox(gs_state * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type);
+int gx_clip_to_rectangle(gs_gstate *, gs_fixed_rect *);
+int gx_clip_to_path(gs_gstate *);
+int gx_default_clip_box(const gs_gstate *, gs_fixed_rect *);
+int gx_effective_clip_path(gs_gstate *, gx_clip_path **);
+int gx_curr_bbox(gs_gstate * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type);
/* Opaque type for a clip list. */
@@ -352,11 +352,11 @@ int gx_cpath_assign_free(gx_clip_path * pcpto, gx_clip_path * pcpfrom);
int
gx_cpath_reset(gx_clip_path *), /* from_rectangle ((0,0),(0,0)) */
gx_cpath_from_rectangle(gx_clip_path *, gs_fixed_rect *),
- gx_cpath_clip(gs_state *, gx_clip_path *, /*const*/ gx_path *, int),
+ gx_cpath_clip(gs_gstate *, gx_clip_path *, /*const*/ gx_path *, int),
gx_cpath_intersect(gx_clip_path *, /*const*/ gx_path *, int,
- gs_imager_state *),
+ gs_gstate *),
gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_orig,
- int rule, gs_imager_state *pis, const gx_fill_params * params),
+ int rule, gs_gstate *pgs, const gx_fill_params * params),
gx_cpath_scale_exp2_shared(gx_clip_path *pcpath, int log2_scale_x,
int log2_scale_y, bool list_shared,
bool segments_shared),
diff --git a/base/gxpcmap.c b/base/gxpcmap.c
index b2fa14325..74efc6533 100644
--- a/base/gxpcmap.c
+++ b/base/gxpcmap.c
@@ -531,7 +531,7 @@ pattern_accum_close(gx_device * dev)
/* _hl_color */
static int
pattern_accum_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
- const gs_imager_state *pis,
+ const gs_gstate *pgs,
const gx_drawing_color *pdcolor,
const gx_clip_path *pcpath)
{
@@ -539,7 +539,7 @@ pattern_accum_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
if (padev->bits)
(*dev_proc(padev->target, fill_rectangle_hl_color))
- (padev->target, rect, pis, pdcolor, pcpath);
+ (padev->target, rect, pgs, pdcolor, pcpath);
if (padev->mask) {
int x, y, w, h;
@@ -837,17 +837,17 @@ gx_pattern_alloc_cache(gs_memory_t * mem, uint num_tiles, ulong max_bits)
}
/* Ensure that an imager has a Pattern cache. */
static int
-ensure_pattern_cache(gs_imager_state * pis)
+ensure_pattern_cache(gs_gstate * pgs)
{
- if (pis->pattern_cache == 0) {
+ if (pgs->pattern_cache == 0) {
gx_pattern_cache *pcache =
- gx_pattern_alloc_cache(pis->memory,
+ gx_pattern_alloc_cache(pgs->memory,
gx_pat_cache_default_tiles(),
gx_pat_cache_default_bits());
if (pcache == 0)
return_error(gs_error_VMerror);
- pis->pattern_cache = pcache;
+ pgs->pattern_cache = pcache;
}
return 0;
}
@@ -864,12 +864,12 @@ gx_pattern_cache_free(gx_pattern_cache *pcache)
/* Get and set the Pattern cache in a gstate. */
gx_pattern_cache *
-gstate_pattern_cache(gs_state * pgs)
+gstate_pattern_cache(gs_gstate * pgs)
{
return pgs->pattern_cache;
}
void
-gstate_set_pattern_cache(gs_state * pgs, gx_pattern_cache * pcache)
+gstate_set_pattern_cache(gs_gstate * pgs, gx_pattern_cache * pcache)
{
pgs->pattern_cache = pcache;
}
@@ -955,15 +955,15 @@ gx_pattern_cache_free_entry(gx_pattern_cache * pcache, gx_color_tile * ctile)
/* enough space is available (or nothing left to free). */
/* This will allow 1 oversized entry */
void
-gx_pattern_cache_ensure_space(gs_imager_state * pis, int needed)
+gx_pattern_cache_ensure_space(gs_gstate * pgs, int needed)
{
- int code = ensure_pattern_cache(pis);
+ int code = ensure_pattern_cache(pgs);
gx_pattern_cache *pcache;
if (code < 0)
return; /* no cache -- just exit */
- pcache = pis->pattern_cache;
+ pcache = pgs->pattern_cache;
/* If too large then start freeing entries */
/* By starting at 'next', we attempt to first free the oldest entries */
@@ -976,9 +976,9 @@ gx_pattern_cache_ensure_space(gs_imager_state * pis, int needed)
/* Export updating the pattern_cache bits_used and tiles_used for clist reading */
void
-gx_pattern_cache_update_used(gs_imager_state *pis, ulong used)
+gx_pattern_cache_update_used(gs_gstate *pgs, ulong used)
{
- gx_pattern_cache *pcache = pis->pattern_cache;
+ gx_pattern_cache *pcache = pgs->pattern_cache;
pcache->bits_used += used;
pcache->tiles_used++;
@@ -992,7 +992,7 @@ gx_pattern_cache_update_used(gs_imager_state *pis, ulong used)
*/
static void make_bitmap(gx_strip_bitmap *, const gx_device_memory *, gx_bitmap_id);
int
-gx_pattern_cache_add_entry(gs_imager_state * pis,
+gx_pattern_cache_add_entry(gs_gstate * pgs,
gx_device_forward * fdev, gx_color_tile ** pctile)
{
gx_pattern_cache *pcache;
@@ -1000,17 +1000,16 @@ gx_pattern_cache_add_entry(gs_imager_state * pis,
ulong used = 0, mask_used = 0, trans_used = 0;
gx_bitmap_id id;
gx_color_tile *ctile;
- int code = ensure_pattern_cache(pis);
+ int code = ensure_pattern_cache(pgs);
extern dev_proc_open_device(pattern_clist_open_device);
gx_device_memory *mmask = NULL;
gx_device_memory *mbits = NULL;
gx_pattern_trans_t *trans = NULL;
int size_b, size_c;
- gs_state *pgs = (gs_state *)pis;
if (code < 0)
return code;
- pcache = pis->pattern_cache;
+ pcache = pgs->pattern_cache;
if (fdev->procs.open_device != pattern_clist_open_device) {
gx_device_pattern_accum *padev = (gx_device_pattern_accum *)fdev;
@@ -1089,7 +1088,7 @@ gx_pattern_cache_add_entry(gs_imager_state * pis,
ctile->blending_mode = 0;
if (fdev->procs.open_device != pattern_clist_open_device) {
if (mbits != 0) {
- make_bitmap(&ctile->tbits, mbits, gs_next_ids(pis->memory, 1));
+ make_bitmap(&ctile->tbits, mbits, gs_next_ids(pgs->memory, 1));
mbits->bitmap_memory = 0; /* don't free the bits */
} else
ctile->tbits.data = 0;
@@ -1099,7 +1098,7 @@ gx_pattern_cache_add_entry(gs_imager_state * pis,
} else
ctile->tmask.data = 0;
if (trans != 0) {
- if_debug2m('?', pis->memory,
+ if_debug2m('?', pgs->memory,
"[v*] Adding trans pattern to cache, uid = %ld id = %ld \n",
ctile->uid.id, ctile->id);
ctile->ttrans = trans;
@@ -1125,7 +1124,7 @@ gx_pattern_cache_add_entry(gs_imager_state * pis,
* going in and coming out of the cache. Therefore we store the used
* figure in the tile so we always remove the same amount. */
ctile->bits_used = used;
- gx_pattern_cache_update_used(pis, used);
+ gx_pattern_cache_update_used(pgs, used);
*pctile = ctile;
return 0;
@@ -1133,17 +1132,17 @@ gx_pattern_cache_add_entry(gs_imager_state * pis,
/* Get entry for reading a pattern from clist. */
int
-gx_pattern_cache_get_entry(gs_imager_state * pis, gs_id id, gx_color_tile ** pctile)
+gx_pattern_cache_get_entry(gs_gstate * pgs, gs_id id, gx_color_tile ** pctile)
{
gx_pattern_cache *pcache;
gx_color_tile *ctile;
- int code = ensure_pattern_cache(pis);
+ int code = ensure_pattern_cache(pgs);
if (code < 0)
return code;
- pcache = pis->pattern_cache;
+ pcache = pgs->pattern_cache;
ctile = &pcache->tiles[id % pcache->num_tiles];
- gx_pattern_cache_free_entry(pis->pattern_cache, ctile);
+ gx_pattern_cache_free_entry(pgs->pattern_cache, ctile);
ctile->id = id;
*pctile = ctile;
return 0;
@@ -1158,17 +1157,17 @@ gx_pattern_tile_is_clist(gx_color_tile *ptile)
/* Add a dummy Pattern cache entry. Stubs a pattern tile for interpreter when
device handles high level patterns. */
int
-gx_pattern_cache_add_dummy_entry(gs_imager_state *pis,
+gx_pattern_cache_add_dummy_entry(gs_gstate *pgs,
gs_pattern1_instance_t *pinst, int depth)
{
gx_color_tile *ctile;
gx_pattern_cache *pcache;
gx_bitmap_id id = pinst->id;
- int code = ensure_pattern_cache(pis);
+ int code = ensure_pattern_cache(pgs);
if (code < 0)
return code;
- pcache = pis->pattern_cache;
+ pcache = pgs->pattern_cache;
ctile = &pcache->tiles[id % pcache->num_tiles];
gx_pattern_cache_free_entry(pcache, ctile);
ctile->id = id;
@@ -1323,7 +1322,7 @@ gx_pattern_cache_winnow(gx_pattern_cache * pcache,
/* blank the pattern accumulator device assumed to be in the graphics
state */
int
-gx_erase_colored_pattern(gs_state *pgs)
+gx_erase_colored_pattern(gs_gstate *pgs)
{
int code;
gx_device_pattern_accum *pdev = (gx_device_pattern_accum *)gs_currentdevice(pgs);
@@ -1361,45 +1360,45 @@ gx_erase_colored_pattern(gs_state *pgs)
/* Reload a (non-null) Pattern color into the cache. */
/* *pdc is already set, except for colors.pattern.p_tile and mask.m_tile. */
int
-gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis,
+gx_pattern_load(gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
gx_device_forward *adev = NULL;
gs_pattern1_instance_t *pinst =
(gs_pattern1_instance_t *)pdc->ccolor.pattern;
- gs_state *saved;
+ gs_gstate *saved;
gx_color_tile *ctile;
- gs_memory_t *mem = pis->memory;
+ gs_memory_t *mem = pgs->memory;
bool has_tags = (dev->graphics_type_tag & GS_DEVICE_ENCODES_TAGS) != 0;
int code;
- if (pis->pattern_cache == NULL)
- if ((code = ensure_pattern_cache((gs_imager_state *) pis))< 0) /* break const for call */
+ if (pgs->pattern_cache == NULL)
+ if ((code = ensure_pattern_cache((gs_gstate *) pgs))< 0) /* break const for call */
return code;
- if (gx_pattern_cache_lookup(pdc, pis, dev, select))
+ if (gx_pattern_cache_lookup(pdc, pgs, dev, select))
return 0;
/* Get enough space in the cache for this pattern (estimated if it is a clist) */
- gx_pattern_cache_ensure_space((gs_imager_state *)pis, gx_pattern_size_estimate(pinst, has_tags));
+ gx_pattern_cache_ensure_space((gs_gstate *)pgs, gx_pattern_size_estimate(pinst, has_tags));
/*
* Note that adev is an internal device, so it will be freed when the
* last reference to it from a graphics state is deleted.
*/
- adev = gx_pattern_accum_alloc(mem, pis->pattern_cache->memory, pinst, "gx_pattern_load");
+ adev = gx_pattern_accum_alloc(mem, pgs->pattern_cache->memory, pinst, "gx_pattern_load");
if (adev == 0)
return_error(gs_error_VMerror);
gx_device_set_target((gx_device_forward *)adev, dev);
code = dev_proc(adev, open_device)((gx_device *)adev);
if (code < 0)
goto fail;
- saved = gs_gstate(pinst->saved);
+ saved = gs_gstate_copy(pinst->saved, pinst->saved->memory);
if (saved == 0) {
code = gs_note_error(gs_error_VMerror);
goto fail;
}
if (saved->pattern_cache == 0)
- saved->pattern_cache = pis->pattern_cache;
+ saved->pattern_cache = pgs->pattern_cache;
gs_setdevice_no_init(saved, (gx_device *)adev);
if (pinst->templat.uses_transparency) {
if_debug0m('v', mem, "gx_pattern_load: pushing the pdf14 compositor device into this graphics state\n");
@@ -1423,7 +1422,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis,
if (code < 0) {
/* RJW: At this point, in the non transparency case,
* saved->device == adev. So unretain it, close it, and the
- * gs_state_free(saved) will remove it. In the transparency case,
+ * gs_gstate_free(saved) will remove it. In the transparency case,
* saved->device = the pdf14 device. So we need to unretain it,
* close adev, and finally close saved->device
* (which frees adev). */
@@ -1437,7 +1436,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis,
}
dev_proc(saved->device, close_device)((gx_device *)saved->device);
/* Freeing the state should now free the device which may be the pdf14 compositor. */
- gs_state_free(saved);
+ gs_gstate_free(saved);
return code;
}
if (pinst->templat.uses_transparency) {
@@ -1463,10 +1462,10 @@ gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis,
}
}
/* We REALLY don't like the following cast.... */
- code = gx_pattern_cache_add_entry((gs_imager_state *)pis,
+ code = gx_pattern_cache_add_entry((gs_gstate *)pgs,
adev, &ctile);
if (code >= 0) {
- if (!gx_pattern_cache_lookup(pdc, pis, dev, select)) {
+ if (!gx_pattern_cache_lookup(pdc, pgs, dev, select)) {
mlprintf(mem, "Pattern cache lookup failed after insertion!\n");
code = gs_note_error(gs_error_Fatal);
}
@@ -1490,7 +1489,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis,
/* data iff they are still needed. */
dev_proc(adev, close_device)((gx_device *)adev);
/* Free the chain of gstates. Freeing the state will free the device. */
- gs_state_free_chain(saved);
+ gs_gstate_free_chain(saved);
return code;
fail:
if (adev->procs.open_device == pattern_clist_open_device) {
@@ -1507,7 +1506,7 @@ fail:
cs_proc_remap_color(gx_remap_Pattern); /* check the prototype */
int
gs_pattern1_remap_color(const gs_client_color * pc, const gs_color_space * pcs,
- gx_device_color * pdc, const gs_imager_state * pis,
+ gx_device_color * pdc, const gs_gstate * pgs,
gx_device * dev, gs_color_select_t select)
{
gs_pattern1_instance_t *pinst = (gs_pattern1_instance_t *)pc->pattern;
@@ -1523,7 +1522,7 @@ gs_pattern1_remap_color(const gs_client_color * pc, const gs_color_space * pcs,
}
if (pinst->templat.PaintType == 2) { /* uncolored */
code = (pcs->base_space->type->remap_color)
- (pc, pcs->base_space, pdc, pis, dev, select);
+ (pc, pcs->base_space, pdc, pgs, dev, select);
if (code < 0)
return code;
if (pdc->type == gx_dc_type_pure)
@@ -1540,7 +1539,7 @@ gs_pattern1_remap_color(const gs_client_color * pc, const gs_color_space * pcs,
color_set_null_pattern(pdc);
pdc->mask.id = pinst->id;
pdc->mask.m_tile = 0;
- return gx_pattern_load(pdc, pis, dev, select);
+ return gx_pattern_load(pdc, pgs, dev, select);
}
int
diff --git a/base/gxpcolor.h b/base/gxpcolor.h
index 1d3f434b4..caee8465d 100644
--- a/base/gxpcolor.h
+++ b/base/gxpcolor.h
@@ -66,7 +66,7 @@ struct gs_pattern_type_s {
#define pattern_proc_make_pattern(proc)\
int proc(gs_client_color *, const gs_pattern_template_t *,\
- const gs_matrix *, gs_state *, gs_memory_t *)
+ const gs_matrix *, gs_gstate *, gs_memory_t *)
pattern_proc_make_pattern((*make_pattern));
@@ -96,7 +96,7 @@ struct gs_pattern_type_s {
* pattern instance specifies a color space.
*/
#define pattern_proc_set_color(proc)\
- int proc(const gs_client_color *, gs_state *)
+ int proc(const gs_client_color *, gs_gstate *)
pattern_proc_set_color((*set_color));
@@ -115,7 +115,7 @@ void gs_pattern_common_init(gs_pattern_template_t *,
* saved graphics state, and fill in the common members.
*/
int gs_make_pattern_common(gs_client_color *, const gs_pattern_template_t *,
- const gs_matrix *, gs_state *, gs_memory_t *,
+ const gs_matrix *, gs_gstate *, gs_memory_t *,
gs_memory_type_ptr_t);
/* Declare the freeing procedure for Pattern instances. */
@@ -257,8 +257,8 @@ gx_pattern_cache *gx_pattern_alloc_cache(gs_memory_t *, uint, ulong);
void gx_pattern_cache_free(gx_pattern_cache *pcache);
/* Get or set the Pattern cache in a gstate. */
-gx_pattern_cache *gstate_pattern_cache(gs_state *);
-void gstate_set_pattern_cache(gs_state *, gx_pattern_cache *);
+gx_pattern_cache *gstate_pattern_cache(gs_gstate *);
+void gstate_set_pattern_cache(gs_gstate *, gx_pattern_cache *);
/*
* Define a device for accumulating the rendering of a Pattern.
@@ -301,29 +301,29 @@ bool gx_device_is_pattern_accum(gx_device *dev);
/* Given the size of a new pattern tile, free entries from the cache until */
/* enough space is available (or nothing left to free). */
/* This will allow 1 oversized entry */
-void gx_pattern_cache_ensure_space(gs_imager_state * pis, int needed);
+void gx_pattern_cache_ensure_space(gs_gstate * pgs, int needed);
-void gx_pattern_cache_update_used(gs_imager_state *pis, ulong used);
+void gx_pattern_cache_update_used(gs_gstate *pgs, ulong used);
/* Update cache tile space */
-void gx_pattern_cache_update_space(gs_imager_state * pis, int64_t used);
+void gx_pattern_cache_update_space(gs_gstate * pgs, int64_t used);
/* Add an accumulated pattern to the cache. */
/* Note that this does not free any of the data in the accumulator */
/* device, but it may zero out the bitmap_memory pointers to prevent */
/* the accumulated bitmaps from being freed when the device is closed. */
-int gx_pattern_cache_add_entry(gs_imager_state *, gx_device_forward *,
+int gx_pattern_cache_add_entry(gs_gstate *, gx_device_forward *,
gx_color_tile **);
/* Add a dummy Pattern cache entry. Stubs a pattern tile for interpreter when
device handles high level patterns. */
-int gx_pattern_cache_add_dummy_entry(gs_imager_state *pis, gs_pattern1_instance_t *pinst,
+int gx_pattern_cache_add_dummy_entry(gs_gstate *pgs, gs_pattern1_instance_t *pinst,
int depth);
/* Get entry for reading a pattern from clist. */
-int gx_pattern_cache_get_entry(gs_imager_state * pis, gs_id id, gx_color_tile ** pctile);
+int gx_pattern_cache_get_entry(gs_gstate * pgs, gs_id id, gx_color_tile ** pctile);
/* Look up a pattern color in the cache. */
-bool gx_pattern_cache_lookup(gx_device_color *, const gs_imager_state *,
+bool gx_pattern_cache_lookup(gx_device_color *, const gs_gstate *,
gx_device *, gs_color_select_t);
/* Purge selected entries from the pattern cache. */
@@ -359,6 +359,6 @@ void tile_rect_trans_blend(int xmin, int ymin, int xmax, int ymax, int px,
gx_pattern_trans_t *fill_trans_buffer);
/* File a colored pattern with white */
-int gx_erase_colored_pattern(gs_state *pgs);
+int gx_erase_colored_pattern(gs_gstate *pgs);
#endif /* gxpcolor_INCLUDED */
diff --git a/base/gxpcopy.c b/base/gxpcopy.c
index efd0c39fa..02a17e672 100644
--- a/base/gxpcopy.c
+++ b/base/gxpcopy.c
@@ -20,7 +20,7 @@
#include "gserrors.h"
#include "gxfixed.h"
#include "gxfarith.h"
-#include "gxistate.h" /* for access to line params */
+#include "gxgstate.h" /* for access to line params */
#include "gzpath.h"
#include "vdtrace.h"
@@ -85,7 +85,7 @@ break_gap_if_long(gx_path *ppath, const segment *pseg)
/* If the copy fails, free the new path. */
int
gx_path_copy_reducing(const gx_path *ppath_old, gx_path *ppath,
- fixed fixed_flatness, const gs_imager_state *pis,
+ fixed fixed_flatness, const gs_gstate *pgs,
gx_path_copy_options options)
{
const segment *pseg;
@@ -105,12 +105,12 @@ gx_path_copy_reducing(const gx_path *ppath_old, gx_path *ppath,
#endif
if (options & pco_for_stroke) {
/* Precompute the maximum expansion of the bounding box. */
- double width = pis->line_params.half_width;
+ double width = pgs->line_params.half_width;
expansion.x =
- float2fixed((fabs(pis->ctm.xx) + fabs(pis->ctm.yx)) * width) * 2;
+ float2fixed((fabs(pgs->ctm.xx) + fabs(pgs->ctm.yx)) * width) * 2;
expansion.y =
- float2fixed((fabs(pis->ctm.xy) + fabs(pis->ctm.yy)) * width) * 2;
+ float2fixed((fabs(pgs->ctm.xy) + fabs(pgs->ctm.yy)) * width) * 2;
} else
expansion.x = expansion.y = 0; /* Quiet gcc warning. */
vd_setcolor(RGB(255,255,0));
diff --git a/base/gxpdash.c b/base/gxpdash.c
index 5f857c43a..ced7618cd 100644
--- a/base/gxpdash.c
+++ b/base/gxpdash.c
@@ -21,7 +21,7 @@
#include "gscoord.h"
#include "gxfixed.h"
#include "gxarith.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gsline.h"
#include "gzline.h"
#include "gzpath.h"
@@ -29,14 +29,14 @@
/* Expand a dashed path into explicit segments. */
/* The path contains no curves. */
static int subpath_expand_dashes(const subpath *, gx_path *,
- const gs_imager_state *,
+ const gs_gstate *,
const gx_dash_params *);
int
gx_path_add_dash_expansion(const gx_path * ppath_old, gx_path * ppath,
- const gs_imager_state * pis)
+ const gs_gstate * pgs)
{
const subpath *psub;
- const gx_dash_params *dash = &gs_currentlineparams(pis)->dash;
+ const gx_dash_params *dash = &gs_currentlineparams(pgs)->dash;
int code = 0;
if (dash->pattern_size == 0)
@@ -44,13 +44,13 @@ gx_path_add_dash_expansion(const gx_path * ppath_old, gx_path * ppath,
for (psub = ppath_old->first_subpath; psub != 0 && code >= 0;
psub = (const subpath *)psub->last->next
)
- code = subpath_expand_dashes(psub, ppath, pis, dash);
+ code = subpath_expand_dashes(psub, ppath, pgs, dash);
return code;
}
static int
subpath_expand_dashes(const subpath * psub, gx_path * ppath,
- const gs_imager_state * pis, const gx_dash_params * dash)
+ const gs_gstate * pgs, const gx_dash_params * dash)
{
const float *pattern = dash->pattern;
int count, index;
@@ -62,7 +62,7 @@ subpath_expand_dashes(const subpath * psub, gx_path * ppath,
int wrap = (dash->init_ink_on && psub->is_closed ? -1 : 0);
int drawing = wrap;
segment_notes notes = ~sn_not_first;
- const gx_line_params *pgs_lp = gs_currentlineparams_inline(pis);
+ const gx_line_params *pgs_lp = gs_currentlineparams_inline(pgs);
bool zero_length = true;
int code;
gs_line_cap cap;
@@ -116,14 +116,14 @@ subpath_expand_dashes(const subpath * psub, gx_path * ppath,
zero_length = false;
dx = udx, dy = udy; /* scaled as fixed */
- code = gs_imager_idtransform(pis, dx, dy, &d);
+ code = gs_gstate_idtransform(pgs, dx, dy, &d);
if (code < 0) {
d.x = 0; d.y = 0;
/* Swallow the error */
code = 0;
}
length = hypot(d.x, d.y) * (1.0 / fixed_1);
- if (gs_imager_currentdashadapt(pis)) {
+ if (gs_gstate_currentdashadapt(pgs)) {
double reps = length / dash->pattern_length;
scale = reps / ceil(reps);
diff --git a/base/gxshade.c b/base/gxshade.c
index 09100130f..ded1bb857 100644
--- a/base/gxshade.c
+++ b/base/gxshade.c
@@ -23,7 +23,7 @@
#include "gscindex.h"
#include "gscie.h" /* requires gscspace.h */
#include "gxdevcli.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxdht.h" /* for computing # of different colors */
#include "gxpaint.h"
#include "gxshade.h"
@@ -54,10 +54,10 @@ static bool cs_eod(const shade_coord_stream_t * cs);
void
shade_next_init(shade_coord_stream_t * cs,
const gs_shading_mesh_params_t * params,
- const gs_imager_state * pis)
+ const gs_gstate * pgs)
{
cs->params = params;
- cs->pctm = &pis->ctm;
+ cs->pctm = &pgs->ctm;
if (data_source_is_stream(params->DataSource)) {
/*
* Rewind the data stream iff it is reusable -- either a reusable
@@ -314,10 +314,10 @@ shade_next_vertex(shade_coord_stream_t * cs, shading_vertex_t * vertex, patch_co
/* Initialize the common parts of the recursion state. */
int
shade_init_fill_state(shading_fill_state_t * pfs, const gs_shading_t * psh,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
const gs_color_space *pcs = psh->params.ColorSpace;
- float max_error = min(pis->smoothness, MAX_SMOOTHNESS);
+ float max_error = min(pgs->smoothness, MAX_SMOOTHNESS);
bool is_lab;
bool cs_lin_test;
@@ -334,7 +334,7 @@ shade_init_fill_state(shading_fill_state_t * pfs, const gs_shading_t * psh,
pfs->cs_always_linear = false;
pfs->dev = dev;
- pfs->pis = pis;
+ pfs->pgs = pgs;
top:
pfs->direct_space = pcs;
pfs->num_components = gs_color_space_num_components(pcs);
@@ -363,7 +363,7 @@ top:
}
if (num_colors <= 32) {
/****** WRONG FOR MULTI-PLANE HALFTONES ******/
- num_colors *= pis->dev_ht->components[0].corder.num_levels;
+ num_colors *= pgs->dev_ht->components[0].corder.num_levels;
}
if (psh->head.type == 2 || psh->head.type == 3) {
max_error *= 0.25;
@@ -375,35 +375,35 @@ top:
pfs->cc_max_error[ci] =
(ranges == 0 ? max_error :
max_error * (ranges[ci].rmax - ranges[ci].rmin));
- if (pis->has_transparency && pis->trans_device != NULL) {
- pfs->trans_device = pis->trans_device;
+ if (pgs->has_transparency && pgs->trans_device != NULL) {
+ pfs->trans_device = pgs->trans_device;
} else {
pfs->trans_device = dev;
}
/* If the CS is PS based and we have not yet converted to the ICC form
then go ahead and do that now */
if (gs_color_space_is_PSCIE(pcs) && pcs->icc_equivalent == NULL) {
- gs_colorspace_set_icc_equivalent((gs_color_space *)pcs, &(is_lab), pis->memory);
+ gs_colorspace_set_icc_equivalent((gs_color_space *)pcs, &(is_lab), pgs->memory);
}
- rendering_params.black_point_comp = pis->blackptcomp;
+ rendering_params.black_point_comp = pgs->blackptcomp;
rendering_params.graphics_type_tag = GS_PATH_TAG;
rendering_params.override_icc = false;
rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
- rendering_params.rendering_intent = pis->renderingintent;
+ rendering_params.rendering_intent = pgs->renderingintent;
rendering_params.cmm = gsCMM_DEFAULT;
/* Grab the icc link transform that we need now */
if (pcs->cmm_icc_profile_data != NULL) {
- pfs->icclink = gsicc_get_link(pis, pis->trans_device, pcs, NULL,
- &rendering_params, pis->memory);
+ pfs->icclink = gsicc_get_link(pgs, pgs->trans_device, pcs, NULL,
+ &rendering_params, pgs->memory);
if (pfs->icclink == NULL)
return_error(gs_error_VMerror);
} else {
if (pcs->icc_equivalent != NULL ) {
/* We have a PS equivalent ICC profile. We may need to go
through special range adjustments in this case */
- pfs->icclink = gsicc_get_link(pis, pis->trans_device,
+ pfs->icclink = gsicc_get_link(pgs, pgs->trans_device,
pcs->icc_equivalent, NULL,
- &rendering_params, pis->memory);
+ &rendering_params, pgs->memory);
if (pfs->icclink == NULL)
return_error(gs_error_VMerror);
} else {
@@ -423,14 +423,11 @@ top:
* now, we will punt on those and let them go through the longer processing
* steps */
if (pfs->icclink == NULL)
- if (pis->is_gstate)
- cs_lin_test = !(using_alt_color_space((gs_state*)pis));
- else
- cs_lin_test = false;
+ cs_lin_test = !(using_alt_color_space((gs_gstate*)pgs));
else
cs_lin_test = pfs->icclink->is_identity;
- if (cs_lin_test && !gx_has_transfer(pis, dev->color_info.num_components)) {
+ if (cs_lin_test && !gx_has_transfer(pgs, dev->color_info.num_components)) {
pfs->cs_always_linear = true;
}
return 0;
@@ -446,6 +443,6 @@ shade_fill_path(const shading_fill_state_t * pfs, gx_path * ppath,
params.rule = -1; /* irrelevant */
params.adjust = *fill_adjust;
params.flatness = 0; /* irrelevant */
- return (*dev_proc(pfs->dev, fill_path)) (pfs->dev, pfs->pis, ppath,
+ return (*dev_proc(pfs->dev, fill_path)) (pfs->dev, pfs->pgs, ppath,
&params, pdevc, NULL);
}
diff --git a/base/gxshade.h b/base/gxshade.h
index 4a3547dbc..a18a16171 100644
--- a/base/gxshade.h
+++ b/base/gxshade.h
@@ -140,7 +140,7 @@ typedef struct patch_color_s patch_color_t;
/* Initialize a packed value stream. */
void shade_next_init(shade_coord_stream_t * cs,
const gs_shading_mesh_params_t * params,
- const gs_imager_state * pis);
+ const gs_gstate * pgs);
/* Get the next flag value. */
int shade_next_flag(shade_coord_stream_t * cs, int BitsPerFlag);
@@ -194,7 +194,7 @@ int shade_next_vertex(shade_coord_stream_t * cs, shading_vertex_t * vertex,
*/
#define shading_fill_state_common\
gx_device *dev;\
- gs_imager_state *pis;\
+ gs_gstate *pgs;\
const gs_color_space *direct_space;\
int num_components; /* # of color components in direct_space */\
float cc_max_error[GS_CLIENT_COLOR_MAX_COMPONENTS];\
@@ -209,7 +209,7 @@ typedef struct shading_fill_state_s {
/* Initialize the common parts of the recursion state. */
int shade_init_fill_state(shading_fill_state_t * pfs,
const gs_shading_t * psh, gx_device * dev,
- gs_imager_state * pis);
+ gs_gstate * pgs);
/* Fill one piece of a shading. */
#ifndef gx_device_color_DEFINED
diff --git a/base/gxshade1.c b/base/gxshade1.c
index 39a77128e..ff48d378c 100644
--- a/base/gxshade1.c
+++ b/base/gxshade1.c
@@ -27,7 +27,7 @@
#include "gxdcolor.h"
#include "gxfarith.h"
#include "gxfixed.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpath.h"
#include "gxshade.h"
#include "gxdevcli.h"
@@ -124,7 +124,7 @@ Fb_fill_region(Fb_fill_state_t * pfs, const gs_fixed_rect *rect)
int
gs_shading_Fb_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect * rect_clip,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
const gs_shading_Fb_t * const psh = (const gs_shading_Fb_t *)psh0;
gs_matrix save_ctm;
@@ -132,15 +132,15 @@ gs_shading_Fb_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
float x[2], y[2];
Fb_fill_state_t state;
- code = shade_init_fill_state((shading_fill_state_t *) & state, psh0, dev, pis);
+ code = shade_init_fill_state((shading_fill_state_t *) & state, psh0, dev, pgs);
if (code < 0)
return code;
state.psh = psh;
/****** HACK FOR FIXED-POINT MATRIX MULTIPLY ******/
- gs_currentmatrix((gs_state *) pis, &save_ctm);
- gs_concat((gs_state *) pis, &psh->params.Matrix);
- state.ptm = pis->ctm;
- gs_setmatrix((gs_state *) pis, &save_ctm);
+ gs_currentmatrix((gs_gstate *) pgs, &save_ctm);
+ gs_concat((gs_gstate *) pgs, &psh->params.Matrix);
+ state.ptm = pgs->ctm;
+ gs_setmatrix((gs_gstate *) pgs, &save_ctm);
/* Compute the parameter X and Y ranges. */
{
gs_rect pbox;
@@ -197,10 +197,10 @@ A_fill_region(A_fill_state_t * pfs, patch_fill_state_t *pfs1)
double h0 = pfs->u0, h1 = pfs->u1;
patch_curve_t curve[4];
- gs_point_transform2fixed(&pfs1->pis->ctm, x0 + pfs->delta.y * h0, y0 - pfs->delta.x * h0, &curve[0].vertex.p);
- gs_point_transform2fixed(&pfs1->pis->ctm, x1 + pfs->delta.y * h0, y1 - pfs->delta.x * h0, &curve[1].vertex.p);
- gs_point_transform2fixed(&pfs1->pis->ctm, x1 + pfs->delta.y * h1, y1 - pfs->delta.x * h1, &curve[2].vertex.p);
- gs_point_transform2fixed(&pfs1->pis->ctm, x0 + pfs->delta.y * h1, y0 - pfs->delta.x * h1, &curve[3].vertex.p);
+ gs_point_transform2fixed(&pfs1->pgs->ctm, x0 + pfs->delta.y * h0, y0 - pfs->delta.x * h0, &curve[0].vertex.p);
+ gs_point_transform2fixed(&pfs1->pgs->ctm, x1 + pfs->delta.y * h0, y1 - pfs->delta.x * h0, &curve[1].vertex.p);
+ gs_point_transform2fixed(&pfs1->pgs->ctm, x1 + pfs->delta.y * h1, y1 - pfs->delta.x * h1, &curve[2].vertex.p);
+ gs_point_transform2fixed(&pfs1->pgs->ctm, x0 + pfs->delta.y * h1, y0 - pfs->delta.x * h1, &curve[3].vertex.p);
curve[0].vertex.cc[0] = pfs->t0; /* The element cc[1] is set to a dummy value against */
curve[1].vertex.cc[0] = pfs->t1; /* interrupts while an idle priocessing in gxshade.6.c . */
curve[2].vertex.cc[0] = pfs->t1;
@@ -216,7 +216,7 @@ A_fill_region(A_fill_state_t * pfs, patch_fill_state_t *pfs1)
static inline int
gs_shading_A_fill_rectangle_aux(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect *clip_rect,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
const gs_shading_A_t *const psh = (const gs_shading_A_t *)psh0;
gs_function_t * const pfn = psh->params.Function;
@@ -231,7 +231,7 @@ gs_shading_A_fill_rectangle_aux(const gs_shading_t * psh0, const gs_rect * rect,
int code;
state.psh = psh;
- code = shade_init_fill_state((shading_fill_state_t *)&pfs1, psh0, dev, pis);
+ code = shade_init_fill_state((shading_fill_state_t *)&pfs1, psh0, dev, pgs);
if (code < 0)
return code;
pfs1.Function = pfn;
@@ -265,7 +265,7 @@ gs_shading_A_fill_rectangle_aux(const gs_shading_t * psh0, const gs_rect * rect,
state.u1 = t_rect.q.x;
state.t0 = t0 * dd + d0;
state.t1 = t1 * dd + d0;
- gs_distance_transform(state.delta.x, state.delta.y, &ctm_only(pis),
+ gs_distance_transform(state.delta.x, state.delta.y, &ctm_only(pgs),
&dist);
state.length = hypot(dist.x, dist.y); /* device space line length */
code = A_fill_region(&state, &pfs1);
@@ -300,7 +300,7 @@ gs_shading_A_fill_rectangle_aux(const gs_shading_t * psh0, const gs_rect * rect,
int
gs_shading_A_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect * rect_clip,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
int code;
@@ -310,7 +310,7 @@ gs_shading_A_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
vd_set_scale(0.01);
vd_set_origin(0, 0);
}
- code = gs_shading_A_fill_rectangle_aux(psh0, rect, rect_clip, dev, pis);
+ code = gs_shading_A_fill_rectangle_aux(psh0, rect, rect_clip, dev, pgs);
if (VD_TRACE_AXIAL_PATCH && vd_allowed('s'))
vd_release_dc;
return code;
@@ -432,14 +432,14 @@ R_tensor_annulus(patch_fill_state_t *pfs,
for (j = 0; j < 4; j++) {
int jj = (j + inside) % 4;
- if (gs_point_transform2fixed(&pfs->pis->ctm, p[j*3 + 0].x, p[j*3 + 0].y, &curve[jj].vertex.p) < 0)
- gs_point_transform2fixed_clamped(&pfs->pis->ctm, p[j*3 + 0].x, p[j*3 + 0].y, &curve[jj].vertex.p);
+ if (gs_point_transform2fixed(&pfs->pgs->ctm, p[j*3 + 0].x, p[j*3 + 0].y, &curve[jj].vertex.p) < 0)
+ gs_point_transform2fixed_clamped(&pfs->pgs->ctm, p[j*3 + 0].x, p[j*3 + 0].y, &curve[jj].vertex.p);
- if (gs_point_transform2fixed(&pfs->pis->ctm, p[j*3 + 1].x, p[j*3 + 1].y, &curve[jj].control[0]) < 0)
- gs_point_transform2fixed_clamped(&pfs->pis->ctm, p[j*3 + 1].x, p[j*3 + 1].y, &curve[jj].control[0]);
+ if (gs_point_transform2fixed(&pfs->pgs->ctm, p[j*3 + 1].x, p[j*3 + 1].y, &curve[jj].control[0]) < 0)
+ gs_point_transform2fixed_clamped(&pfs->pgs->ctm, p[j*3 + 1].x, p[j*3 + 1].y, &curve[jj].control[0]);
- if (gs_point_transform2fixed(&pfs->pis->ctm, p[j*3 + 2].x, p[j*3 + 2].y, &curve[jj].control[1]) < 0)
- gs_point_transform2fixed_clamped(&pfs->pis->ctm, p[j*3 + 2].x, p[j*3 + 2].y, &curve[jj].control[1]);
+ if (gs_point_transform2fixed(&pfs->pgs->ctm, p[j*3 + 2].x, p[j*3 + 2].y, &curve[jj].control[1]) < 0)
+ gs_point_transform2fixed_clamped(&pfs->pgs->ctm, p[j*3 + 2].x, p[j*3 + 2].y, &curve[jj].control[1]);
curve[j].straight = (((j + inside) & 1) != 0);
}
curve[(0 + inside) % 4].vertex.cc[0] = t0;
@@ -557,11 +557,11 @@ R_fill_triangle_new(patch_fill_state_t *pfs, const gs_rect *rect,
p0.c = c;
p1.c = c;
p2.c = c;
- code = gs_point_transform2fixed(&pfs->pis->ctm, x0, y0, &p0.p);
+ code = gs_point_transform2fixed(&pfs->pgs->ctm, x0, y0, &p0.p);
if (code >= 0)
- code = gs_point_transform2fixed(&pfs->pis->ctm, x1, y1, &p1.p);
+ code = gs_point_transform2fixed(&pfs->pgs->ctm, x1, y1, &p1.p);
if (code >= 0)
- code = gs_point_transform2fixed(&pfs->pis->ctm, x2, y2, &p2.p);
+ code = gs_point_transform2fixed(&pfs->pgs->ctm, x2, y2, &p2.p);
if (code >= 0) {
c->t[0] = c->t[1] = t;
patch_resolve_color(c, pfs);
@@ -802,7 +802,7 @@ R_fill_rect_with_const_color(patch_fill_state_t *pfs, const gs_fixed_rect *clip_
return gx_fill_rectangle_device_rop(fixed2int_pixround(clip_rect->p.x), fixed2int_pixround(clip_rect->p.y),
fixed2int_pixround(clip_rect->q.x) - fixed2int_pixround(clip_rect->p.x),
fixed2int_pixround(clip_rect->q.y) - fixed2int_pixround(clip_rect->p.y),
- &dc, pfs->dev, pfs->pis->log_op);
+ &dc, pfs->dev, pfs->pgs->log_op);
#else
/* Can't apply fill_rectangle, because the clist writer device doesn't pass
the clipping path with fill_recatangle. Convert into trapezoids instead.
@@ -1224,7 +1224,7 @@ is_radial_shading_large(double x0, double y0, double r0, double x1, double y1, d
static int
gs_shading_R_fill_rectangle_aux(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect *clip_rect,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
const gs_shading_R_t *const psh = (const gs_shading_R_t *)psh0;
float d0 = psh->params.Domain[0], d1 = psh->params.Domain[1];
@@ -1239,7 +1239,7 @@ gs_shading_R_fill_rectangle_aux(const gs_shading_t * psh0, const gs_rect * rect,
if (r0 == 0 && r1 == 0)
return 0; /* PLRM requires to paint nothing. */
- code = shade_init_fill_state((shading_fill_state_t *)&pfs1, psh0, dev, pis);
+ code = shade_init_fill_state((shading_fill_state_t *)&pfs1, psh0, dev, pgs);
if (code < 0)
return code;
pfs1.Function = psh->params.Function;
@@ -1308,7 +1308,7 @@ gs_shading_R_fill_rectangle_aux(const gs_shading_t * psh0, const gs_rect * rect,
int
gs_shading_R_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect * rect_clip,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
int code;
@@ -1318,7 +1318,7 @@ gs_shading_R_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
vd_set_scale(0.01);
vd_set_origin(0, 0);
}
- code = gs_shading_R_fill_rectangle_aux(psh0, rect, rect_clip, dev, pis);
+ code = gs_shading_R_fill_rectangle_aux(psh0, rect, rect_clip, dev, pgs);
if (VD_TRACE_FUNCTIONAL_PATCH && vd_allowed('s'))
vd_release_dc;
return code;
diff --git a/base/gxshade4.c b/base/gxshade4.c
index 80efd34da..fc780ac8e 100644
--- a/base/gxshade4.c
+++ b/base/gxshade4.c
@@ -25,7 +25,7 @@
#include "gxcspace.h"
#include "gxdcolor.h"
#include "gxdevcli.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpath.h"
#include "gxshade.h"
#include "gxshade4.h"
@@ -38,11 +38,11 @@
int
mesh_init_fill_state(mesh_fill_state_t * pfs, const gs_shading_mesh_t * psh,
const gs_fixed_rect * rect_clip, gx_device * dev,
- gs_imager_state * pis)
+ gs_gstate * pgs)
{
int code;
code = shade_init_fill_state((shading_fill_state_t *) pfs,
- (const gs_shading_t *)psh, dev, pis);
+ (const gs_shading_t *)psh, dev, pgs);
if (code < 0)
return code;
pfs->pshm = psh;
@@ -90,7 +90,7 @@ Gt_fill_triangle(patch_fill_state_t * pfs, const shading_vertex_t * va,
int
gs_shading_FfGt_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect * rect_clip,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
const gs_shading_FfGt_t * const psh = (const gs_shading_FfGt_t *)psh0;
patch_fill_state_t pfs;
@@ -110,7 +110,7 @@ gs_shading_FfGt_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
vd_set_origin(0, 0);
}
code = shade_init_fill_state((shading_fill_state_t *)&pfs,
- (const gs_shading_t *)psh, dev, pis);
+ (const gs_shading_t *)psh, dev, pgs);
if (code < 0)
return code;
pfs.Function = pshm->params.Function;
@@ -125,7 +125,7 @@ gs_shading_FfGt_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
vb.c = cb = C[1];
vc.c = cc = C[2];
shade_next_init(&cs, (const gs_shading_mesh_params_t *)&psh->params,
- pis);
+ pgs);
/* CET 09-47J.PS SpecialTestI04Test01 does not need the color data alignment. */
while ((flag = shade_next_flag(&cs, num_bits)) >= 0) {
switch (flag) {
@@ -170,7 +170,7 @@ v2: if ((code = Gt_next_vertex(pshm, &cs, &vc, cc)) < 0)
int
gs_shading_LfGt_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect * rect_clip,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
const gs_shading_LfGt_t * const psh = (const gs_shading_LfGt_t *)psh0;
patch_fill_state_t pfs;
@@ -191,7 +191,7 @@ gs_shading_LfGt_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
vd_set_origin(0, 0);
}
code = shade_init_fill_state((shading_fill_state_t *)&pfs,
- (const gs_shading_t *)psh, dev, pis);
+ (const gs_shading_t *)psh, dev, pgs);
if (code < 0)
return code;
pfs.Function = pshm->params.Function;
@@ -202,20 +202,20 @@ gs_shading_LfGt_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
reserve_colors(&pfs, &cn, 1); /* Can't fail. */
next.c = cn;
shade_next_init(&cs, (const gs_shading_mesh_params_t *)&psh->params,
- pis);
+ pgs);
vertex = (shading_vertex_t *)
- gs_alloc_byte_array(pis->memory, per_row, sizeof(*vertex),
+ gs_alloc_byte_array(pgs->memory, per_row, sizeof(*vertex),
"gs_shading_LfGt_render");
if (vertex == NULL) {
code = gs_note_error(gs_error_VMerror);
goto out;
}
- color_buffer = gs_alloc_bytes(pis->memory, pfs.color_stack_step * per_row, "gs_shading_LfGt_fill_rectangle");
+ color_buffer = gs_alloc_bytes(pgs->memory, pfs.color_stack_step * per_row, "gs_shading_LfGt_fill_rectangle");
if (color_buffer == NULL) {
code = gs_note_error(gs_error_VMerror);
goto out;
}
- color_buffer_ptrs = (patch_color_t **)gs_alloc_bytes(pis->memory,
+ color_buffer_ptrs = (patch_color_t **)gs_alloc_bytes(pgs->memory,
sizeof(patch_color_t *) * per_row, "gs_shading_LfGt_fill_rectangle");
if (color_buffer_ptrs == NULL) {
code = gs_note_error(gs_error_VMerror);
@@ -255,9 +255,9 @@ gs_shading_LfGt_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
out:
if (VD_TRACE_TRIANGLE_PATCH && vd_allowed('s'))
vd_release_dc;
- gs_free_object(pis->memory, vertex, "gs_shading_LfGt_render");
- gs_free_object(pis->memory, color_buffer, "gs_shading_LfGt_render");
- gs_free_object(pis->memory, color_buffer_ptrs, "gs_shading_LfGt_render");
+ gs_free_object(pgs->memory, vertex, "gs_shading_LfGt_render");
+ gs_free_object(pgs->memory, color_buffer, "gs_shading_LfGt_render");
+ gs_free_object(pgs->memory, color_buffer_ptrs, "gs_shading_LfGt_render");
release_colors(&pfs, pfs.color_stack, 1);
if (pfs.icclink != NULL) gsicc_release_link(pfs.icclink);
if (term_patch_fill_state(&pfs))
diff --git a/base/gxshade4.h b/base/gxshade4.h
index 4ab6b9aed..15add98bf 100644
--- a/base/gxshade4.h
+++ b/base/gxshade4.h
@@ -176,7 +176,7 @@ typedef struct {
int mesh_init_fill_state(mesh_fill_state_t * pfs,
const gs_shading_mesh_t * psh,
const gs_fixed_rect * rect_clip,
- gx_device * dev, gs_imager_state * pis);
+ gx_device * dev, gs_gstate * pgs);
int init_patch_fill_state(patch_fill_state_t *pfs);
bool term_patch_fill_state(patch_fill_state_t *pfs);
diff --git a/base/gxshade6.c b/base/gxshade6.c
index 71a3ebcb3..5fda057ec 100644
--- a/base/gxshade6.c
+++ b/base/gxshade6.c
@@ -27,7 +27,7 @@
#include "gscicach.h"
#include "gxcspace.h"
#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxshade.h"
#include "gxdevcli.h"
#include "gxshade4.h"
@@ -222,7 +222,7 @@ is_linear_color_applicable(const patch_fill_state_t *pfs)
return false;
if (pfs->dev->color_info.separable_and_linear != GX_CINFO_SEP_LIN)
return false;
- if (gx_get_cmap_procs(pfs->pis, pfs->dev)->is_halftoned(pfs->pis, pfs->dev))
+ if (gx_get_cmap_procs(pfs->pgs, pfs->dev)->is_halftoned(pfs->pgs, pfs->dev))
return false;
return true;
}
@@ -245,7 +245,7 @@ alloc_patch_fill_memory(patch_fill_state_t *pfs, gs_memory_t *memory, const gs_c
if (pfs->unlinear || pcs == NULL)
pfs->pcic = NULL;
else {
- pfs->pcic = gs_color_index_cache_create(memory, pcs, pfs->dev, pfs->pis, true, pfs->trans_device);
+ pfs->pcic = gs_color_index_cache_create(memory, pcs, pfs->dev, pfs->pgs, true, pfs->trans_device);
if (pfs->pcic == NULL)
return_error(gs_error_VMerror);
}
@@ -282,19 +282,19 @@ init_patch_fill_state(patch_fill_state_t *pfs)
#else
pfs->decomposition_limit = fixed_1;
#endif
- pfs->fixed_flat = float2fixed(pfs->pis->flatness);
+ pfs->fixed_flat = float2fixed(pfs->pgs->flatness);
/* Restrict the pfs->smoothness with 1/min_linear_grades, because cs_is_linear
can't provide a better precision due to the color
representation with integers.
*/
- pfs->smoothness = max(pfs->pis->smoothness, 1.0 / min_linear_grades);
+ pfs->smoothness = max(pfs->pgs->smoothness, 1.0 / min_linear_grades);
pfs->color_stack_size = 0;
pfs->color_stack_step = 0;
pfs->color_stack_ptr = NULL;
pfs->color_stack = NULL;
pfs->color_stack_limit = NULL;
pfs->unlinear = !is_linear_color_applicable(pfs);
- return alloc_patch_fill_memory(pfs, pfs->pis->memory, pcs);
+ return alloc_patch_fill_memory(pfs, pfs->pgs->memory, pcs);
}
bool
@@ -439,7 +439,7 @@ Cp_transform(gs_fixed_point * pt, const patch_curve_t curve[4],
int
gs_shading_Cp_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect * rect_clip,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
const gs_shading_Cp_t * const psh = (const gs_shading_Cp_t *)psh0;
patch_fill_state_t state;
@@ -448,7 +448,7 @@ gs_shading_Cp_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
int code;
code = mesh_init_fill_state((mesh_fill_state_t *) &state,
- (const gs_shading_mesh_t *)psh0, rect_clip, dev, pis);
+ (const gs_shading_mesh_t *)psh0, rect_clip, dev, pgs);
if (code < 0) {
if (state.icclink != NULL) gsicc_release_link(state.icclink);
return code;
@@ -468,7 +468,7 @@ gs_shading_Cp_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
}
curve[0].straight = curve[1].straight = curve[2].straight = curve[3].straight = false;
- shade_next_init(&cs, (const gs_shading_mesh_params_t *)&psh->params, pis);
+ shade_next_init(&cs, (const gs_shading_mesh_params_t *)&psh->params, pgs);
while ((code = shade_next_patch(&cs, psh->params.BitsPerFlag,
curve, NULL)) == 0 &&
(code = patch_fill(&state, curve, NULL, Cp_transform)) >= 0
@@ -537,7 +537,7 @@ Tpp_transform(gs_fixed_point * pt, const patch_curve_t curve[4],
int
gs_shading_Tpp_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
const gs_fixed_rect * rect_clip,
- gx_device * dev, gs_imager_state * pis)
+ gx_device * dev, gs_gstate * pgs)
{
const gs_shading_Tpp_t * const psh = (const gs_shading_Tpp_t *)psh0;
patch_fill_state_t state;
@@ -547,7 +547,7 @@ gs_shading_Tpp_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
int code;
code = mesh_init_fill_state((mesh_fill_state_t *) & state,
- (const gs_shading_mesh_t *)psh0, rect_clip, dev, pis);
+ (const gs_shading_mesh_t *)psh0, rect_clip, dev, pgs);
if (code < 0) {
if (state.icclink != NULL) gsicc_release_link(state.icclink);
return code;
@@ -564,7 +564,7 @@ gs_shading_Tpp_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
/* vd_erase(RGB(192, 192, 192)); */
}
curve[0].straight = curve[1].straight = curve[2].straight = curve[3].straight = false;
- shade_next_init(&cs, (const gs_shading_mesh_params_t *)&psh->params, pis);
+ shade_next_init(&cs, (const gs_shading_mesh_params_t *)&psh->params, pgs);
while ((code = shade_next_patch(&cs, psh->params.BitsPerFlag,
curve, interior)) == 0) {
/*
@@ -1196,18 +1196,18 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
*/
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&lenew, &re, ybot, ytl,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &re, ytl, ybr,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
ybot = ybr;
return dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &renew, ybr, ytop,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
} else if (ytr < ybl) {
/* | |
* ---+-----+----
@@ -1219,17 +1219,17 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
*/
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &renew, ybot, ytr,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &re, ytr, ybl,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
return dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &re, ybl, ytop,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
}
/* Fill in any section where both left and right edges are
* diagonal at the bottom */
@@ -1244,7 +1244,7 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
*/
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &re, ybot, ymid,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
ybot = ymid;
@@ -1262,7 +1262,7 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
*/
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &re, ymid, ytop,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
ytop = ymid;
@@ -1276,7 +1276,7 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
*/
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &renew, ybot, ybl,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
ybot = ybl;
@@ -1288,7 +1288,7 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
*/
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&lenew, &re, ybot, ybr,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
ybot = ybr;
@@ -1302,7 +1302,7 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
*/
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&le, &renew, ytl, ytop,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
ytop = ytl;
@@ -1314,7 +1314,7 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
*/
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&lenew, &re, ytr, ytop,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
if (code < 0)
return code;
ytop = ytr;
@@ -1325,13 +1325,13 @@ gx_shade_trapezoid(patch_fill_state_t *pfs, const gs_fixed_point q[4],
return 0;
return dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
&lenew, &renew, ybot, ytop,
- swap_axes, pdevc, pfs->pis->log_op);
+ swap_axes, pdevc, pfs->pgs->log_op);
}
}
if (!VD_TRACE_DOWN)
vd_disable;
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
- &le, &re, ybot, ytop, swap_axes, pdevc, pfs->pis->log_op);
+ &le, &re, ybot, ytop, swap_axes, pdevc, pfs->pgs->log_op);
vd_restore;
return code;
}
@@ -1395,7 +1395,7 @@ patch_color_to_device_color_inline(const patch_fill_state_t *pfs,
pdevc = &devc;
memcpy(fcc.paint.values, c->cc.paint.values,
sizeof(fcc.paint.values[0]) * pfs->num_components);
- code = pcs->type->remap_color(&fcc, pcs, pdevc, pfs->pis,
+ code = pcs->type->remap_color(&fcc, pcs, pdevc, pfs->pgs,
pfs->dev, gs_color_select_texture);
if (code < 0)
return code;
@@ -1516,7 +1516,7 @@ constant_color_trapezoid(patch_fill_state_t *pfs, gs_fixed_edge *le, gs_fixed_ed
if (!VD_TRACE_DOWN)
vd_disable;
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
- le, re, ybot, ytop, swap_axes, &dc, pfs->pis->log_op);
+ le, re, ybot, ytop, swap_axes, &dc, pfs->pgs->log_op);
vd_restore;
return code;
}
@@ -1566,7 +1566,7 @@ is_color_linear(const patch_fill_state_t *pfs, const patch_color_t *c0, const pa
return 0;
if (pfs->cs_always_linear)
return 1;
- code = cs_is_linear(cs, pfs->pis, pfs->trans_device,
+ code = cs_is_linear(cs, pfs->pgs, pfs->trans_device,
&c0->cc, &c1->cc, NULL, NULL, pfs->smoothness - s, pfs->icclink);
if (code <= 0)
return code;
@@ -2113,7 +2113,7 @@ try_device_linear_color(patch_fill_state_t *pfs, bool wedge,
if (pfs->cs_always_linear)
code = 1;
else
- code = cs_is_linear(cs, pfs->pis, pfs->trans_device,
+ code = cs_is_linear(cs, pfs->pgs, pfs->trans_device,
&p0->c->cc, &p1->c->cc, &p2->c->cc, NULL,
pfs->smoothness - s012, pfs->icclink);
if (code < 0)
@@ -2519,25 +2519,25 @@ ordered_triangle(patch_fill_state_t *pfs, gs_fixed_edge *le, gs_fixed_edge *re,
return code;
if (le->end.y < re->end.y) {
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
- le, re, le->start.y, le->end.y, false, &dc, pfs->pis->log_op);
+ le, re, le->start.y, le->end.y, false, &dc, pfs->pgs->log_op);
if (code >= 0) {
ue.start = le->end;
ue.end = re->end;
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
- &ue, re, le->end.y, re->end.y, false, &dc, pfs->pis->log_op);
+ &ue, re, le->end.y, re->end.y, false, &dc, pfs->pgs->log_op);
}
} else if (le->end.y > re->end.y) {
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
- le, re, le->start.y, re->end.y, false, &dc, pfs->pis->log_op);
+ le, re, le->start.y, re->end.y, false, &dc, pfs->pgs->log_op);
if (code >= 0) {
ue.start = re->end;
ue.end = le->end;
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
- le, &ue, re->end.y, le->end.y, false, &dc, pfs->pis->log_op);
+ le, &ue, re->end.y, le->end.y, false, &dc, pfs->pgs->log_op);
}
} else
code = dev_proc(pfs->dev, fill_trapezoid)(pfs->dev,
- le, re, le->start.y, le->end.y, false, &dc, pfs->pis->log_op);
+ le, re, le->start.y, le->end.y, false, &dc, pfs->pgs->log_op);
vd_restore;
return code;
}
@@ -2870,7 +2870,7 @@ triangle_by_4(patch_fill_state_t *pfs,
patch_color_t *c[3];
wedge_vertex_list_t L01, L12, L20, L[3];
bool inside_save = pfs->inside;
- gs_fixed_rect r, r1;
+ gs_fixed_rect r = {{0,0},{0,0}}, r1 = {{0,0},{0,0}};
int code = 0;
byte *color_stack_ptr;
const bool inside = pfs->inside; /* 'const' should help compiler to analyze initializations. */
@@ -3037,7 +3037,7 @@ gx_init_patch_fill_state_for_clist(gx_device *dev, patch_fill_state_t *pfs, gs_m
int i;
pfs->dev = dev;
- pfs->pis = NULL;
+ pfs->pgs = NULL;
pfs->direct_space = NULL;
pfs->num_components = dev->color_info.num_components;
/* pfs->cc_max_error[GS_CLIENT_COLOR_MAX_COMPONENTS] unused */
@@ -3429,7 +3429,7 @@ fill_quadrangle(patch_fill_state_t *pfs, const quadrangle_patch *p, bool big)
bool linear_color_save = pfs->linear_color;
bool inside_save = pfs->inside;
const bool inside = pfs->inside; /* 'const' should help compiler to analyze initializations. */
- gs_fixed_rect r, r1;
+ gs_fixed_rect r = {{0,0},{0,0}}, r1 = {{0,0},{0,0}};
/* Warning : pfs->monotonic_color is not restored on error. */
if (!inside) {
diff --git a/base/gxstate.h b/base/gxstate.h
index c819b2820..098fd7cc8 100644
--- a/base/gxstate.h
+++ b/base/gxstate.h
@@ -20,9 +20,9 @@
# define gxstate_INCLUDED
/* Opaque type for a graphics state */
-#ifndef gs_state_DEFINED
-# define gs_state_DEFINED
-typedef struct gs_state_s gs_state;
+#ifndef gs_gstate_DEFINED
+# define gs_gstate_DEFINED
+typedef struct gs_gstate_s gs_gstate;
#endif
#include "gscspace.h"
@@ -34,10 +34,10 @@ typedef struct gs_state_s gs_state;
*/
/* Memory and save/restore management */
-gs_memory_t *gs_state_memory(const gs_state *);
-gs_state *gs_state_saved(const gs_state *);
-gs_state *gs_state_swap_saved(gs_state *, gs_state *);
-gs_memory_t *gs_state_swap_memory(gs_state *, gs_memory_t *);
+gs_memory_t *gs_gstate_memory(const gs_gstate *);
+gs_gstate *gs_gstate_saved(const gs_gstate *);
+gs_gstate *gs_gstate_swap_saved(gs_gstate *, gs_gstate *);
+gs_memory_t *gs_gstate_swap_memory(gs_gstate *, gs_memory_t *);
/*
* "Client data" interface for graphics states.
@@ -45,9 +45,9 @@ gs_memory_t *gs_state_swap_memory(gs_state *, gs_memory_t *);
* As of release 4.36, the copy procedure is superseded by copy_for
* (although it will still be called if there is no copy_for procedure).
*/
-typedef void *(*gs_state_alloc_proc_t) (gs_memory_t * mem);
-typedef int (*gs_state_copy_proc_t) (void *to, const void *from);
-typedef void (*gs_state_free_proc_t) (void *old, gs_memory_t * mem);
+typedef void *(*gs_gstate_alloc_proc_t) (gs_memory_t * mem);
+typedef int (*gs_gstate_copy_proc_t) (void *to, const void *from);
+typedef void (*gs_gstate_free_proc_t) (void *old, gs_memory_t * mem);
typedef enum {
copy_for_gsave, /* from = current, to = new(saved) */
@@ -56,27 +56,27 @@ typedef enum {
copy_for_setgstate, /* from = stored, to = current */
copy_for_copygstate, /* from & to are specified explicitly */
copy_for_currentgstate /* from = current, to = stored */
-} gs_state_copy_reason_t;
+} gs_gstate_copy_reason_t;
/* Note that the 'from' argument of copy_for is not const. */
/* This is deliberate -- some clients need this. */
-typedef int (*gs_state_copy_for_proc_t) (void *to, void *from,
- gs_state_copy_reason_t reason);
-typedef struct gs_state_client_procs_s {
- gs_state_alloc_proc_t alloc;
- gs_state_copy_proc_t copy;
- gs_state_free_proc_t free;
- gs_state_copy_for_proc_t copy_for;
-} gs_state_client_procs;
-void gs_state_set_client(gs_state *, void *, const gs_state_client_procs *,
+typedef int (*gs_gstate_copy_for_proc_t) (void *to, void *from,
+ gs_gstate_copy_reason_t reason);
+typedef struct gs_gstate_client_procs_s {
+ gs_gstate_alloc_proc_t alloc;
+ gs_gstate_copy_proc_t copy;
+ gs_gstate_free_proc_t free;
+ gs_gstate_copy_for_proc_t copy_for;
+} gs_gstate_client_procs;
+void gs_gstate_set_client(gs_gstate *, void *, const gs_gstate_client_procs *,
bool client_has_pattern_streams);
/* gzstate.h redefines the following: */
-#ifndef gs_state_client_data
-void *gs_state_client_data(const gs_state *);
+#ifndef gs_gstate_client_data
+void *gs_gstate_client_data(const gs_gstate *);
#endif
/* Accessories. */
-gs_id gx_get_clip_path_id(gs_state *);
+gs_id gx_get_clip_path_id(gs_gstate *);
#endif /* gxstate_INCLUDED */
diff --git a/base/gxstroke.c b/base/gxstroke.c
index e5051ac19..7b0f804e3 100644
--- a/base/gxstroke.c
+++ b/base/gxstroke.c
@@ -29,7 +29,7 @@
#include "gsdevice.h"
#include "gxdevice.h"
#include "gxhttile.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gzline.h"
#include "gzpath.h"
#include "gzcpath.h"
@@ -59,10 +59,10 @@
#define USE_FILL_ADJUSTMENT
#ifdef USE_FILL_ADJUSTMENT
-# define STROKE_ADJUSTMENT(thin, pis, xy)\
- (thin ? fixed_0 : (pis)->fill_adjust.xy)
+# define STROKE_ADJUSTMENT(thin, pgs, xy)\
+ (thin ? fixed_0 : (pgs)->fill_adjust.xy)
#else
-# define STROKE_ADJUSTMENT(thin, pis, xy) fixed_0
+# define STROKE_ADJUSTMENT(thin, pgs, xy) fixed_0
#endif
/*
@@ -101,34 +101,34 @@
* check and covers many common cases. Clients that care always have the
* option of using strokepath to get an exact result.
*/
-static float join_expansion_factor(const gs_imager_state *, gs_line_join);
+static float join_expansion_factor(const gs_gstate *, gs_line_join);
int
-gx_stroke_path_expansion(const gs_imager_state * pis, const gx_path * ppath,
+gx_stroke_path_expansion(const gs_gstate * pgs, const gx_path * ppath,
gs_fixed_point * ppt)
{
const subpath *psub = ppath->first_subpath;
const segment *pseg;
- double cx = fabs(pis->ctm.xx) + fabs(pis->ctm.yx);
- double cy = fabs(pis->ctm.xy) + fabs(pis->ctm.yy);
- double expand = pis->line_params.half_width;
+ double cx = fabs(pgs->ctm.xx) + fabs(pgs->ctm.yx);
+ double cy = fabs(pgs->ctm.xy) + fabs(pgs->ctm.yy);
+ double expand = pgs->line_params.half_width;
int result = 1;
/* Adjust the expansion (E) for square caps, if needed */
- if (pis->line_params.start_cap == gs_cap_square ||
- pis->line_params.end_cap == gs_cap_square)
+ if (pgs->line_params.start_cap == gs_cap_square ||
+ pgs->line_params.end_cap == gs_cap_square)
expand *= 1.414213562;
/* Check for whether an exact result can be computed easily. */
- if (is_fzero2(pis->ctm.xy, pis->ctm.yx) ||
- is_fzero2(pis->ctm.xx, pis->ctm.yy)
+ if (is_fzero2(pgs->ctm.xy, pgs->ctm.yx) ||
+ is_fzero2(pgs->ctm.xx, pgs->ctm.yy)
) {
bool must_be_closed =
- !(pis->line_params.start_cap == gs_cap_square ||
- pis->line_params.start_cap == gs_cap_round ||
- pis->line_params.end_cap == gs_cap_square ||
- pis->line_params.end_cap == gs_cap_round ||
- pis->line_params.dash_cap == gs_cap_square ||
- pis->line_params.dash_cap == gs_cap_round);
+ !(pgs->line_params.start_cap == gs_cap_square ||
+ pgs->line_params.start_cap == gs_cap_round ||
+ pgs->line_params.end_cap == gs_cap_square ||
+ pgs->line_params.end_cap == gs_cap_round ||
+ pgs->line_params.dash_cap == gs_cap_square ||
+ pgs->line_params.dash_cap == gs_cap_round);
gs_fixed_point prev;
prev.x = prev.y = 0; /* Quiet gcc warning. */
@@ -161,11 +161,11 @@ not_exact:
(pseg = pseg->next) == 0 || pseg->type == s_line_close))
DO_NOTHING;
else {
- float factor = join_expansion_factor(pis, pis->line_params.join);
+ float factor = join_expansion_factor(pgs, pgs->line_params.join);
- if (pis->line_params.curve_join >= 0)
- factor = max(factor, join_expansion_factor(pis,
- (gs_line_join)pis->line_params.curve_join));
+ if (pgs->line_params.curve_join >= 0)
+ factor = max(factor, join_expansion_factor(pgs,
+ (gs_line_join)pgs->line_params.curve_join));
expand *= factor;
}
}
@@ -186,10 +186,10 @@ not_exact:
return result;
}
static float
-join_expansion_factor(const gs_imager_state *pis, gs_line_join join)
+join_expansion_factor(const gs_gstate *pgs, gs_line_join join)
{
switch (join) {
- case gs_join_miter: return pis->line_params.miter_limit;
+ case gs_join_miter: return pgs->line_params.miter_limit;
case gs_join_triangle: return 2.0;
default: return 1.0;
}
@@ -297,7 +297,7 @@ typedef enum note_flags {
/* Other forward declarations */
static bool width_is_thin(pl_ptr);
-static void adjust_stroke(gx_device *, pl_ptr, const gs_imager_state *, bool, bool, note_flags);
+static void adjust_stroke(gx_device *, pl_ptr, const gs_gstate *, bool, bool, note_flags);
static int line_join_points(const gx_line_params * pgs_lp,
pl_ptr plp, pl_ptr nplp,
gs_fixed_point * join_points,
@@ -327,28 +327,28 @@ static int join_under_pie(gx_path *, pl_ptr, pl_ptr, bool);
/* Define the default implementation of the device stroke_path procedure. */
int
-gx_default_stroke_path(gx_device * dev, const gs_imager_state * pis,
+gx_default_stroke_path(gx_device * dev, const gs_gstate * pgs,
gx_path * ppath, const gx_stroke_params * params,
const gx_drawing_color * pdcolor,
const gx_clip_path * pcpath)
{
- return gx_stroke_path_only(ppath, (gx_path *) 0, dev, pis, params,
+ return gx_stroke_path_only(ppath, (gx_path *) 0, dev, pgs, params,
pdcolor, pcpath);
}
/* Fill a partial stroked path. Free variables: */
-/* to_path, stroke_path_body, fill_params, always_thin, pis, dev, pdevc, */
+/* to_path, stroke_path_body, fill_params, always_thin, pgs, dev, pdevc, */
/* code, ppath, exit(label). */
#define FILL_STROKE_PATH(dev, thin, pcpath, final)\
if(to_path==&stroke_path_body && !gx_path_is_void(&stroke_path_body) &&\
- (final || lop_is_idempotent(pis->log_op))) {\
- fill_params.adjust.x = STROKE_ADJUSTMENT(thin, pis, x);\
- fill_params.adjust.y = STROKE_ADJUSTMENT(thin, pis, y);\
+ (final || lop_is_idempotent(pgs->log_op))) {\
+ fill_params.adjust.x = STROKE_ADJUSTMENT(thin, pgs, x);\
+ fill_params.adjust.y = STROKE_ADJUSTMENT(thin, pgs, y);\
if (to_path_reverse != NULL) {\
code = gx_join_path_and_reverse(to_path, to_path_reverse);\
if(code < 0) goto exit;\
}\
- code = gx_fill_path_only(to_path, dev, pis, &fill_params, pdevc, pcpath);\
+ code = gx_fill_path_only(to_path, dev, pgs, &fill_params, pdevc, pcpath);\
gx_path_free(&stroke_path_body, "fill_stroke_path");\
if ( code < 0 ) goto exit;\
gx_path_init_local(&stroke_path_body, ppath->memory);\
@@ -363,7 +363,7 @@ gx_default_stroke_path(gx_device * dev, const gs_imager_state * pis,
*/
#define stroke_line_proc(proc)\
int proc(gx_path *, gx_path *, bool ensure_closed, int, pl_ptr, pl_ptr,\
- const gx_device_color *, gx_device *, const gs_imager_state *,\
+ const gx_device_color *, gx_device *, const gs_gstate *,\
const gx_stroke_params *, const gs_fixed_rect *, int,\
gs_line_join, bool, note_flags)
typedef stroke_line_proc((*stroke_line_proc_t));
@@ -374,7 +374,7 @@ static stroke_line_proc(stroke_add_fast);
static stroke_line_proc(stroke_fill);
static int stroke_add_initial_cap_compat(gx_path * ppath, pl_ptr plp, bool adlust_longitude,
const gx_device_color * pdevc, gx_device * dev,
- const gs_imager_state * pis);
+ const gs_gstate * pgs);
/* Define the orientations we handle specially. */
typedef enum {
@@ -419,29 +419,29 @@ gx_join_path_and_reverse(gx_path * path, gx_path * rpath)
*/
static int
gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
- const gs_imager_state * pis, const gx_stroke_params * params,
+ const gs_gstate * pgs, const gx_stroke_params * params,
const gx_device_color * pdevc, const gx_clip_path * pcpath)
{
- bool CPSI_mode = gs_currentcpsimode(pis->memory);
+ bool CPSI_mode = gs_currentcpsimode(pgs->memory);
bool traditional = CPSI_mode | params->traditional;
stroke_line_proc_t line_proc =
((to_path == 0 && !gx_dc_is_pattern1_color_clist_based(pdevc))
- ? (lop_is_idempotent(pis->log_op) ? stroke_fill : stroke_add) :
+ ? (lop_is_idempotent(pgs->log_op) ? stroke_fill : stroke_add) :
(traditional ? stroke_add_compat : stroke_add_fast));
gs_fixed_rect ibox, cbox;
gx_device_clip cdev;
gx_device *dev = pdev;
int code = 0;
gx_fill_params fill_params;
- const gx_line_params *pgs_lp = gs_currentlineparams_inline(pis);
+ const gx_line_params *pgs_lp = gs_currentlineparams_inline(pgs);
int dash_count = pgs_lp->dash.pattern_size;
gx_path fpath, dpath;
gx_path stroke_path_body;
gx_path stroke_path_reverse;
gx_path *to_path_reverse = NULL;
const gx_path *spath;
- float xx = pis->ctm.xx, xy = pis->ctm.xy;
- float yx = pis->ctm.yx, yy = pis->ctm.yy;
+ float xx = pgs->ctm.xx, xy = pgs->ctm.xy;
+ float yx = pgs->ctm.yx, yy = pgs->ctm.yy;
/*
* We are dealing with a reflected coordinate system
* if transform(1,0) is counter-clockwise from transform(0,1).
@@ -475,7 +475,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
*/
#if 0
segment_notes not_first =
- (!is_fzero(pis->line_params.dot_length) ? sn_not_first : sn_none);
+ (!is_fzero(pgs->line_params.dot_length) ? sn_not_first : sn_none);
#else
const segment_notes not_first = sn_not_first;
#endif
@@ -522,13 +522,13 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
{
gs_fixed_point expansion;
- if (gx_stroke_path_expansion(pis, ppath, &expansion) < 0) {
+ if (gx_stroke_path_expansion(pgs, ppath, &expansion) < 0) {
/* The expansion is so large it caused a limitcheck. */
ibox.p.x = ibox.p.y = min_fixed;
ibox.q.x = ibox.q.y = max_fixed;
} else {
- expansion.x += pis->fill_adjust.x;
- expansion.y += pis->fill_adjust.y;
+ expansion.x += pgs->fill_adjust.x;
+ expansion.y += pgs->fill_adjust.y;
/*
* It's theoretically possible for the following computations to
* overflow, so we need to check for this.
@@ -595,7 +595,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
}
}
fill_params.rule = gx_rule_winding_number;
- fill_params.flatness = pis->flatness;
+ fill_params.flatness = pgs->flatness;
if (line_width < 0)
line_width = -line_width;
line_width_and_scale = line_width * (double)int2fixed(1);
@@ -644,7 +644,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
}
}
if_debug7m('o', ppath->memory, "[o]ctm=(%g,%g,%g,%g,%g,%g) thin=%d\n",
- xx, xy, yx, yy, pis->ctm.tx, pis->ctm.ty, always_thin);
+ xx, xy, yx, yy, pgs->ctm.tx, pgs->ctm.ty, always_thin);
if (device_dot_length != 0) {
/*
* Compute the dot length in device space. We can't do this
@@ -657,7 +657,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
gs_deviceinitialmatrix(pdev, &mat);
pmat = &mat;
} else
- pmat = (const gs_matrix *)&pis->ctm;
+ pmat = (const gs_matrix *)&pgs->ctm;
device_dot_length *= fabs(pmat->xy) + fabs(pmat->yy);
}
/* Start by flattening the path. We should do this on-the-fly.... */
@@ -669,7 +669,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
} else {
gx_path_init_local(&fpath, ppath->memory);
if ((code = gx_path_add_flattened_for_stroke(ppath, &fpath,
- params->flatness, pis)) < 0
+ params->flatness, pgs)) < 0
)
return code;
spath = &fpath;
@@ -678,24 +678,24 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
float max_dash_len = 0;
float expand_squared;
int i;
- float adjust = (float)pis->fill_adjust.x;
- if (adjust > (float)pis->fill_adjust.y)
- adjust = (float)pis->fill_adjust.y;
+ float adjust = (float)pgs->fill_adjust.x;
+ if (adjust > (float)pgs->fill_adjust.y)
+ adjust = (float)pgs->fill_adjust.y;
for (i = 0; i < dash_count; i++) {
if (max_dash_len < pgs_lp->dash.pattern[i])
max_dash_len = pgs_lp->dash.pattern[i];
}
- expand_squared = pis->ctm.xx * pis->ctm.yy - pis->ctm.xy * pis->ctm.yx;
+ expand_squared = pgs->ctm.xx * pgs->ctm.yy - pgs->ctm.xy * pgs->ctm.yx;
if (expand_squared < 0)
expand_squared = -expand_squared;
expand_squared *= max_dash_len * max_dash_len;
/* Wide lines in curves can show dashes up, so fudge to allow for
* this. */
- if (pis->line_params.half_width > 1)
- adjust /= pis->line_params.half_width;
+ if (pgs->line_params.half_width > 1)
+ adjust /= pgs->line_params.half_width;
if (expand_squared*65536.0f >= (float)(adjust*adjust)) {
gx_path_init_local(&dpath, ppath->memory);
- code = gx_path_add_dash_expansion(spath, &dpath, pis);
+ code = gx_path_add_dash_expansion(spath, &dpath, pgs);
if (code < 0)
goto exf;
spath = &dpath;
@@ -905,7 +905,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
gs_point dpt; /* unscaled */
float wl;
- code = gs_imager_idtransform(pis,
+ code = gs_gstate_idtransform(pgs,
(float)udx, (float)udy,
&dpt);
if (code < 0) {
@@ -949,7 +949,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
if (!pl.thin) {
if (index)
dev->sgr.stroke_stored = false;
- adjust_stroke(dev, &pl, pis, false,
+ adjust_stroke(dev, &pl, pgs, false,
(pseg->prev == 0 || pseg->prev->type == s_start) &&
(pseg->next == 0 || pseg->next->type == s_start) &&
(zero_length || !is_closed),
@@ -987,13 +987,13 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
}
ensure_closed = ((to_path == &stroke_path_body &&
- lop_is_idempotent(pis->log_op)) ||
+ lop_is_idempotent(pgs->log_op)) ||
(lptr == NULL ? true : lptr->thin));
/* Draw the PREVIOUS line segment, joining it to lptr (or
* capping if lptr == NULL. */
code = (*line_proc) (to_path, to_path_reverse, ensure_closed,
first, &pl_prev, lptr,
- pdevc, dev, pis, params, &cbox,
+ pdevc, dev, pgs, params, &cbox,
uniform, join, initial_matrix_reflected,
COMBINE_FLAGS(flags));
if (code < 0)
@@ -1038,7 +1038,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
(flags & ~nf_all_from_arc));
code = (*line_proc) (to_path, to_path_reverse, true,
index - 1, &pl_prev, lptr, pdevc,
- dev, pis, params, &cbox, uniform, join,
+ dev, pgs, params, &cbox, uniform, join,
initial_matrix_reflected,
COMBINE_FLAGS(flags));
if (code < 0)
@@ -1048,7 +1048,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
pgs_lp->start_cap : pgs_lp->dash_cap);
if (traditional && lptr == 0 && cap != gs_cap_butt) {
/* Create the initial cap at last. */
- code = stroke_add_initial_cap_compat(to_path, &pl_first, index == 1, pdevc, dev, pis);
+ code = stroke_add_initial_cap_compat(to_path, &pl_first, index == 1, pdevc, dev, pgs);
if (code < 0)
goto exit;
FILL_STROKE_PATH(pdev, always_thin, pcpath, false);
@@ -1076,7 +1076,7 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
int
gx_stroke_path_only(gx_path * ppath, gx_path * to_path, gx_device * pdev,
- const gs_imager_state * pis, const gx_stroke_params * params,
+ const gs_gstate * pgs, const gx_stroke_params * params,
const gx_device_color * pdevc, const gx_clip_path * pcpath)
{
int code;
@@ -1092,7 +1092,7 @@ gx_stroke_path_only(gx_path * ppath, gx_path * to_path, gx_device * pdev,
}
if (vd_enabled)
vd_setcolor(pdevc->colors.pure);
- code = gx_stroke_path_only_aux(ppath, to_path, pdev, pis, params, pdevc, pcpath);
+ code = gx_stroke_path_only_aux(ppath, to_path, pdev, pgs, params, pdevc, pcpath);
if (vd_allowed('S'))
vd_release_dc;
return code;
@@ -1144,7 +1144,7 @@ width_is_thin(pl_ptr plp)
/* Adjust the endpoints and width of a stroke segment along a specified axis */
static void
-adjust_stroke_transversal(pl_ptr plp, const gs_imager_state * pis, bool thin, bool horiz)
+adjust_stroke_transversal(pl_ptr plp, const gs_gstate * pgs, bool thin, bool horiz)
{
fixed *pw;
fixed *pov;
@@ -1155,11 +1155,11 @@ adjust_stroke_transversal(pl_ptr plp, const gs_imager_state * pis, bool thin, bo
if (horiz) {
/* More horizontal stroke */
pw = &plp->width.y, pov = &plp->o.p.y, pev = &plp->e.p.y;
- adj2 = STROKE_ADJUSTMENT(thin, pis, y) << 1;
+ adj2 = STROKE_ADJUSTMENT(thin, pgs, y) << 1;
} else {
/* More vertical stroke */
pw = &plp->width.x, pov = &plp->o.p.x, pev = &plp->e.p.x;
- adj2 = STROKE_ADJUSTMENT(thin, pis, x) << 1;
+ adj2 = STROKE_ADJUSTMENT(thin, pgs, x) << 1;
}
/* Round the larger component of the width up or down, */
/* whichever way produces a result closer to the correct width. */
@@ -1192,7 +1192,7 @@ adjust_stroke_transversal(pl_ptr plp, const gs_imager_state * pis, bool thin, bo
}
static void
-adjust_stroke_longitude(pl_ptr plp, const gs_imager_state * pis,
+adjust_stroke_longitude(pl_ptr plp, const gs_gstate * pgs,
bool thin, bool horiz,
gs_line_cap start_cap, gs_line_cap end_cap)
{
@@ -1208,8 +1208,8 @@ adjust_stroke_longitude(pl_ptr plp, const gs_imager_state * pis,
fixed length = any_abs(*pov - *pev);
fixed length_r, length_r_2;
fixed mv = (*pov + *pev) / 2, mv_r;
- fixed adj2 = (horiz ? STROKE_ADJUSTMENT(thin, pis, x)
- : STROKE_ADJUSTMENT(thin, pis, y)) << 1;
+ fixed adj2 = (horiz ? STROKE_ADJUSTMENT(thin, pgs, x)
+ : STROKE_ADJUSTMENT(thin, pgs, y)) << 1;
/* fixme :
The best value for adjust_longitude is whether
@@ -1249,20 +1249,20 @@ adjust_stroke_longitude(pl_ptr plp, const gs_imager_state * pis,
/* to achieve more uniform rendering. */
/* Only o.p, e.p, e.cdelta, and width have been set. */
static void
-adjust_stroke(gx_device *dev, pl_ptr plp, const gs_imager_state * pis,
+adjust_stroke(gx_device *dev, pl_ptr plp, const gs_gstate * pgs,
bool thin, bool adjust_longitude, note_flags flags)
{
bool horiz, adjust = true;
gs_line_cap start_cap = (flags & nf_dash_head ?
- pis->line_params.dash_cap :
- pis->line_params.start_cap);
+ pgs->line_params.dash_cap :
+ pgs->line_params.start_cap);
gs_line_cap end_cap = (flags & nf_dash_tail ?
- pis->line_params.dash_cap :
- pis->line_params.end_cap);
+ pgs->line_params.dash_cap :
+ pgs->line_params.end_cap);
/* If stroke_adjustment is disabled, or this isn't a horizontal or
* vertical line, then bale. */
- if (!pis->stroke_adjust || (plp->width.x != 0 && plp->width.y != 0)) {
+ if (!pgs->stroke_adjust || (plp->width.x != 0 && plp->width.y != 0)) {
dev->sgr.stroke_stored = false;
return; /* don't adjust */
}
@@ -1345,9 +1345,9 @@ adjust_stroke(gx_device *dev, pl_ptr plp, const gs_imager_state * pis,
dev->sgr.stroke_stored = false;
if (adjust) {
horiz = (any_abs(plp->width.x) <= any_abs(plp->width.y));
- adjust_stroke_transversal(plp, pis, thin, horiz);
+ adjust_stroke_transversal(plp, pgs, thin, horiz);
if (adjust_longitude)
- adjust_stroke_longitude(plp, pis, thin, horiz, start_cap, end_cap);
+ adjust_stroke_longitude(plp, pgs, thin, horiz, start_cap, end_cap);
}
if ((start_cap == gs_cap_butt) || (end_cap == gs_cap_butt)) {
dev->sgr.adjusted[0] = plp->o.p;
@@ -1430,7 +1430,7 @@ set_thin_widths(register pl_ptr plp)
static int
stroke_fill(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
register pl_ptr plp, pl_ptr nplp, const gx_device_color * pdevc,
- gx_device * dev, const gs_imager_state * pis,
+ gx_device * dev, const gs_gstate * pgs,
const gx_stroke_params * params, const gs_fixed_rect * pbbox,
int uniform, gs_line_join join, bool reflected,
note_flags flags)
@@ -1440,17 +1440,17 @@ stroke_fill(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
const fixed litox = plp->e.p.x;
const fixed litoy = plp->e.p.y;
- /* assert(lop_is_idempotent(pis->log_op)); */
+ /* assert(lop_is_idempotent(pgs->log_op)); */
if (plp->thin) {
/* Minimum-width line, don't have to be careful with caps/joins. */
return (*dev_proc(dev, draw_thin_line))(dev, lix, liy, litox, litoy,
- pdevc, pis->log_op,
- pis->fill_adjust.x,
- pis->fill_adjust.y);
+ pdevc, pgs->log_op,
+ pgs->fill_adjust.x,
+ pgs->fill_adjust.y);
}
/* Check for being able to fill directly. */
{
- const gx_line_params *pgs_lp = gs_currentlineparams_inline(pis);
+ const gx_line_params *pgs_lp = gs_currentlineparams_inline(pgs);
gs_line_cap start_cap = (flags & nf_dash_head ?
pgs_lp->dash_cap : pgs_lp->start_cap);
gs_line_cap end_cap = (flags & nf_dash_tail ?
@@ -1465,7 +1465,7 @@ stroke_fill(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
&& (end_cap == gs_cap_butt || end_cap == gs_cap_square)
&& (join == gs_join_bevel || join == gs_join_miter ||
join == gs_join_none)
- && (pis->fill_adjust.x | pis->fill_adjust.y) == 0
+ && (pgs->fill_adjust.x | pgs->fill_adjust.y) == 0
) {
gs_fixed_point points[6];
int npoints, code;
@@ -1477,7 +1477,7 @@ stroke_fill(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
else
code = line_join_points(pgs_lp, plp, nplp, points + npoints,
(uniform ? (gs_matrix *) 0 :
- &ctm_only(pis)), join, reflected);
+ &ctm_only(pgs)), join, reflected);
if (code < 0)
goto general;
/* Make sure the parallelogram fill won't overflow. */
@@ -1512,7 +1512,7 @@ stroke_fill(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
bevel->x, bevel->y,
bevel[1].x - bevel->x, bevel[1].y - bevel->y,
bevel[2].x - bevel->x, bevel[2].y - bevel->y,
- pdevc, pis->log_op);
+ pdevc, pgs->log_op);
if (code < 0)
return code;
}
@@ -1521,7 +1521,7 @@ stroke_fill(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
return (*dev_proc(dev, fill_parallelogram)) (dev,
points[1].x, points[1].y,
ax, ay, bx, by,
- pdevc, pis->log_op);
+ pdevc, pgs->log_op);
fill:
code = add_points(ppath, points, npoints + code, true);
if (code < 0)
@@ -1532,7 +1532,7 @@ stroke_fill(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
/* General case: construct a path for the fill algorithm. */
general:
return stroke_add(ppath, rpath, ensure_closed, first, plp, nplp, pdevc,
- dev, pis, params, pbbox, uniform, join, reflected,
+ dev, pgs, params, pbbox, uniform, join, reflected,
flags);
}
@@ -1540,12 +1540,12 @@ stroke_fill(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
static int
stroke_add(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
pl_ptr plp, pl_ptr nplp, const gx_device_color * pdevc,
- gx_device * dev, const gs_imager_state * pis,
+ gx_device * dev, const gs_gstate * pgs,
const gx_stroke_params * params,
const gs_fixed_rect * ignore_pbbox, int uniform,
gs_line_join join, bool reflected, note_flags flags)
{
- const gx_line_params *pgs_lp = gs_currentlineparams_inline(pis);
+ const gx_line_params *pgs_lp = gs_currentlineparams_inline(pgs);
gs_fixed_point points[8];
int npoints;
int code;
@@ -1559,7 +1559,7 @@ stroke_add(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
/* We didn't set up the endpoint parameters before, */
/* because the line was thin. Do it now. */
set_thin_widths(plp);
- adjust_stroke(dev, plp, pis, true, first == 0 && nplp == 0, flags);
+ adjust_stroke(dev, plp, pgs, true, first == 0 && nplp == 0, flags);
compute_caps(plp);
}
/* Create an initial cap if desired. */
@@ -1610,7 +1610,7 @@ stroke_add(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
goto done;
} else /* non-round join */
code = line_join_points(pgs_lp, plp, nplp, points + npoints,
- (uniform ? (gs_matrix *) 0 : &ctm_only(pis)),
+ (uniform ? (gs_matrix *) 0 : &ctm_only(pgs)),
join, reflected);
if (code < 0)
return code;
@@ -1675,12 +1675,12 @@ wide_underjoin(pl_ptr plp, pl_ptr nplp)
static int
stroke_add_fast(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
pl_ptr plp, pl_ptr nplp, const gx_device_color * pdevc,
- gx_device * dev, const gs_imager_state * pis,
+ gx_device * dev, const gs_gstate * pgs,
const gx_stroke_params * params,
const gs_fixed_rect * ignore_pbbox, int uniform,
gs_line_join join, bool reflected, note_flags flags)
{
- const gx_line_params *pgs_lp = gs_currentlineparams_inline(pis);
+ const gx_line_params *pgs_lp = gs_currentlineparams_inline(pgs);
gs_fixed_point points[8];
gs_fixed_point rpoints[8];
int npoints = 0;
@@ -1694,7 +1694,7 @@ stroke_add_fast(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
/* We didn't set up the endpoint parameters before, */
/* because the line was thin. Do it now. */
set_thin_widths(plp);
- adjust_stroke(dev, plp, pis, true, first == 0 && nplp == 0, flags);
+ adjust_stroke(dev, plp, pgs, true, first == 0 && nplp == 0, flags);
compute_caps(plp);
}
start_cap = (flags & nf_dash_head ?
@@ -1782,7 +1782,7 @@ stroke_add_fast(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
code = line_join_points_fast_ccw(pgs_lp, plp, nplp,
points,
(uniform ? (gs_matrix *) 0 :
- &ctm_only(pis)),
+ &ctm_only(pgs)),
join);
npoints = code;
}
@@ -1843,7 +1843,7 @@ stroke_add_fast(gx_path * ppath, gx_path * rpath, bool ensure_closed, int first,
code = line_join_points_fast_cw(pgs_lp, plp, nplp,
rpoints,
(uniform ? (gs_matrix *) 0 :
- &ctm_only(pis)),
+ &ctm_only(pgs)),
join);
nrpoints = code;
}
@@ -1920,7 +1920,7 @@ static int
stroke_add_compat(gx_path * ppath, gx_path *rpath, bool ensure_closed,
int first, pl_ptr plp, pl_ptr nplp,
const gx_device_color * pdevc, gx_device * dev,
- const gs_imager_state * pis,
+ const gs_gstate * pgs,
const gx_stroke_params * params,
const gs_fixed_rect * ignore_pbbox, int uniform,
gs_line_join join, bool reflected, note_flags flags)
@@ -1928,7 +1928,7 @@ stroke_add_compat(gx_path * ppath, gx_path *rpath, bool ensure_closed,
/* Actually it adds 2 contours : one for the segment itself,
and another one for line join or for the ending cap.
Note CPSI creates negative contours. */
- const gx_line_params *pgs_lp = gs_currentlineparams_inline(pis);
+ const gx_line_params *pgs_lp = gs_currentlineparams_inline(pgs);
gs_fixed_point points[5];
int npoints;
bool const moveto_first = true; /* Keeping this code closer to "stroke_add". */
@@ -1938,7 +1938,7 @@ stroke_add_compat(gx_path * ppath, gx_path *rpath, bool ensure_closed,
/* We didn't set up the endpoint parameters before, */
/* because the line was thin. Do it now. */
set_thin_widths(plp);
- adjust_stroke(dev, plp, pis, true, first == 0 && nplp == 0, flags);
+ adjust_stroke(dev, plp, pgs, true, first == 0 && nplp == 0, flags);
compute_caps(plp);
}
/* The segment itself : */
@@ -1993,7 +1993,7 @@ stroke_add_compat(gx_path * ppath, gx_path *rpath, bool ensure_closed,
vd_lineto(points[0].x, points[0].y);
++npoints;
code = line_join_points(pgs_lp, plp, nplp, points + npoints,
- (uniform ? (gs_matrix *) 0 : &ctm_only(pis)),
+ (uniform ? (gs_matrix *) 0 : &ctm_only(pgs)),
join, reflected);
if (code < 0)
return code;
@@ -2001,7 +2001,7 @@ stroke_add_compat(gx_path * ppath, gx_path *rpath, bool ensure_closed,
npoints += code;
} else {
code = line_join_points(pgs_lp, plp, nplp, points,
- (uniform ? (gs_matrix *) 0 : &ctm_only(pis)),
+ (uniform ? (gs_matrix *) 0 : &ctm_only(pgs)),
join, reflected);
if (code < 0)
return code;
@@ -2026,9 +2026,9 @@ stroke_add_compat(gx_path * ppath, gx_path *rpath, bool ensure_closed,
static int
stroke_add_initial_cap_compat(gx_path * ppath, pl_ptr plp, bool adlust_longitude,
const gx_device_color * pdevc, gx_device * dev,
- const gs_imager_state * pis)
+ const gs_gstate * pgs)
{
- const gx_line_params *pgs_lp = gs_currentlineparams_inline(pis);
+ const gx_line_params *pgs_lp = gs_currentlineparams_inline(pgs);
gs_fixed_point points[5];
int npoints = 0;
int code;
@@ -2039,7 +2039,7 @@ stroke_add_initial_cap_compat(gx_path * ppath, pl_ptr plp, bool adlust_longitude
/* We didn't set up the endpoint parameters before, */
/* because the line was thin. Do it now. */
set_thin_widths(plp);
- adjust_stroke(dev, plp, pis, true, adlust_longitude, 0);
+ adjust_stroke(dev, plp, pgs, true, adlust_longitude, 0);
compute_caps(plp);
}
/* Create an initial cap if desired. */
diff --git a/base/gxtext.h b/base/gxtext.h
index 8ee3cfe9b..3634b50cb 100644
--- a/base/gxtext.h
+++ b/base/gxtext.h
@@ -85,7 +85,7 @@ rc_free_proc(rc_free_text_enum);
gs_text_params_t text; /* must be first for subclassing */\
gx_device *dev;\
gx_device *imaging_dev; /* see note below */\
- gs_imager_state *pis;\
+ gs_gstate *pgs;\
gs_font *orig_font;\
gx_path *path; /* unless DO_NONE & !RETURN_WIDTH */\
const gx_device_color *pdcolor; /* if DO_DRAW */\
@@ -178,7 +178,7 @@ struct gs_text_enum_s {
*/
int gs_text_enum_init(gs_text_enum_t *pte,
const gs_text_enum_procs_t *procs,
- gx_device *dev, gs_imager_state *pis,
+ gx_device *dev, gs_gstate *pgs,
const gs_text_params_t *text,
gs_font *font, gx_path *path,
const gx_device_color *pdcolor,
@@ -190,7 +190,7 @@ int gs_text_enum_init(gs_text_enum_t *pte,
* as that purely for retrieving metrics
*/
gs_text_enum_t *
-gs_text_enum_alloc(gs_memory_t * mem, gs_imager_state * pis, client_name_t cname);
+gs_text_enum_alloc(gs_memory_t * mem, gs_gstate * pgs, client_name_t cname);
/*
* Copy the dynamically changing elements from one enumerator to another.
diff --git a/base/gxttfb.c b/base/gxttfb.c
index 9f13420b0..0e9a444e5 100644
--- a/base/gxttfb.c
+++ b/base/gxttfb.c
@@ -33,7 +33,7 @@
#include "gdebug.h"
#include "memory_.h"
#include "math_.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxpaint.h"
#include "gzspotan.h"
#include <stdarg.h>
@@ -646,7 +646,7 @@ static int grid_fit(gx_device_spot_analyzer *padev, gx_path *path,
gs_font_type42 *pfont, const gs_log2_scale_point *pscale, gx_ttfExport *e, ttfOutliner *o)
{
/* Not completed yet. */
- gs_imager_state is_stub;
+ gs_gstate gs_stub;
gx_fill_params params;
gx_device_color devc_stub;
int code;
@@ -697,8 +697,8 @@ static int grid_fit(gx_device_spot_analyzer *padev, gx_path *path,
code = gx_path_bbox(path, &bbox);
if (code < 0)
return code;
- memset(&is_stub, 0, sizeof(is_stub));
- is_stub.memory = padev->memory;
+ memset(&gs_stub, 0, sizeof(gs_stub));
+ gs_stub.memory = padev->memory;
set_nonclient_dev_color(&devc_stub, 1);
params.rule = gx_rule_winding_number;
params.adjust.x = params.adjust.y = 0;
@@ -710,7 +710,7 @@ static int grid_fit(gx_device_spot_analyzer *padev, gx_path *path,
transpose_path(path);
gx_san_begin(padev);
code = dev_proc(padev, fill_path)((gx_device *)padev,
- &is_stub, path, &params, &devc_stub, NULL);
+ &gs_stub, path, &params, &devc_stub, NULL);
gx_san_end(padev);
if (code >= 0)
code = gx_san_generate_stems(padev, OVERALL_HINT && h.transpose,
diff --git a/base/gxtype1.c b/base/gxtype1.c
index 886b7a6d3..d29168300 100644
--- a/base/gxtype1.c
+++ b/base/gxtype1.c
@@ -25,7 +25,7 @@
#include "gxarith.h"
#include "gxchrout.h"
#include "gxfixed.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gxmatrix.h"
#include "gxcoord.h"
#include "gxfont.h"
@@ -63,7 +63,7 @@ ENUM_PTRS_WITH(gs_type1_state_enum_ptrs, gs_type1_state *pcis)
index % ST_GLYPH_DATA_NUM_PTRS);
return 0;
}
-ENUM_PTR3(0, gs_type1_state, pfont, pis, path);
+ENUM_PTR3(0, gs_type1_state, pfont, pgs, path);
ENUM_PTR(3, gs_type1_state, callback_data);
ENUM_PTRS_END
static RELOC_PTRS_WITH(gs_type1_state_reloc_ptrs, gs_type1_state *pcis)
@@ -71,7 +71,7 @@ static RELOC_PTRS_WITH(gs_type1_state_reloc_ptrs, gs_type1_state *pcis)
int i;
RELOC_PTR(gs_type1_state, pfont);
- RELOC_PTR(gs_type1_state, pis);
+ RELOC_PTR(gs_type1_state, pgs);
RELOC_PTR(gs_type1_state, path);
RELOC_PTR(gs_type1_state, callback_data);
for (i = 0; i < pcis->ips_count; i++) {
@@ -96,7 +96,7 @@ const char gx_extendeg_glyph_name_separator[] = "~GS~";
/* Initialize a Type 1 interpreter. */
/* The caller must supply a string to the first call of gs_type1_interpret. */
int
-gs_type1_interp_init(register gs_type1_state * pcis, gs_imager_state * pis,
+gs_type1_interp_init(register gs_type1_state * pcis, gs_gstate * pgs,
gx_path * ppath, const gs_log2_scale_point * pscale,
const gs_log2_scale_point * psubpixels, bool no_grid_fitting,
int paint_type, gs_font_type1 * pfont)
@@ -107,9 +107,9 @@ gs_type1_interp_init(register gs_type1_state * pcis, gs_imager_state * pis,
const gs_log2_scale_point *plog2_subpixels =
(FORCE_HINTS_TO_BIG_PIXELS ? (psubpixels != NULL ? psubpixels : plog2_scale) : &no_scale);
- if_debug0m('1', pis->memory, "[1]gs_type1_interp_init\n");
+ if_debug0m('1', pgs->memory, "[1]gs_type1_interp_init\n");
pcis->pfont = pfont;
- pcis->pis = pis;
+ pcis->pgs = pgs;
pcis->path = ppath;
pcis->callback_data = pfont; /* default callback data */
pcis->no_grid_fitting = no_grid_fitting;
@@ -163,11 +163,11 @@ gs_type1_set_width(gs_type1_state * pcis, const gs_point * pwpt)
void
gs_type1_finish_init(gs_type1_state * pcis)
{
- gs_imager_state *pis = pcis->pis;
+ gs_gstate *pgs = pcis->pgs;
const int max_coeff_bits = 11; /* max coefficient in char space */
/* Set up the fixed version of the transformation. */
- gx_matrix_to_fixed_coeff(&ctm_only(pis), &pcis->fc, max_coeff_bits);
+ gx_matrix_to_fixed_coeff(&ctm_only(pgs), &pcis->fc, max_coeff_bits);
/* Set the current point of the path to the origin, */
pcis->origin.x = pcis->path->position.x;
@@ -180,7 +180,7 @@ gs_type1_finish_init(gs_type1_state * pcis)
pcis->vs_offset.x = pcis->vs_offset.y = 0;
/* Compute the flatness needed for accurate rendering. */
- pcis->flatness = gs_char_flatness(pis, 0.001);
+ pcis->flatness = gs_char_flatness(pgs, 0.001);
pcis->init_done = 1;
}
@@ -272,7 +272,7 @@ gs_type1_seac(gs_type1_state * pcis, const fixed * cstack, fixed asb,
int
gs_type1_endchar(gs_type1_state * pcis)
{
- gs_imager_state *pis = pcis->pis;
+ gs_gstate *pgs = pcis->pgs;
if (pcis->seac_accent >= 0) { /* We just finished the base character of a seac. */
/* Do the accent. */
@@ -321,10 +321,10 @@ gs_type1_endchar(gs_type1_state * pcis)
return 1;
}
if (pcis->pfont->PaintType == 0)
- pis->fill_adjust.x = pis->fill_adjust.y = -1;
+ pgs->fill_adjust.x = pgs->fill_adjust.y = -1;
/* Set the flatness for curve rendering. */
if (!pcis->no_grid_fitting)
- gs_imager_setflat(pis, pcis->flatness);
+ gs_setflat(pgs, pcis->flatness);
return 0;
}
@@ -631,11 +631,11 @@ gs_type1_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat,
/*
* Interpret the CharString until we get to the [h]sbw.
*/
- gs_imager_state gis;
+ gs_gstate gis;
gs_type1_state cis;
int value;
- /* Initialize just enough of the imager state. */
+ /* Initialize just enough of the gs_gstate. */
if (pmat)
gs_matrix_fixed_from_matrix(&gis.ctm, pmat);
else {
diff --git a/base/gxtype1.h b/base/gxtype1.h
index 397bda255..0f48a6ac4 100644
--- a/base/gxtype1.h
+++ b/base/gxtype1.h
@@ -95,7 +95,7 @@ struct gs_type1_state_s {
t1_hinter h;
/* The following are set at initialization */
gs_font_type1 *pfont; /* font-specific data */
- gs_imager_state *pis; /* imager state */
+ gs_gstate *pgs; /* gs_gstate */
gx_path *path; /* path for appending */
bool no_grid_fitting;
int paint_type; /* 0/3 for fill, 1/2 for stroke */
diff --git a/base/gzacpath.h b/base/gzacpath.h
index 5720a563f..f74320bc3 100644
--- a/base/gzacpath.h
+++ b/base/gzacpath.h
@@ -58,7 +58,7 @@ void gx_cpath_accum_discard(gx_device_cpath_accum * padev);
/* Intersect two clipping paths using an accumulator. */
int gx_cpath_intersect_path_slow(gx_clip_path *, gx_path *, int,
- gs_imager_state *, const gx_fill_params *);
+ gs_gstate *, const gx_fill_params *);
int cpath_accum_fill_rect_with(gx_device_cpath_accum *pcdev, gx_device *tdev,
gx_device_color *pdevc);
diff --git a/base/gzht.h b/base/gzht.h
index aac6c5f70..62470d11e 100644
--- a/base/gzht.h
+++ b/base/gzht.h
@@ -45,9 +45,9 @@ void gx_ht_construct_spot_order(gx_ht_order *);
int gx_ht_construct_threshold_order(gx_ht_order *, const byte *);
void gx_ht_construct_bit(gx_ht_bit * bit, int width, int bit_num);
void gx_ht_construct_bits(gx_ht_order *);
-bool gx_transfer_is_monotonic(const gs_imager_state *pis, int plane_index);
+bool gx_transfer_is_monotonic(const gs_gstate *pgs, int plane_index);
int gx_ht_construct_threshold(gx_ht_order *d_order, gx_device *dev,
- const gs_imager_state * pis, int plane_index);
+ const gs_gstate * pgs, int plane_index);
/* Halftone enumeration structure */
struct gs_screen_enum_s {
@@ -57,7 +57,7 @@ struct gs_screen_enum_s {
gs_matrix mat_inv; /* the inversion of mat */
int x, y;
int strip, shift;
- gs_state *pgs;
+ gs_gstate *pgs;
};
#define private_st_gs_screen_enum() /* in gshtscr.c */\
@@ -66,13 +66,13 @@ struct gs_screen_enum_s {
/* order.levels, order.bits, pgs) */
/* Prepare a device halftone for installation, but don't install it. */
-int gs_sethalftone_prepare(gs_state *, gs_halftone *,
+int gs_sethalftone_prepare(gs_gstate *, gs_halftone *,
gx_device_halftone *);
/* Allocate and initialize a spot screen. */
/* This is the first half of gs_screen_init_accurate/memory. */
int gs_screen_order_alloc(gx_ht_order *, gs_memory_t *);
-int gs_screen_order_init_memory(gx_ht_order *, const gs_state *,
+int gs_screen_order_init_memory(gx_ht_order *, const gs_gstate *,
gs_screen_halftone *, bool, gs_memory_t *);
#define gs_screen_order_init(porder, pgs, phsp, accurate)\
@@ -81,14 +81,14 @@ int gs_screen_order_init_memory(gx_ht_order *, const gs_state *,
/* Prepare to sample a spot screen. */
/* This is the second half of gs_screen_init_accurate/memory. */
int gs_screen_enum_init_memory(gs_screen_enum *, const gx_ht_order *,
- gs_state *, const gs_screen_halftone *,
+ gs_gstate *, const gs_screen_halftone *,
gs_memory_t *);
#define gs_screen_enum_init(penum, porder, pgs, phsp)\
gs_screen_enum_init_memory(penum, porder, pgs, phsp, pgs->memory)
/* Process an entire screen plane. */
-int gx_ht_process_screen_memory(gs_screen_enum * penum, gs_state * pgs,
+int gx_ht_process_screen_memory(gs_screen_enum * penum, gs_gstate * pgs,
gs_screen_halftone * phsp, bool accurate,
gs_memory_t * mem);
@@ -189,10 +189,10 @@ void gx_ht_init_cache(const gs_memory_t *mem, gx_ht_cache *, const gx_ht_order *
void gx_ht_order_release(gx_ht_order * porder, gs_memory_t * mem, bool free_cache);
/*
- * Install a device halftone in an imager state. Note that this does not
+ * Install a device halftone in an gs_gstate. Note that this does not
* read or update the client halftone.
*/
-int gx_imager_dev_ht_install(gs_imager_state * pis,
+int gx_gstate_dev_ht_install(gs_gstate * pgs,
gx_device_halftone * pdht,
gs_halftone_type type,
const gx_device * dev);
@@ -202,13 +202,13 @@ int gx_imager_dev_ht_install(gs_imager_state * pis,
* level of the gs_halftone and the gx_device_halftone, and take ownership
* of any substructures.
*/
-int gx_ht_install(gs_state *, const gs_halftone *, gx_device_halftone *);
+int gx_ht_install(gs_gstate *, const gs_halftone *, gx_device_halftone *);
/* Reestablish the effective transfer functions, taking into account */
/* any overrides from halftone dictionaries. */
/* Some compilers object to names longer than 31 characters.... */
-void gx_imager_set_effective_xfer(gs_imager_state * pis);
-void gx_set_effective_transfer(gs_state * pgs);
+void gx_gstate_set_effective_xfer(gs_gstate * pgs);
+void gx_set_effective_transfer(gs_gstate * pgs);
/*
* This routine will take a color name (defined by a ptr and size) and
@@ -234,6 +234,6 @@ int gs_color_name_component_number(gx_device * dev, const char * pname,
* This version converts a name index value into a string and size and
* then call gs_color_name_component_number.
*/
-int gs_cname_to_colorant_number(gs_state * pgs, byte * pname, uint name_size,
+int gs_cname_to_colorant_number(gs_gstate * pgs, byte * pname, uint name_size,
int halftonetype);
#endif /* gzht_INCLUDED */
diff --git a/base/gzline.h b/base/gzline.h
index f2c86a1b4..52666b536 100644
--- a/base/gzline.h
+++ b/base/gzline.h
@@ -31,6 +31,6 @@
#define st_line_params_num_ptrs 1
/* Internal accessor for line parameters in graphics state */
-const gx_line_params *gs_currentlineparams(const gs_imager_state *);
+const gx_line_params *gs_currentlineparams(const gs_gstate *);
#endif /* gzline_INCLUDED */
diff --git a/base/gzstate.h b/base/gzstate.h
index 607e511e8..9309870a5 100644
--- a/base/gzstate.h
+++ b/base/gzstate.h
@@ -19,155 +19,7 @@
#ifndef gzstate_INCLUDED
# define gzstate_INCLUDED
-#include "gscpm.h"
-#include "gscspace.h"
-#include "gsrefct.h"
-#include "gxdcolor.h"
-#include "gxistate.h"
+#include "gxgstate.h"
#include "gsstate.h"
-#include "gxstate.h"
-
-/* Opaque types referenced by the graphics state. */
-#ifndef gx_path_DEFINED
-# define gx_path_DEFINED
-typedef struct gx_path_s gx_path;
-#endif
-#ifndef gx_clip_path_DEFINED
-# define gx_clip_path_DEFINED
-typedef struct gx_clip_path_s gx_clip_path;
-#endif
-#ifndef gx_clip_stack_DEFINED
-# define gx_clip_stack_DEFINED
-typedef struct gx_clip_stack_s gx_clip_stack_t;
-#endif
-#ifndef gs_color_space_DEFINED
-# define gs_color_space_DEFINED
-typedef struct gs_color_space_s gs_color_space;
-#endif
-#ifndef gs_client_color_DEFINED
-# define gs_client_color_DEFINED
-typedef struct gs_client_color_s gs_client_color;
-#endif
-#ifndef gs_font_DEFINED
-# define gs_font_DEFINED
-typedef struct gs_font_s gs_font;
-#endif
-#ifndef gs_device_filter_stack_DEFINED
-# define gs_device_filter_stack_DEFINED
-typedef struct gs_device_filter_stack_s gs_device_filter_stack_t;
-#endif
-
-/* Device filter stack structure is defined here so that gstate
- lifecycle operations can access reference count; implementation is
- in gsdfilt.c.
- */
-
-#ifndef gs_device_filter_DEFINED
-# define gs_device_filter_DEFINED
-typedef struct gs_device_filter_s gs_device_filter_t;
-#endif
-
-/* This is the base structure from which device filters are derived. */
-struct gs_device_filter_stack_s {
- gs_device_filter_stack_t *next;
- gs_device_filter_t *df;
- gx_device *next_device;
- rc_header rc;
-};
-
-/* Graphics state structure. */
-
-struct gs_state_s {
- gs_imager_state_common; /* imager state, must be first */
- gs_state *saved; /* previous state from gsave */
-
- /* Transformation: */
-
- gs_matrix ctm_inverse;
- bool ctm_inverse_valid; /* true if ctm_inverse = ctm^-1 */
- gs_matrix ctm_default;
- bool ctm_default_set; /* if true, use ctm_default; */
- /* if false, ask device */
- /* Paths: */
-
- gx_path *path;
- gx_clip_path *clip_path;
- gx_clip_stack_t *clip_stack; /* (LanguageLevel 3 only) */
- gx_clip_path *view_clip; /* (may be 0, or have rule = 0) */
-
- /* Effective clip path cache */
- gs_id effective_clip_id; /* (key) clip path id */
- gs_id effective_view_clip_id; /* (key) view clip path id */
- gx_clip_path *effective_clip_path; /* (value) effective clip path, */
- /* possibly = clip_path or view_clip */
- bool effective_clip_shared; /* true iff e.c.p. = c.p. or v.c. */
-
-#define gs_currentdevicecolor_inline(pgs) \
- ((pgs)->color[0].dev_color)
-#define gs_currentcolor_inline(pgs) \
- ((pgs)->color[0].ccolor)
-#define gs_currentcolorspace_inline(pgs) \
- ((pgs)->color[0].color_space)
-#define gs_altdevicecolor_inline(pgs) \
- ((pgs)->color[1].dev_color)
-
- /* Current colors (non-stroking, and stroking) */
- struct {
- gs_color_space *color_space; /* after substitution */
- gs_client_color *ccolor;
- gx_device_color *dev_color;
- } color[2];
-
- /* Font: */
-
- gs_font *font;
- gs_font *root_font;
- gs_matrix_fixed char_tm; /* font matrix * ctm */
-#define char_tm_only(pgs) *(gs_matrix *)&(pgs)->char_tm
- bool char_tm_valid; /* true if char_tm is valid */
- gs_in_cache_device_t in_cachedevice; /* (see gscpm.h) */
- gs_char_path_mode in_charpath; /* (see gscpm.h) */
- gs_state *show_gstate; /* gstate when show was invoked */
- /* (so charpath can append to path) */
-
- /* Other stuff: */
-
- int level; /* incremented by 1 per gsave */
- gx_device *device;
-#undef gs_currentdevice_inline
-#define gs_currentdevice_inline(pgs) ((pgs)->device)
- gs_device_filter_stack_t *dfilter_stack;
-
- /* Client data: */
-
- /*void *client_data;*/ /* in imager state */
-#define gs_state_client_data(pgs) ((pgs)->client_data)
- gs_state_client_procs client_procs;
-};
-
-#define public_st_gs_state() /* in gsstate.c */\
- gs_public_st_composite(st_gs_state, gs_state, "gs_state",\
- gs_state_enum_ptrs, gs_state_reloc_ptrs)
-
-/*
- * Enumerate the pointers in a graphics state, other than the ones in the
- * imager state, and device, which must be handled specially.
- */
-#define gs_state_do_ptrs(m)\
- m(0,saved) m(1,path) m(2,clip_path) m(3,clip_stack)\
- m(4,view_clip) m(5,effective_clip_path)\
- m(6,color[0].color_space) m(7,color[0].ccolor) m(8,color[0].dev_color)\
- m(9,color[1].color_space) m(10,color[1].ccolor) m(11,color[1].dev_color)\
- m(12,font) m(13,root_font) m(14,show_gstate)
-#define gs_state_num_ptrs 15
-
-/* The following macro is used for development purpose for designating places
- where current point is changed. Clients must not use it. */
-#define gx_setcurrentpoint(pgs, xx, yy)\
- (pgs)->current_point.x = xx;\
- (pgs)->current_point.y = yy;
-
-int gs_swapcolors(gs_state *);
-void gs_swapcolors_quick(gs_state *);
#endif /* gzstate_INCLUDED */
diff --git a/base/lib.mak b/base/lib.mak
index c6f29a89c..449e3aa1b 100644
--- a/base/lib.mak
+++ b/base/lib.mak
@@ -521,14 +521,14 @@ gxdcconv_h=$(GLSRC)gxdcconv.h $(gxfrac_h)
gxfmap_h=$(GLSRC)gxfmap.h $(gsrefct_h) $(gsstype_h) $(gxfrac_h) $(gxtmap_h)
gxcmap_h=$(GLSRC)gxcmap.h $(gscsel_h) $(gxcindex_h) $(gxcvalue_h) $(gxfmap_h)\
$(gscspace_h)
-gxistate_h=$(GLSRC)gxistate.h\
+gxgstate.h=$(GLSRC)gxgstate.h\
$(gscsel_h) $(gsrefct_h) $(gsropt_h) $(gstparam_h) $(gxcvalue_h) $(gxcmap_h)\
$(gxfixed_h) $(gxline_h) $(gxmatrix_h) $(gxtmap_h) $(gscspace_h) $(gstrans_h)\
$(gsnamecl_h) $(gscms_h)
gxcolor2_h=$(GLSRC)gxcolor2.h\
$(gscolor2_h) $(gsmatrix_h) $(gsrefct_h) $(gxbitmap_h)
gxclist_h=$(GLSRC)gxclist.h $(gscspace_h)\
- $(gxband_h) $(gxbcache_h) $(gxclio_h) $(gxdevbuf_h) $(gxistate_h)\
+ $(gxband_h) $(gxbcache_h) $(gxclio_h) $(gxdevbuf_h) $(gxgstate_h)\
$(gxrplane_h) $(gscms_h) $(gxcolor2_h)
gxcspace_h=$(GLSRC)gxcspace.h\
$(gscspace_h) $(gsccolor_h) $(gscsel_h) $(gxfrac_h) $(gxcindex_h)
@@ -552,7 +552,7 @@ gzht_h=$(GLSRC)gzht.h $(gscsel_h)\
gzline_h=$(GLSRC)gzline.h $(gxline_h)
gzpath_h=$(GLSRC)gzpath.h $(gsmatrix_h) $(gsrefct_h) $(gsstype_h) $(gxpath_h)
gzstate_h=$(GLSRC)gzstate.h $(gscpm_h) $(gscspace_h) $(gsrefct_h) $(gsstate_h)\
- $(gxdcolor_h) $(gxistate_h) $(gxstate_h)
+ $(gxdcolor_h) $(gxgstate_h) $(gxstate_h)
gdevbbox_h=$(GLSRC)gdevbbox.h
gdevmem_h=$(GLSRC)gdevmem.h $(gxbitops_h)
@@ -653,7 +653,7 @@ $(AUX)gscdefs.$(OBJ) : $(GLSRC)gscdef.c\
$(GLOBJ)gxacpath.$(OBJ) : $(GLSRC)gxacpath.c $(AK) $(gx_h)\
$(gserrors_h) $(gsdcolor_h) $(gsrop_h) $(gsstate_h) $(gsstruct_h) $(gsutil_h)\
- $(gxdevice_h) $(gxfixed_h) $(gxistate_h) $(gxpaint_h)\
+ $(gxdevice_h) $(gxfixed_h) $(gxgstate_h) $(gxpaint_h)\
$(gzacpath_h) $(gzcpath_h) $(gzpath_h) $(gxdevsop_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxacpath.$(OBJ) $(C_) $(GLSRC)gxacpath.c
@@ -685,13 +685,13 @@ $(GLOBJ)gxchar.$(OBJ) : $(GLSRC)gxchar.c $(AK) $(gx_h) $(gserrors_h)\
$(GLCC) $(GLO_)gxchar.$(OBJ) $(C_) $(GLSRC)gxchar.c
$(GLOBJ)gxchrout.$(OBJ) : $(GLSRC)gxchrout.c $(AK) $(gx_h) $(math__h)\
- $(gxchrout_h) $(gxfarith_h) $(gxistate_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxchrout_h) $(gxfarith_h) $(gxgstate_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxchrout.$(OBJ) $(C_) $(GLSRC)gxchrout.c
$(GLOBJ)gxcht.$(OBJ) : $(GLSRC)gxcht.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(gsutil_h) $(gxdevsop_h)\
$(gxarith_h) $(gxcmap_h) $(gxdcolor_h) $(gxdevice_h) $(gxfixed_h)\
- $(gxistate_h) $(gxmatrix_h) $(gzht_h) $(gsserial_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxgstate_h) $(gxmatrix_h) $(gzht_h) $(gsserial_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxcht.$(OBJ) $(C_) $(GLSRC)gxcht.c
$(GLOBJ)gxclip.$(OBJ) : $(GLSRC)gxclip.c $(AK) $(gx_h)\
@@ -710,13 +710,13 @@ $(GLOBJ)gxcmap.$(OBJ) : $(GLSRC)gxcmap.c $(AK) $(gx_h) $(gserrors_h)\
$(GLOBJ)gxcpath.$(OBJ) : $(GLSRC)gxcpath.c $(AK) $(gx_h) $(gserrors_h)\
$(gscoord_h) $(gsline_h) $(gsstruct_h) $(gsutil_h)\
- $(gxdevice_h) $(gxfixed_h) $(gxistate_h) $(gxpaint_h)\
+ $(gxdevice_h) $(gxfixed_h) $(gxgstate_h) $(gxpaint_h)\
$(gzpath_h) $(gzcpath_h) $(gzacpath_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxcpath.$(OBJ) $(C_) $(GLSRC)gxcpath.c
$(GLOBJ)gxdcconv.$(OBJ) : $(GLSRC)gxdcconv.c $(AK) $(gx_h)\
$(gsdcolor_h) $(gxcmap_h) $(gxdcconv_h) $(gxdevice_h)\
- $(gxfarith_h) $(gxistate_h) $(gxlum_h) $(gsstate_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxfarith_h) $(gxgstate_h) $(gxlum_h) $(gsstate_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxdcconv.$(OBJ) $(C_) $(GLSRC)gxdcconv.c
$(GLOBJ)gxdcolor.$(OBJ) : $(GLSRC)gxdcolor.c $(AK) $(gx_h)\
@@ -732,7 +732,7 @@ $(GLOBJ)gxhldevc.$(OBJ) : $(GLSRC)gxhldevc.c $(AK) $(gx_h)\
$(GLOBJ)gxfill.$(OBJ) : $(GLSRC)gxfill.c $(AK) $(gx_h) $(gserrors_h)\
$(gsstruct_h) $(gxdevsop_h) $(assert__h)\
$(gxdcolor_h) $(gxdevice_h) $(gxfixed_h) $(gxhttile_h)\
- $(gxistate_h) $(gxpaint_h) $(gxfdrop_h) $(gxfill_h) $(gxpath_h)\
+ $(gxgstate_h) $(gxpaint_h) $(gxfdrop_h) $(gxfill_h) $(gxpath_h)\
$(gsptype1_h) $(gsptype2_h) $(gxpcolor_h) $(gsstate_h)\
$(gzcpath_h) $(gzpath_h) $(gzspotan_h) $(gdevddrw_h) $(memory__h)\
$(stdint__h) $(vdtrace_h) $(gxfilltr_h) $(gxfillsl_h) $(gxfillts_h) $(LIB_MAK) $(MAKEDIRS)
@@ -745,7 +745,7 @@ $(GLOBJ)gxfdrop.$(OBJ) : $(GLSRC)gxfdrop.c $(AK) $(gx_h) $(gserrors_h)\
$(GLOBJ)gxht.$(OBJ) : $(GLSRC)gxht.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(gsbitops_h) $(gsstruct_h) $(gsutil_h)\
- $(gxdcolor_h) $(gxdevice_h) $(gxfixed_h) $(gxistate_h) $(gzht_h)\
+ $(gxdcolor_h) $(gxdevice_h) $(gxfixed_h) $(gxgstate_h) $(gzht_h)\
$(gsserial_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxht.$(OBJ) $(C_) $(GLSRC)gxht.c
@@ -755,7 +755,7 @@ $(GLOBJ)gxhtbit.$(OBJ) : $(GLSRC)gxhtbit.c $(AK) $(gx_h) $(gserrors_h)\
$(GLCC) $(GLO_)gxhtbit.$(OBJ) $(C_) $(GLSRC)gxhtbit.c
$(GLOBJ)gxht_thresh.$(OBJ) : $(GLSRC)gxht_thresh.c $(AK) $(memory__h)\
- $(gx_h) $(gxistate_h) $(gsiparam_h) $(math__h) $(gxfixed_h) $(gximage_h)\
+ $(gx_h) $(gxgstate_h) $(gsiparam_h) $(math__h) $(gxfixed_h) $(gximage_h)\
$(gxdevice_h) $(gxdht_h) $(gxht_thresh_h) $(gzht_h) $(gxdevsop_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxht_thresh.$(OBJ) $(C_) $(GLSRC)gxht_thresh.c
@@ -767,7 +767,7 @@ $(GLOBJ)gxidata.$(OBJ) : $(GLSRC)gxidata.c $(AK) $(gx_h) $(gserrors_h)\
$(GLOBJ)gxifast.$(OBJ) : $(GLSRC)gxifast.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(gpcheck_h) $(gdevmem_h) $(gsbittab_h) $(gsccolor_h)\
$(gspaint_h) $(gsutil_h) $(gxarith_h) $(gxcmap_h) $(gxcpath_h) $(gxdcolor_h)\
- $(gxdevice_h) $(gxdevmem_h) $(gxfixed_h) $(gximage_h) $(gxistate_h) \
+ $(gxdevice_h) $(gxdevmem_h) $(gxfixed_h) $(gximage_h) $(gxgstate_h) \
$(gxmatrix_h) $(gzht_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxifast.$(OBJ) $(C_) $(GLSRC)gxifast.c
@@ -783,7 +783,7 @@ $(GLOBJ)gximage1.$(OBJ) : $(GLSRC)gximage1.c $(AK) $(gx_h)\
$(GLOBJ)gximono.$(OBJ) : $(GLSRC)gximono.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(gpcheck_h) $(gdevmem_h) $(gsccolor_h) $(gspaint_h) $(gsutil_h)\
$(gxarith_h) $(gxcmap_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h)\
- $(gxdevmem_h) $(gxfixed_h) $(gximage_h) $(gxistate_h) $(gxmatrix_h)\
+ $(gxdevmem_h) $(gxfixed_h) $(gximage_h) $(gxgstate_h) $(gxmatrix_h)\
$(gzht_h) $(vdtrace_h) $(gsicc_h) $(gsicc_cache_h) $(gsicc_cms_h)\
$(gxcie_h) $(gscie_h) $(gxht_thresh_h) $(gxdda_h) $(gxdevsop_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gximono.$(OBJ) $(C_) $(GLSRC)gximono.c
@@ -805,7 +805,7 @@ $(GLOBJ)gxi12bit.$(OBJ) : $(GLSRC)gxi12bit.c $(AK) $(gx_h)\
$(gserrors_h) $(memory__h) $(gpcheck_h)\
$(gsccolor_h) $(gspaint_h)\
$(gxarith_h) $(gxcmap_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h)\
- $(gxdevmem_h) $(gxfixed_h) $(gxfrac_h) $(gximage_h) $(gxistate_h)\
+ $(gxdevmem_h) $(gxfixed_h) $(gxfrac_h) $(gximage_h) $(gxgstate_h)\
$(gxmatrix_h) $(vdtrace_h) $(gsicc_h) $(gsicc_cache_h) $(gsicc_cms_h)\
$(gxcie_h) $(gscie_h) $(gxdevsop_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxi12bit.$(OBJ) $(C_) $(GLSRC)gxi12bit.c
@@ -813,7 +813,7 @@ $(GLOBJ)gxi12bit.$(OBJ) : $(GLSRC)gxi12bit.c $(AK) $(gx_h)\
$(GLOBJ)gxi16bit.$(OBJ) : $(GLSRC)gxi16bit.c $(AK) $(gx_h)\
$(gserrors_h) $(memory__h) $(gpcheck_h) $(gsccolor_h) $(gspaint_h)\
$(gxarith_h) $(gxcmap_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h)\
- $(gxdevmem_h) $(gxfixed_h) $(gxfrac_h) $(gximage_h) $(gxistate_h)\
+ $(gxdevmem_h) $(gxfixed_h) $(gxfrac_h) $(gximage_h) $(gxgstate_h)\
$(gxmatrix_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxi16bit.$(OBJ) $(C_) $(GLSRC)gxi16bit.c
@@ -838,12 +838,12 @@ $(GLOBJ)gxpath2.$(OBJ) : $(GLSRC)gxpath2.c $(AK) $(gx_h) $(gserrors_h)\
$(GLCC) $(GLO_)gxpath2.$(OBJ) $(C_) $(GLSRC)gxpath2.c
$(GLOBJ)gxpcopy.$(OBJ) : $(GLSRC)gxpcopy.c $(AK) $(gx_h) $(gserrors_h)\
- $(math__h) $(gxfarith_h) $(gxfixed_h) $(gxistate_h) $(gzpath_h) $(vdtrace_h)\
+ $(math__h) $(gxfarith_h) $(gxfixed_h) $(gxgstate_h) $(gzpath_h) $(vdtrace_h)\
$(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxpcopy.$(OBJ) $(C_) $(GLSRC)gxpcopy.c
$(GLOBJ)gxpdash.$(OBJ) : $(GLSRC)gxpdash.c $(AK) $(gx_h) $(math__h)\
- $(gscoord_h) $(gsline_h) $(gsmatrix_h) $(gxarith_h) $(gxistate_h)\
+ $(gscoord_h) $(gsline_h) $(gsmatrix_h) $(gxarith_h) $(gxgstate_h)\
$(gxfixed_h) $(gzline_h) $(gzpath_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxpdash.$(OBJ) $(C_) $(GLSRC)gxpdash.c
@@ -860,7 +860,7 @@ $(GLOBJ)gxstroke.$(OBJ) : $(GLSRC)gxstroke.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h) $(gpcheck_h) $(gsstate_h)\
$(gscoord_h) $(gsdcolor_h) $(gsdevice_h) $(gsptype1_h)\
$(gxdevice_h) $(gxfarith_h) $(gxfixed_h)\
- $(gxhttile_h) $(gxistate_h) $(gxmatrix_h) $(gxpaint_h)\
+ $(gxhttile_h) $(gxgstate_h) $(gxmatrix_h) $(gxpaint_h)\
$(gzcpath_h) $(gzline_h) $(gzpath_h) $(vdtrace_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxstroke.$(OBJ) $(C_) $(GLSRC)gxstroke.c
@@ -900,7 +900,7 @@ $(GLOBJ)gscparam.$(OBJ) : $(GLSRC)gscparam.c $(AK) $(gx_h)\
$(GLOBJ)gscspace.$(OBJ) : $(GLSRC)gscspace.c $(AK) $(gx_h)\
$(gserrors_h) $(memory__h) $(gsstruct_h) $(gsccolor_h) $(gsutil_h)\
- $(gxcmap_h) $(gxcspace_h) $(gxistate_h) $(gsovrc_h) $(gsstate_h)\
+ $(gxcmap_h) $(gxcspace_h) $(gxgstate_h) $(gsovrc_h) $(gsstate_h)\
$(gsdevice_h) $(gxdevcli_h) $(gzstate_h) $(gsnamecl_h) $(stream_h)\
$(gsicc_h) $(gsicc_manage_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gscspace.$(OBJ) $(C_) $(GLSRC)gscspace.c
@@ -912,7 +912,7 @@ $(GLOBJ)gscicach.$(OBJ) : $(GLSRC)gscicach.c $(AK) $(gx_h)\
$(GLOBJ)gsovrc.$(OBJ) : $(GLSRC)gsovrc.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(gsutil_h) $(gxcomp_h) $(gxdevice_h) $(gsdevice_h) $(gxgetbit_h)\
- $(gsovrc_h) $(gxdcolor_h) $(gxoprect_h) $(gsbitops_h) $(gxistate_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gsovrc_h) $(gxdcolor_h) $(gxoprect_h) $(gsbitops_h) $(gxgstate_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsovrc.$(OBJ) $(C_) $(GLSRC)gsovrc.c
$(GLOBJ)gxoprect.$(OBJ) : $(GLSRC)gxoprect.c $(AK) $(gx_h)\
@@ -996,11 +996,11 @@ $(GLOBJ)gsiodev.$(OBJ) : $(GLSRC)gsiodev.c $(AK) $(gx_h) $(gserrors_h)\
$(gp_h) $(gscdefs_h) $(gsparam_h) $(gsstruct_h) $(gxiodev_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsiodev.$(OBJ) $(C_) $(GLSRC)gsiodev.c
-$(GLOBJ)gsistate.$(OBJ) : $(GLSRC)gsistate.c $(AK) $(gx_h)\
+$(GLOBJ)gsgstate.$(OBJ) : $(GLSRC)gsgstate.c $(AK) $(gx_h)\
$(gserrors_h) $(gscie_h) $(gscspace_h) $(gsstruct_h) $(gsutil_h) $(gxfmap_h)\
- $(gxbitmap_h) $(gxcmap_h) $(gxdht_h) $(gxistate_h) $(gzht_h) $(gzline_h)\
+ $(gxbitmap_h) $(gxcmap_h) $(gxdht_h) $(gxgstate_h) $(gzht_h) $(gzline_h)\
$(gsicc_cache_h) $(gsicc_manage_h) $(gsicc_profilecache_h) $(LIB_MAK) $(MAKEDIRS)
- $(GLCC) $(GLO_)gsistate.$(OBJ) $(C_) $(GLSRC)gsistate.c
+ $(GLCC) $(GLO_)gsgstate.$(OBJ) $(C_) $(GLSRC)gsgstate.c
$(GLOBJ)gsline.$(OBJ) : $(GLSRC)gsline.c $(AK) $(gx_h) $(gserrors_h)\
$(math__h) $(memory__h)\
@@ -1169,7 +1169,7 @@ $(GLD)bbox.dev : $(ECHOGS_XE) $(LIB_MAK) $(GLOBJ)gdevbbox.$(OBJ) $(LIB_MAK) $(MA
$(GLOBJ)gdevbbox.$(OBJ) : $(GLSRC)gdevbbox.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h) $(memory__h) $(gdevbbox_h) $(gsdevice_h) $(gsparam_h)\
- $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h) $(gxiparam_h) $(gxistate_h)\
+ $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h) $(gxiparam_h) $(gxgstate_h)\
$(gxpaint_h) $(gxpath_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gdevbbox.$(OBJ) $(C_) $(GLSRC)gdevbbox.c
@@ -1190,7 +1190,7 @@ $(GLOBJ)gdevplnx.$(OBJ) : $(GLSRC)gdevplnx.c $(AK) $(gx_h)\
$(gserrors_h) $(gsbitops_h) $(gsrop_h) $(gsstruct_h) $(gsutil_h)\
$(gdevplnx_h)\
$(gxcmap_h) $(gxdcolor_h) $(gxdevice_h) $(gxdevmem_h) $(gxdither_h)\
- $(gxgetbit_h) $(gxiparam_h) $(gxistate_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxgetbit_h) $(gxiparam_h) $(gxgstate_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gdevplnx.$(OBJ) $(C_) $(GLSRC)gdevplnx.c
### Default driver procedure implementations
@@ -1203,7 +1203,7 @@ $(GLOBJ)gdevdbit.$(OBJ) : $(GLSRC)gdevdbit.c $(AK) $(gx_h)\
$(GLOBJ)gdevddrw.$(OBJ) : $(GLSRC)gdevddrw.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h) $(memory__h) $(stdint__h) $(gpcheck_h) $(gsrect_h)\
- $(gxdcolor_h) $(gxdevice_h) $(gxfixed_h) $(gxiparam_h) $(gxistate_h)\
+ $(gxdcolor_h) $(gxdevice_h) $(gxfixed_h) $(gxiparam_h) $(gxgstate_h)\
$(gxmatrix_h) $(gxhldevc_h) $(gdevddrw_h) $(gxdtfill_h) $(vdtrace_h)\
$(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gdevddrw.$(OBJ) $(C_) $(GLSRC)gdevddrw.c
@@ -1349,7 +1349,7 @@ LIB5s=$(GLOBJ)gsdevice.$(OBJ) $(GLOBJ)gsdevmem.$(OBJ) $(GLOBJ)gsdparam.$(OBJ) $(
LIB6s=$(GLOBJ)gsfname.$(OBJ) $(GLOBJ)gsfont.$(OBJ) $(GLOBJ)gsgdata.$(OBJ) $(GLOBJ)gsgcache.$(OBJ)
LIB7s=$(GLOBJ)gsht.$(OBJ) $(GLOBJ)gshtscr.$(OBJ)
LIB8s=$(GLOBJ)gsimage.$(OBJ) $(GLOBJ)gsimpath.$(OBJ) $(GLOBJ)gsinit.$(OBJ)
-LIB9s=$(GLOBJ)gsiodev.$(OBJ) $(GLOBJ)gsistate.$(OBJ) $(GLOBJ)gsline.$(OBJ)
+LIB9s=$(GLOBJ)gsiodev.$(OBJ) $(GLOBJ)gsgstate.$(OBJ) $(GLOBJ)gsline.$(OBJ)
LIB10s=$(GLOBJ)gsmalloc.$(OBJ) $(GLOBJ)memento.$(OBJ) $(GLOBJ)gsmatrix.$(OBJ)
LIB11s=$(GLOBJ)gsmemory.$(OBJ) $(GLOBJ)gsmemret.$(OBJ) $(GLOBJ)gsmisc.$(OBJ) $(GLOBJ)gsnotify.$(OBJ) $(GLOBJ)gslibctx.$(OBJ)
LIB12s=$(GLOBJ)gspaint.$(OBJ) $(GLOBJ)gsparam.$(OBJ) $(GLOBJ)gspath.$(OBJ)
@@ -2022,7 +2022,7 @@ $(GLOBJ)gxclipm.$(OBJ) : $(GLSRC)gxclipm.c $(AK) $(gx_h) $(memory__h)\
$(GLOBJ)gximage3.$(OBJ) : $(GLSRC)gximage3.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h) $(memory__h)\
$(gsbitops_h) $(gscspace_h) $(gsstruct_h)\
- $(gxclipm_h) $(gxdevice_h) $(gxdevmem_h) $(gximage3_h) $(gxistate_h)\
+ $(gxclipm_h) $(gxdevice_h) $(gxdevmem_h) $(gximage3_h) $(gxgstate_h)\
$(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gximage3.$(OBJ) $(C_) $(GLSRC)gximage3.c
@@ -2206,7 +2206,7 @@ $(GLOBJ)gsmchunk.$(OBJ) : $(GLSRC)gsmchunk.c $(AK) $(gx_h)\
# We include this here for the same reasons as page.dev.
gdevvec_h=$(GLSRC)gdevvec.h $(gdevbbox_h) $(gp_h) $(gdevflp_h) $(gdevoflt_h) $(gdevkrnlsclass_h)\
- $(gsropt_h) $(gxdevice_h) $(gxiparam_h) $(gxistate_h) $(gxhldevc_h) $(stream_h)
+ $(gsropt_h) $(gxdevice_h) $(gxiparam_h) $(gxgstate_h) $(gxhldevc_h) $(stream_h)
vector_=$(GLOBJ)gdevvec.$(OBJ)
$(GLD)vector.dev : $(LIB_MAK) $(ECHOGS_XE) $(vector_)\
@@ -2364,7 +2364,7 @@ $(GLOBJ)gstype42.$(OBJ) : $(GLSRC)gstype42.c $(AK) $(gx_h)\
$(gsccode_h) $(gsline_h) $(gsmatrix_h) $(gsstruct_h) $(gsutil_h)\
$(gxchrout_h) $(gxfixed_h) $(gxfont_h) $(gxfont42_h)\
$(gxpath_h) $(gxttf_h) $(gxttfb_h) $(gxtext_h) $(gxchar_h) $(gxfcache_h)\
- $(gxistate_h) $(gzstate_h) $(stream_h) $(stdint__h) \
+ $(gxgstate_h) $(gzstate_h) $(stream_h) $(stdint__h) \
$(strimpl_h) $(stream_h) $(strmio_h) $(szlibx_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gstype42.$(OBJ) $(C_) $(GLSRC)gstype42.c
@@ -2420,7 +2420,7 @@ $(GLOBJ)gxttfb.$(OBJ) : $(GLSRC)gxttfb.c $(AK) $(gx_h) $(gserrors_h) \
$(gxfixed_h) $(gxpath_h) $(gxfont_h) $(gxfont42_h) $(gxttfb_h) $(gxfcache_h)\
$(gxmatrix_h) $(gxhintn_h) $(gzpath_h) $(ttfmemd_h)\
$(gsstruct_h) $(gsfont_h) $(gdebug_h) $(memory__h) $(math__h)\
- $(gxistate_h) $(gxpaint_h) $(gzspotan_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxgstate_h) $(gxpaint_h) $(gzspotan_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxttfb.$(OBJ) $(C_) $(GLSRC)gxttfb.c
$(GLOBJ)gzspotan.$(OBJ) : $(GLSRC)gzspotan.c $(AK) $(gx_h)\
@@ -2553,7 +2553,7 @@ gxtype1_h=$(GLSRC)gxtype1.h $(gscrypt1_h) $(gsgdata_h) $(gstype1_h) $(gxhintn_h)
$(GLOBJ)gxtype1.$(OBJ) : $(GLSRC)gxtype1.c $(AK) $(gx_h) $(gserrors_h)\
$(math__h) $(gsccode_h) $(gsline_h) $(gsstruct_h) $(memory__h)\
$(gxarith_h) $(gxchrout_h) $(gxcoord_h) $(gxfixed_h) $(gxmatrix_h)\
- $(gxfont_h) $(gxfont1_h) $(gxistate_h) $(gxtype1_h)\
+ $(gxfont_h) $(gxfont1_h) $(gxgstate_h) $(gxtype1_h)\
$(gzpath_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxtype1.$(OBJ) $(C_) $(GLSRC)gxtype1.c
@@ -2597,7 +2597,7 @@ $(GLD)psf1lib.dev : $(LIB_MAK) $(ECHOGS_XE) $(psf1lib_) $(type1lib_) \
$(GLOBJ)gstype1.$(OBJ) : $(GLSRC)gstype1.c $(AK) $(gx_h) $(gserrors_h)\
$(math__h) $(memory__h) $(gsstruct_h) $(gxhintn_h)\
$(gxarith_h) $(gxcoord_h) $(gxfixed_h) $(gxmatrix_h)\
- $(gxfont_h) $(gxfont1_h) $(gxistate_h) $(gxtype1_h)\
+ $(gxfont_h) $(gxfont1_h) $(gxgstate_h) $(gxtype1_h)\
$(gxpath_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gstype1.$(OBJ) $(C_) $(GLSRC)gstype1.c
@@ -2612,7 +2612,7 @@ $(GLD)psf2lib.dev : $(LIB_MAK) $(ECHOGS_XE) $(psf2lib_) $(type1lib_) \
$(GLOBJ)gstype2.$(OBJ) : $(GLSRC)gstype2.c $(AK) $(gx_h) $(gserrors_h)\
$(math__h) $(memory__h) $(gsstruct_h)\
$(gxarith_h) $(gxcoord_h) $(gxfixed_h) $(gxmatrix_h)\
- $(gxfont_h) $(gxfont1_h) $(gxistate_h) $(gxtype1_h)\
+ $(gxfont_h) $(gxfont1_h) $(gxgstate_h) $(gxtype1_h)\
$(gxpath_h) $(gxhintn_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gstype2.$(OBJ) $(C_) $(GLSRC)gstype2.c
@@ -2643,7 +2643,7 @@ $(GLOBJ)gxicolor.$(OBJ) : $(GLSRC)gxicolor.c $(AK) $(gx_h)\
$(gxfixed_h) $(gxfrac_h) $(gxmatrix_h)\
$(gsccolor_h) $(gspaint_h) $(gzstate_h)\
$(gxdevice_h) $(gxcmap_h) $(gxdcconv_h) $(gxdcolor_h)\
- $(gxistate_h) $(gxdevmem_h) $(gxcpath_h) $(gximage_h)\
+ $(gxgstate_h) $(gxdevmem_h) $(gxcpath_h) $(gximage_h)\
$(gsicc_h) $(gsicc_cache_h) $(gsicc_cms_h) $(gxcie_h)\
$(gscie_h) $(gzht_h) $(gxht_thresh_h) $(gxdevsop_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxicolor.$(OBJ) $(C_) $(GLSRC)gxicolor.c
@@ -2682,7 +2682,7 @@ $(GLOBJ)gxiscale.$(OBJ) : $(GLSRC)gxiscale.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h) $(memory__h) $(stdint__h) $(gpcheck_h)\
$(gsccolor_h) $(gspaint_h) $(sidscale_h) $(gxdevsop_h)\
$(gxarith_h) $(gxcmap_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h)\
- $(gxdevmem_h) $(gxfixed_h) $(gxfrac_h) $(gximage_h) $(gxistate_h)\
+ $(gxdevmem_h) $(gxfixed_h) $(gxfrac_h) $(gximage_h) $(gxgstate_h)\
$(gxmatrix_h) $(siinterp_h) $(siscale_h) $(stream_h) $(vdtrace_h)\
$(gscindex_h) $(gxcolor2_h) $(gscspace_h) $(gsicc_cache_h)\
$(gsicc_manage_h) $(gsicc_h) $(LIB_MAK) $(MAKEDIRS)
@@ -2756,7 +2756,7 @@ $(GLD)cspixlib.dev : $(LIB_MAK) $(ECHOGS_XE) $(cspixlib_) \
$(GLOBJ)gscpixel.$(OBJ) : $(GLSRC)gscpixel.c $(AK) $(gx_h)\
$(gserrors_h) $(gsrefct_h) $(gxcspace_h) $(gscpixel_h) $(gxdevice_h)\
- $(gxistate_h) $(gsovrc_h) $(gsstate_h) $(gzstate_h) $(stream_h)\
+ $(gxgstate_h) $(gsovrc_h) $(gsstate_h) $(gzstate_h) $(stream_h)\
$(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gscpixel.$(OBJ) $(C_) $(GLSRC)gscpixel.c
@@ -2778,7 +2778,7 @@ $(GLOBJ)gscie.$(OBJ) : $(GLSRC)gscie.c $(AK) $(gx_h) $(gserrors_h)\
$(GLOBJ)gsciemap.$(OBJ) : $(GLSRC)gsciemap.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h)\
$(gxarith_h) $(gxcie_h) $(gxcmap_h) $(gxcspace_h) $(gxdevice_h) \
- $(gxistate_h) $(gscolor2_h) $(gsicc_create_h) $(gsicc_manage_h)\
+ $(gxgstate_h) $(gscolor2_h) $(gsicc_create_h) $(gsicc_manage_h)\
$(gsicc_h) $(gscspace_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsciemap.$(OBJ) $(C_) $(GLSRC)gsciemap.c
@@ -2840,19 +2840,19 @@ $(GLOBJ)gsicc_monitorcm.$(OBJ) : $(GLSRC)gsicc_monitorcm.c $(AK) $(std_h)\
$(GLOBJ)gsicc_nocm.$(OBJ) : $(GLSRC)gsicc_nocm.c $(AK) $(std_h) $(gx_h)\
$(stdpre_h) $(gstypes_h) $(gsmemory_h) $(gsstruct_h) $(scommon_h) $(strmio_h)\
- $(string__h) $(gxistate_h) $(gxcspace_h) $(gsicc_cms_h)\
+ $(string__h) $(gxgstate_h) $(gxcspace_h) $(gsicc_cms_h)\
$(gsicc_cache_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsicc_nocm.$(OBJ) $(C_) $(GLSRC)gsicc_nocm.c
$(GLOBJ)gsicc_replacecm.$(OBJ) : $(GLSRC)gsicc_replacecm.c $(AK) $(std_h) $(gx_h)\
$(stdpre_h) $(gstypes_h) $(gsmemory_h) $(gsstruct_h) $(scommon_h) $(strmio_h)\
- $(string__h) $(gxistate_h) $(gxcspace_h) $(gsicc_cms_h)\
+ $(string__h) $(gxgstate_h) $(gxcspace_h) $(gsicc_cms_h)\
$(gsicc_cache_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsicc_replacecm.$(OBJ) $(C_) $(GLSRC)gsicc_replacecm.c
$(GLOBJ)gsicc_manage.$(OBJ) : $(GLSRC)gsicc_manage.c $(AK) $(gx_h)\
$(stdpre_h) $(gstypes_h) $(gsmemory_h) $(gsstruct_h) $(scommon_h) $(strmio_h)\
- $(gxistate_h) $(gxcspace_h) $(gscms_h) $(gsicc_manage_h) $(gsicc_cache_h)\
+ $(gxgstate_h) $(gxcspace_h) $(gscms_h) $(gsicc_manage_h) $(gsicc_cache_h)\
$(gsicc_profilecache_h) $(gserrors_h) $(string__h) $(gxclist_h) $(gxcldev_h)\
$(gzstate_h) $(gsicc_create_h) $(gpmisc_h) $(gxdevice_h) $(std_h)\
$(gsicc_cms_h) $(gp_h) $(LIB_MAK) $(MAKEDIRS)
@@ -2860,7 +2860,7 @@ $(GLOBJ)gsicc_manage.$(OBJ) : $(GLSRC)gsicc_manage.c $(AK) $(gx_h)\
$(GLOBJ)gsicc_cache.$(OBJ) : $(GLSRC)gsicc_cache.c $(AK) $(gx_h)\
$(stdpre_h) $(gstypes_h) $(gsmemory_h) $(gsstruct_h) $(scommon_h) $(smd5_h)\
- $(gxistate_h) $(gscms_h) $(gsicc_manage_h) $(gsicc_cache_h) $(gzstate_h)\
+ $(gxgstate_h) $(gscms_h) $(gsicc_manage_h) $(gsicc_cache_h) $(gzstate_h)\
$(gserrors_h) $(gsmalloc_h) $(string__h) $(gxsync_h) $(std_h) $(gsicc_cms_h)\
$(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsicc_cache.$(OBJ) $(C_) $(GLSRC)gsicc_cache.c
@@ -2903,13 +2903,13 @@ $(GLOBJ)gsicc_lcms2.$(OBJ) : $(GLOBJ)gsicc_lcms2_$(SHARE_LCMS).$(OBJ) $(gp_h) \
# This object is here instead of in psi since it is used lazily by the
# remap operations.
$(GLOBJ)gsicc_create_1.$(OBJ) : $(GLSRC)gsicc_create.c $(AK) $(string__h)\
- $(gsmemory_h) $(gx_h) $(gxistate_h) $(gstypes_h) $(gscspace_h)\
+ $(gsmemory_h) $(gx_h) $(gxgstate_h) $(gstypes_h) $(gscspace_h)\
$(gscie_h) $(gsicc_create_h) $(gxarith_h) $(gsicc_manage_h) $(gsicc_cache_h)\
$(math__h) $(gscolor2_h) $(gxcie_h) $(LIB_MAK) $(MAKEDIRS)
$(GLLCMSCC) $(GLO_)gsicc_create_1.$(OBJ) $(C_) $(GLSRC)gsicc_create.c
$(GLOBJ)gsicc_create_0.$(OBJ) : $(GLSRC)gsicc_create.c $(AK) $(string__h)\
- $(gsmemory_h) $(gx_h) $(gxistate_h) $(gstypes_h) $(gscspace_h)\
+ $(gsmemory_h) $(gx_h) $(gxgstate_h) $(gstypes_h) $(gscspace_h)\
$(gscie_h) $(gsicc_create_h) $(gxarith_h) $(gsicc_manage_h) $(gsicc_cache_h)\
$(math__h) $(gscolor2_h) $(gxcie_h) $(icc34_h) $(LIB_MAK) $(MAKEDIRS)
$(GLLCMSCC) $(GLO_)gsicc_create_0.$(OBJ) $(C_) $(GLSRC)gsicc_create.c
@@ -3009,7 +3009,7 @@ $(GLOBJ)gscdevn.$(OBJ) : $(GLSRC)gscdevn.c $(AK) $(gx_h) $(gserrors_h)\
$(memory__h) $(string__h) $(gsicc_h)\
$(gscdevn_h) $(gsfunc_h) $(gsmatrix_h) $(gsrefct_h) $(gsstruct_h)\
$(gxcspace_h) $(gxcdevn_h) $(gxfarith_h) $(gxfrac_h) $(gsnamecl_h) $(gxcmap_h)\
- $(gxistate_h) $(gscoord_h) $(gzstate_h) $(gxdevcli_h) $(gsovrc_h) $(stream_h)\
+ $(gxgstate_h) $(gscoord_h) $(gzstate_h) $(gxdevcli_h) $(gsovrc_h) $(stream_h)\
$(gsicc_manage_h) $(gsicc_cache_h) $(gxdevice_h) $(gxcie_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gscdevn.$(OBJ) $(C_) $(GLSRC)gscdevn.c
@@ -3095,7 +3095,7 @@ $(GLOBJ)gstrans.$(OBJ) : $(GLSRC)gstrans.c $(AK) $(gx_h) $(gserrors_h)\
$(GLOBJ)gximag3x.$(OBJ) : $(GLSRC)gximag3x.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h) $(memory__h) $(gdevbbox_h)\
$(gsbitops_h) $(gscpixel_h) $(gscspace_h) $(gsstruct_h)\
- $(gxdevice_h) $(gxdevmem_h) $(gximag3x_h) $(gxistate_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gxdevice_h) $(gxdevmem_h) $(gximag3x_h) $(gxgstate_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gximag3x.$(OBJ) $(C_) $(GLSRC)gximag3x.c
$(GLOBJ)gxblend.$(OBJ) : $(GLSRC)gxblend.c $(AK) $(gx_h) $(memory__h)\
@@ -3105,13 +3105,13 @@ $(GLOBJ)gxblend.$(OBJ) : $(GLSRC)gxblend.c $(AK) $(gx_h) $(memory__h)\
$(GLOBJ)gxblend1.$(OBJ) : $(GLSRC)gxblend1.c $(AK) $(gx_h) $(memory__h)\
$(gstparam_h) $(gsrect_h) $(gxdcconv_h) $(gxblend_h) $(gxdevcli_h)\
- $(gxistate_h) $(gdevdevn_h) $(gdevp14_h) $(vdtrace_h) $(png__h) $(gp_h)\
+ $(gxgstate_h) $(gdevdevn_h) $(gdevp14_h) $(vdtrace_h) $(png__h) $(gp_h)\
$(gsicc_cache_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxblend1.$(OBJ) $(C_) $(GLSRC)gxblend1.c
$(GLOBJ)gdevp14.$(OBJ) : $(GLSRC)gdevp14.c $(AK) $(gx_h) $(gserrors_h)\
$(math__h) $(memory__h) $(gscdefs_h) $(gxdevice_h) $(gsdevice_h)\
- $(gsstruct_h) $(gscoord_h) $(gxistate_h) $(gxdcolor_h) $(gxiparam_h)\
+ $(gsstruct_h) $(gscoord_h) $(gxgstate_h) $(gxdcolor_h) $(gxiparam_h)\
$(gstparam_h) $(gxblend_h) $(gxtext_h) $(gsdfilt_h) $(gsimage_h)\
$(gsrect_h) $(gzstate_h) $(gdevdevn_h) $(gdevp14_h) $(gdevprn_h) $(gsovrc_h) $(gxcmap_h)\
$(gscolor1_h) $(gstrans_h) $(gsutil_h) $(gxcldev_h) $(gxclpath_h)\
@@ -3161,21 +3161,21 @@ $(GLOBJ)gsptype2.$(OBJ) : $(GLSRC)gsptype2.c $(AK) $(gx_h)\
$(GLOBJ)gsshade.$(OBJ) : $(GLSRC)gsshade.c $(AK) $(gx_h) $(gserrors_h)\
$(gscspace_h) $(gsstruct_h) $(gsptype2_h)\
- $(gxcspace_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevcli_h) $(gxistate_h)\
+ $(gxcspace_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevcli_h) $(gxgstate_h)\
$(gxpaint_h) $(gxpath_h) $(gxshade_h) $(gxshade4_h)\
$(gzcpath_h) $(gzpath_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsshade.$(OBJ) $(C_) $(GLSRC)gsshade.c
$(GLOBJ)gxshade.$(OBJ) : $(GLSRC)gxshade.c $(AK) $(gx_h) $(gserrors_h)\
$(math__h) $(gsrect_h) $(gxcspace_h) $(gscindex_h) $(gscie_h) \
- $(gxdevcli_h) $(gxistate_h) $(gxdht_h) $(gxpaint_h) $(gxshade_h) $(gxshade4_h)\
+ $(gxdevcli_h) $(gxgstate_h) $(gxdht_h) $(gxpaint_h) $(gxshade_h) $(gxshade4_h)\
$(gsicc_h) $(gsicc_cache_h) $(gxcdevn_h) $(gximage_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxshade.$(OBJ) $(C_) $(GLSRC)gxshade.c
$(GLOBJ)gxshade1.$(OBJ) : $(GLSRC)gxshade1.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h) $(memory__h) $(vdtrace_h)\
$(gscoord_h) $(gsmatrix_h) $(gspath_h) $(gsptype2_h)\
- $(gxcspace_h) $(gxdcolor_h) $(gxfarith_h) $(gxfixed_h) $(gxistate_h)\
+ $(gxcspace_h) $(gxdcolor_h) $(gxfarith_h) $(gxfixed_h) $(gxgstate_h)\
$(gxpath_h) $(gxshade_h) $(gxshade4_h) $(gxdevcli_h) $(gsicc_cache_h)\
$(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxshade1.$(OBJ) $(C_) $(GLSRC)gxshade1.c
@@ -3183,13 +3183,13 @@ $(GLOBJ)gxshade1.$(OBJ) : $(GLSRC)gxshade1.c $(AK) $(gx_h)\
$(GLOBJ)gxshade4.$(OBJ) : $(GLSRC)gxshade4.c $(AK) $(gx_h)\
$(gserrors_h) $(math__h) $(memory__h)\
$(gscoord_h) $(gsmatrix_h) $(gsptype2_h)\
- $(gxcspace_h) $(gxdcolor_h) $(gxdevcli_h) $(gxistate_h) $(gxpath_h)\
+ $(gxcspace_h) $(gxdcolor_h) $(gxdevcli_h) $(gxgstate_h) $(gxpath_h)\
$(gxshade_h) $(gxshade4_h) $(vdtrace_h) $(gsicc_cache_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxshade4.$(OBJ) $(C_) $(GLSRC)gxshade4.c
$(GLOBJ)gxshade6.$(OBJ) : $(GLSRC)gxshade6.c $(AK) $(gx_h)\
$(gserrors_h) $(memory__h) $(gxdevsop_h) $(stdint__h) $(gscoord_h)\
- $(gscicach_h) $(gsmatrix_h) $(gxcspace_h) $(gxdcolor_h) $(gxistate_h)\
+ $(gscicach_h) $(gsmatrix_h) $(gxcspace_h) $(gxdcolor_h) $(gxgstate_h)\
$(gxshade_h) $(gxshade4_h) $(gxdevcli_h) $(gxarith_h) $(gzpath_h) $(math__h)\
$(vdtrace_h) $(gsicc_cache_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxshade6.$(OBJ) $(C_) $(GLSRC)gxshade6.c