Gimp.DrawableFilter

g GObject.Object GObject.Object Gimp.DrawableFilter Gimp.DrawableFilter GObject.Object->Gimp.DrawableFilter

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_by_id (filter_id)

class

id_is_valid (filter_id)

class

new (drawable, operation_name, name)

delete ()

get_blend_mode ()

get_config ()

get_id ()

get_name ()

get_opacity ()

get_operation_name ()

get_visible ()

is_valid ()

set_aux_input (input_pad_name, input)

set_blend_mode (mode)

set_opacity (opacity)

set_visible (visible)

update ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

id

int

r/w/co

The drawable_filter id for internal use

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gimp.DrawableFilter(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gimp.DrawableFilterClass

Operations on drawable filters: creation, editing.

classmethod get_by_id(filter_id)
Parameters:

filter_id (int) – The Gimp.DrawableFilter id.

Returns:

a Gimp.DrawableFilter for filter_id or None if filter_id does not represent a valid drawable’s filter. The object belongs to libgimp and you must not modify or unref it.

Return type:

Gimp.DrawableFilter or None

New in version 3.0.

classmethod id_is_valid(filter_id)
Parameters:

filter_id (int) – The filter ID to check.

Returns:

Whether the filter ID is valid.

Return type:

bool

Returns True if the drawable filter ID is valid.

This procedure checks if the given drawable filter ID is valid and refers to an existing filter.

New in version 3.0.

classmethod new(drawable, operation_name, name)
Parameters:
  • drawable (Gimp.Drawable) – The drawable.

  • operation_name (str) – The GEGL operation’s name.

  • name (str or None) – The effect name.

Returns:

The newly created filter.

Return type:

Gimp.DrawableFilter

Create a new drawable filter.

This procedure creates a new filter for the specified operation on drawable. The new effect still needs to be either added or merged to drawable later. Add the effect non-destructively with [method`Gimp`.Drawable.append_filter]. Currently only layers can have non-destructive effects. The effects must be merged for all other types of drawable.

New in version 3.0.

delete()
Returns:

True on success.

Return type:

bool

Delete a drawable filter.

This procedure deletes the specified filter. This must not be done if the drawable whose this filter was applied to was already deleted or if the drawable was already removed from the image. Do not use anymore the self object after having deleted it.

New in version 3.0.

get_blend_mode()
Returns:

The effect blending mode.

Return type:

Gimp.LayerMode

Get the blending mode of the specified filter.

This procedure returns the specified filter’s mode.

New in version 3.0.

get_config()
Returns:

The Gimp.DrawableFilterConfig. Further calls will return the same object.

Return type:

Gimp.DrawableFilterConfig

Get the Gimp.Config with properties that match self's arguments.

The config object will be created at the first call of this method and its properties will be synced with the settings of this filter as set in the core application.

Further changes to the config’s properties are not synced back immediately with the core application. Use [method`Gimp`.Drawable.update] to trigger an actual update.

New in version 3.0.

get_id()
Returns:

the drawable’s filter ID.

Return type:

int

New in version 3.0.

get_name()
Returns:

The filter’s name. The returned value must be freed with GLib.free().

Return type:

str

Get a drawable filter’s name.

This procedure returns the specified filter’s name. Since it is not possible to set a drawable filter’s name yet, this will be the operation’s name. Eventually this filter’s name will be a free form field so do not rely on this information for any processing.

New in version 3.0.

get_opacity()
Returns:

The filter’s opacity.

Return type:

float

Get the opacity of the specified filter.

This procedure returns the specified filter’s opacity.

New in version 3.0.

get_operation_name()
Returns:

The filter’s operation name. The returned value must be freed with GLib.free().

Return type:

str

Get a drawable filter’s operation name.

This procedure returns the specified filter’s operation name.

New in version 3.0.

get_visible()
Returns:

The filter visibility.

Return type:

bool

Get the visibility of the specified filter.

This procedure returns the specified filter’s visibility.

New in version 3.0.

is_valid()
Returns:

Whether drawable_filter is valid.

Return type:

bool

Returns True if the drawable_filter is valid.

This procedure checks if the given filter is valid and refers to an existing Gimp.DrawableFilter.

New in version 3.0.

set_aux_input(input_pad_name, input)
Parameters:
  • input_pad_name (str) – name of the filter’s input pad.

  • input (Gimp.Drawable) – the drawable to use as auxiliary input.

When a filter has one or several auxiliary inputs, you can use this function to set them.

The change is not synced immediately with the core application. Use [method`Gimp`.Drawable.update] to trigger an actual update.

New in version 3.0.

set_blend_mode(mode)
Parameters:

mode (Gimp.LayerMode) – blend mode.

This procedure sets the blend mode of self.

The change is not synced immediately with the core application. Use [method`Gimp`.Drawable.update] to trigger an actual update.

New in version 3.0.

set_opacity(opacity)
Parameters:

opacity (float) – the opacity.

This procedure sets the opacity of self on a range from 0.0 (transparent) to 1.0 (opaque).

The change is not synced immediately with the core application. Use [method`Gimp`.Drawable.update] to trigger an actual update.

New in version 3.0.

set_visible(visible)
Parameters:

visible (bool) – The new filter visibility.

Returns:

True on success.

Return type:

bool

Set the visibility of the specified filter.

This procedure sets the specified filter’s visibility. The drawable won’t be immediately rendered. Use [method`Gimp`.Drawable.update] to trigger an update.

New in version 3.0.

update()

Syncs the Gimp.Config with properties that match self's arguments. This procedure updates the settings of the specified filter all at once, including the arguments of the [class`Gimp`.DrawableFilterConfig] obtained with [method`Gimp`.DrawableFilter.get_config] as well as the blend mode and opacity.

In particular, if the image is displayed, rendering will be frozen and will happen only once for all changed settings.

New in version 3.0.

Property Details

Gimp.DrawableFilter.props.id
Name:

id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The drawable_filter id for internal use