Commit e98cd43e authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/base/base-types.h applied patch from Gerald Friedland that introduces

2005-10-12  Sven Neumann  <sven@gimp.org>

	* app/base/base-types.h
	* app/base/siox.[ch]: applied patch from Gerald Friedland that
	introduces a state to the SIOX operation.

	* app/core/gimpdrawable-foreground-extract.c: adapted to the new API.
parent 5a323681
2005-10-12 Sven Neumann <sven@gimp.org>
* app/base/base-types.h
* app/base/siox.[ch]: applied patch from Gerald Friedland that
introduces a state to the SIOX operation.
* app/core/gimpdrawable-foreground-extract.c: adapted to the new API.
2005-10-11 Michael Natterer <mitch@gimp.org>
* libgimpthumb/gimpthumbnail.c: the mime-type is stored in
......
......@@ -61,6 +61,8 @@ typedef struct _PixelRegionIterator PixelRegionIterator;
typedef struct _PixelRegion PixelRegion;
typedef struct _PixelRegionHolder PixelRegionHolder;
typedef struct _SioxState SioxState;
typedef struct _TempBuf TempBuf;
typedef struct _TempBuf MaskBuf;
......
This diff is collapsed.
......@@ -43,24 +43,45 @@
#define SIOX_DEFAULT_SENSITIVITY_A 1.28
#define SIOX_DEFAULT_SENSITIVITY_B 2.56
#define SIOX_REFINEMENT_TYPE_NO_CHANGE 0
#define SIOX_REFINEMENT_TYPE_ADD_FOREGROUND (1 << 0)
#define SIOX_REFINEMENT_TYPE_ADD_BACKGROUND (1 << 1)
#define SIOX_REFINEMENT_TYPE_CHANGE_SENSITIVITY (1 << 2)
#define SIOX_REFINEMENT_TYPE_CHANGE_SMOOTHNESS (1 << 3)
#define SIOX_REFINEMENT_TYPE_CHANGE_MULTIBLOB (1 << 4)
#define SIOX_REFINEMENT_TYPE_RECALCULATE 0xFF
/* FIXME: turn this into an enum */
#define SIOX_DRB_ADD 0
#define SIOX_DRB_SUBTRACT 1
typedef void (* SioxProgressFunc) (gpointer progress_data,
gdouble fraction);
void siox_foreground_extract (TileManager *pixels,
const guchar *colormap,
gint offset_x,
gint offset_y,
TileManager *mask,
gint x,
gint y,
gint width,
gint height,
gint smoothness,
const gdouble sensitivity[3],
SioxProgressFunc progress_callback,
gpointer progress_data);
SioxState * siox_init (TileManager *pixels,
const guchar *colormap,
gint offset_x,
gint offset_y,
TileManager *mask,
gint x,
gint y,
gint width,
gint height,
SioxProgressFunc progress_callback,
gpointer progress_data);
void siox_foreground_extract (SioxState *state,
gint smoothness,
const gdouble sensitivity[3],
gboolean multiblob,
gint refinementtype);
void siox_drb (SioxState *state,
gint x,
gint y,
gint brushradius,
gint brushmode,
gfloat threshold);
void siox_done (SioxState *state);
#endif /* __SIOX_H__ */
......@@ -73,6 +73,7 @@ gimp_drawable_foreground_extract_siox (GimpDrawable *drawable,
GimpProgress *progress)
{
GimpImage *gimage;
SioxState *state;
const guchar *colormap = NULL;
gboolean intersect;
gint offset_x;
......@@ -110,12 +111,14 @@ gimp_drawable_foreground_extract_siox (GimpDrawable *drawable,
if (progress)
gimp_progress_start (progress, _("Foreground Extraction"), FALSE);
siox_foreground_extract (gimp_drawable_data (drawable), colormap,
offset_x, offset_y,
gimp_drawable_data (mask), x, y, width, height,
smoothness, sensitivity,
(SioxProgressFunc) gimp_progress_set_value,
progress);
state = siox_init (gimp_drawable_data (drawable), colormap,
offset_x, offset_y,
gimp_drawable_data (mask), x, y, width, height,
(SioxProgressFunc) gimp_progress_set_value,
progress);
siox_foreground_extract (state, smoothness, sensitivity, TRUE, 255);
siox_done (state);
if (progress)
gimp_progress_end (progress);
......
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