home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / rcm / rcm.h < prev   
Encoding:
C/C++ Source or Header  |  2000-08-24  |  3.9 KB  |  143 lines

  1. /*
  2.  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3.  *
  4.  * This is a plug-in for the GIMP.
  5.  *
  6.  * Colormap-Rotation plug-in. Exchanges two color ranges.
  7.  *
  8.  * Copyright (C) 1999 Sven Anders (anderss@fmi.uni-passau.de)
  9.  *                    Based on code from Pavel Grinfeld (pavel@ml.com)
  10.  *
  11.  *
  12.  * This program is free software; you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation; either version 2 of the License, or
  15.  * (at your option) any later version.
  16.  *
  17.  * This program is distributed in the hope that it will be useful,
  18.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20.  * GNU General Public License for more details.
  21.  *
  22.  * You should have received a copy of the GNU General Public License
  23.  * along with this program; if not, write to the Free Software
  24.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  25.  */
  26.  
  27. /*-----------------------------------------------------------------------------------
  28.  * Change log:
  29.  * 
  30.  * Version 2.0, 04 April 1999.
  31.  *  Nearly complete rewrite, made plug-in stable.
  32.  *  (Works with GIMP 1.1 and GTK+ 1.2)
  33.  *
  34.  * Version 1.0, 27 March 1997.
  35.  *  Initial (unstable) release by Pavel Grinfeld
  36.  *
  37.  *-----------------------------------------------------------------------------------*/
  38.  
  39. /*-----------------------------------------------------------------------------------*/
  40. /* Global defines */
  41. /*-----------------------------------------------------------------------------------*/
  42.  
  43. #define TP (2*G_PI)
  44.  
  45. /*-----------------------------------------------------------------------------------*/
  46. /* Typedefs */
  47. /*-----------------------------------------------------------------------------------*/
  48.  
  49. enum { ENTIRE_IMAGE, SELECTION, SELECTION_IN_CONTEXT, PREVIEW_OPTIONS };
  50.  
  51. enum { EACH, BOTH, DEGREES, RADIANS, RADIANS_OVER_PI, 
  52.        GRAY_FROM, GRAY_TO, CURRENT, ORIGINAL };
  53.  
  54. typedef enum { VIRGIN, DRAG_START, DRAGING, DO_NOTHING } RcmOp;
  55.  
  56. typedef struct
  57. {
  58.   float  alpha;
  59.   float  beta;
  60.   int    cw_ccw;
  61. } RcmAngle;
  62.  
  63. typedef struct
  64. {
  65.   gint    width;
  66.   gint    height;
  67.   guchar  *rgb;
  68.   gdouble *hsv;
  69.   guchar  *mask;
  70. } ReducedImage;
  71.  
  72. typedef struct
  73. {
  74.   GtkWidget  *preview;
  75.   GtkWidget  *frame;
  76.   GtkWidget  *table;
  77.   GtkWidget  *cw_ccw_button;
  78.   GtkWidget  *cw_ccw_box;
  79.   GtkWidget  *cw_ccw_label;
  80.   GtkWidget  *cw_ccw_pixmap;
  81.   GtkWidget  *a_b_button;
  82.   GtkWidget  *a_b_box;
  83.   GtkWidget  *a_b_pixmap;
  84.   GtkWidget  *f360_button;
  85.   GtkWidget  *f360_box;
  86.   GtkWidget  *f360_pixmap;
  87.   GtkWidget  *alpha_entry;
  88.   GtkWidget  *alpha_units_label;
  89.   GtkWidget  *beta_entry;
  90.   GtkWidget  *beta_units_label;
  91.   gfloat     *target;
  92.   gint       mode;
  93.   RcmAngle   *angle;
  94.   RcmOp      action_flag;
  95.   gfloat     prev_clicked;
  96. } RcmCircle;
  97.  
  98. typedef struct
  99. {
  100.   GtkWidget  *dlg;
  101.   GtkWidget  *bna_frame;
  102.   GtkWidget  *before;
  103.   GtkWidget  *after;
  104. } RcmBna;
  105.  
  106. typedef struct
  107. {
  108.   GtkWidget  *preview;
  109.   GtkWidget  *frame;
  110.   float      gray_sat;
  111.   float      hue;
  112.   float      satur;
  113.   GtkWidget  *gray_sat_entry;
  114.   GtkWidget  *hue_entry;
  115.   GtkWidget  *hue_units_label;
  116.   GtkWidget  *satur_entry;
  117.   RcmOp      action_flag;
  118. } RcmGray;
  119.  
  120. typedef struct
  121. {
  122.   gint          Slctn;
  123.   gint          RealTime;
  124.   gint          Success;
  125.   gint          Units;
  126.   gint          Gray_to_from;
  127.   GimpDrawable     *drawable;
  128.   GimpDrawable     *mask;
  129.   ReducedImage  *reduced;
  130.   RcmCircle     *To;
  131.   RcmCircle     *From;
  132.   RcmGray       *Gray;
  133.   RcmBna        *Bna;
  134. } RcmParams;
  135.  
  136. /*-----------------------------------------------------------------------------------*/
  137. /* Global variables */
  138. /*-----------------------------------------------------------------------------------*/
  139.  
  140. extern RcmParams Current;
  141.  
  142. /*-----------------------------------------------------------------------------------*/
  143.