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

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  */
  18.  
  19. #ifndef __GRADIENT_HEADER_H__
  20. #define __GRADIENT_HEADER_H__
  21.  
  22.  
  23. /***** Types *****/
  24.  
  25. /* Gradient segment type */
  26.  
  27. typedef enum
  28. {
  29.   GRAD_LINEAR = 0,
  30.   GRAD_CURVED,
  31.   GRAD_SINE,
  32.   GRAD_SPHERE_INCREASING,
  33.   GRAD_SPHERE_DECREASING
  34. } grad_type_t;
  35.  
  36. typedef enum
  37. {
  38.   GRAD_RGB = 0,  /* normal RGB */
  39.   GRAD_HSV_CCW,  /* counterclockwise hue */
  40.   GRAD_HSV_CW    /* clockwise hue */
  41. } grad_color_t;
  42.  
  43. typedef struct _grad_segment_t grad_segment_t;
  44.  
  45. struct _gradient_t
  46. {
  47.   gchar          *name;
  48.   gchar          *filename;
  49.  
  50.   grad_segment_t *segments;
  51.   grad_segment_t *last_visited;
  52.  
  53.   gboolean        dirty;
  54.   GdkPixmap      *pixmap;
  55. };
  56.  
  57. struct _grad_segment_t
  58. {
  59.   double       left, middle, right; /* Left pos, midpoint, right pos */
  60.   double       r0, g0, b0, a0;       /* Left color */
  61.   double       r1, g1, b1, a1;       /* Right color */
  62.   grad_type_t  type;                 /* Segment's blending function */
  63.   grad_color_t color;             /* Segment's coloring type */
  64.  
  65.   struct _grad_segment_t *prev, *next; /* For linked list of segments */
  66. };
  67.  
  68. #endif  /*  __GRADIENT_HEADER_H__  */
  69.