Skip to content

Latest commit

 

History

History
164 lines (103 loc) · 3.45 KB

File metadata and controls

164 lines (103 loc) · 3.45 KB

Gimppatpattern

Gimpformats Index / Gimpformats / Gimppatpattern

Auto-generated documentation for gimpformats.GimpPatPattern module.

GimpPatPattern

Show source in GimpPatPattern.py:14

Pure python implementation of a gimp pattern file.

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

Signature

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

GimpPatPattern().repr

Show source in GimpPatPattern.py:141

Get a textual representation of this object.

Signature

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

GimpPatPattern().str

Show source in GimpPatPattern.py:137

Get a textual representation of this object.

Signature

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

GimpPatPattern().decode

Show source in GimpPatPattern.py:51

Decode a byte buffer.

Arguments


  • data bytearray - data to decode
  • index int, optional - index to start from. Defaults to 0.

Raises


  • RuntimeError - "File format error. Magic value mismatch."

Returns


  • int - pointer

Signature

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

GimpPatPattern().encode

Show source in GimpPatPattern.py:85

Encode to a byte buffer.

Signature

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

GimpPatPattern().image

Show source in GimpPatPattern.py:107

Get a final, compiled image.

Signature

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

GimpPatPattern().image

Show source in GimpPatPattern.py:116

Signature

@image.setter
def image(self, image: Image.Image) -> None: ...

GimpPatPattern().load

Show source in GimpPatPattern.py:43

Load a gimp file.

Arguments

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

Signature

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

GimpPatPattern().save

Show source in GimpPatPattern.py:121

Save this gimp image to a file.

Signature

def save(
    self, tofileName: Path | str | BytesIO, toExtension: str | None = None
) -> None: ...

GimpPatPattern().size

Show source in GimpPatPattern.py:102

The size of the pattern.

Signature

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