gimp/libgimp/gimpchannel_pdb.c

439 lines
13 KiB
C
Raw Normal View History

Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> Episode IV... * app/Makefile.am * app/message_cmds.c: new name * app/interface_cmds.c: removed * app/help_cmds.c: new name * app/gimphelp_cmds.c: removed * app/internal_procs.c * app/gimphelp_cmds.c * app/plug_in_cmds.c: moved gimp_plugin_help_register to plug_in_cmds.c, s/gimp_plugin_domain_add/gimp_plugin_domain_register/ * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimpfileops_pdb.[ch] * libgimp/gimpguides_pdb.[ch] * libgimp/gimpmessage_pdb.[ch] * libgimp/gimpprocedural_db_pdb.[ch] * libgimp/gimpplugin_pdb.[ch]: new files containing PDB wrappers moved out of libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdisplay_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch] * libgimp/gimphelp_pdb.[ch] * libgimp/gimpimage_pdb.[ch] * libgimp/gimplayer_pdb.c * libgimp/gimpparasite_pdb.c * libgimp/gimpselection_pdb.c: various changes. * libgimp/gimpunit.c: new file * libgimp/gimpunit_pdb.[ch]: contains only PDB wrappers prefixed with "_" which are called from libgimp/gimpunit.c only. * libgimp/gimpunit.h: minor stuff * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_query_database gimp_query_images * libgimp/gimp.[ch]: removed all PDB wrappers. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: changed * tools/pdbgen/lib.pl: tried to fix libgimp autogeneration and fixed just a few comments. * tools/pdbgen/pdb/interface.pdb * tools/pdbgen/pdb/gimphelp.pdb: removed * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb: new names * plug-ins/script-fu/script-fu.c * plug-ins/perl/Gimp/Lib.xs: s/gimp_plugin_domain_add/gimp_plugin_domain_register/ 2000-05-31 Michael Natterer <mitch@gimp.org> * POTFILES.in: s/gimpunit_pdb/gimpunit/
2000-05-31 21:24:14 +08:00
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> Episode IV... * app/Makefile.am * app/message_cmds.c: new name * app/interface_cmds.c: removed * app/help_cmds.c: new name * app/gimphelp_cmds.c: removed * app/internal_procs.c * app/gimphelp_cmds.c * app/plug_in_cmds.c: moved gimp_plugin_help_register to plug_in_cmds.c, s/gimp_plugin_domain_add/gimp_plugin_domain_register/ * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimpfileops_pdb.[ch] * libgimp/gimpguides_pdb.[ch] * libgimp/gimpmessage_pdb.[ch] * libgimp/gimpprocedural_db_pdb.[ch] * libgimp/gimpplugin_pdb.[ch]: new files containing PDB wrappers moved out of libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdisplay_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch] * libgimp/gimphelp_pdb.[ch] * libgimp/gimpimage_pdb.[ch] * libgimp/gimplayer_pdb.c * libgimp/gimpparasite_pdb.c * libgimp/gimpselection_pdb.c: various changes. * libgimp/gimpunit.c: new file * libgimp/gimpunit_pdb.[ch]: contains only PDB wrappers prefixed with "_" which are called from libgimp/gimpunit.c only. * libgimp/gimpunit.h: minor stuff * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_query_database gimp_query_images * libgimp/gimp.[ch]: removed all PDB wrappers. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: changed * tools/pdbgen/lib.pl: tried to fix libgimp autogeneration and fixed just a few comments. * tools/pdbgen/pdb/interface.pdb * tools/pdbgen/pdb/gimphelp.pdb: removed * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb: new names * plug-ins/script-fu/script-fu.c * plug-ins/perl/Gimp/Lib.xs: s/gimp_plugin_domain_add/gimp_plugin_domain_register/ 2000-05-31 Michael Natterer <mitch@gimp.org> * POTFILES.in: s/gimpunit_pdb/gimpunit/
2000-05-31 21:24:14 +08:00
*
* gimpchannel_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
* version 3 of the License, or (at your option) any later version.
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> Episode IV... * app/Makefile.am * app/message_cmds.c: new name * app/interface_cmds.c: removed * app/help_cmds.c: new name * app/gimphelp_cmds.c: removed * app/internal_procs.c * app/gimphelp_cmds.c * app/plug_in_cmds.c: moved gimp_plugin_help_register to plug_in_cmds.c, s/gimp_plugin_domain_add/gimp_plugin_domain_register/ * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimpfileops_pdb.[ch] * libgimp/gimpguides_pdb.[ch] * libgimp/gimpmessage_pdb.[ch] * libgimp/gimpprocedural_db_pdb.[ch] * libgimp/gimpplugin_pdb.[ch]: new files containing PDB wrappers moved out of libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdisplay_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch] * libgimp/gimphelp_pdb.[ch] * libgimp/gimpimage_pdb.[ch] * libgimp/gimplayer_pdb.c * libgimp/gimpparasite_pdb.c * libgimp/gimpselection_pdb.c: various changes. * libgimp/gimpunit.c: new file * libgimp/gimpunit_pdb.[ch]: contains only PDB wrappers prefixed with "_" which are called from libgimp/gimpunit.c only. * libgimp/gimpunit.h: minor stuff * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_query_database gimp_query_images * libgimp/gimp.[ch]: removed all PDB wrappers. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: changed * tools/pdbgen/lib.pl: tried to fix libgimp autogeneration and fixed just a few comments. * tools/pdbgen/pdb/interface.pdb * tools/pdbgen/pdb/gimphelp.pdb: removed * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb: new names * plug-ins/script-fu/script-fu.c * plug-ins/perl/Gimp/Lib.xs: s/gimp_plugin_domain_add/gimp_plugin_domain_register/ 2000-05-31 Michael Natterer <mitch@gimp.org> * POTFILES.in: s/gimpunit_pdb/gimpunit/
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
* 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
* License along with this library. If not, see
* <https://www.gnu.org/licenses/>.
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> Episode IV... * app/Makefile.am * app/message_cmds.c: new name * app/interface_cmds.c: removed * app/help_cmds.c: new name * app/gimphelp_cmds.c: removed * app/internal_procs.c * app/gimphelp_cmds.c * app/plug_in_cmds.c: moved gimp_plugin_help_register to plug_in_cmds.c, s/gimp_plugin_domain_add/gimp_plugin_domain_register/ * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimpfileops_pdb.[ch] * libgimp/gimpguides_pdb.[ch] * libgimp/gimpmessage_pdb.[ch] * libgimp/gimpprocedural_db_pdb.[ch] * libgimp/gimpplugin_pdb.[ch]: new files containing PDB wrappers moved out of libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdisplay_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch] * libgimp/gimphelp_pdb.[ch] * libgimp/gimpimage_pdb.[ch] * libgimp/gimplayer_pdb.c * libgimp/gimpparasite_pdb.c * libgimp/gimpselection_pdb.c: various changes. * libgimp/gimpunit.c: new file * libgimp/gimpunit_pdb.[ch]: contains only PDB wrappers prefixed with "_" which are called from libgimp/gimpunit.c only. * libgimp/gimpunit.h: minor stuff * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_query_database gimp_query_images * libgimp/gimp.[ch]: removed all PDB wrappers. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: changed * tools/pdbgen/lib.pl: tried to fix libgimp autogeneration and fixed just a few comments. * tools/pdbgen/pdb/interface.pdb * tools/pdbgen/pdb/gimphelp.pdb: removed * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb: new names * plug-ins/script-fu/script-fu.c * plug-ins/perl/Gimp/Lib.xs: s/gimp_plugin_domain_add/gimp_plugin_domain_register/ 2000-05-31 Michael Natterer <mitch@gimp.org> * POTFILES.in: s/gimpunit_pdb/gimpunit/
2000-05-31 21:24:14 +08:00
*/
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 14:15:06 +08:00
/* NOTE: This file is auto-generated by pdbgen.pl */
1997-11-25 06:05:25 +08:00
#include "config.h"
#include "stamp-pdbgen.h"
#include "gimp.h"
1997-11-25 06:05:25 +08:00
/**
* SECTION: gimpchannel
* @title: gimpchannel
* @short_description: Functions for manipulating channels.
*
* Functions for manipulating channels.
**/
/**
* gimp_channel_new:
* @image: The image to which to add the channel.
* @name: The channel name.
* @width: The channel width.
* @height: The channel height.
* @opacity: The channel opacity.
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
* @color: The channel compositing color.
*
* Create a new channel.
*
* This procedure creates a new channel with the specified @width,
* @height, @name, @opacity and @color.
*
* Other attributes, such as channel visibility, should be set with
* explicit procedure calls.
*
* 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].
*
* The channel's contents are undefined initially.
*
* Returns: (transfer none): The newly created channel.
**/
GimpChannel *
gimp_channel_new (GimpImage *image,
const gchar *name,
gint width,
gint height,
gdouble opacity,
GeglColor *color)
1997-11-25 06:05:25 +08:00
{
GimpValueArray *args;
GimpValueArray *return_vals;
GimpChannel *channel = NULL;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
G_TYPE_STRING, name,
G_TYPE_INT, width,
G_TYPE_INT, height,
G_TYPE_DOUBLE, opacity,
GEGL_TYPE_COLOR, color,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-new",
args);
gimp_value_array_unref (args);
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
channel = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
gimp_value_array_unref (return_vals);
1997-11-25 06:05:25 +08:00
return channel;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_channel_new_from_component:
* @image: The image to which to add the channel.
* @component: The image component.
* @name: The channel name.
*
* Create a new channel from a color component
*
* 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
* automatic. Add the new channel with gimp_image_insert_channel().
* Other attributes, such as channel visibility, should be set with
* explicit procedure calls.
*
* Returns: (transfer none): The newly created channel.
*
* Since: 2.4
**/
GimpChannel *
gimp_channel_new_from_component (GimpImage *image,
GimpChannelType component,
const gchar *name)
{
GimpValueArray *args;
GimpValueArray *return_vals;
GimpChannel *channel = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
GIMP_TYPE_CHANNEL_TYPE, component,
G_TYPE_STRING, name,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-new-from-component",
args);
gimp_value_array_unref (args);
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
channel = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
gimp_value_array_unref (return_vals);
return channel;
}
/**
* gimp_channel_copy:
* @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().
*
* Returns: (transfer none): The newly copied channel.
**/
GimpChannel *
gimp_channel_copy (GimpChannel *channel)
{
GimpValueArray *args;
GimpValueArray *return_vals;
GimpChannel *channel_copy = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_CHANNEL, channel,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-copy",
args);
gimp_value_array_unref (args);
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
channel_copy = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
gimp_value_array_unref (return_vals);
return channel_copy;
}
/**
* gimp_channel_combine_masks:
* @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,
GIMP_TYPE_CHANNEL, channel1,
GIMP_TYPE_CHANNEL, channel2,
GIMP_TYPE_CHANNEL_OPS, operation,
G_TYPE_INT, offx,
G_TYPE_INT, offy,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-combine-masks",
args);
gimp_value_array_unref (args);
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_channel_get_show_masked:
* @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,
GIMP_TYPE_CHANNEL, channel,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-get-show-masked",
args);
gimp_value_array_unref (args);
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
show_masked = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
gimp_value_array_unref (return_vals);
return show_masked;
}
/**
* gimp_channel_set_show_masked:
* @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,
GIMP_TYPE_CHANNEL, channel,
G_TYPE_BOOLEAN, show_masked,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-set-show-masked",
args);
gimp_value_array_unref (args);
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_channel_get_opacity:
* @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,
GIMP_TYPE_CHANNEL, channel,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-get-opacity",
args);
gimp_value_array_unref (args);
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
opacity = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
gimp_value_array_unref (return_vals);
return opacity;
}
/**
* gimp_channel_set_opacity:
* @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,
GIMP_TYPE_CHANNEL, channel,
G_TYPE_DOUBLE, opacity,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-set-opacity",
args);
gimp_value_array_unref (args);
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_channel_get_color:
* @channel: The channel.
*
* Get the compositing color of the specified channel.
*
* This procedure returns the specified channel's compositing color.
*
* Returns: (transfer full): The channel compositing color.
**/
GeglColor *
gimp_channel_get_color (GimpChannel *channel)
{
GimpValueArray *args;
GimpValueArray *return_vals;
GeglColor *color = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_CHANNEL, channel,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-get-color",
args);
gimp_value_array_unref (args);
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
color = g_value_dup_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return color;
}
2001-01-26 02:23:30 +08:00
/**
* gimp_channel_set_color:
* @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.
**/
2001-01-26 02:23:30 +08:00
gboolean
gimp_channel_set_color (GimpChannel *channel,
GeglColor *color)
2001-01-26 02:23:30 +08:00
{
GimpValueArray *args;
GimpValueArray *return_vals;
2001-01-26 02:23:30 +08:00
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_CHANNEL, channel,
GEGL_TYPE_COLOR, color,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-channel-set-color",
args);
gimp_value_array_unref (args);
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}