2000-05-31 21:24:14 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* gimpchannel_pdb.c
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
2009-01-18 06:28:01 +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
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* 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
|
2000-06-02 01:34:56 +08:00
|
|
|
* Lesser General Public License for more details.
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
1999-11-18 05:13:50 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2000-05-31 21:24:14 +08:00
|
|
|
*/
|
2000-05-31 14:15:06 +08:00
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
#include "gimp.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
2019-07-31 16:04:43 +08:00
|
|
|
* SECTION: gimpchannel
|
2010-07-07 17:43:10 +08:00
|
|
|
* @title: gimpchannel
|
|
|
|
* @short_description: Functions for manipulating channels.
|
|
|
|
*
|
|
|
|
* Functions for manipulating channels.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* _gimp_channel_new:
|
|
|
|
* @image_ID: The image to which to add the channel.
|
|
|
|
* @width: The channel width.
|
|
|
|
* @height: The channel height.
|
|
|
|
* @name: The channel name.
|
|
|
|
* @opacity: The channel opacity.
|
2001-01-25 09:20:05 +08:00
|
|
|
* @color: The channel compositing color.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Create a new channel.
|
|
|
|
*
|
2013-09-13 22:10:08 +08:00
|
|
|
* This procedure creates a new channel with the specified width,
|
2013-09-14 09:12:26 +08:00
|
|
|
* height, name, opacity and color.
|
|
|
|
* The new channel still needs to be added to the image, as this is not
|
|
|
|
* automatic. Add the new channel with gimp_image_insert_channel().
|
|
|
|
* Other attributes, such as channel visibility, should be set with
|
|
|
|
* explicit procedure calls.
|
|
|
|
* The channel's contents are undefined initially.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The newly created channel.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32
|
2003-07-02 09:20:08 +08:00
|
|
|
_gimp_channel_new (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
const gchar *name,
|
|
|
|
gdouble opacity,
|
|
|
|
const GimpRGB *color)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-06-02 01:34:56 +08:00
|
|
|
gint32 channel_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE_ID, image_ID,
|
|
|
|
GIMP_TYPE_INT32, width,
|
|
|
|
GIMP_TYPE_INT32, height,
|
|
|
|
G_TYPE_STRING, name,
|
|
|
|
G_TYPE_DOUBLE, opacity,
|
|
|
|
GIMP_TYPE_RGB, color,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-new",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-new",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
channel_ID = gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return channel_ID;
|
|
|
|
}
|
|
|
|
|
2005-02-23 01:58:36 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_new_from_component:
|
|
|
|
* @image_ID: The image to which to add the channel.
|
|
|
|
* @component: The image component.
|
|
|
|
* @name: The channel name.
|
|
|
|
*
|
|
|
|
* Create a new channel from a color component
|
|
|
|
*
|
2013-09-14 09:12:26 +08:00
|
|
|
* This procedure creates a new channel from a color component.
|
|
|
|
* The new channel still needs to be added to the image, as this is not
|
2013-09-13 22:10:08 +08:00
|
|
|
* automatic. Add the new channel with gimp_image_insert_channel().
|
|
|
|
* Other attributes, such as channel visibility, should be set with
|
|
|
|
* explicit procedure calls.
|
2005-02-23 01:58:36 +08:00
|
|
|
*
|
|
|
|
* Returns: The newly created channel.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-02-23 01:58:36 +08:00
|
|
|
gint32
|
|
|
|
gimp_channel_new_from_component (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpChannelType component,
|
|
|
|
const gchar *name)
|
2005-02-23 01:58:36 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2005-02-23 01:58:36 +08:00
|
|
|
gint32 channel_ID = -1;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE_ID, image_ID,
|
|
|
|
GIMP_TYPE_CHANNEL_TYPE, component,
|
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-new-from-component",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-new-from-component",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2005-02-23 01:58:36 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
channel_ID = gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1));
|
2005-02-23 01:58:36 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2005-02-23 01:58:36 +08:00
|
|
|
|
|
|
|
return channel_ID;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_copy:
|
|
|
|
* @channel_ID: The channel to copy.
|
|
|
|
*
|
|
|
|
* Copy a channel.
|
|
|
|
*
|
|
|
|
* This procedure copies the specified channel and returns the copy.
|
2013-09-13 22:58:39 +08:00
|
|
|
* The new channel still needs to be added to the image, as this is not
|
|
|
|
* automatic. Add the new channel with gimp_image_insert_channel().
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The newly copied channel.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32
|
|
|
|
gimp_channel_copy (gint32 channel_ID)
|
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-06-02 01:34:56 +08:00
|
|
|
gint32 channel_copy_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel_ID,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-copy",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-copy",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
channel_copy_ID = gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
return channel_copy_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-01-29 08:02:33 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_combine_masks:
|
|
|
|
* @channel1_ID: The channel1.
|
|
|
|
* @channel2_ID: The channel2.
|
|
|
|
* @operation: The selection operation.
|
|
|
|
* @offx: x offset between upper left corner of channels: (second - first).
|
|
|
|
* @offy: y offset between upper left corner of channels: (second - first).
|
|
|
|
*
|
|
|
|
* Combine two channel masks.
|
|
|
|
*
|
|
|
|
* This procedure combines two channel masks. The result is stored in
|
|
|
|
* the first channel.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2001-01-29 08:02:33 +08:00
|
|
|
gboolean
|
|
|
|
gimp_channel_combine_masks (gint32 channel1_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 channel2_ID,
|
|
|
|
GimpChannelOps operation,
|
|
|
|
gint offx,
|
|
|
|
gint offy)
|
2001-01-29 08:02:33 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2001-01-29 08:02:33 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel1_ID,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel2_ID,
|
|
|
|
GIMP_TYPE_CHANNEL_OPS, operation,
|
|
|
|
GIMP_TYPE_INT32, offx,
|
|
|
|
GIMP_TYPE_INT32, offy,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-combine-masks",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-combine-masks",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_get_show_masked:
|
|
|
|
* @channel_ID: The channel.
|
|
|
|
*
|
|
|
|
* Get the composite method of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure returns the specified channel's composite method. If
|
2006-03-25 05:57:47 +08:00
|
|
|
* it is TRUE, then the channel is composited with the image so that
|
|
|
|
* masked regions are shown. Otherwise, selected regions are shown.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The channel composite method.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-06-02 01:34:56 +08:00
|
|
|
gboolean
|
|
|
|
gimp_channel_get_show_masked (gint32 channel_ID)
|
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-06-02 01:34:56 +08:00
|
|
|
gboolean show_masked = FALSE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel_ID,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-get-show-masked",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-get-show-masked",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
show_masked = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
|
2000-06-02 01:34:56 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-06-02 01:34:56 +08:00
|
|
|
|
|
|
|
return show_masked;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_set_show_masked:
|
|
|
|
* @channel_ID: The channel.
|
|
|
|
* @show_masked: The new channel composite method.
|
|
|
|
*
|
|
|
|
* Set the composite method of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure sets the specified channel's composite method. If it
|
2006-03-25 05:57:47 +08:00
|
|
|
* is TRUE, then the channel is composited with the image so that
|
2000-08-25 07:06:53 +08:00
|
|
|
* masked regions are shown. Otherwise, selected regions are shown.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-02 01:34:56 +08:00
|
|
|
gimp_channel_set_show_masked (gint32 channel_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gboolean show_masked)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel_ID,
|
|
|
|
G_TYPE_BOOLEAN, show_masked,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-set-show-masked",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-set-show-masked",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_get_opacity:
|
|
|
|
* @channel_ID: The channel.
|
|
|
|
*
|
|
|
|
* Get the opacity of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure returns the specified channel's opacity.
|
|
|
|
*
|
|
|
|
* Returns: The channel opacity.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-06-02 01:34:56 +08:00
|
|
|
gdouble
|
|
|
|
gimp_channel_get_opacity (gint32 channel_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2006-04-02 19:22:47 +08:00
|
|
|
gdouble opacity = 0.0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel_ID,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-get-opacity",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-get-opacity",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
opacity = g_value_get_double (gimp_value_array_index (return_vals, 1));
|
2000-06-02 01:34:56 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-06-02 01:34:56 +08:00
|
|
|
|
|
|
|
return opacity;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_set_opacity:
|
|
|
|
* @channel_ID: The channel.
|
|
|
|
* @opacity: The new channel opacity.
|
|
|
|
*
|
|
|
|
* Set the opacity of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure sets the specified channel's opacity.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-02 01:34:56 +08:00
|
|
|
gimp_channel_set_opacity (gint32 channel_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gdouble opacity)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel_ID,
|
|
|
|
G_TYPE_DOUBLE, opacity,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-set-opacity",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-set-opacity",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1998-05-26 16:46:37 +08:00
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_get_color:
|
|
|
|
* @channel_ID: The channel.
|
2019-08-01 21:39:13 +08:00
|
|
|
* @color: (out caller-allocates): The channel compositing color.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Get the compositing color of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure returns the specified channel's compositing color.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2001-01-25 09:20:05 +08:00
|
|
|
gimp_channel_get_color (gint32 channel_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpRGB *color)
|
1998-05-26 16:46:37 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1998-05-26 16:46:37 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel_ID,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
1998-05-26 16:46:37 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-get-color",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-get-color",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
if (success)
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*color);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1998-05-26 16:46:37 +08:00
|
|
|
}
|
1998-11-08 07:02:14 +08:00
|
|
|
|
2001-01-26 02:23:30 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_set_color:
|
|
|
|
* @channel_ID: The channel.
|
|
|
|
* @color: The new channel compositing color.
|
|
|
|
*
|
|
|
|
* Set the compositing color of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure sets the specified channel's compositing color.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2001-01-26 02:23:30 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_channel_set_color (gint32 channel_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const GimpRGB *color)
|
2001-01-26 02:23:30 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2001-01-26 02:23:30 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, channel_ID,
|
|
|
|
GIMP_TYPE_RGB, color,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-channel-set-color",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-channel-set-color",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2001-01-26 02:23:30 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2001-01-26 02:23:30 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2001-01-26 02:23:30 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|