From 5aaf18889c3cdc31ae61b9593bf5848bc57ec09a Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Thu, 9 Jul 2015 03:54:47 -0300 Subject: Initial patch to unify our render towards cairo This branch allows a pure cairo based render for both PNG and SVG. Cairo backend is mostly the same but with improved support for configurable scale, orientation and inverted color drawing. API is not yet final. --- gerber/render/render.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gerber/render/render.py') diff --git a/gerber/render/render.py b/gerber/render/render.py index 68c2115..124e743 100644 --- a/gerber/render/render.py +++ b/gerber/render/render.py @@ -62,6 +62,7 @@ class GerberContext(object): self._drill_color = (0.25, 0.25, 0.25) self._background_color = (0.0, 0.0, 0.0) self._alpha = 1.0 + self._invert = False @property def units(self): @@ -122,6 +123,14 @@ class GerberContext(object): raise ValueError('Alpha must be between 0.0 and 1.0') self._alpha = alpha + @property + def invert(self): + return self._invert + + @invert.setter + def invert(self, invert): + self._invert = invert + def render(self, primitive): color = (self.color if primitive.level_polarity == 'dark' else self.background_color) -- cgit