color-rotate.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. *
  4. * This is a plug-in for 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 3 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, see <http://www.gnu.org/licenses/>.
  24. */
  25. /*----------------------------------------------------------------------------
  26. * Change log:
  27. *
  28. * Version 2.0, 04 April 1999.
  29. * Nearly complete rewrite, made plug-in stable.
  30. * (Works with GIMP 1.1 and GTK+ 1.2)
  31. *
  32. * Version 1.0, 27 March 1997.
  33. * Initial (unstable) release by Pavel Grinfeld
  34. *
  35. *----------------------------------------------------------------------------*/
  36. /* Global defines */
  37. #define PLUG_IN_PROC "plug-in-rotate-colormap"
  38. #define PLUG_IN_BINARY "rcm"
  39. #define PLUG_IN_ROLE "gimp-rcm"
  40. #define TP (2*G_PI)
  41. /* Typedefs */
  42. enum { ENTIRE_IMAGE, SELECTION, SELECTION_IN_CONTEXT, PREVIEW_OPTIONS };
  43. enum { EACH, BOTH, DEGREES, RADIANS, RADIANS_OVER_PI,
  44. GRAY_FROM, GRAY_TO, CURRENT, ORIGINAL };
  45. typedef enum { VIRGIN, DRAG_START, DRAGING, DO_NOTHING } RcmOp;
  46. typedef struct
  47. {
  48. gfloat alpha;
  49. gfloat beta;
  50. gint cw_ccw;
  51. } RcmAngle;
  52. typedef struct
  53. {
  54. gint width;
  55. gint height;
  56. guchar *rgb;
  57. gdouble *hsv;
  58. guchar *mask;
  59. } ReducedImage;
  60. typedef struct
  61. {
  62. GtkWidget *preview;
  63. GtkWidget *frame;
  64. GtkWidget *table;
  65. GtkWidget *cw_ccw_button;
  66. GtkWidget *cw_ccw_box;
  67. GtkWidget *cw_ccw_label;
  68. GtkWidget *cw_ccw_pixmap;
  69. GtkWidget *a_b_button;
  70. GtkWidget *a_b_box;
  71. GtkWidget *a_b_pixmap;
  72. GtkWidget *f360_button;
  73. GtkWidget *f360_box;
  74. GtkWidget *f360_pixmap;
  75. GtkWidget *alpha_entry;
  76. GtkWidget *alpha_units_label;
  77. GtkWidget *beta_entry;
  78. GtkWidget *beta_units_label;
  79. gfloat *target;
  80. gint mode;
  81. RcmAngle *angle;
  82. gfloat prev_clicked;
  83. } RcmCircle;
  84. typedef struct
  85. {
  86. GtkWidget *dlg;
  87. GtkWidget *bna_frame;
  88. GtkWidget *before;
  89. GtkWidget *after;
  90. } RcmBna;
  91. typedef struct
  92. {
  93. GtkWidget *preview;
  94. GtkWidget *frame;
  95. gfloat gray_sat;
  96. gfloat hue;
  97. gfloat satur;
  98. GtkWidget *hue_entry;
  99. GtkWidget *hue_units_label;
  100. GtkWidget *satur_entry;
  101. RcmOp action_flag;
  102. } RcmGray;
  103. typedef struct
  104. {
  105. gint Slctn;
  106. gint RealTime;
  107. gint Units;
  108. gint Gray_to_from;
  109. GimpDrawable *drawable;
  110. GimpDrawable *mask;
  111. ReducedImage *reduced;
  112. RcmCircle *To;
  113. RcmCircle *From;
  114. RcmGray *Gray;
  115. RcmBna *Bna;
  116. } RcmParams;
  117. /* Global variables */
  118. extern RcmParams Current;