[gs-cvs] rev 7597 - in trunk/gs: doc src
alexcher at ghostscript.com
alexcher at ghostscript.com
Wed Jan 10 12:20:53 PST 2007
Author: alexcher
Date: 2007-01-10 12:20:52 -0800 (Wed, 10 Jan 2007)
New Revision: 7597
Modified:
trunk/gs/doc/pscet_status.txt
trunk/gs/src/iimage.h
trunk/gs/src/int.mak
trunk/gs/src/zimage.c
trunk/gs/src/zimage3.c
trunk/gs/src/ztrans.c
Log:
Adobe interpreters appear to accept sampled images in the pattern
color space using the base color space instead of the pattern space.
We do the same in the compatibility mode to meet CET 12-07a-12.
DIFFERENCES:
None
Modified: trunk/gs/doc/pscet_status.txt
===================================================================
--- trunk/gs/doc/pscet_status.txt 2007-01-10 17:04:22 UTC (rev 7596)
+++ trunk/gs/doc/pscet_status.txt 2007-01-10 20:20:52 UTC (rev 7597)
@@ -2159,8 +2159,8 @@
12-07A-11 OK Minor differences visually reviewed by RJJ
-12-07A-12 DIFF GS reports one more rangecheck in image than CPSI. Square
- pattern missing in GS output. assign Alex (initially).
+12-07A-12 OK Adobe acceptts images in the pattern color space.
+ Since rev. 7597 we do the same in the compatibility mode. - Alex
12-07A-13 OK Minor differences in positions and character shapes - ADC
Modified: trunk/gs/src/iimage.h
===================================================================
--- trunk/gs/src/iimage.h 2007-01-10 17:04:22 UTC (rev 7596)
+++ trunk/gs/src/iimage.h 2007-01-10 20:20:52 UTC (rev 7597)
@@ -38,7 +38,8 @@
bool has_alpha);
int pixel_image_params(i_ctx_t *i_ctx_p, const ref *op,
gs_pixel_image_t *pim, image_params * pip,
- int max_bits_per_component, bool has_alpha);
+ int max_bits_per_component, bool has_alpha,
+ const gs_color_space *csp);
/* Exported for zimage3.c and ztrans.c */
int zimage_setup(i_ctx_t *i_ctx_p, const gs_pixel_image_t * pim,
Modified: trunk/gs/src/int.mak
===================================================================
--- trunk/gs/src/int.mak 2007-01-10 17:04:22 UTC (rev 7596)
+++ trunk/gs/src/int.mak 2007-01-10 20:20:52 UTC (rev 7597)
@@ -481,7 +481,7 @@
$(gscspace_h) $(gscssub_h) $(gsimage_h) $(gsmatrix_h) $(gsstruct_h)\
$(gxiparam_h)\
$(estack_h) $(ialloc_h) $(ifilter_h) $(igstate_h) $(iimage_h) $(ilevel_h)\
- $(store_h) $(stream_h)
+ $(store_h) $(stream_h) $(gxcspace_h)
$(PSCC) $(PSO_)zimage.$(OBJ) $(C_) $(PSSRC)zimage.c
$(PSOBJ)zmatrix.$(OBJ) : $(PSSRC)zmatrix.c $(OP)\
Modified: trunk/gs/src/zimage.c
===================================================================
--- trunk/gs/src/zimage.c 2007-01-10 17:04:22 UTC (rev 7596)
+++ trunk/gs/src/zimage.c 2007-01-10 20:20:52 UTC (rev 7597)
@@ -35,6 +35,7 @@
#include "stream.h"
#include "ifilter.h" /* for stream exception handling */
#include "iimage.h"
+#include "gxcspace.h"
/* Forward references */
private int zimage_data_setup(i_ctx_t *i_ctx_p, const gs_pixel_image_t * pim,
@@ -116,15 +117,15 @@
int
pixel_image_params(i_ctx_t *i_ctx_p, const ref *op, gs_pixel_image_t *pim,
image_params *pip, int max_bits_per_component,
- bool has_alpha)
+ bool has_alpha, const gs_color_space *csp)
{
int num_components =
- gs_color_space_num_components(gs_currentcolorspace(igs));
+ gs_color_space_num_components(csp);
int code;
if (num_components < 1)
return_error(e_rangecheck); /* Pattern space not allowed */
- pim->ColorSpace = gs_currentcolorspace(igs);
+ pim->ColorSpace = csp;
code = data_image_params(imemory, op, (gs_data_image_t *) pim, pip, true,
num_components, max_bits_per_component,
has_alpha);
@@ -161,14 +162,28 @@
gs_image_t image;
image_params ip;
int code;
+ const gs_color_space *csp = gs_currentcolorspace(igs);
+ extern bool CPSI_mode;
- gs_image_t_init(&image, gs_currentcolorspace(igs));
+ /* Adobe interpreters accept sampled images when the current color
+ * space is a pattern color space using the base color space instead
+ * of the pattern space. CET 12-07a-12
+ * If all conditions are not met the pattern color space goes through
+ * triggering a rangecheck error.
+ */
+ if (CPSI_mode && gs_color_space_num_components(csp) < 1) {
+ const gs_color_space *bsp = cs_base_space(csp);
+ if (bsp)
+ csp = bsp;
+ }
+
+ gs_image_t_init(&image, csp);
code = pixel_image_params( i_ctx_p,
op,
(gs_pixel_image_t *)&image,
&ip,
(level2_enabled ? 16 : 8),
- has_alpha );
+ has_alpha, csp);
if (code < 0)
return code;
Modified: trunk/gs/src/zimage3.c
===================================================================
--- trunk/gs/src/zimage3.c 2007-01-10 17:04:22 UTC (rev 7596)
+++ trunk/gs/src/zimage3.c 2007-01-10 20:20:52 UTC (rev 7597)
@@ -52,8 +52,8 @@
)
return_error(e_rangecheck);
if ((code = pixel_image_params(i_ctx_p, pDataDict,
- (gs_pixel_image_t *)&image, &ip_data,
- 12, false)) < 0 ||
+ (gs_pixel_image_t *)&image, &ip_data,
+ 12, false, gs_currentcolorspace(igs))) < 0 ||
(mcode = code = data_image_params(imemory, pMaskDict, &image.MaskDict,
&ip_mask, false, 1, 12, false)) < 0 ||
(code = dict_int_param(pDataDict, "ImageType", 1, 1, 0, &ignored)) < 0 ||
@@ -95,7 +95,7 @@
gs_image4_t_init(&image, NULL);
code = pixel_image_params(i_ctx_p, op, (gs_pixel_image_t *)&image, &ip,
- 12, false);
+ 12, false, gs_currentcolorspace(igs));
if (code < 0)
return code;
code = dict_int_array_check_param(imemory, op, "MaskColor",
Modified: trunk/gs/src/ztrans.c
===================================================================
--- trunk/gs/src/ztrans.c 2007-01-10 17:04:22 UTC (rev 7596)
+++ trunk/gs/src/ztrans.c 2007-01-10 20:20:52 UTC (rev 7597)
@@ -365,8 +365,8 @@
if (dict_find_string(op, "DataDict", &pDataDict) <= 0)
return_error(e_rangecheck);
if ((code = pixel_image_params(i_ctx_p, pDataDict,
- (gs_pixel_image_t *)&image, &ip_data,
- 16, false)) < 0 ||
+ (gs_pixel_image_t *)&image, &ip_data,
+ 16, false, gs_currentcolorspace(igs))) < 0 ||
(code = dict_int_param(pDataDict, "ImageType", 1, 1, 0, &ignored)) < 0
)
return code;
More information about the gs-cvs
mailing list