gimpchannel

gimpchannel — Functions for manipulating channels.

Functions

Object Hierarchy

    GObject
    ╰── GimpItem
        ╰── GimpDrawable
            ╰── GimpChannel
                ├── GimpLayerMask
                ╰── GimpSelection

Description

Functions for manipulating channels.

Functions

gimp_channel_get_by_id ()

GimpChannel *
gimp_channel_get_by_id (gint32 channel_id);

Returns a GimpChannel representing channel_id . This function calls gimp_item_get_by_id() and returns the item if it is channel or NULL otherwise.

Parameters

channel_id

The channel id.

 

Returns

a GimpChannel for channel_id or NULL if channel_id does not represent a valid channel. The object belongs to libgimp and you must not modify or unref it.

[nullable][transfer none]

Since: 3.0


gimp_channel_new ()

GimpChannel *
gimp_channel_new (GimpImage *image,
                  const gchar *name,
                  guint width,
                  guint height,
                  gdouble opacity,
                  const GimpRGB *color);

Create a new channel.

This procedure creates a new channel with the specified width and height. Name, opacity, and color are also supplied parameters. The new channel still needs to be added to the image, as this is not automatic. Add the new channel with the gimp_image_insert_channel() command. Other attributes such as channel show masked, should be set with explicit procedure calls. The channel's contents are undefined initially.

Parameters

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.

 

color

The channel compositing color.

 

Returns

The newly created channel. The object belongs to libgimp and you should not free it.

[transfer none]


gimp_channel_new_from_component ()

GimpChannel *
gimp_channel_new_from_component (GimpImage *image,
                                 GimpChannelType component,
                                 const gchar *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.

Parameters

image

The image to which to add the channel.

 

component

The image component.

 

name

The channel name.

 

Returns

The newly created channel.

[transfer none]

Since: 2.4


gimp_channel_copy ()

GimpChannel *
gimp_channel_copy (GimpChannel *channel);

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().

Parameters

channel

The channel to copy.

 

Returns

The newly copied channel.

[transfer none]


gimp_channel_get_show_masked ()

gboolean
gimp_channel_get_show_masked (GimpChannel *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.

Parameters

channel

The channel.

 

Returns

The channel composite method.


gimp_channel_set_show_masked ()

gboolean
gimp_channel_set_show_masked (GimpChannel *channel,
                              gboolean show_masked);

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.

Parameters

channel

The channel.

 

show_masked

The new channel composite method.

 

Returns

TRUE on success.


gimp_channel_get_opacity ()

gdouble
gimp_channel_get_opacity (GimpChannel *channel);

Get the opacity of the specified channel.

This procedure returns the specified channel's opacity.

Parameters

channel

The channel.

 

Returns

The channel opacity.


gimp_channel_set_opacity ()

gboolean
gimp_channel_set_opacity (GimpChannel *channel,
                          gdouble opacity);

Set the opacity of the specified channel.

This procedure sets the specified channel's opacity.

Parameters

channel

The channel.

 

opacity

The new channel opacity.

 

Returns

TRUE on success.


gimp_channel_get_color ()

gboolean
gimp_channel_get_color (GimpChannel *channel,
                        GimpRGB *color);

Get the compositing color of the specified channel.

This procedure returns the specified channel's compositing color.

Parameters

channel

The channel.

 

color

The channel compositing color.

[out caller-allocates]

Returns

TRUE on success.


gimp_channel_set_color ()

gboolean
gimp_channel_set_color (GimpChannel *channel,
                        const GimpRGB *color);

Set the compositing color of the specified channel.

This procedure sets the specified channel's compositing color.

Parameters

channel

The channel.

 

color

The new channel compositing color.

 

Returns

TRUE on success.


gimp_channel_combine_masks ()

gboolean
gimp_channel_combine_masks (GimpChannel *channel1,
                            GimpChannel *channel2,
                            GimpChannelOps operation,
                            gint offx,
                            gint offy);

Combine two channel masks.

This procedure combines two channel masks. The result is stored in the first channel.

Parameters

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).

 

Returns

TRUE on success.