|
From: <le...@pr...> - 2005-01-23 04:58:57
|
Update of /cvsroot/meshdb/src/vpf/gdps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1402 Modified Files: Tag: leonard-dev gstate.c gstate.h operator.c Log Message: Add some alpha blending operators mentioned in http://www.cs.wisc.edu/~ghost/doc/cvs/Language.htm#Transparency Index: gstate.c =================================================================== RCS file: /cvsroot/meshdb/src/vpf/gdps/gstate.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- gstate.c 18 Sep 2002 03:22:46 -0000 1.2 +++ gstate.c 23 Jan 2005 04:58:47 -0000 1.2.2.1 @@ -32,6 +32,7 @@ gs->color.r = 0; gs->color.g = 0; gs->color.b = 0; + gs->color.a = 1; gs->linewidth = 1; gs->font = NULL; Index: gstate.h =================================================================== RCS file: /cvsroot/meshdb/src/vpf/gdps/gstate.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- gstate.h 18 Sep 2002 03:22:46 -0000 1.2 +++ gstate.h 23 Jan 2005 04:58:47 -0000 1.2.2.1 @@ -8,7 +8,7 @@ double a,b,c,d,tx,ty; } ctm; struct { - double r,g,b; + double r,g,b,a; } color; double linewidth; object_t *font; Index: operator.c =================================================================== RCS file: /cvsroot/meshdb/src/vpf/gdps/operator.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- operator.c 25 Nov 2003 21:11:37 -0000 1.6 +++ operator.c 23 Jan 2005 04:58:47 -0000 1.6.2.1 @@ -911,6 +911,23 @@ } static void +setopacityalpha(gs) + struct gstate *gs; +{ + double a = real(gs); + + if (a < 0 || a > 1) die(".setopacityalpha: bad alpha %f", a); + gs->color.a = a; +} + +static void +currentopacityalpha(gs) + struct gstate *gs; +{ + PUSH(real_new(gs->color.a)); +} + +static void findfont(gs) struct gstate *gs; { @@ -1062,6 +1079,9 @@ { "setgray", setgray }, { "setlinewidth",setlinewidth }, + { ".setopacityalpha",setopacityalpha }, + { ".currentopacityalpha",currentopacityalpha }, + { "clip", notimpl }, { "findfont", findfont }, |