Added XrGetRGBColor and XrGetAlpha

This commit is contained in:
Carl Worth 2003-07-03 08:12:51 +00:00
parent 991d444754
commit 1fc2dabbd0
6 changed files with 59 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2003-07-03 Carl Worth <cworth@isi.edu>
* src/xr.c (XrGetAlpha): Added XrGetAlpha
(XrGetRGBColor): Added XrGetRGBColor
2003-06-12 Carl Worth <cworth@isi.edu>
* src/xrgstate.c (_XrGStateScale): Scale by 0 now causes an

View file

@ -130,6 +130,9 @@ XrSetOperator(XrState *xrs, XrOperator op);
void
XrSetRGBColor(XrState *xrs, double red, double green, double blue);
void
XrGetRGBColor(XrState *xrs, double *red, double *green, double *blue);
/* XXX: Do we want XrGetPattern as well? */
void
XrSetPattern(XrState *xrs, XrSurface *pattern);
@ -140,6 +143,9 @@ XrSetTolerance(XrState *xrs, double tolerance);
void
XrSetAlpha(XrState *xrs, double alpha);
double
XrGetAlpha(XrState *xrs);
typedef enum _XrFillRule { XrFillRuleWinding, XrFillRuleEvenOdd } XrFillRule;
void

View file

@ -183,6 +183,16 @@ XrSetRGBColor(XrState *xrs, double red, double green, double blue)
xrs->status = _XrGStateSetRGBColor(_XR_CURRENT_GSTATE(xrs), red, green, blue);
}
void
XrGetRGBColor(XrState *xrs, double *red, double *green, double *blue)
{
/* XXX: Should we do anything with the return values in the error case? */
if (xrs->status)
return;
xrs->status = _XrGStateGetRGBColor(_XR_CURRENT_GSTATE(xrs), red, green, blue);
}
void
XrSetPattern(XrState *xrs, XrSurface *pattern)
{
@ -220,6 +230,12 @@ XrSetAlpha(XrState *xrs, double alpha)
xrs->status = _XrGStateSetAlpha(_XR_CURRENT_GSTATE(xrs), alpha);
}
double
XrGetAlpha(XrState *xrs)
{
return _XrGStateGetAlpha(_XR_CURRENT_GSTATE(xrs));
}
void
XrSetFillRule(XrState *xrs, XrFillRule fill_rule)
{
@ -501,7 +517,7 @@ XrClosePath(XrState *xrs)
void
XrGetCurrentPoint(XrState *xrs, double *x, double *y)
{
/* XXX: Should we do anything with the return value in the error case? */
/* XXX: Should we do anything with the return values in the error case? */
if (xrs->status)
return;

View file

@ -61,6 +61,14 @@ _XrColorSetRGB(XrColor *color, double red, double green, double blue)
_XrColorComputeXcColor(color);
}
void
_XrColorGetRGB(XrColor *color, double *red, double *green, double *blue)
{
*red = color->red;
*green = color->green;
*blue = color->blue;
}
void
_XrColorSetAlpha(XrColor *color, double alpha)
{

View file

@ -357,6 +357,14 @@ _XrGStateSetRGBColor(XrGState *gstate, double red, double green, double blue)
return XrStatusSuccess;
}
XrStatus
_XrGStateGetRGBColor(XrGState *gstate, double *red, double *green, double *blue)
{
_XrColorGetRGB(&gstate->color, red, green, blue);
return XrStatusSuccess;
}
XrStatus
_XrGStateSetTolerance(XrGState *gstate, double tolerance)
{
@ -391,6 +399,12 @@ _XrGStateSetAlpha(XrGState *gstate, double alpha)
return XrStatusSuccess;
}
double
_XrGStateGetAlpha(XrGState *gstate)
{
return gstate->alpha;
}
XrStatus
_XrGStateSetFillRule(XrGState *gstate, XrFillRule fill_rule)
{

View file

@ -348,6 +348,9 @@ _XrGStateGetOperator(XrGState *gstate);
XrStatus
_XrGStateSetRGBColor(XrGState *gstate, double red, double green, double blue);
XrStatus
_XrGStateGetRGBColor(XrGState *gstate, double *red, double *green, double *blue);
XrStatus
_XrGStateSetTolerance(XrGState *gstate, double tolerance);
@ -357,6 +360,9 @@ _XrGStateGetTolerance(XrGState *gstate);
XrStatus
_XrGStateSetAlpha(XrGState *gstate, double alpha);
double
_XrGStateGetAlpha(XrGState *gstate);
XrStatus
_XrGStateSetFillRule(XrGState *gstate, XrFillRule fill_rule);
@ -501,6 +507,9 @@ _XrColorDeinit(XrColor *color);
void
_XrColorSetRGB(XrColor *color, double red, double green, double blue);
void
_XrColorGetRGB(XrColor *color, double *red, double *green, double *blue);
void
_XrColorSetAlpha(XrColor *color, double alpha);