1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
#ifndef __GIMPRESSIONIST_H
#define __GIMPRESSIONIST_H
/* Includes necessary for the correct processing of this file. */
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "ppmtool.h"
/* Defines */
#define PLUG_IN_NAME "plug_in_gimpressionist"
#define PLUG_IN_VERSION "v1.0, November 2003"
#define HELP_ID "plug-in-gimppressionist"
#define PREVIEWSIZE 150
#define MAXORIENTVECT 50
#define MAXSIZEVECT 50
/* Type declaration and definitions */
typedef struct vector
{
double x, y;
double dir;
double dx, dy;
double str;
int type;
} vector_t;
typedef struct smvector
{
double x, y;
double siz;
double str;
} smvector_t;
typedef struct
{
int orient_num;
double orient_first;
double orient_last;
int orient_type;
double brush_relief;
double brush_scale;
double brush_density;
double brushgamma;
int general_background_type;
double general_dark_edge;
double paper_relief;
double paper_scale;
int paper_invert;
int run;
char selected_brush[200];
char selected_paper[200];
GimpRGB color;
int general_paint_edges;
int place_type;
vector_t orient_vectors[MAXORIENTVECT];
int num_orient_vectors;
int placement_center;
double brush_aspect;
double orient_angle_offset;
double orient_strength_exponent;
int general_tileable;
int paper_overlay;
int orient_voronoi;
int color_brushes;
int general_drop_shadow;
double general_shadow_darkness;
int size_num;
double size_first;
double size_last;
int size_type;
double devthresh;
smvector_t size_vectors[MAXSIZEVECT];
int num_size_vectors;
double size_strength_exponent;
int size_voronoi;
int general_shadow_depth;
int general_shadow_blur;
int color_type;
double color_noise;
} gimpressionist_vals_t;
/* Enumerations */
enum GENERAL_BG_TYPE_ENUM
{
BG_TYPE_SOLID = 0,
BG_TYPE_KEEP_ORIGINAL = 1,
BG_TYPE_FROM_PAPER = 2,
BG_TYPE_TRANSPARENT = 3,
};
enum PRESETS_LIST_COLUMN_ENUM
{
PRESETS_LIST_COLUMN_FILENAME = 0,
PRESETS_LIST_COLUMN_OBJECT_NAME = 1,
};
/* Globals */
extern gimpressionist_vals_t pcvals;
/* Prototypes */
GList *parsepath (void);
void free_parsepath_cache (void);
void grabarea (void);
void store_values (void);
void restore_values (void);
gchar *findfile (const gchar *);
void unselectall (GtkWidget *list);
void reselect (GtkWidget *list, char *fname);
void readdirintolist (char *subdir, GtkWidget *view, char *selected);
void readdirintolist_extended (char *subdir, GtkWidget *view, char *selected,
gboolean with_filename_column,
gchar *(*get_object_name_cb)
(gchar *dir, gchar *filename, void *context),
void * context);
GtkWidget *create_one_column_list (GtkWidget *parent,
void (*changed_cb)
(GtkTreeSelection *selection,
gpointer data));
void brush_reload (const gchar *fn, struct ppm *p);
double get_direction (double x, double y, int from);
void create_sizemap_dialog (void);
double getsiz_proto (double x, double y, int n, smvector_t *vec,
double smstrexp, int voronoi);
void set_colorbrushes (const gchar *fn);
int create_gimpressionist (void);
double dist (double x, double y, double dx, double dy);
void restore_default_values (void);
GtkWidget *create_radio_button (GtkWidget *box, int orient_type,
void (*callback)(GtkWidget *wg, void *d),
gchar *label, gchar *help_string,
GSList **radio_group,
GtkWidget **buttons_array
);
#define CLAMP_UP_TO(x, max) (CLAMP((x),(0),(max-1)))
#endif /* #ifndef __GIMPRESSIONIST_H */
|