From 3305477b99710b8ce6223a0bdd5014ced4de6997 Mon Sep 17 00:00:00 2001 From: Henry Stiles Date: Sat, 8 Aug 1998 06:11:33 +0000 Subject: Initial revision git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@277 06663e23-700e-0410-b217-a244a6096597 --- gs/src/gscolor3.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 gs/src/gscolor3.c (limited to 'gs/src/gscolor3.c') diff --git a/gs/src/gscolor3.c b/gs/src/gscolor3.c new file mode 100644 index 000000000..a38028f55 --- /dev/null +++ b/gs/src/gscolor3.c @@ -0,0 +1,67 @@ +/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. + + This file is part of Aladdin Ghostscript. + + Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author + or distributor accepts any responsibility for the consequences of using it, + or for whether it serves any particular purpose or works at all, unless he + or she says so in writing. Refer to the Aladdin Ghostscript Free Public + License (the "License") for full details. + + Every copy of Aladdin Ghostscript must include a copy of the License, + normally in a plain ASCII text file named PUBLIC. The License grants you + the right to copy, modify and redistribute Aladdin Ghostscript, but only + under certain conditions described in the License. Among other things, the + License requires that the copyright notice and this notice be preserved on + all copies. + */ + +/*Id: gscolor3.c */ +/* "Operators" for LanguageLevel 3 color facilities */ +#include "gx.h" +#include "gserrors.h" +#include "gscspace.h" /* for gscolor2.h */ +#include "gsmatrix.h" /* for gscolor2.h */ +#include "gscolor2.h" +#include "gscolor3.h" +#include "gspath.h" +#include "gzstate.h" +#include "gxshade.h" + +/* setsmoothness */ +int +gs_setsmoothness(gs_state * pgs, floatp smoothness) +{ + pgs->smoothness = + (smoothness < 0 ? 0 : smoothness > 1 ? 1 : smoothness); + return 0; +} + +/* currentsmoothness */ +float +gs_currentsmoothness(const gs_state * pgs) +{ + return pgs->smoothness; +} + +/* shfill */ +int +gs_shfill(gs_state * pgs, const gs_shading_t * psh) +{ + int code = gs_gsave(pgs); + gs_rect rect; + + if (code < 0) + return code; +/****** DOESN'T USE Background, BBox ******/ + if ((code = gs_setcolorspace(pgs, psh->params.ColorSpace)) < 0 || + (code = gs_clippath(pgs)) < 0 || + (code = gs_pathbbox(pgs, &rect)) < 0 || + (code = gs_shading_fill_rectangle(psh, &rect, + gs_currentdevice(pgs), + (gs_imager_state *) pgs)) < 0 + ) + DO_NOTHING; + gs_grestore(pgs); + return code; +} -- cgit v1.2.3