diff options
Diffstat (limited to 'lib/edge.c')
-rw-r--r-- | lib/edge.c | 41 |
1 files changed, 21 insertions, 20 deletions
@@ -1,20 +1,21 @@ -/* edge.c: operations on edges in bitmaps. +# edge.c: operations on edges in bitmaps. +# +# Copyright (C) 1992, 2011 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# -Copyright (C) 1992, 2011 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" @@ -35,7 +36,7 @@ typedef enum static boolean is_marked_edge (edge_type, unsigned, unsigned, bitmap_type); static boolean is_outline_edge (edge_type, bitmap_type, unsigned, unsigned); static edge_type next_edge (edge_type); - + /* The following macros are used (directly or indirectly) by the `next_outline_edge' routine. */ @@ -100,7 +101,7 @@ static edge_type next_edge (edge_type); break; \ } \ } - + /* Finally, we are ready to implement the routine that finds the next edge on the outline. We look first for an adjacent edge that is not on the current pixel. We want to go around outside outlines @@ -163,7 +164,7 @@ next_outline_edge (bitmap_type character, edge_type *edge, if (*row == original_row && *col == original_col) *edge = next_edge (*edge); } - + /* We return the next edge on the pixel at position ROW and COL which is an unmarked outline edge. By ``next'' we mean either the one sent in in STARTING_EDGE, if it qualifies, or the next such returned by @@ -226,7 +227,7 @@ is_outline_edge (edge_type edge, bitmap_type character, return 0; /* NOTREACHED */ } - + /* If EDGE is not already marked, we mark it; otherwise, it's a fatal error. The position ROW and COL should be inside the bitmap MARKED. EDGE can be `no_edge'; we just return false. */ |