2000-05-31 14:15:06 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
1999-11-18 19:37:35 +08:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
2000-05-31 14:15:06 +08:00
|
|
|
* gimpimage_pdb.c
|
|
|
|
*
|
1998-01-25 18:26:47 +08:00
|
|
|
* This library is free software; you can redistribute it and/or
|
1999-11-18 05:13:50 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-01-25 18:26:47 +08:00
|
|
|
* License as published by the Free Software Foundation; either
|
1999-11-18 19:37:35 +08:00
|
|
|
* 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
|
1998-01-25 18:26:47 +08:00
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
1999-11-18 05:13:50 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-04-13 13:44:11 +08:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1999-11-18 19:37:35 +08:00
|
|
|
*/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
|
|
|
|
|
|
|
gint32
|
|
|
|
gimp_image_new (guint width,
|
|
|
|
guint height,
|
|
|
|
GImageType type)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 image_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_new",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_INT32, width,
|
|
|
|
PARAM_INT32, height,
|
|
|
|
PARAM_INT32, type,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
image_ID = -1;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
image_ID = return_vals[1].data.d_image;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return image_ID;
|
|
|
|
}
|
|
|
|
|
1999-10-04 02:54:54 +08:00
|
|
|
gint32
|
|
|
|
gimp_image_duplicate (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-10-04 02:54:54 +08:00
|
|
|
gint32 new_image_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_channel_ops_duplicate",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
new_image_ID = -1;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
new_image_ID = return_vals[1].data.d_image;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return (new_image_ID);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
gimp_image_delete (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_delete",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gimp_image_width (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_width",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = 0;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gimp_image_height (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_height",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = 0;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
GImageType
|
|
|
|
gimp_image_base_type (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_base_type",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = 0;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32
|
|
|
|
gimp_image_floating_selection (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 layer_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_floating_selection",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
layer_ID = 0;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return layer_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_add_channel (gint32 image_ID,
|
|
|
|
gint32 channel_ID,
|
|
|
|
int position)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_add_channel",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_CHANNEL, channel_ID,
|
|
|
|
PARAM_INT32, position,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_add_layer (gint32 image_ID,
|
|
|
|
gint32 layer_ID,
|
2000-03-26 02:49:05 +08:00
|
|
|
gint position)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_add_layer",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_LAYER, layer_ID,
|
|
|
|
PARAM_INT32, position,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_add_layer_mask (gint32 image_ID,
|
|
|
|
gint32 layer_ID,
|
|
|
|
gint32 mask_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_add_layer_mask",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_LAYER, layer_ID,
|
|
|
|
PARAM_CHANNEL, mask_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_image_undo_disable (gint32 image_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_image_undo_disable",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_image_undo_enable (gint32 image_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_image_undo_enable",
|
1997-11-25 06:05:25 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1999-08-22 00:15:58 +08:00
|
|
|
void
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_image_undo_freeze (gint32 image_ID)
|
1999-08-22 00:15:58 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-08-22 00:15:58 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_image_undo_freeze",
|
1999-08-22 00:15:58 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-17 08:07:55 +08:00
|
|
|
gimp_image_undo_thaw (gint32 image_ID)
|
1999-08-22 00:15:58 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-08-22 00:15:58 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_image_undo_thaw",
|
1999-08-22 00:15:58 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1999-04-23 14:07:09 +08:00
|
|
|
void
|
|
|
|
gimp_undo_push_group_start (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-04-23 14:07:09 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_undo_push_group_start",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_undo_push_group_end (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-04-23 14:07:09 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_undo_push_group_end",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
gimp_image_clean_all (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_clean_all",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1998-07-17 10:19:56 +08:00
|
|
|
gint32
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_image_flatten (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1998-07-17 10:19:56 +08:00
|
|
|
gint32 layer_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_flatten",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
1998-07-17 10:19:56 +08:00
|
|
|
layer_ID = -1;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
1998-07-17 10:19:56 +08:00
|
|
|
|
|
|
|
return layer_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_lower_channel (gint32 image_ID,
|
|
|
|
gint32 channel_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_lower_channel",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_CHANNEL, channel_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_lower_layer (gint32 image_ID,
|
|
|
|
gint32 layer_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_lower_layer",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_LAYER, layer_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32
|
1999-12-27 20:02:07 +08:00
|
|
|
gimp_image_merge_visible_layers (gint32 image_ID,
|
|
|
|
GimpMergeType merge_type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 layer_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_merge_visible_layers",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, merge_type,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
layer_ID = -1;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
1998-05-26 16:46:37 +08:00
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return layer_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32
|
|
|
|
gimp_image_pick_correlate_layer (gint32 image_ID,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 layer_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_pick_correlate_layer",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, x,
|
|
|
|
PARAM_INT32, y,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
layer_ID = -1;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
1998-05-26 16:46:37 +08:00
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return layer_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_raise_channel (gint32 image_ID,
|
|
|
|
gint32 channel_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_raise_channel",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_CHANNEL, channel_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_raise_layer (gint32 image_ID,
|
|
|
|
gint32 layer_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_raise_layer",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_LAYER, layer_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_remove_channel (gint32 image_ID,
|
|
|
|
gint32 channel_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_remove_channel",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_CHANNEL, channel_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_remove_layer (gint32 image_ID,
|
|
|
|
gint32 layer_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_remove_layer",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_LAYER, layer_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_remove_layer_mask (gint32 image_ID,
|
|
|
|
gint32 layer_ID,
|
|
|
|
gint mode)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_remove_layer_mask",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_LAYER, layer_ID,
|
|
|
|
PARAM_INT32, mode,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_resize (gint32 image_ID,
|
|
|
|
guint new_width,
|
|
|
|
guint new_height,
|
|
|
|
gint offset_x,
|
|
|
|
gint offset_y)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_resize",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, new_width,
|
|
|
|
PARAM_INT32, new_height,
|
|
|
|
PARAM_INT32, offset_x,
|
|
|
|
PARAM_INT32, offset_y,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32
|
|
|
|
gimp_image_get_active_channel (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 channel_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_active_channel",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
channel_ID = -1;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
channel_ID = return_vals[1].data.d_channel;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return channel_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32
|
|
|
|
gimp_image_get_active_layer (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 layer_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_active_layer",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
layer_ID = -1;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return layer_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32*
|
|
|
|
gimp_image_get_channels (gint32 image_ID,
|
|
|
|
gint *nchannels)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 *channels;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_channels",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
channels = NULL;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
*nchannels = return_vals[1].data.d_int32;
|
|
|
|
channels = g_new (gint32, *nchannels);
|
|
|
|
memcpy (channels, return_vals[2].data.d_int32array, *nchannels * 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return channels;
|
|
|
|
}
|
|
|
|
|
|
|
|
guchar*
|
|
|
|
gimp_image_get_cmap (gint32 image_ID,
|
|
|
|
gint *ncolors)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
guchar *cmap;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_cmap",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
cmap = NULL;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
*ncolors = return_vals[1].data.d_int32 / 3;
|
|
|
|
cmap = g_new (guchar, *ncolors * 3);
|
|
|
|
memcpy (cmap, return_vals[2].data.d_int8array, *ncolors * 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return cmap;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_image_get_component_active (gint32 image_ID,
|
|
|
|
gint component)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_component_active",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gboolean
|
1998-05-12 08:12:47 +08:00
|
|
|
gimp_image_get_component_visible (gint32 image_ID,
|
|
|
|
gint component)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean result;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_component_visible",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
result = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gchar*
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_image_get_filename (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
char *filename;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_filename",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
filename = NULL;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
filename = g_strdup (return_vals[1].data.d_string);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return filename;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32*
|
|
|
|
gimp_image_get_layers (gint32 image_ID,
|
|
|
|
gint *nlayers)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 *layers;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_layers",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
layers = NULL;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
*nlayers = return_vals[1].data.d_int32;
|
|
|
|
layers = g_new (gint32, *nlayers);
|
|
|
|
memcpy (layers, return_vals[2].data.d_int32array, *nlayers * 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return layers;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32
|
|
|
|
gimp_image_get_selection (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32 selection_ID;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_selection",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
selection_ID = -1;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
selection_ID = return_vals[1].data.d_selection;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return selection_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_set_active_channel (gint32 image_ID,
|
|
|
|
gint32 channel_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (channel_ID == -1)
|
|
|
|
{
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_unset_active_channel",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_set_active_channel",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_CHANNEL, channel_ID,
|
|
|
|
PARAM_END);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_set_active_layer (gint32 image_ID,
|
|
|
|
gint32 layer_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_set_active_layer",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_LAYER, layer_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_set_cmap (gint32 image_ID,
|
|
|
|
guchar *cmap,
|
|
|
|
gint ncolors)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_set_cmap",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, ncolors * 3,
|
|
|
|
PARAM_INT8ARRAY, cmap,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-03-26 02:49:05 +08:00
|
|
|
gimp_image_set_component_active (gint32 image_ID,
|
|
|
|
gint component,
|
|
|
|
gboolean active)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_set_component_active",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, component,
|
|
|
|
PARAM_INT32, active,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-03-26 02:49:05 +08:00
|
|
|
gimp_image_set_component_visible (gint32 image_ID,
|
|
|
|
gint component,
|
|
|
|
gboolean visible)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_set_component_visible",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, component,
|
|
|
|
PARAM_INT32, visible,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_set_filename (gint32 image_ID,
|
2000-03-26 02:49:05 +08:00
|
|
|
gchar *name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_set_filename",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_STRING, name,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2000-05-27 06:28:40 +08:00
|
|
|
GimpParasite *
|
2000-03-26 02:49:05 +08:00
|
|
|
gimp_image_parasite_find (gint32 image_ID,
|
|
|
|
const gchar *name)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-05-27 06:28:40 +08:00
|
|
|
GimpParasite *parasite;
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_image_parasite_find",
|
1998-10-08 16:15:21 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
1998-10-14 10:54:02 +08:00
|
|
|
PARAM_STRING, name,
|
1998-10-08 16:15:21 +08:00
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
2000-05-27 06:28:40 +08:00
|
|
|
{
|
|
|
|
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
|
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
else
|
|
|
|
parasite = NULL;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return parasite;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-05-27 06:28:40 +08:00
|
|
|
gimp_image_parasite_attach (gint32 image_ID,
|
|
|
|
const GimpParasite *parasite)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1998-10-08 16:15:21 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_image_parasite_attach",
|
1998-10-08 16:15:21 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
2000-05-27 06:28:40 +08:00
|
|
|
PARAM_PARASITE, parasite,
|
1998-10-08 16:15:21 +08:00
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
void
|
2000-03-26 02:49:05 +08:00
|
|
|
gimp_image_attach_new_parasite (gint32 image_ID,
|
|
|
|
const gchar *name,
|
|
|
|
gint flags,
|
|
|
|
gint size,
|
|
|
|
const gpointer data)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-05-27 06:28:40 +08:00
|
|
|
GimpParasite *p = gimp_parasite_new (name, flags, size, data);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_image_parasite_attach",
|
1998-10-30 18:21:33 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_PARASITE, p,
|
|
|
|
PARAM_END);
|
|
|
|
|
2000-05-27 06:28:40 +08:00
|
|
|
gimp_parasite_free (p);
|
1998-10-30 18:21:33 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1998-10-08 16:15:21 +08:00
|
|
|
void
|
2000-03-26 02:49:05 +08:00
|
|
|
gimp_image_parasite_detach (gint32 image_ID,
|
|
|
|
const gchar *name)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1998-10-08 16:15:21 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp_image_parasite_detach",
|
1998-10-08 16:15:21 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
1998-10-14 10:54:02 +08:00
|
|
|
PARAM_STRING, name,
|
1998-10-08 16:15:21 +08:00
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
1998-11-15 07:28:47 +08:00
|
|
|
void
|
|
|
|
gimp_image_get_resolution (gint32 image_ID,
|
1999-05-23 01:56:35 +08:00
|
|
|
double *xresolution,
|
|
|
|
double *yresolution)
|
1998-10-05 18:05:29 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gdouble xres;
|
|
|
|
gdouble yres;
|
1998-11-15 07:28:47 +08:00
|
|
|
|
1999-05-23 01:56:35 +08:00
|
|
|
g_return_if_fail (xresolution && yresolution);
|
1998-10-05 18:05:29 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_resolution",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
1998-11-15 07:28:47 +08:00
|
|
|
/* error return values */
|
|
|
|
xres = 0.0;
|
|
|
|
yres = 0.0;
|
|
|
|
|
1998-10-05 18:05:29 +08:00
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
1998-11-15 07:28:47 +08:00
|
|
|
{
|
|
|
|
xres = return_vals[1].data.d_float;
|
|
|
|
yres = return_vals[2].data.d_float;
|
|
|
|
}
|
1998-10-05 18:05:29 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
1998-11-15 07:28:47 +08:00
|
|
|
*xresolution = xres;
|
|
|
|
*yresolution = yres;
|
1998-10-05 18:05:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-04 02:54:54 +08:00
|
|
|
gimp_image_set_resolution (gint32 image_ID,
|
|
|
|
double xresolution,
|
|
|
|
double yresolution)
|
1998-10-05 18:05:29 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1998-10-05 18:05:29 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_set_resolution",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
1998-11-15 07:28:47 +08:00
|
|
|
PARAM_FLOAT, xresolution,
|
|
|
|
PARAM_FLOAT, yresolution,
|
1998-10-05 18:05:29 +08:00
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
1999-03-17 04:14:07 +08:00
|
|
|
}
|
|
|
|
|
2000-02-08 04:35:13 +08:00
|
|
|
GimpUnit
|
1999-10-04 02:54:54 +08:00
|
|
|
gimp_image_get_unit (gint32 image_ID)
|
1999-03-17 04:14:07 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-02-08 04:35:13 +08:00
|
|
|
GimpUnit unit;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_unit",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
/* error return value */
|
2000-02-08 04:35:13 +08:00
|
|
|
unit = GIMP_UNIT_INCH;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
unit = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return unit;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-02-08 04:35:13 +08:00
|
|
|
gimp_image_set_unit (gint32 image_ID,
|
|
|
|
GimpUnit unit)
|
1999-03-17 04:14:07 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_set_unit",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, unit,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
1998-10-05 18:05:29 +08:00
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
gint32
|
1999-10-04 02:54:54 +08:00
|
|
|
gimp_image_get_layer_by_tattoo (gint32 image_ID,
|
|
|
|
gint32 tattoo)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1998-10-30 18:21:33 +08:00
|
|
|
gint32 layer = 0;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_layer_by_tattoo",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, tattoo,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
layer = 0;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
layer = return_vals[1].data.d_layer;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return layer;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint32
|
1999-10-04 02:54:54 +08:00
|
|
|
gimp_image_get_channel_by_tattoo (gint32 image_ID,
|
|
|
|
gint32 tattoo)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1998-10-30 18:21:33 +08:00
|
|
|
gint32 channel = 0;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_get_channel_by_tattoo",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, tattoo,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
channel = 0;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
channel = return_vals[1].data.d_channel;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return channel;
|
|
|
|
}
|
|
|
|
|
1999-06-24 07:01:14 +08:00
|
|
|
guchar *
|
1999-10-04 02:54:54 +08:00
|
|
|
gimp_image_get_thumbnail_data (gint32 image_ID,
|
|
|
|
gint *width,
|
|
|
|
gint *height,
|
|
|
|
gint *bytes)
|
1999-06-24 07:01:14 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-12-07 06:44:40 +08:00
|
|
|
guchar *image_data = NULL;
|
1999-06-24 07:01:14 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_thumbnail",
|
|
|
|
&nreturn_vals,
|
1999-11-18 19:37:35 +08:00
|
|
|
PARAM_IMAGE, image_ID,
|
1999-06-24 07:01:14 +08:00
|
|
|
PARAM_INT32, *width,
|
|
|
|
PARAM_INT32, *height,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
*width = return_vals[1].data.d_int32;
|
|
|
|
*height = return_vals[2].data.d_int32;
|
|
|
|
*bytes = return_vals[3].data.d_int32;
|
1999-12-07 06:44:40 +08:00
|
|
|
image_data = g_new (guchar, return_vals[4].data.d_int32);
|
|
|
|
g_memmove (image_data, return_vals[5].data.d_int32array, return_vals[4].data.d_int32);
|
1999-06-24 07:01:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return image_data;
|
|
|
|
}
|
|
|
|
|
1999-10-04 02:54:54 +08:00
|
|
|
void
|
|
|
|
gimp_image_convert_rgb (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-10-04 02:54:54 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_convert_rgb",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_convert_grayscale (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-10-04 02:54:54 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_convert_grayscale",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-12-27 20:02:07 +08:00
|
|
|
gimp_image_convert_indexed (gint32 image_ID,
|
|
|
|
GimpConvertDitherType dither_type,
|
|
|
|
GimpConvertPaletteType palette_type,
|
|
|
|
gint num_colors,
|
|
|
|
gint alpha_dither,
|
|
|
|
gint remove_unused,
|
|
|
|
gchar *palette)
|
1999-10-04 02:54:54 +08:00
|
|
|
{
|
|
|
|
GParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
1999-10-04 02:54:54 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_convert_indexed",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_IMAGE, image_ID,
|
|
|
|
PARAM_INT32, dither_type,
|
|
|
|
PARAM_INT32, palette_type,
|
|
|
|
PARAM_INT32, num_colors,
|
|
|
|
PARAM_INT32, alpha_dither,
|
|
|
|
PARAM_INT32, remove_unused,
|
|
|
|
PARAM_STRING, palette,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
}
|
2000-05-31 21:24:14 +08:00
|
|
|
|
|
|
|
gint32 *
|
|
|
|
gimp_image_list (gint *nimages)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint32 *images;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_image_list",
|
|
|
|
&nreturn_vals,
|
|
|
|
PARAM_END);
|
|
|
|
|
|
|
|
images = NULL;
|
|
|
|
if (return_vals[0].data.d_status == STATUS_SUCCESS)
|
|
|
|
{
|
|
|
|
*nimages = return_vals[1].data.d_int32;
|
|
|
|
images = g_new (gint32, *nimages);
|
|
|
|
memcpy (images, return_vals[2].data.d_int32array, *nimages * 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return images;
|
|
|
|
}
|
|
|
|
|