Commit 9f69f6e7 authored by Sven Neumann's avatar Sven Neumann
Browse files

Wolfgang Hofer sent me a bunch of changes ... here they are.


--Sven
parent 5f265a5e
Mon Apr 19 23:31:17 MEST 1999 Sven Neumann <sven@gimp.org>
* plug-ins/gap: Changes to the GAP plug-in as they were sent to
me by Wolfgang Hofer.
1999-04-19 Tuomas Kuosmanen <tigert@gimp.org>
* pixmaps/penstroke.xpm: Punched a hole inside the icon - it
......
......@@ -69,7 +69,7 @@ State Procedure_name Testnotes
+ plug_in_color_map
-REM plug_in_colorify ERROR: no stored data found for Key plug_in_colorify
.Del plug_in_compose
- plug_in_convmatrix ERROR: p_plug_in_convmatrix_iter_ALT stored Data missmatch in size 140 != 0
+ plug_in_convmatrix
+ plug_in_cubism
.Del plug_in_decompose
.Del plug_in_deinterlace
......@@ -88,7 +88,7 @@ State Procedure_name Testnotes
. * plug_in_figures (not part of 1.1.3)
.Del plug_in_film
-REM plug_in_filter_pack ERROR: no stored data found for Key plug_in_filter_pack
- plug_in_flame
+ plug_in_flame
+ plug_in_flarefx
- * plug_in_fractal_trace OK Button disappeared at 1.st press ?????
+ plug_in_gauss_iir
......
......@@ -130,6 +130,15 @@ static void p_delta_short(short *val, short val_from, short val_to, gint32 total
delta = ((double)(val_to - val_from) / (double)total_steps) * ((double)total_steps - current_step);
*val = val_from + delta;
}
static void p_delta_int(int *val, int val_from, int val_to, gint32 total_steps, gdouble current_step)
{
double delta;
if(total_steps < 1) return;
delta = ((double)(val_to - val_from) / (double)total_steps) * ((double)total_steps - current_step);
*val = val_from + delta;
}
static void p_delta_gint(gint *val, gint val_from, gint val_to, gint32 total_steps, gdouble current_step)
{
double delta;
......@@ -159,16 +168,29 @@ static void p_delta_guchar(guchar *val, char val_from, char val_to, gint32 total
}
static void p_delta_gdouble(double *val, double val_from, double val_to, gint32 total_steps, gdouble current_step)
{
double delta;
double delta;
if(total_steps < 1) return;
if(total_steps < 1) return;
delta = ((double)(val_to - val_from) / (double)total_steps) * ((double)total_steps - current_step);
*val = val_from + delta;
delta = ((double)(val_to - val_from) / (double)total_steps) * ((double)total_steps - current_step);
*val = val_from + delta;
if(gap_debug) fprintf(stderr, "DEBUG: p_delta_gdouble total: %d from: %f to: %f curr: %f delta: %f\n",
if(gap_debug) fprintf(stderr, "DEBUG: p_delta_gdouble total: %d from: %f to: %f curr: %f delta: %f\n",
(int)total_steps, val_from, val_to, *val, delta);
}
static void p_delta_gfloat(gfloat *val, gfloat val_from, gfloat val_to, gint32 total_steps, gdouble current_step)
{
double delta;
if(total_steps < 1) return;
delta = ((double)(val_to - val_from) / (double)total_steps) * ((double)total_steps - current_step);
*val = val_from + delta;
if(gap_debug) fprintf(stderr, "DEBUG: p_delta_gfloat total: %d from: %f to: %f curr: %f delta: %f\n",
(int)total_steps, val_from, val_to, *val, delta);
}
static void p_delta_float(float *val, float val_from, float val_to, gint32 total_steps, gdouble current_step)
{
double delta;
......@@ -354,10 +376,12 @@ static void p_delta_LightSettings(t_LightSettings *val, t_LightSettings *val_fro
#include "iter_ALT/mod/plug_in_alienmap_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_applylens_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_blur_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_convmatrix_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_depth_merge_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_despeckle_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_emboss_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_exchange_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_flame_iter_ALT.inc
#include "iter_ALT/mod/plug_in_lighting_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_map_object_iter_ALT.inc"
#include "iter_ALT/mod/plug_in_maze_iter_ALT.inc"
......@@ -399,14 +423,12 @@ static void p_delta_LightSettings(t_LightSettings *val, t_LightSettings *val_fro
#include "iter_ALT/gen/plug_in_checkerboard_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_color_map_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_colorify_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_convmatrix_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_cubism_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_destripe_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_diffraction_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_displace_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_edge_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_engrave_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_flame_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_flarefx_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_fractal_trace_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_gauss_iir_iter_ALT.inc"
......@@ -415,7 +437,6 @@ static void p_delta_LightSettings(t_LightSettings *val, t_LightSettings *val_fro
#include "iter_ALT/gen/plug_in_glasstile_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_grid_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_jigsaw_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_make_seamless_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_mblur_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_mosaic_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_newsprint_iter_ALT.inc"
......@@ -436,7 +457,6 @@ static void p_delta_LightSettings(t_LightSettings *val, t_LightSettings *val_fro
#include "iter_ALT/gen/plug_in_waves_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_whirl_pinch_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_wind_iter_ALT.inc"
#include "iter_ALT/gen/plug_in_zealouscrop_iter_ALT.inc"
/* table of proc_names and funtion pointers to iter_ALT procedures */
/* del ... Deleted (does not make sense to animate)
......@@ -529,7 +549,7 @@ static t_iter_ALT_tab g_iter_ALT_tab[] =
, { "plug_in_lighting", p_plug_in_lighting_iter_ALT }
, { "plug_in_magic_eye", p_plug_in_magic_eye_iter_ALT }
/*, { "plug_in_mail_image", p_plug_in_mail_image_iter_ALT } */
, { "plug_in_make_seamless", p_plug_in_make_seamless_iter_ALT }
/*, { "plug_in_make_seamless", p_plug_in_make_seamless_iter_ALT } */
, { "plug_in_mandelbrot", p_plug_in_mandelbrot_iter_ALT }
, { "plug_in_map_object", p_plug_in_map_object_iter_ALT }
/*, { "plug_in_max_rgb", p_plug_in_max_rgb_iter_ALT } */
......
......@@ -2163,9 +2163,9 @@ int p_mov_render(gint32 image_id, t_mov_values *val_ptr, t_mov_current *cur_ptr)
guint l_image_width;
guint l_image_height;
if(gap_debug) printf("p_mov_render: frame/layer: %ld/%ld X=%f, Y=%f
Width=%f Height=%f
Opacity=%f Rotate=%f clip_to_img = %d\n",
if(gap_debug) printf("p_mov_render: frame/layer: %ld/%ld X=%f, Y=%f\n"
" Width=%f Height=%f\n"
" Opacity=%f Rotate=%f clip_to_img = %d\n",
cur_ptr->dst_frame_nr, cur_ptr->src_layer_idx,
cur_ptr->currX, cur_ptr->currY,
cur_ptr->currWidth,
......
......@@ -9,14 +9,12 @@ EXTRA_DIST = \
plug_in_checkerboard_iter_ALT.inc \
plug_in_color_map_iter_ALT.inc \
plug_in_colorify_iter_ALT.inc \
plug_in_convmatrix_iter_ALT.inc \
plug_in_cubism_iter_ALT.inc \
plug_in_destripe_iter_ALT.inc \
plug_in_diffraction_iter_ALT.inc \
plug_in_displace_iter_ALT.inc \
plug_in_edge_iter_ALT.inc \
plug_in_engrave_iter_ALT.inc \
plug_in_flame_iter_ALT.inc \
plug_in_flarefx_iter_ALT.inc \
plug_in_fractal_trace_iter_ALT.inc \
plug_in_gauss_iir_iter_ALT.inc \
......@@ -25,7 +23,6 @@ EXTRA_DIST = \
plug_in_glasstile_iter_ALT.inc \
plug_in_grid_iter_ALT.inc \
plug_in_jigsaw_iter_ALT.inc \
plug_in_make_seamless_iter_ALT.inc \
plug_in_mblur_iter_ALT.inc \
plug_in_mosaic_iter_ALT.inc \
plug_in_newsprint_iter_ALT.inc \
......@@ -45,8 +42,7 @@ EXTRA_DIST = \
plug_in_vpropagate_iter_ALT.inc \
plug_in_waves_iter_ALT.inc \
plug_in_whirl_pinch_iter_ALT.inc \
plug_in_wind_iter_ALT.inc \
plug_in_zealouscrop_iter_ALT.inc
plug_in_wind_iter_ALT.inc
files:
......
/* ----------------------------------------------------------------------
* p_plug_in_flame_iter_ALT
* ----------------------------------------------------------------------
*/
gint p_plug_in_flame_iter_ALT(GRunModeType run_mode, gint32 total_steps, gdouble current_step, gint32 len_struct)
{
typedef struct t_plug_in_flame_Vals
{
} t_plug_in_flame_Vals;
t_plug_in_flame_Vals buf, *buf_from, *buf_to;
if(len_struct != sizeof(t_plug_in_flame_Vals))
{
fprintf(stderr, "ERROR: p_plug_in_flame_iter_ALT stored Data missmatch in size %d != %d\n",
(int)len_struct, sizeof(t_plug_in_flame_Vals) );
return -1; /* ERROR */
}
gimp_get_data("plug_in_flame_ITER_FROM", g_plugin_data_from);
gimp_get_data("plug_in_flame_ITER_TO", g_plugin_data_to);
buf_from = (t_plug_in_flame_Vals *)&g_plugin_data_from[0];
buf_to = (t_plug_in_flame_Vals *)&g_plugin_data_to[0];
memcpy(&buf, buf_from, sizeof(buf));
gimp_set_data("plug_in_flame", &buf, sizeof(buf));
return 0; /* OK */
}
/* ----------------------------------------------------------------------
* p_plug_in_make_seamless_iter_ALT
* ----------------------------------------------------------------------
*/
gint p_plug_in_make_seamless_iter_ALT(GRunModeType run_mode, gint32 total_steps, gdouble current_step, gint32 len_struct)
{
typedef struct t_plug_in_make_seamless_Vals
{
} t_plug_in_make_seamless_Vals;
t_plug_in_make_seamless_Vals buf, *buf_from, *buf_to;
if(len_struct != sizeof(t_plug_in_make_seamless_Vals))
{
fprintf(stderr, "ERROR: p_plug_in_make_seamless_iter_ALT stored Data missmatch in size %d != %d\n",
(int)len_struct, sizeof(t_plug_in_make_seamless_Vals) );
return -1; /* ERROR */
}
gimp_get_data("plug_in_make_seamless_ITER_FROM", g_plugin_data_from);
gimp_get_data("plug_in_make_seamless_ITER_TO", g_plugin_data_to);
buf_from = (t_plug_in_make_seamless_Vals *)&g_plugin_data_from[0];
buf_to = (t_plug_in_make_seamless_Vals *)&g_plugin_data_to[0];
memcpy(&buf, buf_from, sizeof(buf));
gimp_set_data("plug_in_make_seamless", &buf, sizeof(buf));
return 0; /* OK */
}
/* ----------------------------------------------------------------------
* p_plug_in_zealouscrop_iter_ALT
* ----------------------------------------------------------------------
*/
gint p_plug_in_zealouscrop_iter_ALT(GRunModeType run_mode, gint32 total_steps, gdouble current_step, gint32 len_struct)
{
typedef struct t_plug_in_zealouscrop_Vals
{
} t_plug_in_zealouscrop_Vals;
t_plug_in_zealouscrop_Vals buf, *buf_from, *buf_to;
if(len_struct != sizeof(t_plug_in_zealouscrop_Vals))
{
fprintf(stderr, "ERROR: p_plug_in_zealouscrop_iter_ALT stored Data missmatch in size %d != %d\n",
(int)len_struct, sizeof(t_plug_in_zealouscrop_Vals) );
return -1; /* ERROR */
}
gimp_get_data("plug_in_zealouscrop_ITER_FROM", g_plugin_data_from);
gimp_get_data("plug_in_zealouscrop_ITER_TO", g_plugin_data_to);
buf_from = (t_plug_in_zealouscrop_Vals *)&g_plugin_data_from[0];
buf_to = (t_plug_in_zealouscrop_Vals *)&g_plugin_data_to[0];
memcpy(&buf, buf_from, sizeof(buf));
gimp_set_data("plug_in_zealouscrop", &buf, sizeof(buf));
return 0; /* OK */
}
......@@ -4,10 +4,12 @@ EXTRA_DIST = \
plug_in_Twist_iter_ALT.inc \
plug_in_alienmap_iter_ALT.inc \
plug_in_applylens_iter_ALT.inc \
plug_in_convmatrix_iter_ALT.inc \
plug_in_depth_merge_iter_ALT.inc \
plug_in_despeckle_iter_ALT.inc \
plug_in_emboss_iter_ALT.inc \
plug_in_exchange_iter_ALT.inc \
plug_in_flame_iter_ALT.inc \
plug_in_map_object_iter_ALT.inc \
plug_in_maze_iter_ALT.inc \
plug_in_nlfilt_iter_ALT.inc \
......
......@@ -4,11 +4,26 @@
*/
gint p_plug_in_convmatrix_iter_ALT(GRunModeType run_mode, gint32 total_steps, gdouble current_step, gint32 len_struct)
{
typedef enum {
EXTEND,
WRAP,
CLEAR,
MIRROR
}t_convmatrix_BorderMode;
typedef struct t_plug_in_convmatrix_Vals
{
gfloat matrix[5][5];
gfloat divisor;
gfloat offset;
gint alpha_alg;
t_convmatrix_BorderMode bmode;
gint channels[5];
gint autoset;
} t_plug_in_convmatrix_Vals;
t_plug_in_convmatrix_Vals buf, *buf_from, *buf_to;
int l_x, l_y;
if(len_struct != sizeof(t_plug_in_convmatrix_Vals))
{
......@@ -25,6 +40,19 @@ gint p_plug_in_convmatrix_iter_ALT(GRunModeType run_mode, gint32 total_steps, gd
memcpy(&buf, buf_from, sizeof(buf));
for(l_x=0; l_x < 5; l_x++)
{
for(l_y=0; l_y < 5; l_y++)
{
p_delta_gfloat(&buf.matrix[l_x][l_y], buf_from->matrix[l_x][l_y], buf_to->matrix[l_x][l_y], total_steps, current_step);
}
}
p_delta_gfloat(&buf.divisor, buf_from->divisor, buf_to->divisor, total_steps, current_step);
p_delta_gfloat(&buf.offset, buf_from->offset, buf_to->offset, total_steps, current_step);
gimp_set_data("plug_in_convmatrix", &buf, sizeof(buf));
return 0; /* OK */
......
#define FLAME_NXFORMS 6
#define FLAME_NVARS 7
typedef struct {
double var[FLAME_NVARS]; /* normalized interp coefs between variations */
double c[3][2]; /* the coefs to the affine part of the function */
double density; /* prob is this function is chosen. 0 - 1 */
double color; /* color coord for this function. 0 - 1 */
} t_flame_xform;
typedef double t_flame_clrmap[256][3];
typedef struct {
t_flame_xform xform[FLAME_NXFORMS];
t_flame_clrmap cmap;
double time;
int cmap_index;
double brightness; /* 1.0 = normal */
double contrast; /* 1.0 = normal */
double gamma;
int width, height; /* of the final image */
int spatial_oversample;
double center[2]; /* camera center */
double zoom; /* effects ppu and sample density */
double pixels_per_unit; /* and scale */
double spatial_filter_radius; /* variance of gaussian */
double sample_density; /* samples per pixel (not bucket) */
/* in order to motion blur more accurately we compute the logs of the
sample density many times and average the results. we interplate
only this many times. */
int nbatches;
/* this much color resolution. but making it too high induces clipping */
int white_level;
int cmap_inter; /* if this is true, then color map interpolates one entry
at a time with a bright edge */
double pulse[2][2]; /* [i][0]=magnitute [i][1]=frequency */
double wiggle[2][2]; /* frequency is /minute, assuming 30 frames/s */
} t_flame_control_point;
static void p_delta_flame_xform(t_flame_xform *val, t_flame_xform *val_from, t_flame_xform *val_to, gint32 total_steps, gdouble current_step)
{
int l_x, l_y;
for(l_x=0; l_x < FLAME_NVARS; l_x++)
{
p_delta_gdouble(&val->var[l_x], val_from->var[l_x], val_to->var[l_x], total_steps, current_step);
}
for(l_x=0; l_x < 3; l_x++)
{
for(l_y=0; l_y < 2; l_y++)
{
p_delta_gdouble(&val->c[l_x][l_y], val_from->c[l_x][l_y], val_to->c[l_x][l_y], total_steps, current_step);
}
}
p_delta_gdouble(&val->density, val_from->density, val_to->density, total_steps, current_step);
p_delta_gdouble(&val->color, val_from->color, val_to->color, total_steps, current_step);
}
static void p_delta_flame_control_point(t_flame_control_point *val, t_flame_control_point *val_from, t_flame_control_point *val_to, gint32 total_steps, gdouble current_step)
{
int l_x, l_y;
for(l_x=0; l_x < FLAME_NXFORMS; l_x++)
{
p_delta_flame_xform(&val->xform[l_x], &val_from->xform[l_x], &val_to->xform[l_x], total_steps, current_step);
}
/* p_delta_flame_clrmap(&val->cmap, &val_from->cmap, &val_to->cmap, total_steps, current_step); */
for(l_x=0; l_x < 256; l_x++)
{
for(l_y=0; l_y < 3; l_y++)
{
p_delta_gdouble(&val->cmap[l_x][l_y], val_from->cmap[l_x][l_y], val_to->cmap[l_x][l_y], total_steps, current_step);
}
}
p_delta_gdouble(&val->time, val_from->time, val_to->time, total_steps, current_step);
p_delta_int(&val->cmap_index, val_from->cmap_index, val_to->cmap_index, total_steps, current_step);
p_delta_gdouble(&val->brightness, val_from->brightness, val_to->brightness, total_steps, current_step);
p_delta_gdouble(&val->contrast, val_from->contrast, val_to->contrast, total_steps, current_step);
p_delta_gdouble(&val->gamma, val_from->gamma, val_to->gamma, total_steps, current_step);
p_delta_int(&val->width, val_from->width, val_to->width, total_steps, current_step);
p_delta_int(&val->height, val_from->height, val_to->height, total_steps, current_step);
p_delta_int(&val->spatial_oversample, val_from->spatial_oversample, val_to->spatial_oversample, total_steps, current_step);
for(l_x=0; l_x < 2; l_x++)
{
p_delta_gdouble(&val->center[l_x], val_from->center[l_x], val_to->center[l_x], total_steps, current_step);
}
p_delta_gdouble(&val->zoom, val_from->zoom, val_to->zoom, total_steps, current_step);
p_delta_gdouble(&val->pixels_per_unit, val_from->pixels_per_unit, val_to->pixels_per_unit, total_steps, current_step);
p_delta_gdouble(&val->spatial_filter_radius, val_from->spatial_filter_radius, val_to->spatial_filter_radius, total_steps, current_step);
p_delta_gdouble(&val->sample_density, val_from->sample_density, val_to->sample_density, total_steps, current_step);
p_delta_int(&val->nbatches, val_from->nbatches, val_to->nbatches, total_steps, current_step);
p_delta_int(&val->white_level, val_from->white_level, val_to->white_level, total_steps, current_step);
p_delta_int(&val->cmap_inter, val_from->cmap_inter, val_to->cmap_inter, total_steps, current_step);
for(l_x=0; l_x < 2; l_x++)
{
for(l_y=0; l_y < 2; l_y++)
{
p_delta_gdouble(&val->pulse[l_x][l_y], val_from->pulse[l_x][l_y], val_to->pulse[l_x][l_y], total_steps, current_step);
p_delta_gdouble(&val->wiggle[l_x][l_y], val_from->wiggle[l_x][l_y], val_to->wiggle[l_x][l_y], total_steps, current_step);
}
}
}
/* ----------------------------------------------------------------------
* p_plug_in_flame_iter_ALT
* ----------------------------------------------------------------------
*/
gint p_plug_in_flame_iter_ALT(GRunModeType run_mode, gint32 total_steps, gdouble current_step, gint32 len_struct)
{
typedef struct t_plug_in_flame_Vals
{
int randomize; /* superseded */
int variation;
gint32 cmap_drawable;
t_flame_control_point cp;
} t_plug_in_flame_Vals;
t_plug_in_flame_Vals buf, *buf_from, *buf_to;
if(len_struct != sizeof(t_plug_in_flame_Vals))
{
fprintf(stderr, "ERROR: p_plug_in_flame_iter_ALT stored Data missmatch in size %d != %d\n",
(int)len_struct, sizeof(t_plug_in_flame_Vals) );
return -1; /* ERROR */
}
gimp_get_data("plug_in_flame_ITER_FROM", g_plugin_data_from);
gimp_get_data("plug_in_flame_ITER_TO", g_plugin_data_to);
buf_from = (t_plug_in_flame_Vals *)&g_plugin_data_from[0];
buf_to = (t_plug_in_flame_Vals *)&g_plugin_data_to[0];
memcpy(&buf, buf_from, sizeof(buf));
p_delta_int(&buf.randomize, buf_from->randomize, buf_to->randomize, total_steps, current_step);
p_delta_int(&buf.variation, buf_from->variation, buf_to->variation, total_steps, current_step);
p_delta_flame_control_point(&buf.cp, &buf_from->cp, &buf_to->cp, total_steps, current_step);
gimp_set_data("plug_in_flame", &buf, sizeof(buf));
return 0; /* OK */
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment