diff options
| author | Josh Andler <scislac@gmail.com> | 2011-08-30 00:28:20 +0000 |
|---|---|---|
| committer | Josh Andler <scislac@gmail.com> | 2011-08-30 00:28:20 +0000 |
| commit | c8a8af767399878f679cf316edecfca6c67ede20 (patch) | |
| tree | 86967bf7457d6a9d7e7e3d805a4bda76596a9009 /src | |
| parent | UI. Fix for bug #817249 (Help->About Inkscape icon missing in rev 10505, Win32). (diff) | |
| download | inkscape-c8a8af767399878f679cf316edecfca6c67ede20.tar.gz inkscape-c8a8af767399878f679cf316edecfca6c67ede20.zip | |
Update to Potrace 1.10
(bzr r10600)
Diffstat (limited to 'src')
| -rw-r--r-- | src/trace/potrace/auxiliary.h | 2 | ||||
| -rw-r--r-- | src/trace/potrace/bitmap.h | 2 | ||||
| -rw-r--r-- | src/trace/potrace/curve.cpp | 3 | ||||
| -rw-r--r-- | src/trace/potrace/curve.h | 2 | ||||
| -rw-r--r-- | src/trace/potrace/decompose.cpp | 5 | ||||
| -rw-r--r-- | src/trace/potrace/decompose.h | 3 | ||||
| -rw-r--r-- | src/trace/potrace/greymap.cpp | 3 | ||||
| -rw-r--r-- | src/trace/potrace/greymap.h | 3 | ||||
| -rw-r--r-- | src/trace/potrace/lists.h | 3 | ||||
| -rw-r--r-- | src/trace/potrace/potracelib.cpp | 116 | ||||
| -rw-r--r-- | src/trace/potrace/potracelib.h | 2 | ||||
| -rw-r--r-- | src/trace/potrace/progress.h | 2 | ||||
| -rw-r--r-- | src/trace/potrace/render.cpp | 3 | ||||
| -rw-r--r-- | src/trace/potrace/render.h | 3 | ||||
| -rw-r--r-- | src/trace/potrace/trace.cpp | 3 | ||||
| -rw-r--r-- | src/trace/potrace/trace.h | 3 |
16 files changed, 74 insertions, 84 deletions
diff --git a/src/trace/potrace/auxiliary.h b/src/trace/potrace/auxiliary.h index 1c2765816..b7480bbb8 100644 --- a/src/trace/potrace/auxiliary.h +++ b/src/trace/potrace/auxiliary.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ diff --git a/src/trace/potrace/bitmap.h b/src/trace/potrace/bitmap.h index 671382dc2..2df04b46f 100644 --- a/src/trace/potrace/bitmap.h +++ b/src/trace/potrace/bitmap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ diff --git a/src/trace/potrace/curve.cpp b/src/trace/potrace/curve.cpp index 00d7bd2db..d2e32aa7b 100644 --- a/src/trace/potrace/curve.cpp +++ b/src/trace/potrace/curve.cpp @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: curve.c 227 2010-12-16 05:47:19Z selinger $ */ /* private part of the path and curve data structures */ #include <stdio.h> diff --git a/src/trace/potrace/curve.h b/src/trace/potrace/curve.h index bfde0af1a..6ceae0c3a 100644 --- a/src/trace/potrace/curve.h +++ b/src/trace/potrace/curve.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ diff --git a/src/trace/potrace/decompose.cpp b/src/trace/potrace/decompose.cpp index 8219234c4..708c17106 100644 --- a/src/trace/potrace/decompose.cpp +++ b/src/trace/potrace/decompose.cpp @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: decompose.c 227 2010-12-16 05:47:19Z selinger $ */ #include <stdio.h> #include <stdlib.h> @@ -12,11 +11,11 @@ #include "potracelib.h" #include "curve.h" #include "lists.h" -#include "auxiliary.h" #include "bitmap.h" #include "decompose.h" #include "progress.h" + /* ---------------------------------------------------------------------- */ /* auxiliary bitmap manipulations */ diff --git a/src/trace/potrace/decompose.h b/src/trace/potrace/decompose.h index 409439c62..89b01e504 100644 --- a/src/trace/potrace/decompose.h +++ b/src/trace/potrace/decompose.h @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: decompose.h 227 2010-12-16 05:47:19Z selinger $ */ #ifndef DECOMPOSE_H #define DECOMPOSE_H diff --git a/src/trace/potrace/greymap.cpp b/src/trace/potrace/greymap.cpp index 770dd72e6..2495575e8 100644 --- a/src/trace/potrace/greymap.cpp +++ b/src/trace/potrace/greymap.cpp @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: greymap.c 227 2010-12-16 05:47:19Z selinger $ */ /* Routines for manipulating greymaps, including reading pgm files. We only deal with greymaps of depth 8 bits. */ diff --git a/src/trace/potrace/greymap.h b/src/trace/potrace/greymap.h index 0736232a7..1fb5426c1 100644 --- a/src/trace/potrace/greymap.h +++ b/src/trace/potrace/greymap.h @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: greymap.h 227 2010-12-16 05:47:19Z selinger $ */ #ifndef GREYMAP_H #define GREYMAP_H diff --git a/src/trace/potrace/lists.h b/src/trace/potrace/lists.h index 4f78bf20f..078129afc 100644 --- a/src/trace/potrace/lists.h +++ b/src/trace/potrace/lists.h @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: lists.h 227 2010-12-16 05:47:19Z selinger $ */ #ifndef _PS_LISTS_H #define _PS_LISTS_H diff --git a/src/trace/potrace/potracelib.cpp b/src/trace/potrace/potracelib.cpp index 3dbf3230b..be92fb24e 100644 --- a/src/trace/potrace/potracelib.cpp +++ b/src/trace/potrace/potracelib.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ @@ -35,14 +35,14 @@ static const potrace_param_t param_default = { /* Return a fresh copy of the set of default parameters, or NULL on failure with errno set. */ potrace_param_t *potrace_param_default(void) { - potrace_param_t *p; - - p = (potrace_param_t *) malloc(sizeof(potrace_param_t)); - if (!p) { - return NULL; - } - memcpy(p, ¶m_default, sizeof(potrace_param_t)); - return p; + potrace_param_t *p; + + p = (potrace_param_t *) malloc(sizeof(potrace_param_t)); + if (!p) { + return NULL; + } + memcpy(p, ¶m_default, sizeof(potrace_param_t)); + return p; } /* On success, returns a Potrace state st with st->status == @@ -52,63 +52,63 @@ potrace_param_t *potrace_param_default(void) { set). Complete or incomplete Potrace state can be freed with potrace_state_free(). */ potrace_state_t *potrace_trace(const potrace_param_t *param, const potrace_bitmap_t *bm) { - int r; - path_t *plist = NULL; - potrace_state_t *st; - progress_t prog; - progress_t subprog; - - /* prepare private progress bar state */ - prog.callback = param->progress.callback; - prog.data = param->progress.data; - prog.min = param->progress.min; - prog.max = param->progress.max; - prog.epsilon = param->progress.epsilon; - prog.d_prev = param->progress.min; - - /* allocate state object */ - st = (potrace_state_t *)malloc(sizeof(potrace_state_t)); - if (!st) { - return NULL; - } - - progress_subrange_start(0.0, 0.1, &prog, &subprog); - - /* process the image */ - r = bm_to_pathlist(bm, &plist, param, &subprog); - if (r) { - free(st); - return NULL; - } - - st->status = POTRACE_STATUS_OK; - st->plist = plist; - st->priv = NULL; /* private state currently unused */ - - progress_subrange_end(&prog, &subprog); - - progress_subrange_start(0.1, 1.0, &prog, &subprog); - - /* partial success. */ - r = process_path(plist, param, &subprog); - if (r) { - st->status = POTRACE_STATUS_INCOMPLETE; - } - - progress_subrange_end(&prog, &subprog); - - return st; + int r; + path_t *plist = NULL; + potrace_state_t *st; + progress_t prog; + progress_t subprog; + + /* prepare private progress bar state */ + prog.callback = param->progress.callback; + prog.data = param->progress.data; + prog.min = param->progress.min; + prog.max = param->progress.max; + prog.epsilon = param->progress.epsilon; + prog.d_prev = param->progress.min; + + /* allocate state object */ + st = (potrace_state_t *)malloc(sizeof(potrace_state_t)); + if (!st) { + return NULL; + } + + progress_subrange_start(0.0, 0.1, &prog, &subprog); + + /* process the image */ + r = bm_to_pathlist(bm, &plist, param, &subprog); + if (r) { + free(st); + return NULL; + } + + st->status = POTRACE_STATUS_OK; + st->plist = plist; + st->priv = NULL; /* private state currently unused */ + + progress_subrange_end(&prog, &subprog); + + progress_subrange_start(0.1, 1.0, &prog, &subprog); + + /* partial success. */ + r = process_path(plist, param, &subprog); + if (r) { + st->status = POTRACE_STATUS_INCOMPLETE; + } + + progress_subrange_end(&prog, &subprog); + + return st; } /* free a Potrace state, without disturbing errno. */ void potrace_state_free(potrace_state_t *st) { - pathlist_free(st->plist); - free(st); + pathlist_free(st->plist); + free(st); } /* free a parameter list, without disturbing errno. */ void potrace_param_free(potrace_param_t *p) { - free(p); + free(p); } char *potrace_version(void) { diff --git a/src/trace/potrace/potracelib.h b/src/trace/potrace/potracelib.h index d15b05e5c..cd142a6e1 100644 --- a/src/trace/potrace/potracelib.h +++ b/src/trace/potrace/potracelib.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ diff --git a/src/trace/potrace/progress.h b/src/trace/potrace/progress.h index 220639c6e..93a1fa3f0 100644 --- a/src/trace/potrace/progress.h +++ b/src/trace/potrace/progress.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ diff --git a/src/trace/potrace/render.cpp b/src/trace/potrace/render.cpp index 39bec0684..3c8f79c05 100644 --- a/src/trace/potrace/render.cpp +++ b/src/trace/potrace/render.cpp @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: render.c 227 2010-12-16 05:47:19Z selinger $ */ #include <stdio.h> #include <stdlib.h> diff --git a/src/trace/potrace/render.h b/src/trace/potrace/render.h index 6cfbe0964..ad600156a 100644 --- a/src/trace/potrace/render.h +++ b/src/trace/potrace/render.h @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: render.h 227 2010-12-16 05:47:19Z selinger $ */ #ifndef RENDER_H #define RENDER_H diff --git a/src/trace/potrace/trace.cpp b/src/trace/potrace/trace.cpp index 8fe1a1bc4..f1e88a908 100644 --- a/src/trace/potrace/trace.cpp +++ b/src/trace/potrace/trace.cpp @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: trace.c 227 2010-12-16 05:47:19Z selinger $ */ /* transform jaggy paths into smooth curves */ #include <stdio.h> diff --git a/src/trace/potrace/trace.h b/src/trace/potrace/trace.h index 72d1a3696..dc2b9247a 100644 --- a/src/trace/potrace/trace.h +++ b/src/trace/potrace/trace.h @@ -1,8 +1,7 @@ -/* Copyright (C) 2001-2010 Peter Selinger. +/* Copyright (C) 2001-2011 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ -/* $Id: trace.h 227 2010-12-16 05:47:19Z selinger $ */ #ifndef TRACE_H #define TRACE_H |
