2 graphcut- a graphcut implementation based on the Boykov Kolmogorov algorithm
4 Part of the swftools package.
6 Copyright (c) 2007,2008,2009 Matthias Kramm <kramm@quiss.org>
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef __graphcut_h__
22 #define __graphcut_h__
24 typedef signed int weight_t;
26 typedef struct _halfedge halfedge_t;
27 typedef struct _node node_t;
28 typedef struct _graph graph_t;
54 graph_t* graph_new(int num_nodes);
55 halfedge_t*graph_add_edge(node_t*from, node_t*to, weight_t forward_weight, weight_t backward_weight);
56 weight_t graph_maxflow(graph_t*graph, node_t*pos1, node_t*pos2);
57 int graph_find_components(graph_t*g);
58 void graph_delete(graph_t*);