summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/gxicolor.c29
-rw-r--r--base/gximono.c2
-rw-r--r--base/lib.mak17
-rw-r--r--devices/gdevtsep.c2
4 files changed, 35 insertions, 15 deletions
diff --git a/base/gxicolor.c b/base/gxicolor.c
index 4800af1aa..2d5f443c4 100644
--- a/base/gxicolor.c
+++ b/base/gxicolor.c
@@ -62,8 +62,18 @@ static irender_proc(image_render_color_icc_tpr);
#ifndef WITH_CAL
static irender_proc(image_render_color_thresh);
#else
+
+#include "cal.h"
+
static irender_proc(image_render_color_ht_cal);
+static int
+image_render_color_ht_cal_skip_line(gx_image_enum *penum,
+ gx_device *dev)
+{
+ return !cal_halftone_next_line_required(penum->cal_ht);
+}
+
static void
color_halftone_callback(cal_halftone_data_t *ht, void *arg)
{
@@ -85,11 +95,6 @@ color_halftone_callback(cal_halftone_data_t *ht, void *arg)
static cal_halftone*
color_halftone_init(gx_image_enum *penum)
{
- void *callback;
- void *args;
- int ox;
- int dd_curr_y;
- int dev_width;
cal_halftone *cal_ht = NULL;
gx_dda_fixed dda_ht;
cal_context *ctx = penum->memory->gs_lib_ctx->core->cal_ctx;
@@ -108,9 +113,6 @@ color_halftone_init(gx_image_enum *penum)
dda_ht = penum->dda.pixel0.x;
if (penum->dxx > 0)
dda_translate(dda_ht, -fixed_epsilon);
- ox = dda_current(dda_ht);
- dd_curr_y = dda_current(penum->dda.pixel0.y);
- dev_width = gxht_dda_length(&dda_ht, penum->rect.w);
matrix.xx = penum->matrix.xx;
matrix.xy = penum->matrix.xy;
matrix.yx = penum->matrix.yx;
@@ -293,7 +295,8 @@ gs_image_class_4_color(gx_image_enum * penum, irender_proc_t *render_fn)
penum->cal_ht = color_halftone_init(penum);
if (penum->cal_ht != NULL)
{
- penum->skip_render = image_render_color_ht_cal;
+ penum->skip_next_line = image_render_color_ht_cal_skip_line;
+ *render_fn = &image_render_color_ht_cal;
return code;
}
#else
@@ -591,8 +594,9 @@ image_render_color_ht_cal(gx_image_enum *penum, const byte *buffer, int data_x,
byte *psrc_cm = NULL, *psrc_cm_start = NULL;
byte *bufend = NULL;
byte *input[GX_DEVICE_COLOR_MAX_COMPONENTS]; /* to ensure 128 bit boundary */
+ int i;
- if (h == 0 || penum->line_size == 0) /* line_size == 0, nothing to do */
+ if (h == 0)
return 0;
/* Get the buffer into the device color space */
@@ -601,8 +605,11 @@ image_render_color_ht_cal(gx_image_enum *penum, const byte *buffer, int data_x,
if (code < 0)
return code;
+ for (i = 0; i < spp_cm; i++)
+ input[i] = psrc_cm + w*i;
+
code = cal_halftone_process_planar(penum->cal_ht, penum->memory->non_gc_memory,
- input, halftone_callback, dev);
+ (const byte * const *)input, color_halftone_callback, dev);
/* Free cm buffer, if it was used */
if (psrc_cm_start != NULL) {
diff --git a/base/gximono.c b/base/gximono.c
index b46a37610..ee2c69b42 100644
--- a/base/gximono.c
+++ b/base/gximono.c
@@ -1002,7 +1002,7 @@ image_render_mono_ht_cal(gx_image_enum * penum, const byte * buffer, int data_x,
return 0;
return cal_halftone_process_planar(penum->cal_ht, penum->memory->non_gc_memory,
- &input, halftone_callback, dev);
+ (const byte * const *)&input, halftone_callback, dev);
}
#else
/*
diff --git a/base/lib.mak b/base/lib.mak
index 475d1b37a..ac5eae19b 100644
--- a/base/lib.mak
+++ b/base/lib.mak
@@ -2764,7 +2764,7 @@ $(GLD)colimlib.dev : $(LIB_MAK) $(ECHOGS_XE) $(colimlib_) $(LIB_MAK) $(MAKEDIRS)
$(SETMOD) $(GLD)colimlib $(colimlib_)
$(ADDMOD) $(GLD)colimlib -imageclass 4_color
-$(GLOBJ)gxicolor.$(OBJ) : $(GLSRC)gxicolor.c $(AK) $(gx_h)\
+$(GLOBJ)gxicolor_0.$(OBJ) : $(GLSRC)gxicolor.c $(AK) $(gx_h)\
$(gserrors_h) $(memory__h) $(gpcheck_h) $(gxarith_h)\
$(gxfixed_h) $(gxfrac_h) $(gxmatrix_h)\
$(gsccolor_h) $(gspaint_h) $(gzstate_h)\
@@ -2772,7 +2772,20 @@ $(GLOBJ)gxicolor.$(OBJ) : $(GLSRC)gxicolor.c $(AK) $(gx_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
+ $(GLCC) $(GLO_)gxicolor_0.$(OBJ) $(C_) $(GLSRC)gxicolor.c
+
+$(GLOBJ)gxicolor_1.$(OBJ) : $(GLSRC)gxicolor.c $(AK) $(gx_h)\
+ $(gserrors_h) $(memory__h) $(gpcheck_h) $(gxarith_h)\
+ $(gxfixed_h) $(gxfrac_h) $(gxmatrix_h)\
+ $(gsccolor_h) $(gspaint_h) $(gzstate_h)\
+ $(gxdevice_h) $(gxcmap_h) $(gxdcconv_h) $(gxdcolor_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) $(D_)WITH_CAL$(_D) $(I_)$(CALSRCDIR)$(_I) $(GLO_)gxicolor_1.$(OBJ) $(C_) $(GLSRC)gxicolor.c
+
+$(GLOBJ)gxicolor.$(OBJ) : $(GLOBJ)gxicolor_$(WITH_CAL).$(OBJ)
+ $(CP_) $(GLOBJ)gxicolor_$(WITH_CAL).$(OBJ) $(GLOBJ)gxicolor.$(OBJ)
# ---- Level 1 path miscellany (arcs, pathbbox, path enumeration) ---- #
diff --git a/devices/gdevtsep.c b/devices/gdevtsep.c
index f82072c38..7fddf1c7c 100644
--- a/devices/gdevtsep.c
+++ b/devices/gdevtsep.c
@@ -2827,7 +2827,7 @@ tiffsep1_print_page(gx_device_printer * pdev, gp_file * file)
if(cal_ht != NULL) {
if (cal_halftone_process_planar(cal_ht,
pdev->memory->non_gc_memory,
- &params.data[0],
+ (const byte * const *)&params.data[0],
ht_callback,
tfdev) < 0)
goto cal_fail;