summaryrefslogtreecommitdiff
path: root/shared-bindings/vectorio/__init__.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-05-12 18:22:57 -0700
committerGitHub <noreply@github.com>2020-05-12 18:22:57 -0700
commit277e8d528bef84cefe854d527bf5f822e0ec8ceb (patch)
treebeaa452a5dacf21e663a884e358e2ac2d223b777 /shared-bindings/vectorio/__init__.c
parentbc40034a08a7c3b371a13610a896e1ca40c4a329 (diff)
parent75f9969860870a4ae636c74ae210275413b13c2f (diff)
Merge branch 'master' into Optical-Encoder-Module
Diffstat (limited to 'shared-bindings/vectorio/__init__.c')
-rw-r--r--shared-bindings/vectorio/__init__.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/shared-bindings/vectorio/__init__.c b/shared-bindings/vectorio/__init__.c
new file mode 100644
index 000000000..b9e3828bd
--- /dev/null
+++ b/shared-bindings/vectorio/__init__.c
@@ -0,0 +1,46 @@
+#include <stdint.h>
+
+#include "py/obj.h"
+#include "py/runtime.h"
+
+#include "shared-bindings/vectorio/Circle.h"
+#include "shared-bindings/vectorio/Polygon.h"
+#include "shared-bindings/vectorio/Rectangle.h"
+#include "shared-bindings/vectorio/VectorShape.h"
+
+//| :mod:`vectorio` --- Lightweight 2d shapes for displays
+//| =========================================================================
+//|
+//| .. module:: vectorio
+//| :synopsis: Adds vector graphics to displayio
+//| :platform: SAMD21, SAMD51, nRF52
+//|
+//| The `vectorio` module contains classes to construct shapes
+//| by describing their points rather than providing them in bitmaps.
+//|
+//| Libraries
+//|
+//| .. toctree::
+//| :maxdepth: 3
+//|
+//| Circle
+//| Polygon
+//| Rectangle
+//| VectorShape
+//|
+
+
+STATIC const mp_rom_map_elem_t vectorio_module_globals_table[] = {
+ { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_vectorio) },
+ { MP_ROM_QSTR(MP_QSTR_Circle), MP_ROM_PTR(&vectorio_circle_type) },
+ { MP_ROM_QSTR(MP_QSTR_Polygon), MP_ROM_PTR(&vectorio_polygon_type) },
+ { MP_ROM_QSTR(MP_QSTR_Rectangle), MP_ROM_PTR(&vectorio_rectangle_type) },
+ { MP_ROM_QSTR(MP_QSTR_VectorShape), MP_ROM_PTR(&vectorio_vector_shape_type) },
+};
+
+STATIC MP_DEFINE_CONST_DICT(vectorio_module_globals, vectorio_module_globals_table);
+
+const mp_obj_module_t vectorio_module = {
+ .base = { &mp_type_module },
+ .globals = (mp_obj_dict_t*)&vectorio_module_globals,
+};