summaryrefslogtreecommitdiffstats
path: root/src/libnr/nr-svp.h
blob: ca1521f29a535326307f87dde3a54e6a79786380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef __NR_SVP_H__
#define __NR_SVP_H__

/*
 * Pixel buffer rendering library
 *
 * Authors:
 *   Lauris Kaplinski <lauris@kaplinski.com>
 *
 * This code is in public domain
 */

/* Sorted vector paths */

#include <glib/gtypes.h>
#include <libnr/nr-coord.h>

struct NRPoint;

struct NRSVPSegment {
    gint16 wind;
    guint16 length;
    guint32 start;
    float x0, x1;
};

struct NRSVPFlat {
    gint16 wind;
    guint16 length;
    float y;
    float x0, x1;
};

struct NRSVP {
    unsigned int length;
    NRPoint *points;
    NRSVPSegment segments[1];
};

#define NR_SVPSEG_IS_FLAT(s,i) (!(s)->segments[i].length)

void nr_svp_free (NRSVP *svp);

void nr_svp_bbox (NRSVP *svp, NRRect *bbox, unsigned int clear);

/* Sorted vertex lists */

struct NRVertex {
    NRVertex *next;
    NR::Coord x, y;
};


#endif

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :