Skip to content

Latest commit

 

History

History
158 lines (99 loc) · 3.31 KB

GimpGbrBrush.md

File metadata and controls

158 lines (99 loc) · 3.31 KB

Gimpgbrbrush

Gimpformats Index / Gimpformats / Gimpgbrbrush

Auto-generated documentation for gimpformats.GimpGbrBrush module.

GimpGbrBrush

Show source in GimpGbrBrush.py:16

Pure python implementation of the gimp gbr brush format.

See: https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/gbr.txt

Signature

class GimpGbrBrush:
    def __init__(self, fileName: str | None = None) -> None: ...

GimpGbrBrush().repr

Show source in GimpGbrBrush.py:149

Get a textual representation of this object.

Signature

def __repr__(self, indent: int = 0) -> str: ...

GimpGbrBrush().str

Show source in GimpGbrBrush.py:145

Get a textual representation of this object.

Signature

def __str__(self) -> str: ...

GimpGbrBrush().decode

Show source in GimpGbrBrush.py:53

Decode a byte buffer.

Arguments


  • data bytes - data buffer to decode
  • index int, optional - index within the buffer to start at. Defaults to 0.

Raises


  • RuntimeError - "unknown brush version"
  • RuntimeError - "File format error. Magic value mismatch"

Returns


  • int - offset]

Signature

def decode(self, data: bytes, index: int = 0) -> int: ...

GimpGbrBrush().encode

Show source in GimpGbrBrush.py:96

Encode this object to byte array.

Signature

def encode(self) -> bytearray: ...

GimpGbrBrush().image

Show source in GimpGbrBrush.py:115

Get a final, compiled image.

Signature

@property
def image(self) -> PIL.Image.Image | None: ...

GimpGbrBrush().load

Show source in GimpGbrBrush.py:45

Load a gimp file.

Arguments

  • fileName - can be a file name or a file-like object

Signature

def load(self, fileName: BytesIO | str) -> None: ...

GimpGbrBrush().save

Show source in GimpGbrBrush.py:122

Save this GIMP image to a file.

Arguments


  • filename str - The name of the file to save.
  • extension str, optional - The extension of the file. If not provided, it will be inferred from the filename.

Signature

def save(self, filename: str, extension: str | None = None) -> None: ...

GimpGbrBrush().size

Show source in GimpGbrBrush.py:110

Get the size.

Signature

@property
def size(self) -> tuple[int, int]: ...