diff options
author | Henry Stiles <henry.stiles@artifex.com> | 2003-05-08 05:29:09 +0000 |
---|---|---|
committer | Henry Stiles <henry.stiles@artifex.com> | 2003-05-08 05:29:09 +0000 |
commit | 60f0e70310da879f9a17358757c36e3e4d1d1e4b (patch) | |
tree | f7e1812e3a8bfca86f6b7b2a8bf328d203b42eba | |
parent | 846499d1437652e23464a15f3961a76d2f8fe18b (diff) |
Beginnings of a shared halftone facility factored from pxl and pcl.
Also, modifications to support 8.0 halftone api changes. pcl and pxl
halftones should work with this check in the code is ***WORK IN
PROGRESS**
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@1905 06663e23-700e-0410-b217-a244a6096597
-rw-r--r-- | pl/pl.mak | 27 | ||||
-rw-r--r-- | pl/plht.c | 45 |
2 files changed, 49 insertions, 23 deletions
@@ -135,16 +135,14 @@ $(PLOBJ)pldict.$(OBJ): $(PLSRC)pldict.c $(AK) $(memory__h)\ $(pldict_h) $(PLCCC) $(PLSRC)pldict.c $(PLO_)pldict.$(OBJ) +$(PLOBJ)plht.$(OBJ): $(PLSRC)plht.c + $(PLCCC) $(PLSRC)plht.c $(PLO_)plht.$(OBJ) + $(PLOBJ)pldraw.$(OBJ): $(PLSRC)pldraw.c $(AK) $(std_h)\ $(gsmemory_h) $(gstypes_h) $(gxdevice_h) $(gzstate_h)\ $(pldraw_h) $(PLCCC) $(PLSRC)pldraw.c $(PLO_)pldraw.$(OBJ) -$(PLOBJ)plfdraw.$(OBJ): $(PLSRC)plfdraw.c $(AK) $(std_h)\ - $(gsmemory_h) $(gstypes_h) $(gxdevice_h) $(gzstate_h)\ - $(pldraw_h) - $(PLCCC) $(PLSRC)plfdraw.c $(PLO_)plfdraw.$(OBJ) - #artifex font module. $(PLOBJ)plfont.$(OBJ): $(PLSRC)plfont.c $(AK) $(memory__h) $(stdio__h)\ @@ -155,15 +153,6 @@ $(PLOBJ)plfont.$(OBJ): $(PLSRC)plfont.c $(AK) $(memory__h) $(stdio__h)\ $(plfont_h) $(plvalue_h) $(PLCCC) $(PLSRC)plfont.c $(PLO_)plfont.$(OBJ) -#freetype font module. -$(PLOBJ)plffont.$(OBJ): $(PLSRC)plffont.c $(AK) $(memory__h) $(stdio__h)\ - $(gdebug_h) $(gp_h)\ - $(gschar_h) $(gserror_h) $(gserrors_h) $(gsmatrix_h) $(gsmemory_h)\ - $(gsstate_h) $(gsstruct_h)\ - $(gschar_h) $(gsutil_h) $(gxfont_h) $(gxfont42_h)\ - $(plfont_h) $(plvalue_h) - $(PLCCC) $(FT_INCLUDES) $(PLSRC)plffont.c $(PLO_)plffont.$(OBJ) - #ufst font module. $(PLOBJ)plufont.$(OBJ): $(PLSRC)plufont.c $(AK) $(memory__h) $(stdio__h)\ $(gdebug_h)\ @@ -213,14 +202,6 @@ $(PLOBJ)plalloc.$(OBJ): $(PLSRC)plalloc.c $(AK) \ $(gsmemory_h) $(gsstype_h) $(plalloc_h) $(plftable_h) $(PLCCC) $(PLSRC)plalloc.c $(PLO_)plalloc.$(OBJ) -# freetype font loading module. -$(PLOBJ)plflfont.$(OBJ): $(PLSRC)plflfont.c $(PLSRC)pllfont.h $(AK)\ - $(ctype__h) $(stdio__h) $(string__h)\ - $(gx_h) $(gp_h) $(gsccode_h) $(gserrors_h) $(gsmatrix_h) $(gsutil_h)\ - $(gxfont_h) $(gxfont42_h) $(plfont_h) $(pldict_h) $(pllfont_h)\ - $(plvalue_h) $(freetype_h) - $(PLCCC) $(FT_INCLUDES) $(PLSRC)plflfont.c $(PLO_)plflfont.$(OBJ) - # ufst font loading module. $(PLOBJ)plulfont.$(OBJ): $(PLSRC)plulfont.c $(PLSRC)pllfont.h $(AK)\ $(stdio_h) $(string__h) $(gsmemory_h) $(gstypes_h)\ @@ -235,7 +216,7 @@ $(PLOBJ)pllfont.$(OBJ): $(PLSRC)pllfont.c $(PLSRC)pllfont.h $(AK)\ $(gxfont_h) $(gxfont42_h) $(plfont_h) $(pldict_h) $(PLCCC) $(PLSRC)pllfont.c $(PLO_)pllfont.$(OBJ) -pl_obj1=$(PLOBJ)pldict.$(OBJ) $(PLOBJ)pldraw.$(OBJ) $(PLOBJ)plsymbol.$(OBJ) $(PLOBJ)plvalue.$(OBJ) +pl_obj1=$(PLOBJ)pldict.$(OBJ) $(PLOBJ)pldraw.$(OBJ) $(PLOBJ)plsymbol.$(OBJ) $(PLOBJ)plvalue.$(OBJ) $(PLOBJ)plht.$(OBJ) pl_obj2=$(PLOBJ)plvocab.$(OBJ) $(PLOBJ)pltop.$(OBJ) $(PLOBJ)pltoputl.$(OBJ) pl_obj3=$(PLOBJ)plplatf.$(OBJ) $(PLOBJ)plalloc.$(OBJ) diff --git a/pl/plht.c b/pl/plht.c new file mode 100644 index 000000000..e1af2946b --- /dev/null +++ b/pl/plht.c @@ -0,0 +1,45 @@ +#include "stdpre.h" +#include "gstypes.h" +#include "gsmemory.h" +#include "gxtmap.h" +/* Define an abstract type for the PostScript graphics state. */ +#ifndef gs_state_DEFINED +# define gs_state_DEFINED +typedef struct gs_state_s gs_state; +#endif +#include "gsstate.h" +#include "gxht.h" + +int +pl_set_pcl_halftone(gs_state *pgs, gs_mapping_proc transfer_proc, + int width, int height, + gs_const_string threshold_data, + int phase_x, + int phase_y) +{ + + int code; + gs_halftone ht; + gs_settransfer(pgs, transfer_proc); + ht.type = ht_type_threshold; + ht.params.threshold.width = width; + ht.params.threshold.height = height; + ht.params.threshold.thresholds.data = threshold_data.data; + ht.params.threshold.thresholds.size = threshold_data.size; + ht.params.threshold.transfer = 0; + ht.params.threshold.transfer_closure.proc = 0; + code = gs_sethalftone(pgs, &ht); + if ( code < 0 ) + return code; + return gs_sethalftonephase(pgs, phase_x, phase_y); + /* + * Here is where we do the dreadful thing that appears to be + * necessary to match the observed behavior of LaserJet 5 and + * 6 printers with respect to superimposing halftoned source + * and pattern. NB needs review wrt later printers. + */ + // if ( code < 0 ) + // return code; + // return gs_setscreenphase(pgs, px + source_phase_x, + // py + source_phase_y, gs_color_select_source); +} |