Commit d8be79f0 authored by GMT 1999  Austin Donnelly's avatar GMT 1999 Austin Donnelly Committed by Austin Donnelly

Bit of a large checkin this - it's basically three things: 1 - GimpModules

Sun Jan 11 00:24:21 GMT 1999  Austin Donnelly  <austin@greenend.org.uk>

	Bit of a large checkin this - it's basically three things:
	  1 - GimpModules using gmodules to dynamically load and
	       initialise modules at gimp start of day.
	  2 - Color selectors now register themselves with a color
	       notebook.
	  3 - progress bars have been cleaned up a bit, so now have
	       progress indictations on all transform tool and gradient
	       fill operations.  Not done bucket fill, but that seems to
	       be the next candidate.

	New directories:
	* modules/: new directory for dynamically loadable modules.

	New files:
	* modules/.cvsignore
	* modules/Makefile.am
	* modules/colorsel_gtk.c: GTK color selector wrapped up as a
	    color selector the gimp can use.

	* app/gimpprogress.[ch]: progress bars within gimp core, either as
	    popups, or in the status bar.  This is mainly code moved out
	    of plug-in.c

	* app/color_notebook.[ch]: color selector notebook, implementing
	    very similar interface to color_select.h so it can be used as
	    a drop-in replacement for it.

	* libgimp/color_selector.h: API color selectors need to implement
	    to become a page in the color_notebook.

	* libgimp/gimpmodule.h: API gimp modules need to implement to be
	    initialised by gimp at start of day.

	Modified files:
	* Makefile.am: add modules/ to SUBDIRS
	* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
	* app/gimprc.[ch]: recognise module-path variable.
	* gimprc.in: set module-path variable to something sensible
	    (currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
	* app/Makefile.am: build color notebook and gimpprogress
	* app/app_procs.c: register internal GIMP color selector with
	    color notebook.
	* app/asupsample.c: call progress function less frequently for
	    better performance.
	* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
	* app/blend.c: make callbacks to a progress function
	* app/color_area.c: use a color notebook rather than a color selector
	* app/color_panel.c: ditto
	* app/color_select.c: export color selector interface for notebook
	* app/color_select.h: color_select_init() prototype
	* app/flip_tool.c: flip the image every time, rather than every
	    second click.
	* app/interface.c: move progress bar stuff out to
	    gimpprogress.c.  Make the code actually work while we're at it.
	* app/interface.h: move prototypes for progress functions out to
	    gimpprogress.h
	* app/plug_in.c: load and initialise modules (if possible). Move
	    progress bar handling code out to gimpprogress.c
	* app/plug_in.h: keep only a gimp_progress * for each plugin, not
	    a whole bunch of GtkWidgets.
	* app/scale_tool.c
	* app/rotate_tool.c
	* app/shear_tool.c
	* app/perspective_tool.c: progress bar during operation.
	    De-sensitise the dialog to discourage the user from running
	    two transforms in parallel.
	* app/transform_core.c: recalculate grid coords when bounding box
	    changes.  Only initialise the action area of the dialog once,
	    to avoid multiple "ok" / "reset" buttons appearing.  Undraw
	    transform tool with correct matrix to get rid of handle
	    remains on screen.  Call a progress function as we apply the
	    transform matrix.  A few new i18n markups.  Invalidate
	    floating selection marching ants after applying matrix.
	* app/transform_core.h: transform_core_do() takes an optional
	    progress callback argument (and data).
	* plug-ins/oilify/oilify.c: send progress bar updates after every
	    pixel region, not only if they processed a multiple of 5
	    pixels (which was quite unlikely, and therefore gave a jerky
	    progress indication).
parent bf0dbb20
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
Sun Jan 10 23:31:45 GMT 1999 Adam D. Moss <adam@gimp.org>
* app/blend.c app/bucket_fill.c app/convert.c app/crop.c
......
## Process this file with automake to produce Makefile.in
SUBDIRS = po intl @GCG_SUBDIRS@ libgimp app plug-ins data @GIMPDOCS@
SUBDIRS = po intl @GCG_SUBDIRS@ libgimp app plug-ins modules data @GIMPDOCS@
bin_SCRIPTS = gimptool
......
......@@ -77,6 +77,8 @@ gimp_SOURCES = \
color_area.h \
color_balance.c \
color_balance.h \
color_notebook.c \
color_notebook.h \
color_panel.c \
color_panel.h \
color_picker.c \
......@@ -186,6 +188,8 @@ gimp_SOURCES = \
gimplistP.h \
gimpparasite.c \
gimpparasite.h \
gimpprogress.c \
gimpprogress.h \
gimprc.c \
gimprc.h \
global_edit.c \
......@@ -370,8 +374,8 @@ LDADD = \
libgimpim.a \
$(top_builddir)/libgimp/libgimpi.a \
$(GTK_LIBS) \
$(GIMP_THREAD_LIBS) \
$(INTLLIBS)
$(GIMP_THREAD_LIBS) # \
# $(INTLLIBS)
DEPS = \
libgimpim.a \
......
......@@ -30,6 +30,7 @@
#include <unistd.h>
#include "libgimp/parasite.h"
#include "libgimp/parasiteP.h" /* ick */
#include "libgimp/gimpmodule.h"
#ifdef HAVE_IPC_H
#include <sys/ipc.h>
......@@ -62,7 +63,7 @@
#include "libgimp/gimpintl.h"
#define SEPARATE_PROGRESS_BAR
typedef struct _PlugInBlocked PlugInBlocked;
......@@ -126,8 +127,6 @@ static void plug_in_args_destroy (Argument *args,
int nargs,
int full_destroy);
static void plug_in_disconnect_cancel (PlugIn *plug_in);
static Argument* progress_init_invoker (Argument *args);
static Argument* progress_update_invoker (Argument *args);
......@@ -138,6 +137,8 @@ static Argument* message_handler_set_invoker (Argument *args);
static Argument* plugin_temp_PDB_name_invoker (Argument *args);
static void module_initialize (char *filename);
static GSList *plug_in_defs = NULL;
static GSList *gimprc_proc_defs = NULL;
......@@ -481,8 +482,79 @@ plug_in_init ()
g_free (plug_in_def);
}
g_slist_free (plug_in_defs);
/* Load and initialize gimp modules */
if (g_module_supported ())
datafiles_read_directories (module_path,
module_initialize, 0 /* no flags */);
}
/* name must be of the form lib*.so */
/* TODO: need support for WIN32-style dll names. Maybe this function
* should live in libgmodule? */
static gboolean
valid_module_name (const char *filename)
{
const char *basename;
int len;
basename = strrchr (filename, '/');
if (basename)
basename++;
else
basename = filename;
len = strlen (basename);
if (len < 3 + 1 + 3)
return FALSE;
if (strncmp (basename, "lib", 3))
return FALSE;
if (strcmp (basename + len - 3, ".so"))
return FALSE;
return TRUE;
}
static void
module_initialize (char *filename)
{
GModule *mod;
GimpModuleInitFunc init;
gpointer symbol;
if (!valid_module_name (filename))
return;
if ((be_verbose == TRUE) || (no_splash == TRUE))
g_print (_("load module: \"%s\"\n"), filename);
mod = g_module_open (filename, G_MODULE_BIND_LAZY);
if (!mod)
{
g_warning (_("module load error: %s: %s"), filename, g_module_error ());
return;
}
if (g_module_symbol (mod, "module_init", &symbol))
{
init = symbol;
if (init () == GIMP_MODULE_UNLOAD)
g_module_close (mod);
}
else
{
g_warning (_("%s: module_init() symbol not found"), filename);
g_module_close (mod);
}
}
void
plug_in_kill ()
{
......@@ -818,9 +890,6 @@ plug_in_new (char *name)
plug_in->write_buffer_index = 0;
plug_in->temp_proc_defs = NULL;
plug_in->progress = NULL;
plug_in->progress_label = NULL;
plug_in->progress_bar = NULL;
plug_in->progress_gdisp_ID = -1;
plug_in->user_data = NULL;
return plug_in;
......@@ -829,9 +898,6 @@ plug_in_new (char *name)
void
plug_in_destroy (PlugIn *plug_in)
{
GDisplay *gdisp;
guint c_id;
if (plug_in)
{
plug_in_close (plug_in, TRUE);
......@@ -849,18 +915,9 @@ plug_in_destroy (PlugIn *plug_in)
if (plug_in->args[5])
g_free (plug_in->args[5]);
if (plug_in->progress_gdisp_ID > 0)
{
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
"progress");
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
plug_in_disconnect_cancel (plug_in);
gdisp->progressid = 0;
}
if (plug_in->progress)
progress_end (plug_in->progress);
plug_in->progress = NULL;
if (plug_in == current_plug_in)
plug_in_pop ();
......@@ -1011,23 +1068,9 @@ plug_in_close (PlugIn *plug_in,
/* Destroy the progress dialog if it exists
*/
#ifdef SEPARATE_PROGRESS_BAR
if (plug_in->progress)
{
gtk_signal_disconnect_by_data (GTK_OBJECT (plug_in->progress), plug_in);
gtk_widget_destroy (plug_in->progress);
plug_in->progress = NULL;
plug_in->progress_label = NULL;
plug_in->progress_bar = NULL;
}
#else
if (plug_in->progress)
{
progress_end ();
plug_in->progress = NULL;
}
#endif
progress_end (plug_in->progress);
plug_in->progress = NULL;
/* Set the fields to null values.
*/
......@@ -3089,32 +3132,15 @@ static void
plug_in_progress_cancel (GtkWidget *widget,
PlugIn *plug_in)
{
plug_in->progress = NULL;
plug_in_destroy (plug_in);
}
static void
plug_in_disconnect_cancel (PlugIn *plug_in)
{
GDisplay *gdisp = NULL;
gdisp = gdisplay_get_ID (plug_in->progress_gdisp_ID);
gtk_widget_set_sensitive (gdisp->cancelbutton, FALSE);
gtk_signal_disconnect_by_func (GTK_OBJECT (gdisp->cancelbutton),
(GtkSignalFunc) plug_in_progress_cancel,
plug_in);
}
static void
plug_in_progress_init (PlugIn *plug_in,
char *message,
gint gdisp_ID)
{
GtkWidget *vbox;
GtkWidget *button;
GDisplay *gdisp = NULL;
guint context_id;
if (!message)
message = plug_in->args[0];
......@@ -3122,100 +3148,22 @@ plug_in_progress_init (PlugIn *plug_in,
if (gdisp_ID > 0)
gdisp = gdisplay_get_ID(gdisp_ID);
if (gdisp_ID > 0 && GTK_WIDGET_VISIBLE (gdisp->statusarea)
&& (gdisp->progressid == 0 || plug_in->progress_gdisp_ID > 0))
{
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
"progress");
if (plug_in->progress_gdisp_ID > 0)
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), context_id);
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
context_id, message);
plug_in->progress_gdisp_ID = gdisp_ID;
gtk_signal_connect (GTK_OBJECT (gdisp->cancelbutton), "clicked",
(GtkSignalFunc) plug_in_progress_cancel,
plug_in);
gtk_widget_set_sensitive (gdisp->cancelbutton, TRUE);
}
#ifdef SEPARATE_PROGRESS_BAR
else if (!plug_in->progress)
{
plug_in->progress = gtk_dialog_new ();
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
gtk_window_set_title (GTK_WINDOW (plug_in->progress), prune_filename (plug_in->args[0]));
gtk_signal_connect (GTK_OBJECT (plug_in->progress), "destroy",
(GtkSignalFunc) plug_in_progress_cancel,
plug_in);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (plug_in->progress)->action_area), 2);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (plug_in->progress)->vbox), vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
plug_in->progress_label = gtk_label_new (message);
gtk_misc_set_alignment (GTK_MISC (plug_in->progress_label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), plug_in->progress_label, FALSE, TRUE, 0);
gtk_widget_show (plug_in->progress_label);
plug_in->progress_bar = gtk_progress_bar_new ();
gtk_widget_set_usize (plug_in->progress_bar, 150, 20);
gtk_box_pack_start (GTK_BOX (vbox), plug_in->progress_bar, TRUE, TRUE, 0);
gtk_widget_show (plug_in->progress_bar);
button = gtk_button_new_with_label (_("Cancel"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
GTK_OBJECT (plug_in->progress));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (plug_in->progress)->action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
gtk_widget_show (plug_in->progress);
}
if (plug_in->progress)
plug_in->progress = progress_restart (plug_in->progress, message,
plug_in_progress_cancel, plug_in);
else
{
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
}
#else
else if (!plug_in->progress)
{
plug_in->progress = 0x1;
progress_update (0.0);
progress_start ();
}
#endif
plug_in->progress = progress_start (gdisp, message, TRUE,
plug_in_progress_cancel, plug_in);
}
static void
plug_in_progress_update (PlugIn *plug_in,
double percentage)
{
GDisplay *gdisp;
if (plug_in->progress_gdisp_ID > 0)
{
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
if (percentage >= 0.0 && percentage <= 1.0)
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
}
else
{
#ifdef SEPARATE_PROGRESS_BAR
if (!plug_in->progress)
plug_in_progress_init (plug_in, NULL, -1);
if (percentage >= 0.0 && percentage <= 1.0)
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
#else
progress_update (percentage);
#endif
}
if (!plug_in->progress)
plug_in_progress_init (plug_in, NULL, -1);
progress_update (plug_in->progress, percentage);
}
static Argument*
......
......@@ -67,6 +67,9 @@
#include "docindex.h"
#include "colormap_dialog.h"
#include "color_notebook.h"
#include "color_select.h"
#include "config.h"
#include "libgimp/gimpintl.h"
......@@ -554,6 +557,9 @@ app_init (void)
get_active_pattern ();
paint_funcs_setup ();
/* register internal color selectors */
color_select_init ();
if (no_interface == FALSE)
{
devices_restore(); /* Must be done AFTER get_active_{brush|pattern}
......
......@@ -193,7 +193,7 @@ adaptive_supersample_area(int x1, int y1, int x2, int y2, int max_depth, double
/* Call progress display function */
if (progress_func)
if (progress_func && !(y & 0xf))
(*progress_func)(y1, y2, y, progress_data);
} /* for */
......
......@@ -24,6 +24,7 @@
#ifndef __ASUPSAMPLE_H__
#define __ASUPSAMPLE_H__
#include "gimpprogress.h"
/***** Types *****/
......@@ -33,7 +34,6 @@ typedef struct {
typedef void (*render_func_t) (double x, double y, color_t *color, void *render_data);
typedef void (*put_pixel_func_t) (int x, int y, color_t color, void *put_pixel_data);
typedef void (*progress_func_t) (int y1, int y2, int curr_y, void *progress_data);
/***** Functions *****/
......
......@@ -161,7 +161,9 @@ static void blend (GImage *gimage, GimpDrawable *drawa
RepeatMode repeat,
int supersample, int max_depth, double threshold,
double startx, double starty,
double endx, double endy);
double endx, double endy,
progress_func_t progress_callback,
void *progress_data);
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
double x, double y);
......@@ -195,7 +197,9 @@ static void gradient_fill_region (GImage *gimage, GimpDrawable *drawa
BlendMode blend_mode, GradientType gradient_type,
double offset, RepeatMode repeat,
int supersample, int max_depth, double threshold,
double sx, double sy, double ex, double ey);
double sx, double sy, double ex, double ey,
progress_func_t progress_callback,
void *progress_data);
static void calc_rgb_to_hsv(double *r, double *g, double *b);
static void calc_hsv_to_rgb(double *h, double *s, double *v);
......@@ -606,8 +610,12 @@ blend_button_release (Tool *tool,
GDisplay * gdisp;
GImage * gimage;
BlendTool * blend_tool;
#ifdef BLEND_UI_CALLS_VIA_PDB
Argument *return_vals;
int nreturn_vals;
#else
gimp_progress *progress;
#endif
gdisp = (GDisplay *) gdisp_ptr;
gimage = gdisp->gimage;
......@@ -626,6 +634,9 @@ blend_button_release (Tool *tool,
((blend_tool->startx != blend_tool->endx) ||
(blend_tool->starty != blend_tool->endy)))
{
/* we can't do callbacks easily with the PDB, so this UI/backend
* separation (though good) is ignored for the moment */
#ifdef BLEND_UI_CALLS_VIA_PDB
return_vals = procedural_db_run_proc ("gimp_blend",
&nreturn_vals,
PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)),
......@@ -650,6 +661,33 @@ blend_button_release (Tool *tool,
g_message (_("Blend operation failed."));
procedural_db_destroy_args (return_vals, nreturn_vals);
#else /* ! BLEND_UI_CALLS_VIA_PDB */
progress = progress_start (gdisp, _("Blending..."), FALSE, NULL, NULL);
blend (gimage,
gimage_active_drawable (gimage),
blend_options->blend_mode,
blend_options->paint_mode,
blend_options->gradient_type,
blend_options->opacity,
blend_options->offset,
blend_options->repeat,
blend_options->supersample,
blend_options->max_depth,
blend_options->threshold,
blend_tool->startx,
blend_tool->starty,
blend_tool->endx,
blend_tool->endy,
progress? progress_update_and_flush : NULL, progress);
if (progress)
progress_end (progress);
gdisplays_flush ();
#endif /* ! BLEND_UI_CALLS_VIA_PDB */
}
}
......@@ -766,21 +804,23 @@ blend_control (Tool *tool,
/* The actual blending procedure */
static void
blend (GImage *gimage,
GimpDrawable *drawable,
BlendMode blend_mode,
int paint_mode,
GradientType gradient_type,
double opacity,
double offset,
RepeatMode repeat,
int supersample,
int max_depth,
double threshold,
double startx,
double starty,
double endx,
double endy)
blend (GImage *gimage,
GimpDrawable *drawable,
BlendMode blend_mode,
int paint_mode,
GradientType gradient_type,
double opacity,
double offset,
RepeatMode repeat,
int supersample,
int max_depth,
double threshold,
double startx,
double starty,
double endx,
double endy,
progress_func_t progress_callback,
void *progress_data)
{
TileManager *buf_tiles;
PixelRegion bufPR;
......@@ -811,7 +851,8 @@ blend (GImage *gimage,
blend_mode, gradient_type, offset, repeat,
supersample, max_depth, threshold,
(startx - x1), (starty - y1),
(endx - x1), (endy - y1));
(endx - x1), (endy - y1),
progress_callback, progress_data);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimage_apply_image (gimage, drawable, &bufPR, TRUE,
......@@ -1375,23 +1416,26 @@ gradient_put_pixel(int x, int y, color_t color, void *put_pixel_data)
}
static void
gradient_fill_region (GImage *gimage,
GimpDrawable *drawable,
PixelRegion *PR,
int width,
int height,
BlendMode blend_mode,
GradientType gradient_type,
double offset,
RepeatMode repeat,
int supersample,
int max_depth,
double threshold,
double sx,
double sy,
double ex,
double ey)
gradient_fill_region (GImage *gimage,
GimpDrawable *drawable,
PixelRegion *PR,
int width,
int height,
BlendMode blend_mode,
GradientType gradient_type,
double offset,
RepeatMode repeat,
int supersample,
int max_depth,
double threshold,
double sx,
double sy,
double ex,
double ey,
progress_func_t progress_callback,
void *progress_data)
{
RenderBlendData rbd;
PutPixelData ppd;
......@@ -1536,7 +1580,7 @@ gradient_fill_region (GImage *gimage,
max_depth, threshold,
gradient_render_pixel, &rbd,
gradient_put_pixel, &ppd,