fixed z-order problems in poly2bitmap
[swftools.git] / lib / graphcut.h
index ca6d82a..9b15a44 100644 (file)
 #ifndef __graphcut_h__
 #define __graphcut_h__
 
-#include "image.h"
-
 typedef signed int weight_t;
-#define MAX_WEIGHT 0x07ffffff
 
 typedef struct _halfedge halfedge_t;
 typedef struct _node node_t;
@@ -34,12 +31,18 @@ struct _halfedge {
     node_t*node;
     struct _halfedge*fwd;
     weight_t weight;
+    weight_t init_weight;
     char used;
     halfedge_t*next;
 };
 
 struct _node {
     halfedge_t*edges;
+    union {
+       int tmp;
+       int component;
+       int color;
+    };
     int nr;
 };
 
@@ -49,8 +52,9 @@ struct _graph {
 };
 
 graph_t* graph_new(int num_nodes);
-halfedge_t*edge_new(node_t*from, node_t*to, weight_t forward_weight, weight_t backward_weight);
+halfedge_t*graph_add_edge(node_t*from, node_t*to, weight_t forward_weight, weight_t backward_weight);
 weight_t graph_maxflow(graph_t*graph, node_t*pos1, node_t*pos2);
+int graph_find_components(graph_t*g);
 void graph_delete(graph_t*);
 
 #endif