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"
|
|
|
|
|
2022-03-28 21:13:17 +08:00
|
|
|
#include "stamp-pdbgen.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
|
|
|
/**
|
2024-09-27 23:10:46 +08:00
|
|
|
* gimp_channel_new:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image to which to add the channel.
|
2024-09-27 23:10:46 +08:00
|
|
|
* @name: The channel name.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @width: The channel width.
|
|
|
|
* @height: The channel height.
|
|
|
|
* @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.
|
|
|
|
*
|
2024-09-27 23:10:46 +08:00
|
|
|
* This procedure creates a new channel with the specified @width,
|
|
|
|
* @height, @name, @opacity and @color.
|
|
|
|
*
|
2013-09-14 09:12:26 +08:00
|
|
|
* Other attributes, such as channel visibility, should be set with
|
|
|
|
* explicit procedure calls.
|
2024-09-27 23:10:46 +08:00
|
|
|
*
|
|
|
|
* The new channel still needs to be added to the image, as this is not
|
|
|
|
* automatic. Add the new channel with
|
|
|
|
* [method@Gimp.Image.insert_channel].
|
|
|
|
*
|
2013-09-14 09:12:26 +08:00
|
|
|
* The channel's contents are undefined initially.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-08-15 18:12:25 +08:00
|
|
|
* Returns: (transfer none): The newly created channel.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel *
|
2024-09-27 23:10:46 +08:00
|
|
|
gimp_channel_new (GimpImage *image,
|
|
|
|
const gchar *name,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gdouble opacity,
|
|
|
|
GeglColor *color)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel *channel = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2024-09-27 23:10:46 +08:00
|
|
|
G_TYPE_STRING, name,
|
2019-08-15 20:04:56 +08:00
|
|
|
G_TYPE_INT, width,
|
|
|
|
G_TYPE_INT, height,
|
2019-08-08 19:01:50 +08:00
|
|
|
G_TYPE_DOUBLE, opacity,
|
2023-11-20 07:20:03 +08:00
|
|
|
GEGL_TYPE_COLOR, color,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-new",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
channel = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-14 03:36:03 +08:00
|
|
|
return channel;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-02-23 01:58:36 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_new_from_component:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image to which to add the channel.
|
2005-02-23 01:58:36 +08:00
|
|
|
* @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
|
|
|
*
|
2019-08-15 18:12:25 +08:00
|
|
|
* Returns: (transfer none): The newly created channel.
|
2005-02-23 01:58:36 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel *
|
2019-08-11 20:20:05 +08:00
|
|
|
gimp_channel_new_from_component (GimpImage *image,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpChannelType component,
|
|
|
|
const gchar *name)
|
2005-02-23 01:58:36 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel *channel = NULL;
|
2005-02-23 01:58:36 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-08 19:01:50 +08:00
|
|
|
GIMP_TYPE_CHANNEL_TYPE, component,
|
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-new-from-component",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
channel = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-08-14 03:36:03 +08:00
|
|
|
return channel;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_copy:
|
2019-08-14 03:36:03 +08:00
|
|
|
* @channel: The channel to copy.
|
|
|
|
*
|
|
|
|
* Copy a channel.
|
|
|
|
*
|
|
|
|
* This procedure copies the specified channel and returns the copy.
|
|
|
|
* 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().
|
|
|
|
*
|
2019-08-15 18:12:25 +08:00
|
|
|
* Returns: (transfer none): The newly copied channel.
|
2019-08-14 03:36:03 +08:00
|
|
|
**/
|
|
|
|
GimpChannel *
|
|
|
|
gimp_channel_copy (GimpChannel *channel)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpChannel *channel_copy = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
2019-08-14 03:36:03 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-copy",
|
|
|
|
args);
|
2019-08-14 03:36:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
channel_copy = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return channel_copy;
|
|
|
|
}
|
|
|
|
|
2001-01-29 08:02:33 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_combine_masks:
|
2019-08-14 03:36:03 +08:00
|
|
|
* @channel1: The channel1.
|
|
|
|
* @channel2: 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.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_channel_combine_masks (GimpChannel *channel1,
|
|
|
|
GimpChannel *channel2,
|
|
|
|
GimpChannelOps operation,
|
|
|
|
gint offx,
|
|
|
|
gint offy)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel1,
|
|
|
|
GIMP_TYPE_CHANNEL, channel2,
|
2019-08-14 03:36:03 +08:00
|
|
|
GIMP_TYPE_CHANNEL_OPS, operation,
|
|
|
|
G_TYPE_INT, offx,
|
|
|
|
G_TYPE_INT, offy,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-combine-masks",
|
|
|
|
args);
|
2019-08-14 03:36:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_get_show_masked:
|
2019-08-14 03:36:03 +08:00
|
|
|
* @channel: The channel.
|
|
|
|
*
|
|
|
|
* Get the composite method of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure returns the specified channel's composite method. If
|
|
|
|
* it is TRUE, then the channel is composited with the image so that
|
|
|
|
* masked regions are shown. Otherwise, selected regions are shown.
|
|
|
|
*
|
|
|
|
* Returns: The channel composite method.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_channel_get_show_masked (GimpChannel *channel)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean show_masked = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
2019-08-14 03:36:03 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-get-show-masked",
|
|
|
|
args);
|
2019-08-14 03:36:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
show_masked = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return show_masked;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_set_show_masked:
|
2019-08-14 03:36:03 +08:00
|
|
|
* @channel: 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
|
|
|
|
* is TRUE, then the channel is composited with the image so that
|
|
|
|
* masked regions are shown. Otherwise, selected regions are shown.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_channel_set_show_masked (GimpChannel *channel,
|
|
|
|
gboolean show_masked)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
2019-08-14 03:36:03 +08:00
|
|
|
G_TYPE_BOOLEAN, show_masked,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-set-show-masked",
|
|
|
|
args);
|
2019-08-14 03:36:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_get_opacity:
|
2019-08-14 03:36:03 +08:00
|
|
|
* @channel: The channel.
|
|
|
|
*
|
|
|
|
* Get the opacity of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure returns the specified channel's opacity.
|
|
|
|
*
|
|
|
|
* Returns: The channel opacity.
|
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_channel_get_opacity (GimpChannel *channel)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gdouble opacity = 0.0;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
2019-08-14 03:36:03 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-get-opacity",
|
|
|
|
args);
|
2019-08-14 03:36:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
opacity = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return opacity;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_set_opacity:
|
2019-08-14 03:36:03 +08:00
|
|
|
* @channel: 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.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_channel_set_opacity (GimpChannel *channel,
|
|
|
|
gdouble opacity)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
2019-08-14 03:36:03 +08:00
|
|
|
G_TYPE_DOUBLE, opacity,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-set-opacity",
|
|
|
|
args);
|
2019-08-14 03:36:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_get_color:
|
2019-08-14 03:36:03 +08:00
|
|
|
* @channel: The channel.
|
|
|
|
*
|
|
|
|
* Get the compositing color of the specified channel.
|
|
|
|
*
|
|
|
|
* This procedure returns the specified channel's compositing color.
|
|
|
|
*
|
2023-11-20 07:20:03 +08:00
|
|
|
* Returns: (transfer full): The channel compositing color.
|
2019-08-14 03:36:03 +08:00
|
|
|
**/
|
2023-11-20 07:20:03 +08:00
|
|
|
GeglColor *
|
|
|
|
gimp_channel_get_color (GimpChannel *channel)
|
2019-08-14 03:36:03 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2023-11-20 07:20:03 +08:00
|
|
|
GeglColor *color = NULL;
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
2019-08-14 03:36:03 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-get-color",
|
|
|
|
args);
|
2019-08-14 03:36:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2023-11-20 07:20:03 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
color = g_value_dup_object (gimp_value_array_index (return_vals, 1));
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2023-11-20 07:20:03 +08:00
|
|
|
return color;
|
2019-08-14 03:36:03 +08:00
|
|
|
}
|
|
|
|
|
2001-01-26 02:23:30 +08:00
|
|
|
/**
|
|
|
|
* gimp_channel_set_color:
|
2019-08-14 03:36:03 +08:00
|
|
|
* @channel: The channel.
|
2001-01-26 02:23:30 +08:00
|
|
|
* @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
|
2023-11-20 07:20:03 +08:00
|
|
|
gimp_channel_set_color (GimpChannel *channel,
|
|
|
|
GeglColor *color)
|
2001-01-26 02:23:30 +08:00
|
|
|
{
|
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-14 03:36:03 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
2023-11-20 07:20:03 +08:00
|
|
|
GEGL_TYPE_COLOR, color,
|
2019-08-14 03:36:03 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-channel-set-color",
|
|
|
|
args);
|
2019-08-14 03:36:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-14 03:36:03 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|