File: wind.h

package info (click to toggle)
swftools 0.9.2%2Bgit20130725-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,680 kB
  • ctags: 17,348
  • sloc: ansic: 108,712; sh: 8,494; cpp: 8,040; yacc: 2,260; lisp: 904; makefile: 601; python: 300
file content (41 lines) | stat: -rw-r--r-- 1,063 bytes parent folder | download | duplicates (3)
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
#ifndef __wind_h__
#define __wind_h__

/* Every segment has an original direction, which is the direction
   the segment had in the input data.
   as our scanline moves from minimum y to maximum y, "DOWN" means
   the the (original) segment's y2 is larger than its y1 */
typedef enum {DIR_UP, DIR_DOWN, DIR_UNKNOWN} segment_dir_t;

#define DIR_INVERT(d) ((d)^(DIR_UP^DIR_DOWN))

typedef struct _edgestyle {
    void*internal;
} edgestyle_t;

extern edgestyle_t edgestyle_default;

typedef struct _windstate
{
    char is_filled;
    int wind_nr;
} windstate_t;

typedef struct _windcontext
{
    int num_polygons;
} windcontext_t;

typedef struct _windrule
{
    windstate_t (*start)(windcontext_t* num_polygons);
    windstate_t (*add)(windcontext_t*context, windstate_t left, edgestyle_t*edge, segment_dir_t dir, int polygon_nr);
    edgestyle_t* (*diff)(windstate_t*left, windstate_t*right);
} windrule_t;

extern windrule_t windrule_evenodd;
extern windrule_t windrule_circular;
extern windrule_t windrule_intersect;
extern windrule_t windrule_union;

#endif