pygerber.parser.pillow package

Subpackages

Submodules

pygerber.parser.pillow.api module

class pygerber.parser.pillow.api.PillowLayerSpec(file_path: 'str', colors: 'ColorSet')[source]

Bases: pygerber.parser.project_spec.LayerSpecBase

colors: pygerber.parser.pillow.parser.ColorSet
file_path: str
classmethod load(contents: Dict)[source]
class pygerber.parser.pillow.api.PillowProjectSpec(init_spec: Dict)[source]

Bases: pygerber.parser.project_spec.ProjectSpecBase

property LayerSpecClass: pygerber.parser.pillow.api.PillowLayerSpec
dpi: int = 600
ignore_deprecated: bool = True
image_padding: int = 0
layers: List[pygerber.parser.pillow.api.PillowLayerSpec] = []
render() PIL.Image.Image[source]

pygerber.parser.pillow.cli module

pygerber.parser.pillow.cli.handle_pillow_cli(args)[source]

pygerber.parser.pillow.parser module

class pygerber.parser.pillow.parser.ColorSet(dark: 'Color_Type', clear: 'Color_Type' = (0, 0, 0, 0), background: 'Color_Type' = (0, 0, 0, 0))[source]

Bases: object

background: Tuple[float, float, float, float] = (0, 0, 0, 0)
clear: Tuple[float, float, float, float] = (0, 0, 0, 0)
dark: Tuple[float, float, float, float]
exception pygerber.parser.pillow.parser.ImageSizeNullError[source]

Bases: IndexError

class pygerber.parser.pillow.parser.ParserWithPillow(*, ignore_deprecated: bool = True, dpi: int = 600, colors: pygerber.parser.pillow.parser.ColorSet = ColorSet(dark=(66, 166, 66, 255), clear=(16, 66, 36, 255), background=(0, 0, 0, 0)), image_padding: int = 0)[source]

Bases: pygerber.parser.parser.AbstractParser

apertureSet: ApertureSet = ApertureSet(circle=<class 'pygerber.parser.pillow.apertures.circle.PillowCircle'>, rectangle=<class 'pygerber.parser.pillow.apertures.rectangle.PillowRectangle'>, obround=<class 'pygerber.parser.pillow.apertures.obround.PillowObround'>, polygon=<class 'pygerber.parser.pillow.apertures.polygon.PillowPolygon'>, custom=<class 'pygerber.parser.pillow.apertures.custom.PillowCustom'>, region=<class 'pygerber.parser.pillow.apertures.region.PillowRegion'>)
property canvas: PIL.Image.Image
get_image() PIL.Image.Image[source]
is_rendered: bool
save(file_path: str, format: Optional[str] = None) None[source]

Saves rendered image. file_path A filename (string), pathlib.Path object or file object. format Optional format override. If omitted, the format to use is determined from the filename extension. If a file object was used instead of a filename, this parameter should always be used.

Module contents