Gimp.Channel¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gimp.Channel(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Functions for manipulating channels.
- classmethod get_by_id(channel_id)¶
- Parameters:
channel_id (
int
) – The channel id.- Returns:
a
Gimp.Channel
for channel_id orNone
if channel_id does not represent a valid channel. The object belongs to libgimp and you must not modify or unref it.- Return type:
Gimp.Channel
orNone
Returns a
Gimp.Channel
representing channel_id. This function callsGimp.Item.get_by_id
() and returns the item if it is channel orNone
otherwise.New in version 3.0.
- classmethod new(image, name, width, height, opacity, color)¶
- Parameters:
image (
Gimp.Image
) – The image to which to add the channel.name (
str
) – The channel name.width (
int
) – The channel width.height (
int
) – The channel height.opacity (
float
) – The channel opacity.color (
Gegl.Color
) – The channel compositing color.
- Returns:
The newly created channel.
- Return type:
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.
- classmethod new_from_component(image, component, name)¶
- Parameters:
image (
Gimp.Image
) – The image to which to add the channel.component (
Gimp.ChannelType
) – The image component.name (
str
) – The channel name.
- Returns:
The newly created channel.
- Return type:
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.New in version 2.4.
- combine_masks(channel2, operation, offx, offy)¶
- Parameters:
channel2 (
Gimp.Channel
) – The channel2.operation (
Gimp.ChannelOps
) – The selection operation.offx (
int
) – x offset between upper left corner of channels: (second - first).offy (
int
) – y offset between upper left corner of channels: (second - first).
- Returns:
True
on success.- Return type:
Combine two channel masks.
This procedure combines two channel masks. The result is stored in the first channel.
- copy()¶
- Returns:
The newly copied channel.
- Return type:
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
().
- get_color()¶
- Returns:
The channel compositing color.
- Return type:
Get the compositing color of the specified channel.
This procedure returns the specified channel’s compositing color.
- get_opacity()¶
- Returns:
The channel opacity.
- Return type:
Get the opacity of the specified channel.
This procedure returns the specified channel’s opacity.
- get_show_masked()¶
- Returns:
The channel composite method.
- Return type:
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.
- set_color(color)¶
- Parameters:
color (
Gegl.Color
) – The new channel compositing color.- Returns:
True
on success.- Return type:
Set the compositing color of the specified channel.
This procedure sets the specified channel’s compositing color.
- set_opacity(opacity)¶
-
Set the opacity of the specified channel.
This procedure sets the specified channel’s opacity.
- set_show_masked(show_masked)¶
- Parameters:
show_masked (
bool
) – The new channel composite method.- Returns:
True
on success.- Return type:
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.