1
/* LIBGIMP - The GIMP Library
2
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the
18
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
22
/* NOTE: This file is autogenerated by pdbgen.pl */
30
* @image_ID: The image to which to add the channel.
31
* @width: The channel width.
32
* @height: The channel height.
33
* @name: The channel name.
34
* @opacity: The channel opacity.
35
* @color: The channel compositing color.
37
* Create a new channel.
39
* This procedure creates a new channel with the specified width and
40
* height. Name, opacity, and color are also supplied parameters. The
41
* new channel still needs to be added to the image, as this is not
42
* automatic. Add the new channel with the 'gimp_image_add_channel'
43
* command. Other attributes such as channel show masked, should be set
44
* with explicit procedure calls. The channel's contents are undefined
47
* Returns: The newly created channel.
50
_gimp_channel_new (gint32 image_ID,
57
GimpParam *return_vals;
59
gint32 channel_ID = -1;
61
return_vals = gimp_run_procedure ("gimp_channel_new",
63
GIMP_PDB_IMAGE, image_ID,
64
GIMP_PDB_INT32, width,
65
GIMP_PDB_INT32, height,
66
GIMP_PDB_STRING, name,
67
GIMP_PDB_FLOAT, opacity,
68
GIMP_PDB_COLOR, color,
71
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
72
channel_ID = return_vals[1].data.d_channel;
74
gimp_destroy_params (return_vals, nreturn_vals);
81
* @channel_ID: The channel to copy.
85
* This procedure copies the specified channel and returns the copy.
87
* Returns: The newly copied channel.
90
gimp_channel_copy (gint32 channel_ID)
92
GimpParam *return_vals;
94
gint32 channel_copy_ID = -1;
96
return_vals = gimp_run_procedure ("gimp_channel_copy",
98
GIMP_PDB_CHANNEL, channel_ID,
101
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
102
channel_copy_ID = return_vals[1].data.d_channel;
104
gimp_destroy_params (return_vals, nreturn_vals);
106
return channel_copy_ID;
110
* gimp_channel_combine_masks:
111
* @channel1_ID: The channel1.
112
* @channel2_ID: The channel2.
113
* @operation: The selection operation.
114
* @offx: x offset between upper left corner of channels: (second - first).
115
* @offy: y offset between upper left corner of channels: (second - first).
117
* Combine two channel masks.
119
* This procedure combines two channel masks. The result is stored in
122
* Returns: TRUE on success.
125
gimp_channel_combine_masks (gint32 channel1_ID,
127
GimpChannelOps operation,
131
GimpParam *return_vals;
133
gboolean success = TRUE;
135
return_vals = gimp_run_procedure ("gimp_channel_combine_masks",
137
GIMP_PDB_CHANNEL, channel1_ID,
138
GIMP_PDB_CHANNEL, channel2_ID,
139
GIMP_PDB_INT32, operation,
140
GIMP_PDB_INT32, offx,
141
GIMP_PDB_INT32, offy,
144
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
146
gimp_destroy_params (return_vals, nreturn_vals);
152
* gimp_channel_get_show_masked:
153
* @channel_ID: The channel.
155
* Get the composite method of the specified channel.
157
* This procedure returns the specified channel's composite method. If
158
* it is non-zero, then the channel is composited with the image so
159
* that masked regions are shown. Otherwise, selected regions are
162
* Returns: The channel composite method.
165
gimp_channel_get_show_masked (gint32 channel_ID)
167
GimpParam *return_vals;
169
gboolean show_masked = FALSE;
171
return_vals = gimp_run_procedure ("gimp_channel_get_show_masked",
173
GIMP_PDB_CHANNEL, channel_ID,
176
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
177
show_masked = return_vals[1].data.d_int32;
179
gimp_destroy_params (return_vals, nreturn_vals);
185
* gimp_channel_set_show_masked:
186
* @channel_ID: The channel.
187
* @show_masked: The new channel composite method.
189
* Set the composite method of the specified channel.
191
* This procedure sets the specified channel's composite method. If it
192
* is non-zero, then the channel is composited with the image so that
193
* masked regions are shown. Otherwise, selected regions are shown.
195
* Returns: TRUE on success.
198
gimp_channel_set_show_masked (gint32 channel_ID,
199
gboolean show_masked)
201
GimpParam *return_vals;
203
gboolean success = TRUE;
205
return_vals = gimp_run_procedure ("gimp_channel_set_show_masked",
207
GIMP_PDB_CHANNEL, channel_ID,
208
GIMP_PDB_INT32, show_masked,
211
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
213
gimp_destroy_params (return_vals, nreturn_vals);
219
* gimp_channel_get_opacity:
220
* @channel_ID: The channel.
222
* Get the opacity of the specified channel.
224
* This procedure returns the specified channel's opacity.
226
* Returns: The channel opacity.
229
gimp_channel_get_opacity (gint32 channel_ID)
231
GimpParam *return_vals;
235
return_vals = gimp_run_procedure ("gimp_channel_get_opacity",
237
GIMP_PDB_CHANNEL, channel_ID,
240
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
241
opacity = return_vals[1].data.d_float;
243
gimp_destroy_params (return_vals, nreturn_vals);
249
* gimp_channel_set_opacity:
250
* @channel_ID: The channel.
251
* @opacity: The new channel opacity.
253
* Set the opacity of the specified channel.
255
* This procedure sets the specified channel's opacity.
257
* Returns: TRUE on success.
260
gimp_channel_set_opacity (gint32 channel_ID,
263
GimpParam *return_vals;
265
gboolean success = TRUE;
267
return_vals = gimp_run_procedure ("gimp_channel_set_opacity",
269
GIMP_PDB_CHANNEL, channel_ID,
270
GIMP_PDB_FLOAT, opacity,
273
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
275
gimp_destroy_params (return_vals, nreturn_vals);
281
* gimp_channel_get_color:
282
* @channel_ID: The channel.
283
* @color: The channel compositing color.
285
* Get the compositing color of the specified channel.
287
* This procedure returns the specified channel's compositing color.
289
* Returns: TRUE on success.
292
gimp_channel_get_color (gint32 channel_ID,
295
GimpParam *return_vals;
297
gboolean success = TRUE;
299
return_vals = gimp_run_procedure ("gimp_channel_get_color",
301
GIMP_PDB_CHANNEL, channel_ID,
304
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
307
*color = return_vals[1].data.d_color;
309
gimp_destroy_params (return_vals, nreturn_vals);
315
* gimp_channel_set_color:
316
* @channel_ID: The channel.
317
* @color: The new channel compositing color.
319
* Set the compositing color of the specified channel.
321
* This procedure sets the specified channel's compositing color.
323
* Returns: TRUE on success.
326
gimp_channel_set_color (gint32 channel_ID,
327
const GimpRGB *color)
329
GimpParam *return_vals;
331
gboolean success = TRUE;
333
return_vals = gimp_run_procedure ("gimp_channel_set_color",
335
GIMP_PDB_CHANNEL, channel_ID,
336
GIMP_PDB_COLOR, color,
339
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
341
gimp_destroy_params (return_vals, nreturn_vals);