Commit 72403e73 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

plug-ins/FractalExplorer/*.[ch] plug-ins/Lighting/*.[ch]

2000-08-22  Sven Neumann  <sven@gimp.org>

* plug-ins/FractalExplorer/*.[ch]
* plug-ins/Lighting/*.[ch]
* plug-ins/MapObject/*.[ch]
* plug-ins/bmp/*.[ch]
* plug-ins/faxg3/faxg3.c
* plug-ins/fits/fits.c
* plug-ins/flame/flame.c
* plug-ins/fp/*.[ch]
* plug-ins/gap/*.[ch]
* plug-ins/gdyntext/*.[ch]
* plug-ins/gfig/gfig.c
* plug-ins/gflare/gflare.c
* plug-ins/gfli/gfli.c
* plug-ins/gimpressionist/*.c
* plug-ins/script-fu/*.[ch]: removed COMPAT_CRUFT.
parent fdd6acd8
2000-08-22 Sven Neumann <sven@gimp.org>
* plug-ins/FractalExplorer/*.[ch]
* plug-ins/Lighting/*.[ch]
* plug-ins/MapObject/*.[ch]
* plug-ins/bmp/*.[ch]
* plug-ins/faxg3/faxg3.c
* plug-ins/fits/fits.c
* plug-ins/flame/flame.c
* plug-ins/fp/*.[ch]
* plug-ins/gap/*.[ch]
* plug-ins/gdyntext/*.[ch]
* plug-ins/gfig/gfig.c
* plug-ins/gflare/gflare.c
* plug-ins/gfli/gfli.c
* plug-ins/gimpressionist/*.c
* plug-ins/script-fu/*.[ch]: removed COMPAT_CRUFT.
Tue Aug 22 03:35:46 CEST 2000 Daniel Egger <egger@suse.de>
* plug-ins/common/AlienMap.c: Cleaned up AlienMap
......
......@@ -205,7 +205,7 @@ explorer_number_of_colors_callback (GtkAdjustment *adjustment,
if (gradient_name == NULL)
gradient_name = gimp_gradients_get_active ();
gimp_gradient_get_gradient_data (gradient_name, &dummy, wvals.ncolors,
gimp_gradients_get_gradient_data (gradient_name, &dummy, wvals.ncolors,
&gradient_samples);
set_cmap_preview ();
......@@ -226,7 +226,7 @@ explorer_gradient_select_callback (gchar *name,
gradient_name = g_strdup (name);
gimp_gradient_get_gradient_data (gradient_name, &dummy, wvals.ncolors,
gimp_gradients_get_gradient_data (gradient_name, &dummy, wvals.ncolors,
&gradient_samples);
if (wvals.colormode == 1)
......
......@@ -96,11 +96,11 @@
static void query (void);
static void run (gchar *name,
gint nparams,
GParam *param,
GimpParam *param,
gint *nreturn_vals,
GParam **return_vals);
GimpParam **return_vals);
static void explorer (GDrawable *drawable);
static void explorer (GimpDrawable *drawable);
static void explorer_render_row (const guchar *src_row,
guchar *dest_row,
gint row,
......@@ -158,7 +158,7 @@ static void fractalexplorer_rescan_ok_callback (GtkWidget *widget,
static void fractalexplorer_rescan_list (void);
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......@@ -179,29 +179,29 @@ MAIN()
static void
query (void)
{
static GParamDef args[] =
static GimpParamDef args[] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
{ PARAM_IMAGE, "image", "Input image" },
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
{ PARAM_INT8, "fractaltype", "0: Mandelbrot; 1: Julia; 2: Barnsley 1; 3: Barnsley 2; 4: Barnsley 3; 5: Spider; 6: ManOWar; 7: Lambda; 8: Sierpinski" },
{ PARAM_FLOAT, "xmin", "xmin fractal image delimiter" },
{ PARAM_FLOAT, "xmax", "xmax fractal image delimiter" },
{ PARAM_FLOAT, "ymin", "ymin fractal image delimiter" },
{ PARAM_FLOAT, "ymax", "ymax fractal image delimiter" },
{ PARAM_FLOAT, "iter", "Iteration value" },
{ PARAM_FLOAT, "cx", "cx value ( only Julia)" },
{ PARAM_FLOAT, "cy", "cy value ( only Julia)" },
{ PARAM_INT8, "colormode", "0: Apply colormap as specified by the parameters below; 1: Apply active gradient to final image" },
{ PARAM_FLOAT, "redstretch", "Red stretching factor" },
{ PARAM_FLOAT, "greenstretch", "Green stretching factor" },
{ PARAM_FLOAT, "bluestretch", "Blue stretching factor" },
{ PARAM_INT8, "redmode", "Red application mode (0:SIN;1:COS;2:NONE)" },
{ PARAM_INT8, "greenmode", "Green application mode (0:SIN;1:COS;2:NONE)" },
{ PARAM_INT8, "bluemode", "Blue application mode (0:SIN;1:COS;2:NONE)" },
{ PARAM_INT8, "redinvert", "Red inversion mode (1: enabled; 0: disabled)" },
{ PARAM_INT8, "greeninvert", "Green inversion mode (1: enabled; 0: disabled)" },
{ PARAM_INT8, "blueinvert", "Green inversion mode (1: enabled; 0: disabled)" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT8, "fractaltype", "0: Mandelbrot; 1: Julia; 2: Barnsley 1; 3: Barnsley 2; 4: Barnsley 3; 5: Spider; 6: ManOWar; 7: Lambda; 8: Sierpinski" },
{ GIMP_PDB_FLOAT, "xmin", "xmin fractal image delimiter" },
{ GIMP_PDB_FLOAT, "xmax", "xmax fractal image delimiter" },
{ GIMP_PDB_FLOAT, "ymin", "ymin fractal image delimiter" },
{ GIMP_PDB_FLOAT, "ymax", "ymax fractal image delimiter" },
{ GIMP_PDB_FLOAT, "iter", "Iteration value" },
{ GIMP_PDB_FLOAT, "cx", "cx value ( only Julia)" },
{ GIMP_PDB_FLOAT, "cy", "cy value ( only Julia)" },
{ GIMP_PDB_INT8, "colormode", "0: Apply colormap as specified by the parameters below; 1: Apply active gradient to final image" },
{ GIMP_PDB_FLOAT, "redstretch", "Red stretching factor" },
{ GIMP_PDB_FLOAT, "greenstretch", "Green stretching factor" },
{ GIMP_PDB_FLOAT, "bluestretch", "Blue stretching factor" },
{ GIMP_PDB_INT8, "redmode", "Red application mode (0:SIN;1:COS;2:NONE)" },
{ GIMP_PDB_INT8, "greenmode", "Green application mode (0:SIN;1:COS;2:NONE)" },
{ GIMP_PDB_INT8, "bluemode", "Blue application mode (0:SIN;1:COS;2:NONE)" },
{ GIMP_PDB_INT8, "redinvert", "Red inversion mode (1: enabled; 0: disabled)" },
{ GIMP_PDB_INT8, "greeninvert", "Green inversion mode (1: enabled; 0: disabled)" },
{ GIMP_PDB_INT8, "blueinvert", "Green inversion mode (1: enabled; 0: disabled)" },
};
static gint nargs = sizeof(args) / sizeof(args[0]);
......@@ -215,7 +215,7 @@ query (void)
"December, 1998",
N_("<Image>/Filters/Render/Pattern/Fractal Explorer..."),
"RGB*",
PROC_PLUG_IN,
GIMP_PLUGIN,
nargs, 0,
args, NULL);
}
......@@ -227,22 +227,22 @@ query (void)
static void
run (gchar *name,
gint nparams,
GParam *param,
GimpParam *param,
gint *nreturn_vals,
GParam **return_vals)
GimpParam **return_vals)
{
static GParam values[1];
static GimpParam values[1];
gint32 image_ID;
GRunModeType run_mode;
GimpRunModeType run_mode;
gdouble xhsiz;
gdouble yhsiz;
gint pwidth;
gint pheight;
GStatusType status = STATUS_SUCCESS;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
run_mode = param[0].data.d_int32;
values[0].type = PARAM_STATUS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
*nreturn_vals = 1;
......@@ -289,7 +289,7 @@ run (gchar *name,
/* See how we will run */
switch (run_mode)
{
case RUN_INTERACTIVE:
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_fractalexplorer", &wvals);
......@@ -299,11 +299,11 @@ run (gchar *name,
break;
case RUN_NONINTERACTIVE:
case GIMP_RUN_NONINTERACTIVE:
/* Make sure all the arguments are present */
if (nparams != 22)
{
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
}
else
{
......@@ -330,7 +330,7 @@ run (gchar *name,
make_color_map();
break;
case RUN_WITH_LAST_VALS:
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_fractalexplorer", &wvals);
make_color_map ();
......@@ -347,7 +347,7 @@ run (gchar *name,
cx = wvals.cx;
cy = wvals.cy;
if (status == STATUS_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
{
/* Make sure that the drawable is indexed or RGB color */
if (gimp_drawable_is_rgb(drawable->id))
......@@ -359,17 +359,17 @@ run (gchar *name,
/* Run! */
explorer (drawable);
if (run_mode != RUN_NONINTERACTIVE)
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
/* Store data */
if (run_mode == RUN_INTERACTIVE)
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_fractalexplorer",
&wvals, sizeof (explorer_vals_t));
}
else
{
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
}
values[0].data.d_status = status;
......@@ -382,10 +382,10 @@ run (gchar *name,
*********************************************************************/
static void
explorer (GDrawable * drawable)
explorer (GimpDrawable * drawable)
{
GPixelRgn srcPR;
GPixelRgn destPR;
GimpPixelRgn srcPR;
GimpPixelRgn destPR;
gint width;
gint height;
gint bytes;
......
......@@ -189,7 +189,7 @@ extern double x_release,
y_release;
extern float cx;
extern float cy;
extern GDrawable *drawable;
extern GimpDrawable *drawable;
extern gint tile_width,
tile_height;
extern gint img_width,
......@@ -203,7 +203,7 @@ extern gint sel_width,
sel_height;
extern gint preview_width,
preview_height;
extern GTile *the_tile;
extern GimpTile *the_tile;
extern double cen_x,
cen_y;
extern double xpos,
......
......@@ -18,7 +18,7 @@ double x_release = -1.0,
y_release = -1.0;
float cx = -0.75;
float cy = -0.2;
GDrawable *drawable;
GimpDrawable *drawable;
gint tile_width,
tile_height;
gint img_width,
......@@ -32,7 +32,7 @@ gint sel_width,
sel_height;
gint preview_width,
preview_height;
GTile *the_tile = NULL;
GimpTile *the_tile = NULL;
double cen_x,
cen_y;
double xpos,
......
......@@ -67,7 +67,7 @@ compute_image (void)
/* Create a new image */
/* ================== */
new_image_id=gimp_image_new(width,height,RGB);
new_image_id=gimp_image_new(width,height,GIMP_RGB);
if (mapvals.transparent_background==TRUE)
{
......@@ -75,7 +75,7 @@ compute_image (void)
/* ================================= */
new_layer_id=gimp_layer_new(new_image_id,"Background",
width,height,RGBA_IMAGE,100.0,NORMAL_MODE);
width,height,GIMP_RGBA_IMAGE,100.0,GIMP_NORMAL_MODE);
}
else
{
......@@ -83,7 +83,7 @@ compute_image (void)
/* ======================= */
new_layer_id=gimp_layer_new(new_image_id,"Background",
width,height,RGB_IMAGE,100.0,NORMAL_MODE);
width,height,GIMP_RGB_IMAGE,100.0,GIMP_NORMAL_MODE);
}
gimp_image_add_layer(new_image_id,new_layer_id,0);
......
......@@ -13,14 +13,14 @@
#include "lighting_preview.h"
#include "lighting_ui.h"
GDrawable *input_drawable,*output_drawable;
GPixelRgn source_region, dest_region;
GimpDrawable *input_drawable,*output_drawable;
GimpPixelRgn source_region, dest_region;
GDrawable *bump_drawable = NULL;
GPixelRgn bump_region;
GimpDrawable *bump_drawable = NULL;
GimpPixelRgn bump_region;
GDrawable *env_drawable = NULL;
GPixelRgn env_region;
GimpDrawable *env_drawable = NULL;
GimpPixelRgn env_region;
guchar *preview_rgb_data = NULL;
GdkImage *image = NULL;
......@@ -38,7 +38,7 @@ guchar sinemap[256], spheremap[256], logmap[256];
/******************/
guchar
peek_map (GPixelRgn *region,
peek_map (GimpPixelRgn *region,
gint x,
gint y)
{
......@@ -269,7 +269,7 @@ get_image_color (gdouble u,
}
gdouble
get_map_value (GPixelRgn *region,
get_map_value (GimpPixelRgn *region,
gdouble u,
gdouble v,
gint *inside)
......@@ -330,7 +330,7 @@ compute_maps (void)
/****************************************/
gint
image_setup (GDrawable *drawable,
image_setup (GimpDrawable *drawable,
gint interactive)
{
glong numbytes;
......
#ifndef __LIGHTING_IMAGE_H__
#define __LIGHTING_IMAGE_H__
extern GDrawable *input_drawable,*output_drawable;
extern GPixelRgn source_region, dest_region;
extern GimpDrawable *input_drawable,*output_drawable;
extern GimpPixelRgn source_region, dest_region;
extern GDrawable *bump_drawable;
extern GPixelRgn bump_region;
extern GimpDrawable *bump_drawable;
extern GimpPixelRgn bump_region;
extern GDrawable *env_drawable;
extern GPixelRgn env_region;
extern GimpDrawable *env_drawable;
extern GimpPixelRgn env_region;
extern guchar *preview_rgb_data;
extern GdkImage *image;
......@@ -21,7 +21,7 @@ extern gint border_x1,border_y1,border_x2,border_y2;
extern guchar sinemap[256], spheremap[256], logmap[256];
guchar peek_map (GPixelRgn *region,
guchar peek_map (GimpPixelRgn *region,
gint x,
gint y);
GckRGB peek (gint x,
......@@ -48,11 +48,11 @@ void pos_to_float (gdouble x,
GckRGB get_image_color (gdouble u,
gdouble v,
gint *inside);
gdouble get_map_value (GPixelRgn *region,
gdouble get_map_value (GimpPixelRgn *region,
gdouble u,
gdouble v,
gint *inside);
gint image_setup (GDrawable *drawable,
gint image_setup (GimpDrawable *drawable,
gint interactive);
#endif /* __LIGHTING_IMAGE_H__ */
......@@ -130,32 +130,32 @@ check_drawables (void)
static void
query (void)
{
static GParamDef args[] =
static GimpParamDef args[] =
{
{ PARAM_INT32, "run_mode", "Interactive (0), non-interactive (1)" },
{ PARAM_IMAGE, "image", "Input image" },
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
{ PARAM_DRAWABLE, "bumpdrawable", "Bumpmap drawable (set to 0 if disabled)" },
{ PARAM_DRAWABLE, "envdrawable", "Environmentmap drawable (set to 0 if disabled)" },
{ PARAM_INT32, "dobumpmap", "Enable bumpmapping (TRUE/FALSE)" },
{ PARAM_INT32, "doenvmap", "Enable envmapping (TRUE/FALSE)" },
{ PARAM_INT32, "bumpmaptype", "Type of mapping (0=linear,1=log, 2=sinusoidal, 3=spherical)" },
{ PARAM_INT32, "lighttype", "Type of lightsource (0=point,1=directional,3=spot,4=none)" },
{ PARAM_COLOR, "lightcolor", "Lightsource color (r,g,b)" },
{ PARAM_FLOAT, "lightposition_x", "Lightsource position (x,y,z)" },
{ PARAM_FLOAT, "lightposition_y", "Lightsource position (x,y,z)" },
{ PARAM_FLOAT, "lightposition_z", "Lightsource position (x,y,z)" },
{ PARAM_FLOAT, "lightdirection_x", "Lightsource direction [x,y,z]" },
{ PARAM_FLOAT, "lightdirection_y", "Lightsource direction [x,y,z]" },
{ PARAM_FLOAT, "lightdirection_z", "Lightsource direction [x,y,z]" },
{ PARAM_FLOAT, "ambient_intensity", "Material ambient intensity (0..1)" },
{ PARAM_FLOAT, "diffuse_intensity", "Material diffuse intensity (0..1)" },
{ PARAM_FLOAT, "diffuse_reflectivity", "Material diffuse reflectivity (0..1)" },
{ PARAM_FLOAT, "specular_reflectivity", "Material specular reflectivity (0..1)" },
{ PARAM_FLOAT, "highlight", "Material highlight (0..->), note: it's expotential" },
{ PARAM_INT32, "antialiasing", "Apply antialiasing (TRUE/FALSE)" },
{ PARAM_INT32, "newimage", "Create a new image (TRUE/FALSE)" },
{ PARAM_INT32, "transparentbackground", "Make background transparent (TRUE/FALSE)" }
{ GIMP_PDB_INT32, "run_mode", "Interactive (0), non-interactive (1)" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_DRAWABLE, "bumpdrawable", "Bumpmap drawable (set to 0 if disabled)" },
{ GIMP_PDB_DRAWABLE, "envdrawable", "Environmentmap drawable (set to 0 if disabled)" },
{ GIMP_PDB_INT32, "dobumpmap", "Enable bumpmapping (TRUE/FALSE)" },
{ GIMP_PDB_INT32, "doenvmap", "Enable envmapping (TRUE/FALSE)" },
{ GIMP_PDB_INT32, "bumpmaptype", "Type of mapping (0=linear,1=log, 2=sinusoidal, 3=spherical)" },
{ GIMP_PDB_INT32, "lighttype", "Type of lightsource (0=point,1=directional,3=spot,4=none)" },
{ GIMP_PDB_COLOR, "lightcolor", "Lightsource color (r,g,b)" },
{ GIMP_PDB_FLOAT, "lightposition_x", "Lightsource position (x,y,z)" },
{ GIMP_PDB_FLOAT, "lightposition_y", "Lightsource position (x,y,z)" },
{ GIMP_PDB_FLOAT, "lightposition_z", "Lightsource position (x,y,z)" },
{ GIMP_PDB_FLOAT, "lightdirection_x", "Lightsource direction [x,y,z]" },
{ GIMP_PDB_FLOAT, "lightdirection_y", "Lightsource direction [x,y,z]" },
{ GIMP_PDB_FLOAT, "lightdirection_z", "Lightsource direction [x,y,z]" },
{ GIMP_PDB_FLOAT, "ambient_intensity", "Material ambient intensity (0..1)" },
{ GIMP_PDB_FLOAT, "diffuse_intensity", "Material diffuse intensity (0..1)" },
{ GIMP_PDB_FLOAT, "diffuse_reflectivity", "Material diffuse reflectivity (0..1)" },
{ GIMP_PDB_FLOAT, "specular_reflectivity", "Material specular reflectivity (0..1)" },
{ GIMP_PDB_FLOAT, "highlight", "Material highlight (0..->), note: it's expotential" },
{ GIMP_PDB_INT32, "antialiasing", "Apply antialiasing (TRUE/FALSE)" },
{ GIMP_PDB_INT32, "newimage", "Create a new image (TRUE/FALSE)" },
{ GIMP_PDB_INT32, "transparentbackground", "Make background transparent (TRUE/FALSE)" }
};
static gint nargs = sizeof (args) / sizeof (args[0]);
......@@ -169,7 +169,7 @@ query (void)
"Version 0.2.0, March 15 1998",
N_("<Image>/Filters/Light Effects/Lighting Effects..."),
"RGB*",
PROC_PLUG_IN,
GIMP_PLUGIN,
nargs, 0,
args, NULL);
}
......@@ -177,18 +177,18 @@ query (void)
static void
run (gchar *name,
gint nparams,
GParam *param,
GimpParam *param,
gint *nreturn_vals,
GParam **return_vals)
GimpParam **return_vals)
{
static GParam values[1];
GDrawable *drawable;
GRunModeType run_mode;
GStatusType status = STATUS_SUCCESS;
static GimpParam values[1];
GimpDrawable *drawable;
GimpRunModeType run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
run_mode = param[0].data.d_int32;
if (run_mode == RUN_INTERACTIVE)
if (run_mode == GIMP_RUN_INTERACTIVE)
{
INIT_I18N_UI();
}
......@@ -200,7 +200,7 @@ run (gchar *name,
*nreturn_vals = 1;
*return_vals = values;
values[0].type = PARAM_STATUS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
/* Set default values */
......@@ -222,7 +222,7 @@ run (gchar *name,
check_drawables ();
if (status == STATUS_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
{
/* Make sure that the drawable is RGBA or RGB color */
/* ================================================ */
......@@ -236,7 +236,7 @@ run (gchar *name,
switch (run_mode)
{
case RUN_INTERACTIVE:
case GIMP_RUN_INTERACTIVE:
if (main_dialog (drawable))
{
compute_image ();
......@@ -246,15 +246,15 @@ run (gchar *name,
}
break;
case RUN_WITH_LAST_VALS:
case GIMP_RUN_WITH_LAST_VALS:
image_setup (drawable, FALSE);
compute_image ();
break;
case RUN_NONINTERACTIVE:
case GIMP_RUN_NONINTERACTIVE:
if (nparams != 24)
{
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
}
else
{
......@@ -291,10 +291,10 @@ run (gchar *name,
}
}
else
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
if (run_mode != RUN_NONINTERACTIVE)
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
values[0].data.d_status = status;
......@@ -306,7 +306,7 @@ run (gchar *name,
g_free (ypostab);
}
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......
......@@ -1045,7 +1045,7 @@ create_main_notebook (GtkWidget *container)
/********************************/
gboolean
main_dialog (GDrawable *drawable)
main_dialog (GimpDrawable *drawable)
{
GtkWidget *main_hbox;
GtkWidget *vbox;
......
......@@ -12,6 +12,6 @@ extern GtkWidget *previewarea;
/* Externally visible functions */
/* ============================ */
gboolean main_dialog (GDrawable *drawable);
gboolean main_dialog (GimpDrawable *drawable);
#endif /* __LIGHTING_UI_H__ */
......@@ -204,21 +204,21 @@ void compute_image(void)
/* Create a new image */
/* ================== */
new_image_id=gimp_image_new(width,height,RGB);
new_image_id=gimp_image_new(width,height,GIMP_RGB);
if (mapvals.transparent_background==TRUE)
{
/* Add a layer with an alpha channel */
/* ================================= */
new_layer_id=gimp_layer_new(new_image_id,"Background",width,height,RGBA_IMAGE,100.0,NORMAL_MODE);
new_layer_id=gimp_layer_new(new_image_id,"Background",width,height,GIMP_RGBA_IMAGE,100.0,GIMP_NORMAL_MODE);
}
else
{
/* Create a "normal" layer */
/* ======================= */
new_layer_id=gimp_layer_new(new_image_id,"Background",width,height,RGB_IMAGE,100.0,NORMAL_MODE);
new_layer_id=gimp_layer_new(new_image_id,"Background",width,height,GIMP_RGB_IMAGE,100.0,GIMP_NORMAL_MODE);
}
gimp_image_add_layer(new_image_id,new_layer_id,0);
......
......@@ -19,14 +19,14 @@
#include "mapobject_ui.h"
#include "mapobject_image.h"
GDrawable *input_drawable,*output_drawable;
GPixelRgn source_region,dest_region;
GimpDrawable *input_drawable,*output_drawable;
GimpPixelRgn source_region,dest_region;
GDrawable *box_drawables[6];
GPixelRgn box_regions[6];
GimpDrawable *box_drawables[6];
GimpPixelRgn box_regions[6];
GDrawable *cylinder_drawables[2];
GPixelRgn cylinder_regions[2];
GimpDrawable *cylinder_drawables[2];
GimpPixelRgn cylinder_regions[2];
guchar *preview_rgb_data = NULL;
GdkImage *image = NULL;
......@@ -326,7 +326,7 @@ get_cylinder_image_color (gint image,
/****************************************/
gint
image_setup (GDrawable *drawable,
image_setup (GimpDrawable *drawable,
gint interactive)
{
glong numbytes;
......
......@@ -4,14 +4,14 @@
/* Externally visible variables */
/* ============================ */
extern GDrawable *input_drawable,*output_drawable;
extern GPixelRgn source_region,dest_region;
extern GimpDrawable *input_drawable,*output_drawable;
extern GimpPixelRgn source_region,dest_region;
extern GDrawable *box_drawables[6];
extern GPixelRgn box_regions[6];
extern GimpDrawable *box_drawables[6];
extern GimpPixelRgn box_regions[6];
extern GDrawable *cylinder_drawables[2];
extern GPixelRgn cylinder_regions[2];
extern GimpDrawable *cylinder_drawables[2];
extern GimpPixelRgn cylinder_regions[2];
extern guchar *preview_rgb_data;
extern GdkImage *image;
......@@ -23,12 +23,12 @@ extern gdouble oldtreshold;
extern gint border_x1, border_y1, border_x2, border_y2;
extern GTile *current_in_tile, *current_out_tile;
extern GimpTile *current_in_tile, *current_out_tile;
/* Externally visible functions */
/* ============================ */
extern gint image_setup (GDrawable *drawable,
extern gint image_setup (GimpDrawable *drawable,
gint interactive);
extern glong in_xy_to_index (gint x,
gint y);
......
......@@ -104,7 +104,7 @@ set_default_settings (void)
}
static void
check_drawables (GDrawable *drawable)
check_drawables (GimpDrawable *drawable)
{
gint i;
......@@ -140,57 +140,57 @@ check_drawables (GDrawable *drawable)
static void
query (void)
{
static GParamDef args[] =
static GimpParamDef args[] =
{
{ PARAM_INT32, "run_mode", "Interactive (0), non-interactive (1)" },
{ PARAM_IMAGE, "image", "Input image" },
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
{ PARAM_INT32, "maptype", "Type of mapping (0=plane,1=sphere,2=box,3=cylinder)" },
{ PARAM_FLOAT, "viewpoint_x", "Position of viewpoint (x,y,z)" },
{ PARAM_FLOAT, "viewpoint_y", "Position of viewpoint (x,y,z)" },
{ PARAM_FLOAT, "viewpoint_z", "Position of viewpoint (x,y,z)" },
{ PARAM_FLOAT, "position_x", "Object position (x,y,z)" },
{ PARAM_FLOAT, "position_y", "Object position (x,y,z)" },
{ PARAM_FLOAT, "position_z", "Object position (x,y,z)" },
{ PARAM_FLOAT, "firstaxis_x", "First axis of object [x,y,z]" },
{ PARAM_FLOAT, "firstaxis_y", "First axis of object [x,y,z]" },
{ PARAM_FLOAT, "firstaxis_z", "First axis of object [x,y,z]" },
{ PARAM_FLOAT, "secondaxis_x", "Second axis of object [x,y,z]" },
{ PARAM_FLOAT, "secondaxis_y", "Second axis of object [x,y,z]" },
{ PARAM_FLOAT, "secondaxis_z", "Second axis of object [x,y,z]" },
{ PARAM_FLOAT, "rotationangle_x", "Rotation about X axis in degrees" },
{ PARAM_FLOAT, "rotationangle_y", "Rotation about Y axis in degrees" },
{ PARAM_FLOAT, "rotationangle_z", "Rotation about Z axis in degrees" },
{ PARAM_INT32, "lighttype", "Type of lightsource (0=point,1=directional,3=none)" },
{ PARAM_COLOR, "lightcolor", "Lightsource color (r,g,b)" },
{ PARAM_FLOAT, "lightposition_x", "Lightsource position (x,y,z)" },
{ PARAM_FLOAT, "lightposition_y", "Lightsource position (x,y,z)" },
{ PARAM_FLOAT, "lightposition_z", "Lightsource position (x,y,z)" },
{ PARAM_FLOAT, "lightdirection_x", "Lightsource direction [x,y,z]" },
{ PARAM_FLOAT, "lightdirection_y", "Lightsource direction [x,y,z]" },
{ PARAM_FLOAT, "lightdirection_z", "Lightsource direction [x,y,z]" },
{ PARAM_FLOAT, "ambient_intensity", "Material ambient intensity (0..1)" },
{ PARAM_FLOAT, "diffuse_intensity", "Material diffuse intensity (0..1)" },