app/core/gimpimage-convert-data.h app/core/gimpimage-convert.c

2006-08-04  Raphael Quinet  <raphael@gimp.org>

	* app/core/gimpimage-convert-data.h
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-convert.h
	* tools/pdbgen/pdb/convert.pdb: Applied slightly modified patch
	from David Gowers allowing a custom dither matrix to be used when
	converting images to indexed mode.  Fixes bug #136604.

	* app/pdb/convert_cmds.c
	* libgimp/gimpconvert_pdb.h
	* libgimp/gimpconvert_pdb.c: Regenerated.

	* app/tools/gimpselectiontool.c: N_() should have been _().
This commit is contained in:
Raphael Quinet
2006-08-04 17:54:26 +00:00
committed by Raphaël Quinet
parent 438d30f38f
commit 1999e437d4
9 changed files with 249 additions and 12 deletions

View File

@ -146,3 +146,42 @@ gimp_image_convert_indexed (gint32 image_ID,
return success;
}
/**
* gimp_image_convert_set_dither_matrix:
* @width: Width of the matrix (0 to reset to default matrix).
* @height: Height of the matrix (0 to reset to default matrix).
* @matrix_length: The length of 'matrix'.
* @matrix: The matrix -- all values must be >= 1.
*
* Set dither matrix for conversion to indexed
*
* This procedure sets the dither matrix used when converting images to
* INDEXED mode with positional dithering.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_convert_set_dither_matrix (gint width,
gint height,
gint matrix_length,
const guint8 *matrix)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-convert-set-dither-matrix",
&nreturn_vals,
GIMP_PDB_INT32, width,
GIMP_PDB_INT32, height,
GIMP_PDB_INT32, matrix_length,
GIMP_PDB_INT8ARRAY, matrix,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}

View File

@ -29,15 +29,19 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_image_convert_rgb (gint32 image_ID);
gboolean gimp_image_convert_grayscale (gint32 image_ID);
gboolean gimp_image_convert_indexed (gint32 image_ID,
GimpConvertDitherType dither_type,
GimpConvertPaletteType palette_type,
gint num_cols,
gboolean alpha_dither,
gboolean remove_unused,
const gchar *palette);
gboolean gimp_image_convert_rgb (gint32 image_ID);
gboolean gimp_image_convert_grayscale (gint32 image_ID);
gboolean gimp_image_convert_indexed (gint32 image_ID,
GimpConvertDitherType dither_type,
GimpConvertPaletteType palette_type,
gint num_cols,
gboolean alpha_dither,
gboolean remove_unused,
const gchar *palette);
gboolean gimp_image_convert_set_dither_matrix (gint width,
gint height,
gint matrix_length,
const guint8 *matrix);
G_END_DECLS