summaryrefslogtreecommitdiff
path: root/gs/src/gscolor3.c
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>1998-08-08 06:11:33 +0000
committerHenry Stiles <henry.stiles@artifex.com>1998-08-08 06:11:33 +0000
commit3305477b99710b8ce6223a0bdd5014ced4de6997 (patch)
tree2cd123878deab83af88cbfcbff04624712c5b46c /gs/src/gscolor3.c
parentb8cb922d73b866149ca3da2288f1edcf959c45c9 (diff)
Initial revision
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@277 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'gs/src/gscolor3.c')
-rw-r--r--gs/src/gscolor3.c67
1 files changed, 67 insertions, 0 deletions
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;
+}