diff options
author | Henry Stiles <henry.stiles@artifex.com> | 2006-04-20 17:54:57 +0000 |
---|---|---|
committer | Henry Stiles <henry.stiles@artifex.com> | 2006-04-20 17:54:57 +0000 |
commit | 7815f9bb66aba4c42ae2a2261944621edf7f5225 (patch) | |
tree | 2ecc361088a151290ccf1e3e80c3f1644870b99f /pxl | |
parent | 69f0fa9a45fd1bafdc381907eb37aa495ee291b8 (diff) |
Set the graphics state color space to pxl's color space before
rendering a pattern. Possible improvements to be found in:
CET
---
C305.BIN
C334.BIN
C420.BIN
C421.BIN
C422.BIN
C427.BIN
FTS
---
T421.BIN
T422.BIN
A001.BIN
T337.BIN
T421.BIN
T422.BIN
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2363 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pxl')
-rw-r--r-- | pxl/pxink.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/pxl/pxink.c b/pxl/pxink.c index 17565a372..777ee17ef 100644 --- a/pxl/pxink.c +++ b/pxl/pxink.c @@ -249,6 +249,7 @@ px_paint_pattern(const gs_client_color *pcc, gs_state *pgs) */ image.Width = rep_width; image.Height = full_height; + image.CombineWithColor = true; for ( x = 0; x < full_width; x += rep_width ) { int y; @@ -358,20 +359,32 @@ render_pattern(gs_client_color *pcc, const px_pattern_t *pattern, pxgs->brush.type = pxgs->pen.type = pxpNull; gs_newpath(pgs); px_initclip(pxs); - /* - * Since the PaintProcs don't reference the saved color space or - * color, reset these so that there isn't an extra retained - * reference to the Pattern object. - */ - { - gs_color_space cs; - gs_color_space *pcs; - - gs_cspace_init_DeviceGray(pxgs->memory, &cs); - pcs = &cs; - gs_setcolorspace(pgs, pcs); - } } + { + gs_color_space cs; + gs_color_space *pcs; + /* set the color space */ + switch ( pxgs->color_space ) { + case eGray: + gs_cspace_init_DeviceGray(pxgs->memory, &cs); + pcs = &cs; + gs_setcolorspace(pgs, pcs); + break; + case eRGB: + gs_cspace_init_DeviceRGB(pxgs->memory, &cs); + pcs = &cs; + gs_setcolorspace(pgs, pcs); + break; + case eSRGB: + case eCRGB: + if ( pl_build_and_set_sRGB_space(pgs) < 0 ) + /* should not happen */ + return_error(pxgs->memory, errorInsufficientMemory); + break; + default: + return_error(pxgs->memory, errorIllegalAttributeValue); + } + } code = gs_makepattern(pcc, &template, &mat, pgs, NULL); gs_grestore(pgs); return code; |