gradient_header.h 1.87 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/* The GIMP -- an image manipulation program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * 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 2 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
#ifndef __GRADIENT_HEADER_H__
#define __GRADIENT_HEADER_H__

21 22
#include <gtk/gtk.h>

23 24 25 26
/***** Types *****/

/* Gradient segment type */

27 28 29 30 31 32 33
typedef enum
{
  GRAD_LINEAR = 0,
  GRAD_CURVED,
  GRAD_SINE,
  GRAD_SPHERE_INCREASING,
  GRAD_SPHERE_DECREASING
34 35
} grad_type_t;

36 37 38 39 40
typedef enum
{
  GRAD_RGB = 0,  /* normal RGB */
  GRAD_HSV_CCW,  /* counterclockwise hue */
  GRAD_HSV_CW    /* clockwise hue */
41 42
} grad_color_t;

43
typedef struct _grad_segment_t grad_segment_t;
44

45 46
struct _gradient_t
{
47 48 49
  gchar          *name;
  gchar          *filename;

50 51
  grad_segment_t *segments;
  grad_segment_t *last_visited;
52 53

  gboolean        dirty;
54 55
  GdkPixmap      *pixmap;
};
56

57
struct _grad_segment_t
58
{
59 60 61 62 63
  double       left, middle, right; /* Left pos, midpoint, right pos */
  double       r0, g0, b0, a0;   	/* Left color */
  double       r1, g1, b1, a1;   	/* Right color */
  grad_type_t  type;             	/* Segment's blending function */
  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__  */