File: plug_in_gimpressionist_iter_ALT.inc

package info (click to toggle)
gimp-gap 2.6.0%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 19,656 kB
  • ctags: 7,358
  • sloc: ansic: 119,801; sh: 3,890; makefile: 932; lisp: 97; pascal: 55
file content (155 lines) | stat: -rw-r--r-- 8,039 bytes parent folder | download | duplicates (5)
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
/* ----------------------------------------------------------------------
 * p_plug_in_gimpressionist_iter_ALT 
 * ----------------------------------------------------------------------
 */
gint 
p_plug_in_gimpressionist_iter_ALT(GimpRunMode run_mode, gint32 total_steps, gdouble current_step, gint32 len_struct) 
{
#define MAXORIENTVECT   50
#define MAXSIZEVECT     50

    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;
	t_gimpressionist_vector   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;

	t_gimpressionist_smvector 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;

    } t_plug_in_gimpressionist_Vals; 





    t_plug_in_gimpressionist_Vals  buf, buf_from, buf_to;
    int                        l_idx;

    if(len_struct != sizeof(t_plug_in_gimpressionist_Vals)) 
    {
      fprintf(stderr, "ERROR: p_plug_in_gimpressionist_iter  stored Data missmatch in size %d != %d\n",   
                       (int)len_struct, sizeof(t_plug_in_gimpressionist_Vals) ); 
      return -1;  /* ERROR */ 
    }

    gimp_get_data("plug-in-gimpressionist-ITER-FROM", &buf_from); 
    gimp_get_data("plug-in-gimpressionist-ITER-TO",   &buf_to); 
    memcpy(&buf, &buf_from, sizeof(buf));

    p_delta_int(&buf.orient_num, buf_from.orient_num, buf_to.orient_num, total_steps, current_step);
    p_delta_gdouble(&buf.orient_first, buf_from.orient_first, buf_to.orient_first, total_steps, current_step);
    p_delta_gdouble(&buf.orient_last, buf_from.orient_last, buf_to.orient_last, total_steps, current_step);

    p_delta_int(&buf.orient_type, buf_from.orient_type, buf_to.orient_type, total_steps, current_step);
    p_delta_gdouble(&buf.brush_relief, buf_from.brush_relief, buf_to.brush_relief, total_steps, current_step);
    p_delta_gdouble(&buf.brush_scale, buf_from.brush_scale, buf_to.brush_scale, total_steps, current_step);
    p_delta_gdouble(&buf.brush_density, buf_from.brush_density, buf_to.brush_density, total_steps, current_step);
    p_delta_gdouble(&buf.brushgamma, buf_from.brushgamma, buf_to.brushgamma, total_steps, current_step);

    p_delta_int(&buf.general_background_type, buf_from.general_background_type, buf_to.general_background_type, total_steps, current_step);
    p_delta_gdouble(&buf.general_dark_edge, buf_from.general_dark_edge, buf_to.general_dark_edge, total_steps, current_step);
    p_delta_gdouble(&buf.paper_relief, buf_from.paper_relief, buf_to.paper_relief, total_steps, current_step);
    p_delta_gdouble(&buf.paper_scale, buf_from.paper_scale, buf_to.paper_scale, total_steps, current_step);

    p_delta_int(&buf.paper_invert, buf_from.paper_invert, buf_to.paper_invert, total_steps, current_step);


/*  p_delta_int(&buf.run, buf_from.run, buf_to.run, total_steps, current_step); */

    p_delta_GimpRGB(&buf.color, &buf_from.color, &buf_to.color, total_steps, current_step);


    p_delta_int(&buf.general_paint_edges, buf_from.general_paint_edges, buf_to.general_paint_edges, total_steps, current_step);
    p_delta_int(&buf.place_type, buf_from.place_type, buf_to.place_type, total_steps, current_step);

    for(l_idx = 0; l_idx < MAXORIENTVECT; l_idx++)
    {
      p_delta_gimpressionist_vector(&buf.orient_vectors[l_idx], &buf_from.orient_vectors[l_idx], &buf_to.orient_vectors[l_idx], total_steps, current_step);
    }



    p_delta_int(&buf.num_orient_vectors, buf_from.num_orient_vectors, buf_to.num_orient_vectors, total_steps, current_step);
    p_delta_int(&buf.placement_center, buf_from.placement_center, buf_to.placement_center, total_steps, current_step);
    p_delta_gdouble(&buf.brush_aspect, buf_from.brush_aspect, buf_to.brush_aspect, total_steps, current_step);
    p_delta_gdouble(&buf.orient_angle_offset, buf_from.orient_angle_offset, buf_to.orient_angle_offset, total_steps, current_step);
    p_delta_gdouble(&buf.orient_strength_exponent, buf_from.orient_strength_exponent, buf_to.orient_strength_exponent, total_steps, current_step);

    /* p_delta_int(&buf.general_tileable, buf_from.general_tileable, buf_to.general_tileable, total_steps, current_step); */
    p_delta_int(&buf.paper_overlay, buf_from.paper_overlay, buf_to.paper_overlay, total_steps, current_step);
    p_delta_int(&buf.orient_voronoi, buf_from.orient_voronoi, buf_to.orient_voronoi, total_steps, current_step);
    p_delta_int(&buf.color_brushes, buf_from.color_brushes, buf_to.color_brushes, total_steps, current_step);
    /* p_delta_int(&buf.general_drop_shadow, buf_from.general_drop_shadow, buf_to.general_drop_shadow, total_steps, current_step); */


    p_delta_gdouble(&buf.general_shadow_darkness, buf_from.general_shadow_darkness, buf_to.general_shadow_darkness, total_steps, current_step);
    p_delta_int(&buf.size_num, buf_from.size_num, buf_to.size_num, total_steps, current_step);
    p_delta_gdouble(&buf.size_first, buf_from.size_first, buf_to.size_first, total_steps, current_step);
    p_delta_gdouble(&buf.size_last, buf_from.size_last, buf_to.size_last, total_steps, current_step);
    p_delta_int(&buf.size_type, buf_from.size_type, buf_to.size_type, total_steps, current_step);
    p_delta_gdouble(&buf.devthresh, buf_from.devthresh, buf_to.devthresh, total_steps, current_step);
 
    for(l_idx = 0; l_idx < MAXSIZEVECT; l_idx++)
    {
      p_delta_gimpressionist_smvector(&buf.size_vectors[l_idx], &buf_from.size_vectors[l_idx], &buf_to.size_vectors[l_idx], total_steps, current_step);
    }
    

    p_delta_int(&buf.num_size_vectors, buf_from.num_size_vectors, buf_to.num_size_vectors, total_steps, current_step);
    p_delta_gdouble(&buf.size_strength_exponent, buf_from.size_strength_exponent, buf_to.size_strength_exponent, total_steps, current_step);
    p_delta_int(&buf.size_voronoi, buf_from.size_voronoi, buf_to.size_voronoi, total_steps, current_step);

    p_delta_int(&buf.general_shadow_depth, buf_from.general_shadow_depth, buf_to.general_shadow_depth, total_steps, current_step);
    p_delta_int(&buf.general_shadow_blur, buf_from.general_shadow_blur, buf_to.general_shadow_blur, total_steps, current_step);

    p_delta_int(&buf.color_type, buf_from.color_type, buf_to.color_type, total_steps, current_step);
    p_delta_gdouble(&buf.color_noise, buf_from.color_noise, buf_to.color_noise, total_steps, current_step);


    gimp_set_data("plug-in-gimpressionist", &buf, sizeof(buf)); 

    return 0; /* OK */
}