home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / blob.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-02  |  1.7 KB  |  57 lines

  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 __BLOB_H__
  26. #define __BLOB_H__
  27.  
  28. typedef struct _BlobPoint BlobPoint;
  29. typedef struct _BlobSpan BlobSpan;
  30. typedef struct _Blob Blob;
  31.  
  32. struct _BlobPoint {
  33.   int x;
  34.   int y;
  35. };
  36.  
  37. struct _BlobSpan {
  38.   int left;
  39.   int right;
  40. };
  41.  
  42. struct _Blob {
  43.   int y;
  44.   int height;
  45.   BlobSpan data[1];
  46. };
  47.  
  48.  
  49. Blob *blob_convex_union (Blob *b1, Blob *b2);
  50. Blob *blob_polygon (BlobPoint *points, int npoints);
  51. Blob *blob_square (double xc, double yc, double xp, double yp, double xq, double yq);
  52. Blob *blob_diamond (double xc, double yc, double xp, double yp, double xq, double yq);
  53. Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq);
  54. void blob_bounds(Blob *b, int *x, int *y, int *width, int *height);
  55.  
  56. #endif /* __BLOB_H__ */
  57.