]>
gitweb.michael.orlitzky.com - libsvgtiny.git/blob - include/svgtiny.h
2 * This file is part of Libsvgtiny
3 * Licensed under the MIT License,
4 * http://opensource.org/licenses/mit-license.php
5 * Copyright 2008 James Bursa <james@semichrome.net>
11 typedef int svgtiny_colour
;
12 #define svgtiny_TRANSPARENT 0x1000000
14 #define svgtiny_RGB(r, g, b) ((b) << 16 | (g) << 8 | (r))
15 #define svgtiny_RED(c) ((c) & 0xff)
16 #define svgtiny_GREEN(c) (((c) >> 8) & 0xff)
17 #define svgtiny_BLUE(c) (((c) >> 16) & 0xff)
19 #define svgtiny_RGB(r, g, b) ((r) << 16 | (g) << 8 | (b))
20 #define svgtiny_RED(c) (((c) >> 16) & 0xff)
21 #define svgtiny_GREEN(c) (((c) >> 8) & 0xff)
22 #define svgtiny_BLUE(c) ((c) & 0xff)
25 struct svgtiny_shape
{
27 unsigned int path_length
;
31 float fill_opacity
; /* Between 0.0 and 1.0 */
32 svgtiny_colour stroke
;
33 float stroke_opacity
; /* Between 0.0 and 1.0 */
37 struct svgtiny_diagram
{
40 struct svgtiny_shape
*shape
;
41 unsigned int shape_count
;
43 unsigned short error_line
;
44 const char *error_message
;
49 svgtiny_OUT_OF_MEMORY
,
63 struct svgtiny_named_color
{
69 struct svgtiny_diagram
*svgtiny_create(void);
70 svgtiny_code
svgtiny_parse(struct svgtiny_diagram
*diagram
,
71 const char *buffer
, size_t size
, const char *url
,
72 int width
, int height
);
73 void svgtiny_free(struct svgtiny_diagram
*svg
);