![]() |
![]() |
![]() |
Goffice Reference Manual | ![]() |
---|---|---|---|---|
#define GDK_TO_UINT (c) #define RGB_TO_UINT (r,g,b) #define RGB_TO_RGBA (x,a) #define RGB_WHITE #define RGB_BLACK #define RGB_RED #define RGB_GREEN #define RGB_BLUE #define RGB_YELLOW #define RGB_VIOLET #define RGB_CYAN #define RGB_GREY (x) #define RGBA_TO_UINT (r,g,b,a) #define RGBA_WHITE #define RGBA_BLACK #define RGBA_RED #define RGBA_GREEN #define RGBA_BLUE #define RGBA_YELLOW #define RGBA_VIOLET #define RGBA_CYAN #define RGBA_GREY (x) #define UINT_RGBA_R (x) #define UINT_RGBA_G (x) #define UINT_RGBA_B (x) #define UINT_RGBA_A (x) #define UINT_RGBA_CHANGE_R (x, r) #define UINT_RGBA_CHANGE_G (x, g) #define UINT_RGBA_CHANGE_B (x, b) #define UINT_RGBA_CHANGE_A (x, a) #define UINT_TO_RGB (u,r,g,b) #define UINT_TO_RGBA (u,r,g,b,a) #define MONO_INTERPOLATE (v1, v2, t) #define UINT_INTERPOLATE (c1, c2, t) #define PIXEL_RGB (p, r, g, b) #define PIXEL_RGBA (p, r, g, b, a) #define PIXEL_RGB_UINT (p, i) #define PIXEL_RGBA_UINT (p, i) #define PIXEL_BLACK (p) #define PIXEL_WHITE (p) #define PIXEL_GREY (p,g) #define PIXEL_GREYA (p,g,a) void go_color_to_artpix (ArtPixMaxDepth *res, GOColor rgba); void go_color_render_svp (GOColor color, ArtSVP const *svp, int x0, int y0, int x1, int y1, art_u8 *buf, int rowstride); gboolean go_color_from_str (char const *str, GOColor *res); gchar* go_color_as_str (GOColor color); PangoAttribute* go_color_to_pango (GOColor color, gboolean is_fore); GdkColor* go_color_to_gdk (GOColor color, GdkColor *res);
#define GDK_TO_UINT(c) RGBA_TO_UINT(((c).red>>8), ((c).green>>8), ((c).blue>>8), 0xff)
c : |
#define RGB_TO_UINT(r,g,b) ((((guint)(r))<<16)|(((guint)(g))<<8)|((guint)(b)))
r : |
|
g : |
|
b : |
#define RGBA_TO_UINT(r,g,b,a) ((((guint)(r))<<24)|(((guint)(g))<<16)|(((guint)(b))<<8)|(guint)(a))
r : |
|
g : |
|
b : |
|
a : |
#define UINT_RGBA_CHANGE_R(x, r) (((x)&(~(0xff<<24)))|(((r)&0xff)<<24))
x : |
|
r : |
#define UINT_RGBA_CHANGE_G(x, g) (((x)&(~(0xff<<16)))|(((g)&0xff)<<16))
x : |
|
g : |
#define MONO_INTERPOLATE(v1, v2, t) ((gint)go_rint((v2)*(t)+(v1)*(1-(t))))
v1 : |
|
v2 : |
|
t : |
void go_color_render_svp (GOColor color, ArtSVP const *svp, int x0, int y0, int x1, int y1, art_u8 *buf, int rowstride);
Renders the shape specified with svp
over the buf
RGB buffer.
x1
- x0
specifies the width, and y1
- y0
specifies the height,
of the rectangle rendered. The new pixels are stored starting at
the first byte of buf
. Thus, the x0
and y0
parameters specify
an offset within svp
, and may be tweaked as a way of doing
integer-pixel translations without fiddling with svp
itself.
The color
argument specifies the color for the rendering. Pixels of
entirely 0 winding number are left untouched. Pixels of entirely
1 winding number have the color color
composited over them (ie,
are replaced by the red, green, blue components of color
if the alpha
component is 0xff). Pixels of intermediate coverage are linearly
interpolated.
color : |
Color in 0xRRGGBBAA format. |
svp : |
The source sorted vector path. |
x0 : |
Left coordinate of destination rectangle. |
y0 : |
Top coordinate of destination rectangle. |
x1 : |
Right coordinate of destination rectangle. |
y1 : |
Bottom coordinate of destination rectangle. |
buf : |
Destination RGB buffer. |
rowstride : |
Rowstride of buf buffer.
|
gboolean go_color_from_str (char const *str, GOColor *res);
str : |
|
res : |
|
Returns : | TRUE if str can be parsed as a color of the form R:G:B:A and the
result is stored in res .
|
PangoAttribute* go_color_to_pango (GOColor color, gboolean is_fore);
color : |
|
is_fore : |
|
Returns : |