fractal-explorer.h 4.78 KB
Newer Older
1 2 3 4
#ifndef __FRACTALEXPLORER_H__
#define __FRACTALEXPLORER_H__


Michael Natterer's avatar
Michael Natterer committed
5
/**********************************************************************
6
 Magic numbers
Michael Natterer's avatar
Michael Natterer committed
7 8
 *********************************************************************/

9
#define PREVIEW_SIZE 256
Michael Natterer's avatar
Michael Natterer committed
10 11 12 13 14
#define SCALE_WIDTH  200
#define ENTRY_WIDTH  60
#define MAX_LOAD_LINE 256
#define GR_WIDTH 325

15
#define MAXNCOLORS 8192
16 17
#define MAXSTRLEN 256

18 19
#define PLUG_IN_PROC   "plug-in-fractalexplorer"
#define PLUG_IN_BINARY "fractal-explorer"
20
#define PLUG_IN_ROLE   "gimp-fractal-explorer"
21

Michael Natterer's avatar
Michael Natterer committed
22 23 24
#define FRACTAL_HEADER "Fractal Explorer Plug-In Version 2 - (c) 1997 <cotting@mygale.org>\n"
#define fractalexplorer_HEADER "Fractal Explorer Plug-In Version 2 - (c) 1997 <cotting@mygale.org>\n"

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
enum
{
  SINUS,
  COSINUS,
  NONE
};

enum
{
  TYPE_MANDELBROT,
  TYPE_JULIA,
  TYPE_BARNSLEY_1,
  TYPE_BARNSLEY_2,
  TYPE_BARNSLEY_3,
  TYPE_SPIDER,
  TYPE_MAN_O_WAR,
  TYPE_LAMBDA,
  TYPE_SIERPINSKI,
  NUM_TYPES
};

Michael Natterer's avatar
Michael Natterer committed
46
/**********************************************************************
47
 Types
Michael Natterer's avatar
Michael Natterer committed
48 49
 *********************************************************************/

50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
typedef struct
{
  gint     fractaltype;
  gdouble  xmin;
  gdouble  xmax;
  gdouble  ymin;
  gdouble  ymax;
  gdouble  iter;
  gdouble  cx;
  gdouble  cy;
  gint     colormode;
  gdouble  redstretch;
  gdouble  greenstretch;
  gdouble  bluestretch;
  gint     redmode;
  gint     greenmode;
  gint     bluemode;
67 68 69 70
  gboolean redinvert;
  gboolean greeninvert;
  gboolean blueinvert;
  gboolean alwayspreview;
71
  gint     ncolors;
72 73
  gboolean gradinvert;
  gboolean useloglog;
Michael Natterer's avatar
Michael Natterer committed
74 75
} explorer_vals_t;

76 77 78 79 80
typedef struct
{
  GtkWidget *preview;
  guchar    *wimage;
  gint       run;
Michael Natterer's avatar
Michael Natterer committed
81 82
} explorer_interface_t;

83 84 85 86 87 88 89
/* typedef gint       colorvalue[3]; */
typedef struct
  {
    guchar r, g, b;
  } gucharRGB;

typedef gucharRGB  clrmap[MAXNCOLORS];
90

91
typedef guchar     vlumap[MAXNCOLORS];
Michael Natterer's avatar
Michael Natterer committed
92

93 94 95 96
typedef struct
{
  GtkWidget     *text;
  GtkAdjustment *data;
Michael Natterer's avatar
Michael Natterer committed
97 98 99 100
} scaledata;

typedef struct _DialogElements DialogElements;

101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
struct _DialogElements
{
  GtkWidget  *type[NUM_TYPES];
  GtkObject  *xmin;
  GtkObject  *xmax;
  GtkObject  *ymin;
  GtkObject  *ymax;
  GtkObject  *iter;
  GtkObject  *cx;
  GtkObject  *cy;

  GtkObject  *ncol;
  GtkWidget  *useloglog;

  GtkObject  *red;
  GtkObject  *green;
  GtkObject  *blue;

  GtkWidget  *redmode[3];
  GtkWidget  *redinvert;
Michael Natterer's avatar
Michael Natterer committed
121

122 123 124 125 126 127 128
  GtkWidget  *greenmode[3];
  GtkWidget  *greeninvert;

  GtkWidget  *bluemode[3];
  GtkWidget  *blueinvert;

  GtkWidget  *colormode[2];
Michael Natterer's avatar
Michael Natterer committed
129 130 131
};


132 133 134 135 136 137 138 139 140 141
typedef struct DFigObj
{
  gchar           *name;      /* Trailing name of file  */
  gchar           *filename;  /* Filename itself */
  gchar           *draw_name; /* Name of the drawing */
  explorer_vals_t  opts;      /* Options enforced when fig saved */
  GtkWidget       *list_item;
  GtkWidget       *label_widget;
  GtkWidget       *pixmap_widget;
  gint             obj_status;
142
} fractalexplorerOBJ;
Michael Natterer's avatar
Michael Natterer committed
143 144


145 146 147 148 149 150
typedef struct GigObj
{
  gchar     *name;      /* Trailing name of file  */
  gchar     *filename;  /* Filename itself */
  gchar     *draw_name; /* Name of the drawing */
  gint       typus;
Michael Natterer's avatar
Michael Natterer committed
151 152 153
  GtkWidget *list_item;
  GtkWidget *label_widget;
  GtkWidget *pixmap_widget;
154
  gint       obj_status;
155
} gradientOBJ;
Michael Natterer's avatar
Michael Natterer committed
156

157 158 159 160 161 162 163
typedef struct _fractalexplorerListOptions
{
  GtkWidget          *query_box;
  GtkWidget          *name_entry;
  GtkWidget          *list_entry;
  fractalexplorerOBJ *obj;
  gint                created;
Michael Natterer's avatar
Michael Natterer committed
164 165 166 167 168 169
} fractalexplorerListOptions;

/* States of the object */
#define fractalexplorer_OK       0x0
#define fractalexplorer_MODIFIED 0x1

170
#define gradient_GRADIENTEDITOR  0x2
Michael Natterer's avatar
Michael Natterer committed
171

172
extern fractalexplorerOBJ *current_obj;
Michael Natterer's avatar
Michael Natterer committed
173

174
GtkWidget * add_objects_list (void);
Michael Natterer's avatar
Michael Natterer committed
175 176

/**********************************************************************
177
  Global variables
Michael Natterer's avatar
Michael Natterer committed
178 179
 *********************************************************************/

180 181 182 183 184 185 186 187
extern gdouble      xmin;
extern gdouble      xmax;
extern gdouble      ymin;
extern gdouble      ymax;
extern gdouble      xbild;
extern gdouble      ybild;
extern gdouble      xdiff;
extern gdouble      ydiff;
188
extern gint         sel_x1,
Michael Natterer's avatar
Michael Natterer committed
189 190 191
                    sel_y1,
                    sel_x2,
                    sel_y2;
192
extern gint         preview_width,
Michael Natterer's avatar
Michael Natterer committed
193
                    preview_height;
194 195 196 197
extern gdouble     *gg;
extern int          line_no;
extern gchar       *filename;
extern clrmap       colormap;
198
extern gchar       *fractalexplorer_path;
199

200

201 202 203
extern explorer_interface_t wint;

extern explorer_vals_t wvals;
204 205 206 207 208 209 210 211 212 213 214 215
extern GimpDrawable   *drawable;


/**********************************************************************
  Global functions
 *********************************************************************/

void explorer_render_row (const guchar *src_row,
                          guchar       *dest_row,
                          gint          row,
                          gint          row_width,
                          gint          bpp);
216
#endif