home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / path_bezier.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-12-17  |  2.7 KB  |  118 lines

  1. /* The GIMP -- an image manipulation program
  2.  *
  3.  * This file Copyright (C) 1999 Simon Budig
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * This function is to get a set of npoints different coordinates for
  22.  * the range from start to end (each in the range from 0 to 1 and
  23.  * start < end.
  24.  * returns the number of created coords. Make sure that the points-
  25.  * Array is allocated.
  26.  */
  27.  
  28. #ifndef __PATH_BEZIER_H__
  29. #define __PATH_BEZIER_H__
  30.  
  31.  
  32. #include "path_toolP.h"
  33.  
  34. typedef struct 
  35. {
  36.    gdouble x1;
  37.    gdouble y1;
  38.    gdouble x2;
  39.    gdouble y2;
  40.  
  41. } PathBezierData;
  42.  
  43.  
  44. guint
  45. path_bezier_get_points (PathTool *path_tool,
  46.                         PathSegment *segment,
  47.             GdkPoint *points,
  48.             guint npoints,
  49.             gdouble start,
  50.             gdouble end);
  51.  
  52. void
  53. path_bezier_get_point (PathTool *path_tool,
  54.                PathSegment *segment,
  55.                gdouble position,
  56.                gdouble *x,
  57.                gdouble *y);
  58.  
  59. void
  60. path_bezier_draw_handles (Tool *tool,
  61.               PathSegment *segment);
  62.               
  63. void
  64. path_bezier_draw_segment (Tool *tool,
  65.               PathSegment *segment);
  66.               
  67.  
  68. gdouble
  69. path_bezier_on_segment (Tool *tool,
  70.             PathSegment *segment,
  71.             gint x,
  72.             gint y,
  73.             gint halfwidth,
  74.             gint *distance);
  75.  
  76. void
  77. path_bezier_drag_segment (PathTool *path_tool,
  78.               PathSegment *segment,
  79.               gdouble position,
  80.               gdouble dx,
  81.               gdouble dy);
  82.  
  83. gint
  84. path_bezier_on_handles (PathTool *path_tool,
  85.             PathSegment *segment,
  86.             gdouble x,
  87.             gdouble y,
  88.             gdouble halfwidth);
  89.  
  90. void
  91. path_bezier_drag_handles (PathTool *path_tool,
  92.               PathSegment *segment,
  93.               gdouble dx,
  94.               gdouble dy,
  95.               gint handle_id);
  96.  
  97. PathSegment *
  98. path_bezier_insert_anchor (PathTool *path_tool,
  99.                PathSegment *segment,
  100.                gdouble position);
  101.  
  102. void
  103. path_bezier_update_segment (PathTool *path_tool,
  104.                 PathSegment *segment);
  105.  
  106. void
  107. path_bezier_flip_segment (PathSegment *segment);
  108.  
  109. void
  110. path_bezier_init_segment (PathSegment *segment);
  111.  
  112. void
  113. path_bezier_cleanup_segment (PathSegment *segment);
  114.  
  115. #endif /*  __PATH_BEZIER_H__ */
  116.  
  117.             
  118.