X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgraphcut.h;h=b08577076b5beeb9be463dd8f354034d779e7bb7;hp=ca6d82a8fd5f2a15236e16988bd966fddfd5c978;hb=c4e8d97d137d32868c97280106819a1f868e361c;hpb=818ac2906f7eb845c097ef8362a9c1f231978f44 diff --git a/lib/graphcut.h b/lib/graphcut.h index ca6d82a..b085770 100644 --- a/lib/graphcut.h +++ b/lib/graphcut.h @@ -21,10 +21,7 @@ #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,6 +31,7 @@ struct _halfedge { node_t*node; struct _halfedge*fwd; weight_t weight; + weight_t init_weight; char used; halfedge_t*next; }; @@ -49,7 +47,7 @@ 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); void graph_delete(graph_t*);