Gimp.Pattern

g GObject.GInterface GObject.GInterface Gimp.ConfigInterface Gimp.ConfigInterface GObject.GInterface->Gimp.ConfigInterface GObject.Object GObject.Object Gimp.Resource Gimp.Resource GObject.Object->Gimp.Resource Gimp.ConfigInterface->Gimp.Resource Gimp.Pattern Gimp.Pattern Gimp.Resource->Gimp.Pattern

Subclasses:

None

Methods

Inherited:

Gimp.Resource (20), GObject.Object (37), Gimp.ConfigInterface (14)

Structs:

GObject.ObjectClass (5)

class

get_by_name (name)

get_buffer (max_width, max_height, format)

get_info ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gimp.Resource (1)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gimp.Pattern(**kwargs)
Bases:

Gimp.Resource

Abstract:

No

Structure:

Gimp.PatternClass

Installable object used by fill and clone tools.

classmethod get_by_name(name)
Parameters:

name (str) – The name of the pattern.

Returns:

The pattern.

Return type:

Gimp.Pattern or None

Returns the pattern with the given name.

Returns an existing pattern having the given name. Returns None when no pattern exists of that name.

New in version 3.0.

get_buffer(max_width, max_height, format)
Parameters:
  • max_width (int) – a maximum width for the returned buffer.

  • max_height (int) – a maximum height for the returned buffer.

  • format (Babl.Object) – an optional Babl.Object format.

Returns:

a [class`Gegl`.Buffer].

Return type:

Gegl.Buffer

Gets pixel data of the pattern within the bounding box specified by max_width and max_height. The data will be scaled down so that it fits within this size without changing its ratio. If the pattern is smaller than this size to begin with, it will not be scaled up.

If max_width or max_height are None, the buffer is returned in the pattern’s native size.

Make sure you called [func`Gegl`.init] before calling any function using GEGL.

get_info()
Returns:

True on success.

width:

The pattern width.

height:

The pattern height.

bpp:

The pattern bpp.

Return type:

(bool, width: int, height: int, bpp: int)

Gets information about the pattern.

Gets information about the pattern: the pattern extents (width and height) and bytes per pixel.

New in version 2.2.