Commit 2fb4908c authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

applied a patch by Gerald Friedland that changes the code to clear the

2005-11-04  Sven Neumann  <sven@gimp.org>

	* app/base/siox.c: applied a patch by Gerald Friedland that
	changes the code to clear the cache selectively instead of dumping
	it completely if the foreground or background area is changed.
parent a241bbc2
2005-11-04 Sven Neumann <sven@gimp.org>
* app/base/siox.c: applied a patch by Gerald Friedland that
changes the code to clear the cache selectively instead of dumping
it completely if the foreground or background area is changed.
2005-11-04 Sven Neumann <sven@gimp.org>
* app/core/gimpenvirontable.c (gimp_environ_table_load_env_file):
......
......@@ -698,15 +698,26 @@ siox_progress_update (SioxProgressFunc progress_callback,
progress_callback (progress_data, value);
}
/* Needed for clearing hashtable as defined by glib*/
/* Clear hashtable entries that get invalid due to refinement */
static gboolean
dummy_remove_hash (gpointer key,
gpointer value,
gpointer user_data)
siox_cache_remove_fg (gpointer key,
gpointer value,
gpointer user_data)
{
return TRUE;
classresult *cr = value;
return (cr->bgdist < cr->fgdist);
}
static gboolean
siox_cache_remove_bg (gpointer key,
gpointer value,
gpointer user_data)
{
classresult *cr = value;
return (cr->fgdist < cr->bgdist);
}
/**
* siox_init:
......@@ -845,7 +856,9 @@ siox_foreground_extract (SioxState *state,
SIOX_REFINEMENT_ADD_BACKGROUND))
{
g_hash_table_foreach_remove (state->cache,
(GHRFunc) dummy_remove_hash, NULL);
refinement & SIOX_REFINEMENT_ADD_FOREGROUND ?
siox_cache_remove_fg : siox_cache_remove_bg,
NULL);
/* count given foreground and background pixels */
pixel_region_init (&mapPR, mask, x, y, width, height, FALSE);
......
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