[gs-cvs] rev 7886 - in trunk/gs: doc src
ray at ghostscript.com
ray at ghostscript.com
Sat Apr 28 15:17:20 PDT 2007
Author: ray
Date: 2007-04-28 15:17:19 -0700 (Sat, 28 Apr 2007)
New Revision: 7886
Added:
trunk/gs/src/sidscale.c
trunk/gs/src/sidscale.h
Modified:
trunk/gs/doc/Develop.htm
trunk/gs/src/gxdda.h
trunk/gs/src/gxiscale.c
trunk/gs/src/lib.mak
trunk/gs/src/siinterp.c
trunk/gs/src/sisparam.h
Log:
Implementation of a new non-linear image filter that prevents dropout
when images are scaled down to a 1-bit per component device. Bugs
689147 for customer 531 and image quality problem for customer 780.
This filter is used whenever /Interpolate == true (or -dDOINTERPOLATE
command line option is used) and the image is being scaled down on
a 1-bit per component device.
Interpolation throughput of gray or cmyk images is also improved by
a factor of about 2:1 (depending on the data content) even when
the standard Mitchell filter is used. The performance improvement
when using this new filter is even higher since the filter itself
uses less CPU time.
DETAILS:
This filter uses the darkest of the image pixels that are within a
device pixel, rather than the default behaviour which uses the PS
'center of pixel' rule (i.e., whichever image pixel covers the
center of the device pixel is used to color the device pixel).
The center of pixel rule can result in missing narrow black
lines or single dots in patterns when a source image is scaled down.
One side effect of this filter is that narrow white features or
small white areas in patterns can be lost, effectively darkening
the result. For now the customers needing this are not concerned
with small white-on-black areas becoming solid black. Many real
world printers tend to do this anyway due to 'dot gain'.
If we encounter the need for preserving small white areas, we
can change the filter somewhat to prevent this effect.
EXPECTED DIFFERENCES:
None. (except improved performance for Interpolated images).
Modified: trunk/gs/doc/Develop.htm
===================================================================
--- trunk/gs/doc/Develop.htm 2007-04-28 21:55:23 UTC (rev 7885)
+++ trunk/gs/doc/Develop.htm 2007-04-28 22:17:19 UTC (rev 7886)
@@ -571,6 +571,8 @@
<a href="../src/siinterp.h">src/siinterp.h</a>,
<a href="../src/siscale.c">src/siscale.c</a>,
<a href="../src/siscale.h">src/siscale.h</a>,
+<a href="../src/sidscale.c">src/sidscale.c</a>,
+<a href="../src/sidscale.h">src/sidscale.h</a>,
<a href="../src/sisparam.h">src/sisparam.h</a>.
<dt>
@@ -2386,6 +2388,7 @@
Other:
<dd>
<a href="../src/ivmem2.h">src/ivmem2.h</a>,
+<a href="../src/zalg.c">src/zalg.c</a>,
<a href="../src/zarith.c">src/zarith.c</a>,
<a href="../src/zcontext.c">src/zcontext.c</a>,
<a href="../src/zcontrol.c">src/zcontrol.c</a>,
Modified: trunk/gs/src/gxdda.h
===================================================================
--- trunk/gs/src/gxdda.h 2007-04-28 21:55:23 UTC (rev 7885)
+++ trunk/gs/src/gxdda.h 2007-04-28 22:17:19 UTC (rev 7886)
@@ -50,6 +50,13 @@
struct sname { dtype Q; ntype R; }
#define dda_step_struct(sname, dtype, ntype)\
struct sname { dtype dQ; ntype dR, NdR; }
+
+/* DDA with int Q and uint N */
+typedef struct gx_dda_int_s {
+ dda_state_struct(ia_, int, uint) state;
+ dda_step_struct(ie_, int, uint) step;
+} gx_dda_int_t;
+
/* DDA with fixed Q and (unsigned) integer N */
typedef
dda_state_struct(_a, fixed, uint) gx_dda_state_fixed;
Modified: trunk/gs/src/gxiscale.c
===================================================================
--- trunk/gs/src/gxiscale.c 2007-04-28 21:55:23 UTC (rev 7885)
+++ trunk/gs/src/gxiscale.c 2007-04-28 22:17:19 UTC (rev 7886)
@@ -34,6 +34,7 @@
#include "stream.h" /* for s_alloc_state */
#include "siinterp.h" /* for spatial interpolation */
#include "siscale.h" /* for Mitchell filtering */
+#include "sidscale.h" /* for special case downscale filter */
/*
* Define whether we are using Mitchell filtering or spatial
@@ -65,12 +66,7 @@
if (!penum->interpolate)
return 0;
if (penum->use_mask_color || penum->posture != image_portrait ||
- penum->masked || penum->alpha ||
- (penum->dev->color_info.num_components == 1 &&
- penum->dev->color_info.max_gray < 15) ||
- (penum->dev->color_info.num_components > 1 &&
- penum->dev->color_info.max_color < 15)
- ) {
+ penum->masked || penum->alpha ) {
/* We can't handle these cases yet. Punt. */
penum->interpolate = false;
return 0;
@@ -122,6 +118,27 @@
in_size = round_up(iss.WidthIn * iss.Colors * sizeof(frac),
align_bitmap_mod);
}
+#ifdef USE_MITCHELL_FILTER
+ template = &s_IScale_template;
+#else
+ template = &s_IIEncode_template;
+#endif
+ /* Special case handling for when we are downsampling to a dithered device */
+ /* The point of this non-linear downsampling is to preserve dark pixels */
+ /* from the source image to avoid dropout. The color polarity must be used */
+ if (((iss.WidthOut < iss.WidthIn) && (iss.HeightOut < iss.HeightIn)) &&
+ ((penum->dev->color_info.num_components == 1 &&
+ penum->dev->color_info.max_gray < 15) ||
+ (penum->dev->color_info.num_components > 1 &&
+ penum->dev->color_info.max_color < 15))
+ ) {
+ if (penum->dev->color_info.polarity == GX_CINFO_POLARITY_UNKNOWN)
+ return 0; /* can't do special downsampling to this color space */
+ template = &s_ISpecialDownScale_template;
+ }
+ /* The SpecialDownScale filter needs polarity, either ADDITIVE or SUBTRACTIVE */
+ /* UNKNOWN case (such as for palette colors) has been handled above */
+ iss.ColorPolarityAdditive = penum->dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE;
/* Allocate a buffer for one source/destination line. */
{
uint out_size =
@@ -131,11 +148,6 @@
line = gs_alloc_bytes(mem, in_size + out_size,
"image scale src+dst line");
}
-#ifdef USE_MITCHELL_FILTER
- template = &s_IScale_template;
-#else
- template = &s_IIEncode_template;
-#endif
pss = (stream_image_scale_state *)
s_alloc_state(mem, template->stype, "image scale state");
if (line == 0 || pss == 0 ||
@@ -306,17 +318,33 @@
/* Just pack colors into a scan line. */
gx_color_index color = devc.colors.pure;
- /* Skip RGB runs quickly. */
- if (c == 3) {
- do {
- LINE_ACCUM(color, bpp);
- x++, psrc += 3;
- } while (x < xe && psrc[-3] == psrc[0] &&
+ /* Skip runs quickly for the common cases. */
+ switch (c) {
+ case 1:
+ do {
+ LINE_ACCUM(color, bpp);
+ x++, psrc += 1;
+ } while (x < xe && psrc[-1] == psrc[0]);
+ break;
+ case 3:
+ do {
+ LINE_ACCUM(color, bpp);
+ x++, psrc += 3;
+ } while (x < xe && psrc[-4] == psrc[0] &&
+ psrc[-3] == psrc[1] && psrc[-2] == psrc[2] &&
+ psrc[-1] == psrc[3]);
+ break;
+ case 4:
+ do {
+ LINE_ACCUM(color, bpp);
+ x++, psrc += 3;
+ } while (x < xe && psrc[-3] == psrc[0] &&
psrc[-2] == psrc[1] &&
psrc[-1] == psrc[2]);
- } else {
- LINE_ACCUM(color, bpp);
- x++, psrc += c;
+ break;
+ default:
+ LINE_ACCUM(color, bpp);
+ x++, psrc += c;
}
} else {
int rcode;
Modified: trunk/gs/src/lib.mak
===================================================================
--- trunk/gs/src/lib.mak 2007-04-28 21:55:23 UTC (rev 7885)
+++ trunk/gs/src/lib.mak 2007-04-28 22:17:19 UTC (rev 7886)
@@ -496,6 +496,7 @@
scfx_h=$(GLSRC)scfx.h $(shc_h)
siinterp_h=$(GLSRC)siinterp.h $(sisparam_h)
siscale_h=$(GLSRC)siscale.h $(sisparam_h)
+sidscale_h=$(GLSRC)sidscale.h $(sisparam_h)
simscale_h=$(GLSRC)simscale.h $(scommon_h) $(sisparam_h)
gximage_h=$(GLSRC)gximage.h $(gsiparam_h)\
$(gxcspace_h) $(gxdda_h) $(gxiclass_h) $(gxiparam_h) $(gxsample_h)\
@@ -1771,7 +1772,7 @@
# ---------------- Image scaling filters ---------------- #
-iscale_=$(GLOBJ)siinterp.$(OBJ) $(GLOBJ)siscale.$(OBJ)
+iscale_=$(GLOBJ)siinterp.$(OBJ) $(GLOBJ)siscale.$(OBJ) $(GLOBJ)sidscale.$(OBJ)
$(GLD)iscale.dev : $(LIB_MAK) $(ECHOGS_XE) $(iscale_)
$(SETMOD) $(GLD)iscale $(iscale_)
@@ -1786,6 +1787,12 @@
$(siscale_h) $(strimpl_h)
$(GLCC) $(GLO_)siscale.$(OBJ) $(C_) $(GLSRC)siscale.c
+$(GLOBJ)sidscale.$(OBJ) : $(GLSRC)sidscale.c $(AK)\
+ $(math__h) $(memory__h) $(stdio__h)\
+ $(gconfigv_h) $(gdebug_h)\
+ $(sidscale_h) $(strimpl_h)
+ $(GLCC) $(GLO_)sidscale.$(OBJ) $(C_) $(GLSRC)sidscale.c
+
# -------------- imagemask scaling filter --------------- #
simscale_=$(GLOBJ)simscale.$(OBJ)
Added: trunk/gs/src/sidscale.c
===================================================================
--- trunk/gs/src/sidscale.c 2007-04-28 21:55:23 UTC (rev 7885)
+++ trunk/gs/src/sidscale.c 2007-04-28 22:17:19 UTC (rev 7886)
@@ -0,0 +1,354 @@
+/* Copyright (C) 2001-2006 artofcode LLC.
+ 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 that
+ license. 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.
+*/
+
+/* $Id: sidscale.c 6651 2006-03-13 16:18:19Z stefan $ */
+/* Special Image downsample scaling filters for dithered devices */
+#include "math_.h"
+#include "memory_.h"
+#include "stdio_.h"
+#include "gconfigv.h"
+#include "gdebug.h"
+#include "gxfixed.h" /* for gxdda.h */
+#include "gxdda.h"
+#include "gxfrac.h"
+#include "strimpl.h"
+#include "sidscale.h"
+
+/* Temporary intermediate values */
+typedef byte PixelTmp;
+
+#define minPixelTmp 0
+#define maxPixelTmp 255
+#define unitPixelTmp 255
+
+/* Max of all pixel sizes */
+#define maxSizeofPixel 2
+
+/* Auxiliary structures. */
+
+/* ImageSpecialDownScaleEncode / ImageSpecialDownScaleDecode */
+typedef struct stream_ISpecialDownScale_state_s {
+ /* The client sets the params values before initialization. */
+ stream_image_scale_state_common; /* = state_common + params */
+ /* The init procedure sets the following. */
+ int sizeofPixelIn; /* bytes per input value, 1 or 2 */
+ int sizeofPixelOut; /* bytes per output value, 1 or 2 */
+ void /*PixelIn */ *src;
+ void /*PixelOut */ *dst;
+ void /*PixelIn */ *tmp;
+ gx_dda_int_t dda_x_init; /* initial setting of dda_x */
+ /* The following are updated dynamically. */
+ int dst_x;
+ uint dst_offset, dst_size;
+ gx_dda_int_t dda_x; /* DDA for dest X in current scan line */
+ int src_y;
+ uint src_offset, src_size;
+ int dst_y;
+ gx_dda_int_t dda_y; /* DDA for dest Y */
+} stream_ISpecialDownScale_state;
+
+gs_private_st_ptrs3(st_ISpecialDownScale_state, stream_ISpecialDownScale_state,
+ "ImageSpecialDownScaleEncode/Decode state",
+ isdscale_state_enum_ptrs, isdscale_state_reloc_ptrs,
+ dst, src, tmp);
+
+/* Apply filter to downscale horizontally from src to tmp. */
+private void
+idownscale_x(void /* PixelIn */ * tmp, const void /* PixelIn */ *src, stream_ISpecialDownScale_state *const ss)
+{
+ int c, i;
+ int Colors = ss->params.Colors;
+ int WidthIn = ss->params.WidthIn;
+ int prev_y = dda_previous(ss->dda_y);
+ int cur_y = dda_next(ss->dda_y);
+ bool firstline = prev_y != cur_y; /* at the start of a new group of lines */
+ bool polarity_additive = ss->params.ColorPolarityAdditive;
+
+ /* The following could be a macro, BUT macro's with control */
+ /* are not good style and hard to debug */
+ if (ss->sizeofPixelIn == 1) {
+ for (c = 0; c < Colors; ++c) {
+ byte *tp = (byte *)tmp + c; /* destination */
+ const byte *pp = (const byte *)src + c;
+
+ ss->dda_x = ss->dda_x_init;
+ if_debug1('W', "[W]idownscale_x color %d:", c);
+
+ for ( i = 0; i < WidthIn; tp += Colors) {
+ int endx = dda_next(ss->dda_x);
+ if (firstline)
+ *tp = *pp;
+ else {
+ if ((polarity_additive && (*pp < *tp)) ||
+ (!polarity_additive && (*pp > *tp)) )
+ *tp = *pp;
+ }
+ i++; pp += Colors;
+ while (i < endx) {
+ if (*pp < *tp)
+ *tp = *pp;
+ i++; pp += Colors;
+ }
+ if_debug1('W', " %d", *tp);
+ }
+ if_debug0('W', "\n");
+ }
+ } else { /* sizeofPixelIn == 2 */
+ for (c = 0; c < Colors; ++c) {
+ bits16 *tp = (bits16 *)tmp + c; /* destination */
+ const bits16 *pp = (const bits16 *)src + c;
+
+ ss->dda_x = ss->dda_x_init;
+ if_debug1('W', "[W]idownscale_x color %d:", c);
+
+ for ( i = 0; i < WidthIn; tp += Colors) {
+ int endx = dda_next(ss->dda_x);
+ if (firstline)
+ *tp = *pp;
+ else {
+ if ((polarity_additive && (*pp < *tp)) ||
+ (!polarity_additive && (*pp > *tp)) )
+ *tp = *pp;
+ }
+ i++; pp += Colors;
+ while (i < endx) {
+ if (*pp < *tp)
+ *tp = *pp;
+ i++; pp += Colors;
+ }
+ if_debug1('W', " %d", *tp);
+ }
+ if_debug0('W', "\n");
+ }
+ }
+}
+
+
+/*
+ * Copy from tmp to dst, taking into account PixelOut vs. PixelIn sizes
+ * We do the conversion from PixelIn to PixelOut here (if needed)
+ * since if the Y is scaled down we will convert less often.
+ * This is simpler because we can treat all columns identically
+ * without regard to the number of samples per pixel.
+ */
+private void
+idownscale_y(void /*PixelOut */ *dst, const void /* PixelIn */ *tmp,
+ stream_ISpecialDownScale_state *const ss)
+{
+ int kn = ss->params.WidthOut * ss->params.Colors;
+ int kc;
+
+ if_debug0('W', "[W]idownscale_y: ");
+
+ if (ss->sizeofPixelOut == 1) {
+ if (ss->sizeofPixelIn == 1) {
+ const byte *pp = (byte *)tmp;
+
+ for ( kc = 0; kc < kn; ++kc, pp++ ) {
+ if_debug1('W', " %d", *pp);
+ ((byte *)dst)[kc] = *pp;
+ }
+ } else { /* sizeofPixelIn == 2 */
+ const bits16 *pp = (bits16 *)tmp;
+
+ for ( kc = 0; kc < kn; ++kc, pp++ ) {
+ if_debug1('W', " %d", *pp);
+ ((byte *)dst)[kc] = frac2byte(*pp);
+ }
+ }
+ } else { /* sizeofPixelOut == 2 */
+ if (ss->sizeofPixelIn == 1) {
+ const byte *pp = (byte *)tmp;
+
+ for ( kc = 0; kc < kn; ++kc, pp++ ) {
+ if_debug1('W', " %d", *pp);
+ ((bits16 *)dst)[kc] = byte2frac(*pp);
+ }
+ } else { /* sizeofPixelIn == 2 */
+ const bits16 *pp = (bits16 *)tmp;
+
+ for ( kc = 0; kc < kn; ++kc, pp++ ) {
+ if_debug1('W', " %d", *pp);
+ ((bits16 *)dst)[kc] = *pp;
+ }
+ }
+ }
+ if_debug0('W', "n");
+}
+
+/* ------ Stream implementation ------ */
+
+
+/* Forward references */
+private void s_ISpecialDownScale_release(stream_state * st);
+
+/* Set default parameter values (actually, just clear pointers). */
+private void
+s_ISpecialDownScale_set_defaults(stream_state * st)
+{
+ stream_ISpecialDownScale_state *const ss = (stream_ISpecialDownScale_state *) st;
+
+ ss->src = 0;
+ ss->dst = 0;
+ ss->tmp = 0;
+}
+
+/* Initialize the filter. */
+private int
+s_ISpecialDownScale_init(stream_state * st)
+{
+ stream_ISpecialDownScale_state *const ss = (stream_ISpecialDownScale_state *) st;
+ gs_memory_t *mem = ss->memory;
+
+ ss->sizeofPixelIn = ss->params.BitsPerComponentIn / 8;
+ ss->sizeofPixelOut = ss->params.BitsPerComponentOut / 8;
+
+ ss->src_size = ss->params.WidthIn * ss->sizeofPixelIn * ss->params.Colors;
+ ss->dst_size = ss->params.WidthOut * ss->sizeofPixelOut * ss->params.Colors;
+
+ /* Initialize destination DDAs. */
+ ss->dst_x = 0;
+ ss->src_offset = ss->dst_offset = 0;
+ dda_init(ss->dda_x, 0, ss->params.WidthIn, ss->params.WidthOut);
+ ss->dda_x_init = ss->dda_x;
+ ss->src_y = ss->dst_y = 0;
+ dda_init(ss->dda_y, 0, ss->params.HeightOut, ss->params.HeightIn);
+
+
+ /* create intermediate image to hold horizontal zoom */
+ ss->tmp = gs_alloc_byte_array(mem, ss->params.WidthOut * ss->params.Colors,
+ ss->sizeofPixelIn, "image_scale tmp");
+ /* Allocate buffers for 1 row of source and destination. */
+ ss->dst = gs_alloc_byte_array(mem, ss->params.WidthOut * ss->params.Colors,
+ ss->sizeofPixelOut, "image_scale dst");
+ ss->src = gs_alloc_byte_array(mem, ss->params.WidthIn * ss->params.Colors,
+ ss->sizeofPixelIn, "image_scale src");
+ if (ss->tmp == 0 || ss->dst == 0 || ss->src == 0) {
+ s_ISpecialDownScale_release(st);
+ return ERRC;
+/****** WRONG ******/
+ }
+
+ return 0;
+
+}
+
+/* Process a buffer. Note that this handles Encode and Decode identically. */
+private int
+s_ISpecialDownScale_process(stream_state * st, stream_cursor_read * pr,
+ stream_cursor_write * pw, bool last)
+{
+ stream_ISpecialDownScale_state *const ss = (stream_ISpecialDownScale_state *) st;
+ uint cur_y = dda_current(ss->dda_y);
+
+ /* Check whether we need to deliver any output. */
+
+top:
+ if (cur_y > ss->dst_y) {
+ /* Deliver some or all of the current scaled row. */
+ /* to generate a vertically scaled output row. */
+ uint wleft = pw->limit - pw->ptr;
+
+ if (ss->dst_y == ss->params.HeightOut)
+ return EOFC;
+ if (wleft == 0)
+ return 1;
+ if (ss->dst_offset == 0) {
+ byte *row;
+
+ if (wleft >= ss->dst_size) { /* We can scale the row directly into the output. */
+ row = pw->ptr + 1;
+ pw->ptr += ss->dst_size;
+ } else { /* We'll have to buffer the row. */
+ row = ss->dst;
+ }
+ /* Apply filter to zoom vertically from tmp to dst. */
+ idownscale_y(row, ss->tmp, ss);
+ /* Idiotic C coercion rules allow T* and void* to be */
+ /* inter-assigned freely, but not compared! */
+ if ((void *)row != ss->dst) /* no buffering */
+ goto adv;
+ } { /* We're delivering a buffered output row. */
+ uint wcount = ss->dst_size - ss->dst_offset;
+ uint ncopy = min(wleft, wcount);
+
+ memcpy(pw->ptr + 1, (byte *) ss->dst + ss->dst_offset, ncopy);
+ pw->ptr += ncopy;
+ ss->dst_offset += ncopy;
+ if (ncopy != wcount)
+ return 1;
+ ss->dst_offset = 0;
+ }
+ /* Advance to the next output row. */
+adv: ++(ss->dst_y);
+ }
+
+ /* Read input data and scale horizontally into tmp. */
+
+ {
+ uint rleft = pr->limit - pr->ptr;
+ uint rcount = ss->src_size - ss->src_offset;
+
+ if (rleft == 0)
+ return 0; /* need more input */
+ if (ss->src_y >= ss->params.HeightIn)
+ return ERRC;
+ if (rleft >= rcount) { /* We're going to fill up a row. */
+ const byte *row;
+
+ if (ss->src_offset == 0) { /* We have a complete row. Read the data */
+ /* directly from the input. */
+ row = pr->ptr + 1;
+ } else { /* We're buffering a row in src. */
+ row = ss->src;
+ memcpy((byte *) ss->src + ss->src_offset, pr->ptr + 1,
+ rcount);
+ ss->src_offset = 0;
+ }
+ /* Apply filter to zoom horizontally from src to tmp. */
+ if_debug2('w', "[w]idownscale_x y = %d to tmp row %d\n",
+ ss->src_y, (ss->src_y % MAX_ISCALE_SUPPORT));
+ idownscale_x(ss->tmp, row, ss);
+ pr->ptr += rcount;
+ ++(ss->src_y);
+ cur_y = dda_next(ss->dda_y);
+ goto top;
+ } else { /* We don't have a complete row. Copy data to src buffer. */
+ memcpy((byte *) ss->src + ss->src_offset, pr->ptr + 1, rleft);
+ ss->src_offset += rleft;
+ pr->ptr += rleft;
+ return 0;
+ }
+ }
+}
+
+/* Release the filter's storage. */
+private void
+s_ISpecialDownScale_release(stream_state * st)
+{
+ stream_ISpecialDownScale_state *const ss = (stream_ISpecialDownScale_state *) st;
+ gs_memory_t *mem = ss->memory;
+
+ gs_free_object(mem, (void *)ss->src, "image_scale src"); /* no longer const */
+ ss->src = 0;
+ gs_free_object(mem, ss->dst, "image_scale dst");
+ ss->dst = 0;
+ gs_free_object(mem, ss->tmp, "image_scale tmp");
+ ss->tmp = 0;
+}
+
+/* Stream template */
+const stream_template s_ISpecialDownScale_template = {
+ &st_ISpecialDownScale_state, s_ISpecialDownScale_init, s_ISpecialDownScale_process, 1, 1,
+ s_ISpecialDownScale_release, s_ISpecialDownScale_set_defaults
+};
Added: trunk/gs/src/sidscale.h
===================================================================
--- trunk/gs/src/sidscale.h 2007-04-28 21:55:23 UTC (rev 7885)
+++ trunk/gs/src/sidscale.h 2007-04-28 22:17:19 UTC (rev 7886)
@@ -0,0 +1,25 @@
+/* Copyright (C) 2001-2006 artofcode LLC.
+ 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 that
+ license. 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.
+*/
+
+/* $Id: sidscale.h 6651 2006-03-13 16:18:19Z stefan $ */
+/* Definitions for smoothed image scaling filter */
+/* Requires strimpl.h */
+
+#ifndef sidscale_INCLUDED
+# define sidscale_INCLUDED
+
+#include "sisparam.h"
+
+extern const stream_template s_ISpecialDownScale_template;
+
+#endif /* sidscale_INCLUDED */
Modified: trunk/gs/src/siinterp.c
===================================================================
--- trunk/gs/src/siinterp.c 2007-04-28 21:55:23 UTC (rev 7885)
+++ trunk/gs/src/siinterp.c 2007-04-28 22:17:19 UTC (rev 7886)
@@ -21,10 +21,6 @@
#include "siinterp.h"
/* ImageInterpolateEncode state */
-typedef struct gx_dda_int_s {
- dda_state_struct(ia_, int, uint) state;
- dda_step_struct(ie_, int, uint) step;
-} gx_dda_int_t;
typedef enum {
SCALE_SAME = 0,
SCALE_SAME_ALIGNED,
Modified: trunk/gs/src/sisparam.h
===================================================================
--- trunk/gs/src/sisparam.h 2007-04-28 21:55:23 UTC (rev 7885)
+++ trunk/gs/src/sisparam.h 2007-04-28 22:17:19 UTC (rev 7886)
@@ -55,6 +55,7 @@
uint MaxValueOut; /* max value of output component, */
/* 0 < MaxValueOut < 1 << BitsPerComponentOut*/
int WidthOut, HeightOut; /* > 0 */
+ bool ColorPolarityAdditive; /* needed by SpecialDownScale filter */
} stream_image_scale_params_t;
/* Define a generic image scaling stream state. */
More information about the gs-cvs
mailing list