~ubuntu-branches/ubuntu/hoary/gimp/hoary

« back to all changes in this revision

Viewing changes to app/paint/gimpink-blob.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-04-04 14:51:23 UTC
  • Revision ID: james.westby@ubuntu.com-20050404145123-9py049eeelfymur8
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* blob.h: routines for manipulating scan converted convex
 
2
 *         polygons.
 
3
 *
 
4
 * Copyright 1998, Owen Taylor <otaylor@gtk.org>
 
5
 *
 
6
 * > Please contact the above author before modifying the copy <
 
7
 * > of this file in the GIMP distribution. Thanks.            <
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU General Public License as published by
 
11
 * the Free Software Foundation; either version 2 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
22
 *
 
23
*/
 
24
 
 
25
#ifndef __GIMP_INK_BLOB_H__
 
26
#define __GIMP_INK_BLOB_H__
 
27
 
 
28
 
 
29
typedef struct _BlobPoint BlobPoint;
 
30
typedef struct _BlobSpan  BlobSpan;
 
31
typedef struct _Blob      Blob;
 
32
 
 
33
typedef Blob * (* BlobFunc) (gdouble xc,
 
34
                             gdouble yc,
 
35
                             gdouble xp,
 
36
                             gdouble yp,
 
37
                             gdouble xq,
 
38
                             gdouble yq);
 
39
 
 
40
struct _BlobPoint
 
41
{
 
42
  gint x;
 
43
  gint y;
 
44
};
 
45
 
 
46
struct _BlobSpan
 
47
{
 
48
  gint left;
 
49
  gint right;
 
50
};
 
51
 
 
52
struct _Blob
 
53
{
 
54
  gint     y;
 
55
  gint     height;
 
56
  BlobSpan data[1];
 
57
};
 
58
 
 
59
 
 
60
Blob * blob_polygon      (BlobPoint *points,
 
61
                          gint       npoints);
 
62
Blob * blob_square       (gdouble    xc,
 
63
                          gdouble    yc,
 
64
                          gdouble    xp,
 
65
                          gdouble    yp,
 
66
                          gdouble    xq,
 
67
                          gdouble    yq);
 
68
Blob * blob_diamond      (gdouble    xc,
 
69
                          gdouble    yc,
 
70
                          gdouble    xp,
 
71
                          gdouble    yp,
 
72
                          gdouble    xq,
 
73
                          gdouble    yq);
 
74
Blob * blob_ellipse      (gdouble    xc,
 
75
                          gdouble    yc,
 
76
                          gdouble    xp,
 
77
                          gdouble    yp,
 
78
                          gdouble    xq,
 
79
                          gdouble    yq);
 
80
void   blob_bounds       (Blob      *b,
 
81
                          gint      *x,
 
82
                          gint      *y,
 
83
                          gint      *width,
 
84
                          gint      *height);
 
85
Blob * blob_convex_union (Blob      *b1,
 
86
                          Blob      *b2);
 
87
 
 
88
 
 
89
#endif /* __GIMP_INK_BLOB_H__ */