summaryrefslogtreecommitdiff
path: root/gerber/render/render.py
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2015-07-09 03:54:47 -0300
committerPaulo Henrique Silva <ph.silva@gmail.com>2015-07-09 03:54:47 -0300
commit5aaf18889c3cdc31ae61b9593bf5848bc57ec09a (patch)
treefe6dfa0cb55dc3b4dcc31e0fdc0fe3f7a2acb465 /gerber/render/render.py
parent9e36d7e21d2906e22c91350ea0fee0d989d58584 (diff)
downloadgerbonara-5aaf18889c3cdc31ae61b9593bf5848bc57ec09a.tar.gz
gerbonara-5aaf18889c3cdc31ae61b9593bf5848bc57ec09a.tar.bz2
gerbonara-5aaf18889c3cdc31ae61b9593bf5848bc57ec09a.zip
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.
Diffstat (limited to 'gerber/render/render.py')
-rw-r--r--gerber/render/render.py9
1 files changed, 9 insertions, 0 deletions
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)