2000-06-01 20:20:13 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimpcolor_pdb.c
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl */
|
|
|
|
|
|
|
|
#include "gimp.h"
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_brightness_contrast (gint32 drawable_ID,
|
|
|
|
gint brightness,
|
|
|
|
gint contrast)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_brightness_contrast",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, brightness,
|
|
|
|
GIMP_PDB_INT32, contrast,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_levels (gint32 drawable_ID,
|
|
|
|
GimpChannelLutType channel,
|
|
|
|
gint low_input,
|
|
|
|
gint high_input,
|
|
|
|
gdouble gamma,
|
|
|
|
gint low_output,
|
|
|
|
gint high_output)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_levels",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, channel,
|
|
|
|
GIMP_PDB_INT32, low_input,
|
|
|
|
GIMP_PDB_INT32, high_input,
|
|
|
|
GIMP_PDB_FLOAT, gamma,
|
|
|
|
GIMP_PDB_INT32, low_output,
|
|
|
|
GIMP_PDB_INT32, high_output,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_posterize (gint32 drawable_ID,
|
|
|
|
gint levels)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_posterize",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, levels,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_desaturate (gint32 drawable_ID)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_desaturate",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_equalize (gint32 drawable_ID,
|
|
|
|
gboolean mask_only)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_equalize",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, mask_only,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_invert (gint32 drawable_ID)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_invert",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_curves_spline (gint32 drawable_ID,
|
|
|
|
GimpChannelLutType channel,
|
|
|
|
gint num_points,
|
|
|
|
guint8 *control_pts)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_curves_spline",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, channel,
|
|
|
|
GIMP_PDB_INT32, num_points,
|
|
|
|
GIMP_PDB_INT8ARRAY, control_pts,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_curves_explicit (gint32 drawable_ID,
|
|
|
|
GimpChannelLutType channel,
|
|
|
|
gint num_bytes,
|
|
|
|
guint8 *curve)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_curves_explicit",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, channel,
|
|
|
|
GIMP_PDB_INT32, num_bytes,
|
|
|
|
GIMP_PDB_INT8ARRAY, curve,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_color_balance (gint32 drawable_ID,
|
|
|
|
GimpTransferMode transfer_mode,
|
|
|
|
gboolean preserve_lum,
|
|
|
|
gdouble cyan_red,
|
|
|
|
gdouble magenta_green,
|
|
|
|
gdouble yellow_blue)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_color_balance",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, transfer_mode,
|
|
|
|
GIMP_PDB_INT32, preserve_lum,
|
|
|
|
GIMP_PDB_FLOAT, cyan_red,
|
|
|
|
GIMP_PDB_FLOAT, magenta_green,
|
|
|
|
GIMP_PDB_FLOAT, yellow_blue,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_histogram (gint32 drawable_ID,
|
|
|
|
GimpChannelLutType channel,
|
|
|
|
gint start_range,
|
|
|
|
gint end_range,
|
|
|
|
gdouble *mean,
|
|
|
|
gdouble *std_dev,
|
|
|
|
gdouble *median,
|
|
|
|
gdouble *pixels,
|
|
|
|
gdouble *count,
|
|
|
|
gdouble *percentile)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_histogram",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, channel,
|
|
|
|
GIMP_PDB_INT32, start_range,
|
|
|
|
GIMP_PDB_INT32, end_range,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-06-23 04:06:02 +08:00
|
|
|
*mean = 0.0;
|
|
|
|
*std_dev = 0.0;
|
|
|
|
*median = 0.0;
|
|
|
|
*pixels = 0.0;
|
|
|
|
*count = 0.0;
|
|
|
|
*percentile = 0.0;
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
|
|
|
*mean = return_vals[1].data.d_float;
|
|
|
|
*std_dev = return_vals[2].data.d_float;
|
|
|
|
*median = return_vals[3].data.d_float;
|
|
|
|
*pixels = return_vals[4].data.d_float;
|
|
|
|
*count = return_vals[5].data.d_float;
|
|
|
|
*percentile = return_vals[6].data.d_float;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_hue_saturation (gint32 drawable_ID,
|
|
|
|
GimpHueRange hue_range,
|
|
|
|
gdouble hue_offset,
|
|
|
|
gdouble lightness,
|
|
|
|
gdouble saturation)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_hue_saturation",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, hue_range,
|
|
|
|
GIMP_PDB_FLOAT, hue_offset,
|
|
|
|
GIMP_PDB_FLOAT, lightness,
|
|
|
|
GIMP_PDB_FLOAT, saturation,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_threshold (gint32 drawable_ID,
|
|
|
|
gint low_threshold,
|
|
|
|
gint high_threshold)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_threshold",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_INT32, low_threshold,
|
|
|
|
GIMP_PDB_INT32, high_threshold,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|