summaryrefslogtreecommitdiff
path: root/base/gxshade.c
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2021-03-16 18:00:13 -0700
committerRay Johnston <ray.johnston@artifex.com>2021-05-03 08:43:18 -0700
commit032cb22e6d63e2e81b86ae6ba1cbd04d7798bae7 (patch)
tree384383fb28c5e38380019437c026087ac99d2196 /base/gxshade.c
parent2b5118c3fcb8e5cc58c9a3d87ad9fe327eece117 (diff)
downloadghostpdl-032cb22e6d63e2e81b86ae6ba1cbd04d7798bae7.tar.gz
Add object type specific device halftones to the graphics state.
PostScript 'sethalftone' has an optional parameter "ObjectType" that allows one of the three object specific types to be set: Vector, Image or Text. Also add a new PostScript operator to set the current halftone (dev_ht, set by sethalftone) as the device halftone to be used for an object type: path, image and text. For non-PostScript clients, the gs_halftone structure adds a 'objtype' element (enum) that can be set prior to calling gs_sethalftone. The gs_gstate_s dev_ht is now an array of HT_OBJTYPE_COUNT elements, indexed by the gs_HT_objtype_t enum, with HT_OBJTYPE_DEFAULT (value 0) used for prior sethalftone/setscreen/setcolorscreen operations. NOTE: adding object types beyond the default+3 entries will require modification of gx_select_dev_ht since it only uses 3 bits of the 'tag' to get the index for the dev_ht[] array. For code style, change to use != NULL instead of != 0 in most places that this commit touched (but we may want a general cleanup of this everywhere). TBD: Command line options for all PDL's will need a method to take a halftone specification -- most likely a file that may be "PS-lite" syntax and may be limited to a threshold array. Discussions are in progress.
Diffstat (limited to 'base/gxshade.c')
-rw-r--r--base/gxshade.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/gxshade.c b/base/gxshade.c
index a0ddf2900..08b9edcc2 100644
--- a/base/gxshade.c
+++ b/base/gxshade.c
@@ -365,7 +365,7 @@ top:
}
if (num_colors <= 32) {
/****** WRONG FOR MULTI-PLANE HALFTONES ******/
- num_colors *= pgs->dev_ht->components[0].corder.num_levels;
+ num_colors *= pgs->dev_ht[HT_OBJTYPE_DEFAULT]->components[0].corder.num_levels;
}
if (psh->head.type == 2 || psh->head.type == 3) {
max_error *= 0.25;