From 7922f13add1a6f9726b1d96122ed32ddcbed40f8 Mon Sep 17 00:00:00 2001 From: SolidHal Date: Sat, 20 Aug 2022 13:50:31 -0500 Subject: [PATCH 1/2] Add RGBMatrix::DeleteFrameCanvas(FrameCanvas*) And associated python bindings Enables the user to direct the RGBMatrix to free FrameCanvas objects to avoid wasting memory --- bindings/python/rgbmatrix/core.cpp | 198 ++++++++++++++++++--------- bindings/python/rgbmatrix/core.pyx | 19 +++ bindings/python/rgbmatrix/cppinc.pxd | 1 + include/led-matrix.h | 13 +- lib/led-matrix.cc | 23 +++- 5 files changed, 186 insertions(+), 68 deletions(-) diff --git a/bindings/python/rgbmatrix/core.cpp b/bindings/python/rgbmatrix/core.cpp index c7fc3d0d6..23c1ae91e 100644 --- a/bindings/python/rgbmatrix/core.cpp +++ b/bindings/python/rgbmatrix/core.cpp @@ -1761,7 +1761,8 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_4Fill(struct __pyx_obj_9rg static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6SetPixel(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, int __pyx_v_x, int __pyx_v_y, uint8_t __pyx_v_red, uint8_t __pyx_v_green, uint8_t __pyx_v_blue); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_8Clear(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10CreateFrameCanvas(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12SwapOnVSync(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_newFrame, uint8_t __pyx_v_framerate_fraction); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12DeleteFrameCanvas(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_frame); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_14SwapOnVSync(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_newFrame, uint8_t __pyx_v_framerate_fraction); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect___get__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect_2__set__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, PyObject *__pyx_v_luminanceCorrect); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits___get__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ @@ -1770,8 +1771,8 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness___get__(struc static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness_2__set__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, PyObject *__pyx_v_brightness); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6height___get__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_5width___get__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_9rgbmatrix_4core_Canvas(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_9rgbmatrix_4core_FrameCanvas(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -7309,7 +7310,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_8Clear(struct __pyx_obj_9r * def Clear(self): * self.__matrix.Clear() # <<<<<<<<<<<<<< * - * def CreateFrameCanvas(self): + * # Create a new buffer to be used for multi-buffering. The returned new */ __pyx_v_self->__pyx___matrix->Clear(); @@ -7328,9 +7329,9 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_8Clear(struct __pyx_obj_9r return __pyx_r; } -/* "rgbmatrix/core.pyx":233 - * self.__matrix.Clear() - * +/* "rgbmatrix/core.pyx":245 + * # memory as they are only deleted when the RGBMatrix is deleted or by + * # calling DeleteFrameCanvas(). * def CreateFrameCanvas(self): # <<<<<<<<<<<<<< * return __createFrameCanvas(self.__matrix.CreateFrameCanvas()) * @@ -7358,23 +7359,23 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10CreateFrameCanvas(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("CreateFrameCanvas", 0); - /* "rgbmatrix/core.pyx":234 - * + /* "rgbmatrix/core.pyx":246 + * # calling DeleteFrameCanvas(). * def CreateFrameCanvas(self): * return __createFrameCanvas(self.__matrix.CreateFrameCanvas()) # <<<<<<<<<<<<<< * - * def SwapOnVSync(self, FrameCanvas newFrame, uint8_t framerate_fraction = 1): + * # Delete a FrameCanvas associated with the RGBMatrix */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_9rgbmatrix_4core___createFrameCanvas(__pyx_v_self->__pyx___matrix->CreateFrameCanvas()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __pyx_f_9rgbmatrix_4core___createFrameCanvas(__pyx_v_self->__pyx___matrix->CreateFrameCanvas()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "rgbmatrix/core.pyx":233 - * self.__matrix.Clear() - * + /* "rgbmatrix/core.pyx":245 + * # memory as they are only deleted when the RGBMatrix is deleted or by + * # calling DeleteFrameCanvas(). * def CreateFrameCanvas(self): # <<<<<<<<<<<<<< * return __createFrameCanvas(self.__matrix.CreateFrameCanvas()) * @@ -7391,17 +7392,87 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10CreateFrameCanvas(struct return __pyx_r; } -/* "rgbmatrix/core.pyx":236 - * return __createFrameCanvas(self.__matrix.CreateFrameCanvas()) +/* "rgbmatrix/core.pyx":251 + * # Otherwise FrameCanvas objects created by CreateFrameCanvas() are never deleted + * # until the RGBMatrix is deleted + * def DeleteFrameCanvas(self, FrameCanvas frame): # <<<<<<<<<<<<<< + * self.__matrix.DeleteFrameCanvas(frame.__canvas) + * del frame + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13DeleteFrameCanvas(PyObject *__pyx_v_self, PyObject *__pyx_v_frame); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13DeleteFrameCanvas(PyObject *__pyx_v_self, PyObject *__pyx_v_frame) { + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("DeleteFrameCanvas (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame), __pyx_ptype_9rgbmatrix_4core_FrameCanvas, 1, "frame", 0))) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_12DeleteFrameCanvas(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), ((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_frame)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12DeleteFrameCanvas(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_frame) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("DeleteFrameCanvas", 0); + __Pyx_INCREF((PyObject *)__pyx_v_frame); + + /* "rgbmatrix/core.pyx":252 + * # until the RGBMatrix is deleted + * def DeleteFrameCanvas(self, FrameCanvas frame): + * self.__matrix.DeleteFrameCanvas(frame.__canvas) # <<<<<<<<<<<<<< + * del frame * + */ + __pyx_v_self->__pyx___matrix->DeleteFrameCanvas(__pyx_v_frame->__pyx___canvas); + + /* "rgbmatrix/core.pyx":253 + * def DeleteFrameCanvas(self, FrameCanvas frame): + * self.__matrix.DeleteFrameCanvas(frame.__canvas) + * del frame # <<<<<<<<<<<<<< + * + * # The optional "framerate_fraction" parameter allows to choose which + */ + __Pyx_DECREF(((PyObject *)__pyx_v_frame)); + __pyx_v_frame = NULL; + + /* "rgbmatrix/core.pyx":251 + * # Otherwise FrameCanvas objects created by CreateFrameCanvas() are never deleted + * # until the RGBMatrix is deleted + * def DeleteFrameCanvas(self, FrameCanvas frame): # <<<<<<<<<<<<<< + * self.__matrix.DeleteFrameCanvas(frame.__canvas) + * del frame + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XDECREF((PyObject *)__pyx_v_frame); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "rgbmatrix/core.pyx":263 + * # If you combine this with RGBMatrixOptions.limit_refresh_rate_hz you can create + * # time-correct animations. * def SwapOnVSync(self, FrameCanvas newFrame, uint8_t framerate_fraction = 1): # <<<<<<<<<<<<<< * return __createFrameCanvas(self.__matrix.SwapOnVSync(newFrame.__canvas, framerate_fraction)) * */ /* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13SwapOnVSync(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13SwapOnVSync(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_15SwapOnVSync(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_15SwapOnVSync(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_newFrame = 0; uint8_t __pyx_v_framerate_fraction; int __pyx_lineno = 0; @@ -7437,7 +7508,7 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13SwapOnVSync(PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SwapOnVSync") < 0)) __PYX_ERR(0, 236, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SwapOnVSync") < 0)) __PYX_ERR(0, 263, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7450,21 +7521,21 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13SwapOnVSync(PyObject *__ } __pyx_v_newFrame = ((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)values[0]); if (values[1]) { - __pyx_v_framerate_fraction = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_framerate_fraction == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L3_error) + __pyx_v_framerate_fraction = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_framerate_fraction == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 263, __pyx_L3_error) } else { __pyx_v_framerate_fraction = ((uint8_t)1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SwapOnVSync", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SwapOnVSync", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 263, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.SwapOnVSync", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newFrame), __pyx_ptype_9rgbmatrix_4core_FrameCanvas, 1, "newFrame", 0))) __PYX_ERR(0, 236, __pyx_L1_error) - __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_12SwapOnVSync(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), __pyx_v_newFrame, __pyx_v_framerate_fraction); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newFrame), __pyx_ptype_9rgbmatrix_4core_FrameCanvas, 1, "newFrame", 0))) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_14SwapOnVSync(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), __pyx_v_newFrame, __pyx_v_framerate_fraction); /* function exit code */ goto __pyx_L0; @@ -7475,7 +7546,7 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13SwapOnVSync(PyObject *__ return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12SwapOnVSync(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_newFrame, uint8_t __pyx_v_framerate_fraction) { +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_14SwapOnVSync(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_newFrame, uint8_t __pyx_v_framerate_fraction) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -7484,23 +7555,23 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12SwapOnVSync(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SwapOnVSync", 0); - /* "rgbmatrix/core.pyx":237 - * + /* "rgbmatrix/core.pyx":264 + * # time-correct animations. * def SwapOnVSync(self, FrameCanvas newFrame, uint8_t framerate_fraction = 1): * return __createFrameCanvas(self.__matrix.SwapOnVSync(newFrame.__canvas, framerate_fraction)) # <<<<<<<<<<<<<< * * property luminanceCorrect: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_9rgbmatrix_4core___createFrameCanvas(__pyx_v_self->__pyx___matrix->SwapOnVSync(__pyx_v_newFrame->__pyx___canvas, __pyx_v_framerate_fraction)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __pyx_f_9rgbmatrix_4core___createFrameCanvas(__pyx_v_self->__pyx___matrix->SwapOnVSync(__pyx_v_newFrame->__pyx___canvas, __pyx_v_framerate_fraction)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "rgbmatrix/core.pyx":236 - * return __createFrameCanvas(self.__matrix.CreateFrameCanvas()) - * + /* "rgbmatrix/core.pyx":263 + * # If you combine this with RGBMatrixOptions.limit_refresh_rate_hz you can create + * # time-correct animations. * def SwapOnVSync(self, FrameCanvas newFrame, uint8_t framerate_fraction = 1): # <<<<<<<<<<<<<< * return __createFrameCanvas(self.__matrix.SwapOnVSync(newFrame.__canvas, framerate_fraction)) * @@ -7517,7 +7588,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12SwapOnVSync(struct __pyx return __pyx_r; } -/* "rgbmatrix/core.pyx":240 +/* "rgbmatrix/core.pyx":267 * * property luminanceCorrect: * def __get__(self): return self.__matrix.luminance_correct() # <<<<<<<<<<<<<< @@ -7547,7 +7618,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect___get__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___matrix->luminance_correct()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___matrix->luminance_correct()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7564,7 +7635,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect___get__ return __pyx_r; } -/* "rgbmatrix/core.pyx":241 +/* "rgbmatrix/core.pyx":268 * property luminanceCorrect: * def __get__(self): return self.__matrix.luminance_correct() * def __set__(self, luminanceCorrect): self.__matrix.set_luminance_correct(luminanceCorrect) # <<<<<<<<<<<<<< @@ -7593,7 +7664,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect_2__set__(stru const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_luminanceCorrect); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_luminanceCorrect); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) __pyx_v_self->__pyx___matrix->set_luminance_correct(__pyx_t_1); /* function exit code */ @@ -7607,7 +7678,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect_2__set__(stru return __pyx_r; } -/* "rgbmatrix/core.pyx":244 +/* "rgbmatrix/core.pyx":271 * * property pwmBits: * def __get__(self): return self.__matrix.pwmbits() # <<<<<<<<<<<<<< @@ -7637,7 +7708,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits___get__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->__pyx___matrix->pwmbits()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->__pyx___matrix->pwmbits()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7654,7 +7725,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits___get__(struct __ return __pyx_r; } -/* "rgbmatrix/core.pyx":245 +/* "rgbmatrix/core.pyx":272 * property pwmBits: * def __get__(self): return self.__matrix.pwmbits() * def __set__(self, pwmBits): self.__matrix.SetPWMBits(pwmBits) # <<<<<<<<<<<<<< @@ -7683,7 +7754,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits_2__set__(struct __pyx_o const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_pwmBits); if (unlikely((__pyx_t_1 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_pwmBits); if (unlikely((__pyx_t_1 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) (void)(__pyx_v_self->__pyx___matrix->SetPWMBits(__pyx_t_1)); /* function exit code */ @@ -7697,7 +7768,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits_2__set__(struct __pyx_o return __pyx_r; } -/* "rgbmatrix/core.pyx":248 +/* "rgbmatrix/core.pyx":275 * * property brightness: * def __get__(self): return self.__matrix.brightness() # <<<<<<<<<<<<<< @@ -7727,7 +7798,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->__pyx___matrix->brightness()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->__pyx___matrix->brightness()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7744,7 +7815,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness___get__(struc return __pyx_r; } -/* "rgbmatrix/core.pyx":249 +/* "rgbmatrix/core.pyx":276 * property brightness: * def __get__(self): return self.__matrix.brightness() * def __set__(self, brightness): self.__matrix.SetBrightness(brightness) # <<<<<<<<<<<<<< @@ -7773,7 +7844,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness_2__set__(struct __p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_brightness); if (unlikely((__pyx_t_1 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_brightness); if (unlikely((__pyx_t_1 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_v_self->__pyx___matrix->SetBrightness(__pyx_t_1); /* function exit code */ @@ -7787,7 +7858,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness_2__set__(struct __p return __pyx_r; } -/* "rgbmatrix/core.pyx":252 +/* "rgbmatrix/core.pyx":279 * * property height: * def __get__(self): return self.__matrix.height() # <<<<<<<<<<<<<< @@ -7817,7 +7888,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6height___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___matrix->height()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___matrix->height()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7834,7 +7905,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6height___get__(struct __p return __pyx_r; } -/* "rgbmatrix/core.pyx":255 +/* "rgbmatrix/core.pyx":282 * * property width: * def __get__(self): return self.__matrix.width() # <<<<<<<<<<<<<< @@ -7864,7 +7935,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_5width___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___matrix->width()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___matrix->width()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7888,19 +7959,19 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_5width___get__(struct __py */ /* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_14__reduce_cython__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self)); + __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__reduce_cython__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self) { +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -7945,19 +8016,19 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_14__reduce_cython__(CYTHON */ /* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__setstate_cython__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_18__setstate_cython__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -7994,7 +8065,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__setstate_cython__(CYTH return __pyx_r; } -/* "rgbmatrix/core.pyx":257 +/* "rgbmatrix/core.pyx":284 * def __get__(self): return self.__matrix.width() * * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): # <<<<<<<<<<<<<< @@ -8012,19 +8083,19 @@ static PyObject *__pyx_f_9rgbmatrix_4core___createFrameCanvas(rgb_matrix::FrameC int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__createFrameCanvas", 0); - /* "rgbmatrix/core.pyx":258 + /* "rgbmatrix/core.pyx":285 * * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): * canvas = FrameCanvas() # <<<<<<<<<<<<<< * canvas.__canvas = newCanvas * return canvas */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_9rgbmatrix_4core_FrameCanvas)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_9rgbmatrix_4core_FrameCanvas)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_canvas = ((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_t_1); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":259 + /* "rgbmatrix/core.pyx":286 * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): * canvas = FrameCanvas() * canvas.__canvas = newCanvas # <<<<<<<<<<<<<< @@ -8033,7 +8104,7 @@ static PyObject *__pyx_f_9rgbmatrix_4core___createFrameCanvas(rgb_matrix::FrameC */ __pyx_v_canvas->__pyx___canvas = __pyx_v_newCanvas; - /* "rgbmatrix/core.pyx":260 + /* "rgbmatrix/core.pyx":287 * canvas = FrameCanvas() * canvas.__canvas = newCanvas * return canvas # <<<<<<<<<<<<<< @@ -8045,7 +8116,7 @@ static PyObject *__pyx_f_9rgbmatrix_4core___createFrameCanvas(rgb_matrix::FrameC __pyx_r = ((PyObject *)__pyx_v_canvas); goto __pyx_L0; - /* "rgbmatrix/core.pyx":257 + /* "rgbmatrix/core.pyx":284 * def __get__(self): return self.__matrix.width() * * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): # <<<<<<<<<<<<<< @@ -8789,9 +8860,10 @@ static PyMethodDef __pyx_methods_9rgbmatrix_4core_RGBMatrix[] = { {"SetPixel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_7SetPixel, METH_VARARGS|METH_KEYWORDS, 0}, {"Clear", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_9Clear, METH_NOARGS, 0}, {"CreateFrameCanvas", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_11CreateFrameCanvas, METH_NOARGS, 0}, - {"SwapOnVSync", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13SwapOnVSync, METH_VARARGS|METH_KEYWORDS, 0}, - {"__reduce_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_15__reduce_cython__, METH_NOARGS, 0}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__setstate_cython__, METH_O, 0}, + {"DeleteFrameCanvas", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13DeleteFrameCanvas, METH_O, 0}, + {"SwapOnVSync", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_15SwapOnVSync, METH_VARARGS|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9RGBMatrix_19__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; diff --git a/bindings/python/rgbmatrix/core.pyx b/bindings/python/rgbmatrix/core.pyx index e093407f1..172ec392b 100755 --- a/bindings/python/rgbmatrix/core.pyx +++ b/bindings/python/rgbmatrix/core.pyx @@ -230,9 +230,28 @@ cdef class RGBMatrix(Canvas): def Clear(self): self.__matrix.Clear() + # Create a new buffer to be used for multi-buffering. The returned new + # Buffer implements a Canvas with the same size of thie RGBMatrix. + # You can use it to draw off-screen on it, then swap it with the active + # buffer using SwapOnVSync(). That would be classic double-buffering. + + # You can also create as many FrameCanvas as you like and for instance use + # them to pre-fill scenes of an animation for fast playback later. + + # The ownership of the created Canvases remains with the RGBMatrix. You + # you don't want to create more than needed as this will fill up your + # memory as they are only deleted when the RGBMatrix is deleted or by + # calling DeleteFrameCanvas(). def CreateFrameCanvas(self): return __createFrameCanvas(self.__matrix.CreateFrameCanvas()) + # Delete a FrameCanvas associated with the RGBMatrix + # Otherwise FrameCanvas objects created by CreateFrameCanvas() are never deleted + # until the RGBMatrix is deleted + def DeleteFrameCanvas(self, FrameCanvas frame): + self.__matrix.DeleteFrameCanvas(frame.__canvas) + del frame + # The optional "framerate_fraction" parameter allows to choose which # multiple of the global frame-count to use. So it slows down your animation # to an exact integer fraction of the refresh rate. diff --git a/bindings/python/rgbmatrix/cppinc.pxd b/bindings/python/rgbmatrix/cppinc.pxd index c8b1d28bf..35ecc559e 100755 --- a/bindings/python/rgbmatrix/cppinc.pxd +++ b/bindings/python/rgbmatrix/cppinc.pxd @@ -23,6 +23,7 @@ cdef extern from "led-matrix.h" namespace "rgb_matrix": uint8_t brightness() FrameCanvas *CreateFrameCanvas() FrameCanvas *SwapOnVSync(FrameCanvas*, uint8_t) + void DeleteFrameCanvas(FrameCanvas*) cdef cppclass FrameCanvas(Canvas): bool SetPWMBits(uint8_t) diff --git a/include/led-matrix.h b/include/led-matrix.h index 086fadd6c..80d94d673 100644 --- a/include/led-matrix.h +++ b/include/led-matrix.h @@ -209,12 +209,17 @@ class RGBMatrix : public Canvas { // You can also create as many FrameCanvas as you like and for instance use // them to pre-fill scenes of an animation for fast playback later. // - // The ownership of the created Canvases remains with the RGBMatrix, so you - // don't have to worry about deleting them (but you also don't want to create - // more than needed as this will fill up your memory as they are only deleted - // when the RGBMatrix is deleted). + // The ownership of the created Canvases remains with the RGBMatrix. You + // you don't want to create more than needed as this will fill up your + // memory as they are only deleted when the RGBMatrix is deleted or by + // calling DeleteFrameCanvas(). FrameCanvas *CreateFrameCanvas(); + // Delete a FrameCanvas associated with the RGBMatrix + // Otherwise FrameCanvas objects created by CreateFrameCanvas() are never deleted + // until the RGBMatrix is deleted + void DeleteFrameCanvas(FrameCanvas* frame); + // This method waits to the next VSync and swaps the active buffer with the // supplied buffer. The formerly active buffer is returned. // diff --git a/lib/led-matrix.cc b/lib/led-matrix.cc index abc830751..d93fa6221 100644 --- a/lib/led-matrix.cc +++ b/lib/led-matrix.cc @@ -73,6 +73,7 @@ class RGBMatrix::Impl { bool StartRefresh(); FrameCanvas *CreateFrameCanvas(); + void DeleteFrameCanvas(FrameCanvas *frame); FrameCanvas *SwapOnVSync(FrameCanvas *other, unsigned framerate_fraction); bool ApplyPixelMapper(const PixelMapper *mapper); @@ -504,6 +505,21 @@ FrameCanvas *RGBMatrix::Impl::CreateFrameCanvas() { return result; } +void RGBMatrix::Impl::DeleteFrameCanvas(FrameCanvas* frame) { + if (frame == nullptr){ + return; + } + + for(auto it = created_frames_.begin(); it != created_frames_.end(); ++it){ + if (*it == frame){ + created_frames_.erase(it); + } + + } + delete frame; + frame = nullptr; +} + FrameCanvas *RGBMatrix::Impl::SwapOnVSync(FrameCanvas *other, unsigned frame_fraction) { if (frame_fraction == 0) frame_fraction = 1; // correct user error. @@ -546,7 +562,6 @@ void RGBMatrix::Impl::SetBrightness(uint8_t brightness) { uint8_t RGBMatrix::Impl::brightness() { return params_.brightness; } - bool RGBMatrix::Impl::ApplyPixelMapper(const PixelMapper *mapper) { if (mapper == NULL) return true; using internal::PixelDesignatorMap; @@ -672,10 +687,16 @@ RGBMatrix *RGBMatrix::CreateFromFlags(int *argc, char ***argv, FrameCanvas *RGBMatrix::CreateFrameCanvas() { return impl_->CreateFrameCanvas(); } + +void RGBMatrix::DeleteFrameCanvas(FrameCanvas *frame){ + impl_->DeleteFrameCanvas(frame); +} + FrameCanvas *RGBMatrix::SwapOnVSync(FrameCanvas *other, unsigned framerate_fraction) { return impl_->SwapOnVSync(other, framerate_fraction); } + bool RGBMatrix::ApplyPixelMapper(const PixelMapper *mapper) { return impl_->ApplyPixelMapper(mapper); } From df1e0aa06508768dd70cdb69c4770ae637b097e8 Mon Sep 17 00:00:00 2001 From: SolidHal Date: Mon, 22 Aug 2022 17:18:26 -0500 Subject: [PATCH 2/2] Python bindings for FrameCanvas::Serialize/Deserialize this enables usage like in cpp content-streamer --- bindings/python/rgbmatrix/core.cpp | 3287 ++++++++++++++++-------- bindings/python/rgbmatrix/core.pxd | 5 + bindings/python/rgbmatrix/core.pyx | 17 + bindings/python/rgbmatrix/cppinc.pxd | 2 + bindings/python/rgbmatrix/graphics.cpp | 50 +- 5 files changed, 2300 insertions(+), 1061 deletions(-) diff --git a/bindings/python/rgbmatrix/core.cpp b/bindings/python/rgbmatrix/core.cpp index 23c1ae91e..ec3a38128 100644 --- a/bindings/python/rgbmatrix/core.cpp +++ b/bindings/python/rgbmatrix/core.cpp @@ -930,6 +930,7 @@ static const char *__pyx_f[] = { /*--- Type declarations ---*/ struct __pyx_obj_9rgbmatrix_4core_Canvas; +struct __pyx_obj_9rgbmatrix_4core_FrameData; struct __pyx_obj_9rgbmatrix_4core_FrameCanvas; struct __pyx_obj_9rgbmatrix_4core_RGBMatrix; struct __pyx_obj_9rgbmatrix_4core_RGBMatrixOptions; @@ -950,6 +951,21 @@ struct __pyx_obj_9rgbmatrix_4core_Canvas { /* "rgbmatrix/core.pxd":6 * cdef cppinc.Canvas *__getCanvas(self) except + * + * cdef class FrameData: # <<<<<<<<<<<<<< + * cdef const char *__data + * cdef size_t __length + */ +struct __pyx_obj_9rgbmatrix_4core_FrameData { + PyObject_HEAD + struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData *__pyx_vtab; + char const *__pyx___data; + size_t __pyx___length; +}; + + +/* "rgbmatrix/core.pxd":11 + * cdef const char *__getData(self) except + + * * cdef class FrameCanvas(Canvas): # <<<<<<<<<<<<<< * cdef cppinc.FrameCanvas *__canvas * @@ -960,7 +976,7 @@ struct __pyx_obj_9rgbmatrix_4core_FrameCanvas { }; -/* "rgbmatrix/core.pxd":9 +/* "rgbmatrix/core.pxd":14 * cdef cppinc.FrameCanvas *__canvas * * cdef class RGBMatrix(Canvas): # <<<<<<<<<<<<<< @@ -973,7 +989,7 @@ struct __pyx_obj_9rgbmatrix_4core_RGBMatrix { }; -/* "rgbmatrix/core.pxd":12 +/* "rgbmatrix/core.pxd":17 * cdef cppinc.RGBMatrix *__matrix * * cdef class RGBMatrixOptions: # <<<<<<<<<<<<<< @@ -1009,6 +1025,20 @@ static struct __pyx_vtabstruct_9rgbmatrix_4core_Canvas *__pyx_vtabptr_9rgbmatrix /* "rgbmatrix/core.pyx":56 * my_canvas.SetPixel(xstart+col, ystart+row, r, g, b) * + * cdef class FrameData: # <<<<<<<<<<<<<< + * cdef const char *__getData(self) except +: + * if self.__data != NULL: + */ + +struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData { + char const *(*__pyx___getData)(struct __pyx_obj_9rgbmatrix_4core_FrameData *); +}; +static struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData *__pyx_vtabptr_9rgbmatrix_4core_FrameData; + + +/* "rgbmatrix/core.pyx":62 + * raise Exception("FrameData ptr was destroyed or not initialized, you cannot use this object anymore") + * * cdef class FrameCanvas(Canvas): # <<<<<<<<<<<<<< * def __dealloc__(self): * if self.__canvas != NULL: @@ -1021,7 +1051,7 @@ struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas { static struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *__pyx_vtabptr_9rgbmatrix_4core_FrameCanvas; -/* "rgbmatrix/core.pyx":196 +/* "rgbmatrix/core.pyx":213 * def __set__(self, uint8_t value): self.__runtime_options.drop_privileges = value * * cdef class RGBMatrix(Canvas): # <<<<<<<<<<<<<< @@ -1349,18 +1379,18 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif -/* KeywordStringCheck.proto */ -static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); - -/* PyObjectCall2Args.proto */ -static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); - /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) @@ -1481,6 +1511,9 @@ static void __Pyx_CppExn2PyErr() { } #endif +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); @@ -1499,9 +1532,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); -/* CIntFromPy.proto */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); - /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); @@ -1525,6 +1555,7 @@ static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_6Canvas___getCanvas(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_Canvas *__pyx_v_self); /* proto*/ +static char const *__pyx_f_9rgbmatrix_4core_9FrameData___getData(struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_self); /* proto*/ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto*/ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas__pyx_wrap_1(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto*/ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto*/ @@ -1540,11 +1571,13 @@ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas__pyx_wrap_1( /* Module declarations from 'rgbmatrix.core' */ static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_Canvas = 0; +static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_FrameData = 0; static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_FrameCanvas = 0; static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_RGBMatrix = 0; static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions = 0; static PyObject *__pyx_f_9rgbmatrix_4core___createFrameCanvas(rgb_matrix::FrameCanvas *); /*proto*/ static PyObject *__pyx_f_9rgbmatrix_4core___pyx_unpickle_Canvas__set_state(struct __pyx_obj_9rgbmatrix_4core_Canvas *, PyObject *); /*proto*/ +static PyObject *__pyx_f_9rgbmatrix_4core___pyx_unpickle_FrameData__set_state(struct __pyx_obj_9rgbmatrix_4core_FrameData *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "rgbmatrix.core" extern int __pyx_module_is_main_rgbmatrix__core; int __pyx_module_is_main_rgbmatrix__core = 0; @@ -1595,6 +1628,7 @@ static const char __pyx_k_offset_y[] = "offset_y"; static const char __pyx_k_parallel[] = "parallel"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_FrameData[] = "FrameData"; static const char __pyx_k_RGBMatrix[] = "RGBMatrix"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_pyx_state[] = "__pyx_state"; @@ -1617,17 +1651,23 @@ static const char __pyx_k_RGBMatrixOptions[] = "RGBMatrixOptions"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_framerate_fraction[] = "framerate_fraction"; static const char __pyx_k_pyx_unpickle_Canvas[] = "__pyx_unpickle_Canvas"; +static const char __pyx_k_pyx_unpickle_FrameData[] = "__pyx_unpickle_FrameData"; static const char __pyx_k_Canvas_was_destroyed_or_not_init[] = "Canvas was destroyed or not initialized, you cannot use this object anymore"; static const char __pyx_k_Currently_only_RGB_mode_is_suppo[] = "Currently, only RGB mode is supported for SetImage(). Please create images with mode 'RGB' or convert first with image = image.convert('RGB'). Pull requests to support more modes natively are also welcome :)"; +static const char __pyx_k_FrameData_ptr_was_destroyed_or_n[] = "FrameData ptr was destroyed or not initialized, you cannot use this object anymore"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_self___canvas_cannot_be_converte[] = "self.__canvas cannot be converted to a Python object for pickling"; +static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0x920b9ba, 0x5bce662, 0x176a391) = (__data, __length))"; static PyObject *__pyx_n_s_Canvas; static PyObject *__pyx_kp_s_Canvas_was_destroyed_or_not_init; static PyObject *__pyx_kp_s_Currently_only_RGB_mode_is_suppo; static PyObject *__pyx_n_s_FrameCanvas; +static PyObject *__pyx_n_s_FrameData; +static PyObject *__pyx_kp_s_FrameData_ptr_was_destroyed_or_n; static PyObject *__pyx_n_s_Image; static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; +static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2; static PyObject *__pyx_kp_s_Not_implemented; static PyObject *__pyx_n_s_PIL; static PyObject *__pyx_n_s_PickleError; @@ -1669,6 +1709,7 @@ static PyObject *__pyx_n_s_pyx_result; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_type; static PyObject *__pyx_n_s_pyx_unpickle_Canvas; +static PyObject *__pyx_n_s_pyx_unpickle_FrameData; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_red; @@ -1696,18 +1737,22 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_6Canvas_SetImage(struct __pyx_obj_9rg static PyObject *__pyx_pf_9rgbmatrix_4core_6Canvas_2SetPixelsPillow(struct __pyx_obj_9rgbmatrix_4core_Canvas *__pyx_v_self, int __pyx_v_xstart, int __pyx_v_ystart, int __pyx_v_width, int __pyx_v_height, PyObject *__pyx_v_image); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_6Canvas_4__reduce_cython__(struct __pyx_obj_9rgbmatrix_4core_Canvas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_6Canvas_6__setstate_cython__(struct __pyx_obj_9rgbmatrix_4core_Canvas *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_9FrameData___reduce_cython__(struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_9FrameData_2__setstate_cython__(struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static void __pyx_pf_9rgbmatrix_4core_11FrameCanvas___dealloc__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_2Fill(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, uint8_t __pyx_v_red, uint8_t __pyx_v_green, uint8_t __pyx_v_blue); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_4Clear(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_6SetPixel(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, int __pyx_v_x, int __pyx_v_y, uint8_t __pyx_v_red, uint8_t __pyx_v_green, uint8_t __pyx_v_blue); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_8Serialize(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10Deserialize(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_framedata); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_5width___get__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_6height___get__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_7pwmBits___get__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ static int __pyx_pf_9rgbmatrix_4core_11FrameCanvas_7pwmBits_2__set__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, PyObject *__pyx_v_pwmBits); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10brightness___get__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ static int __pyx_pf_9rgbmatrix_4core_11FrameCanvas_10brightness_2__set__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ -static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions___cinit__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrixOptions *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16hardware_mapping___get__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrixOptions *__pyx_v_self); /* proto */ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16hardware_mapping_2__set__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrixOptions *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ @@ -1774,10 +1819,15 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_5width___get__(struct __py static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_9rgbmatrix_4core_2__pyx_unpickle_FrameData(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_9rgbmatrix_4core_Canvas(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_9rgbmatrix_4core_FrameData(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_9rgbmatrix_4core_FrameCanvas(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_9rgbmatrix_4core_RGBMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_9rgbmatrix_4core_RGBMatrixOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_24552337; +static PyObject *__pyx_int_96265826; +static PyObject *__pyx_int_153139642; static PyObject *__pyx_int_222419149; static PyObject *__pyx_int_228825662; static PyObject *__pyx_int_238750788; @@ -1792,7 +1842,11 @@ static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; -static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; /* Late includes */ /* "rgbmatrix/core.pyx":9 @@ -2981,7 +3035,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_6Canvas_2SetPixelsPillow(struct __pyx * b = (pixel >> 16) & 0xFF * my_canvas.SetPixel(xstart+col, ystart+row, r, g, b) # <<<<<<<<<<<<<< * - * cdef class FrameCanvas(Canvas): + * cdef class FrameData: */ __pyx_v_my_canvas->SetPixel((__pyx_v_xstart + __pyx_v_col), (__pyx_v_ystart + __pyx_v_row), __pyx_v_r, __pyx_v_g, __pyx_v_b); } @@ -3300,273 +3354,650 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_6Canvas_6__setstate_cython__(struct _ /* "rgbmatrix/core.pyx":57 * - * cdef class FrameCanvas(Canvas): - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self.__canvas != NULL: - * self.__canvas = NULL - */ - -/* Python wrapper */ -static void __pyx_pw_9rgbmatrix_4core_11FrameCanvas_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_9rgbmatrix_4core_11FrameCanvas_1__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_9rgbmatrix_4core_11FrameCanvas___dealloc__(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_9rgbmatrix_4core_11FrameCanvas___dealloc__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "rgbmatrix/core.pyx":58 - * cdef class FrameCanvas(Canvas): - * def __dealloc__(self): - * if self.__canvas != NULL: # <<<<<<<<<<<<<< - * self.__canvas = NULL - * - */ - __pyx_t_1 = ((((void *)__pyx_v_self->__pyx___canvas) != NULL) != 0); - if (__pyx_t_1) { - - /* "rgbmatrix/core.pyx":59 - * def __dealloc__(self): - * if self.__canvas != NULL: - * self.__canvas = NULL # <<<<<<<<<<<<<< - * - * cdef cppinc.Canvas* __getCanvas(self) except *: - */ - __pyx_v_self->__pyx___canvas = NULL; - - /* "rgbmatrix/core.pyx":58 - * cdef class FrameCanvas(Canvas): - * def __dealloc__(self): - * if self.__canvas != NULL: # <<<<<<<<<<<<<< - * self.__canvas = NULL - * - */ - } - - /* "rgbmatrix/core.pyx":57 - * - * cdef class FrameCanvas(Canvas): - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self.__canvas != NULL: - * self.__canvas = NULL - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "rgbmatrix/core.pyx":61 - * self.__canvas = NULL - * - * cdef cppinc.Canvas* __getCanvas(self) except *: # <<<<<<<<<<<<<< - * if self.__canvas != NULL: - * return self.__canvas + * cdef class FrameData: + * cdef const char *__getData(self) except +: # <<<<<<<<<<<<<< + * if self.__data != NULL: + * return self.__data */ -rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { - rgb_matrix::Canvas *__pyx_r; +static char const *__pyx_f_9rgbmatrix_4core_9FrameData___getData(struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_self) { + char const *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getCanvas", 0); + __Pyx_RefNannySetupContext("__getData", 0); - /* "rgbmatrix/core.pyx":62 - * - * cdef cppinc.Canvas* __getCanvas(self) except *: - * if self.__canvas != NULL: # <<<<<<<<<<<<<< - * return self.__canvas - * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") + /* "rgbmatrix/core.pyx":58 + * cdef class FrameData: + * cdef const char *__getData(self) except +: + * if self.__data != NULL: # <<<<<<<<<<<<<< + * return self.__data + * raise Exception("FrameData ptr was destroyed or not initialized, you cannot use this object anymore") */ - __pyx_t_1 = ((((void *)__pyx_v_self->__pyx___canvas) != NULL) != 0); + __pyx_t_1 = ((((void *)__pyx_v_self->__pyx___data) != NULL) != 0); if (__pyx_t_1) { - /* "rgbmatrix/core.pyx":63 - * cdef cppinc.Canvas* __getCanvas(self) except *: - * if self.__canvas != NULL: - * return self.__canvas # <<<<<<<<<<<<<< - * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") + /* "rgbmatrix/core.pyx":59 + * cdef const char *__getData(self) except +: + * if self.__data != NULL: + * return self.__data # <<<<<<<<<<<<<< + * raise Exception("FrameData ptr was destroyed or not initialized, you cannot use this object anymore") * */ - __pyx_r = __pyx_v_self->__pyx___canvas; + __pyx_r = __pyx_v_self->__pyx___data; goto __pyx_L0; - /* "rgbmatrix/core.pyx":62 - * - * cdef cppinc.Canvas* __getCanvas(self) except *: - * if self.__canvas != NULL: # <<<<<<<<<<<<<< - * return self.__canvas - * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") + /* "rgbmatrix/core.pyx":58 + * cdef class FrameData: + * cdef const char *__getData(self) except +: + * if self.__data != NULL: # <<<<<<<<<<<<<< + * return self.__data + * raise Exception("FrameData ptr was destroyed or not initialized, you cannot use this object anymore") */ } - /* "rgbmatrix/core.pyx":64 - * if self.__canvas != NULL: - * return self.__canvas - * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") # <<<<<<<<<<<<<< + /* "rgbmatrix/core.pyx":60 + * if self.__data != NULL: + * return self.__data + * raise Exception("FrameData ptr was destroyed or not initialized, you cannot use this object anymore") # <<<<<<<<<<<<<< * - * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): + * cdef class FrameCanvas(Canvas): */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 64, __pyx_L1_error) + __PYX_ERR(0, 60, __pyx_L1_error) - /* "rgbmatrix/core.pyx":61 - * self.__canvas = NULL + /* "rgbmatrix/core.pyx":57 * - * cdef cppinc.Canvas* __getCanvas(self) except *: # <<<<<<<<<<<<<< - * if self.__canvas != NULL: - * return self.__canvas + * cdef class FrameData: + * cdef const char *__getData(self) except +: # <<<<<<<<<<<<<< + * if self.__data != NULL: + * return self.__data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.__getCanvas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("rgbmatrix.core.FrameData.__getData", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas__pyx_wrap_1(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { - return __pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas(__pyx_v_self); -} - -/* "rgbmatrix/core.pyx":66 - * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") - * - * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< - * (self.__getCanvas()).Fill(red, green, blue) - * +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict */ /* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_3Fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_3Fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - uint8_t __pyx_v_red; - uint8_t __pyx_v_green; - uint8_t __pyx_v_blue; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +static PyObject *__pyx_pw_9rgbmatrix_4core_9FrameData_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9FrameData_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("Fill (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, 1); __PYX_ERR(0, 66, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, 2); __PYX_ERR(0, 66, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Fill") < 0)) __PYX_ERR(0, 66, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_red = __Pyx_PyInt_As_uint8_t(values[0]); if (unlikely((__pyx_v_red == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) - __pyx_v_green = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_green == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) - __pyx_v_blue = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_blue == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 66, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.Fill", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_2Fill(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_9rgbmatrix_4core_9FrameData___reduce_cython__(((struct __pyx_obj_9rgbmatrix_4core_FrameData *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_2Fill(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, uint8_t __pyx_v_red, uint8_t __pyx_v_green, uint8_t __pyx_v_blue) { +static PyObject *__pyx_pf_9rgbmatrix_4core_9FrameData___reduce_cython__(struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - rgb_matrix::Canvas *__pyx_t_1; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("Fill", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "rgbmatrix/core.pyx":67 - * - * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): - * (self.__getCanvas()).Fill(red, green, blue) # <<<<<<<<<<<<<< - * - * def Clear(self): + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = (self.__data, self.__length) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) - ((rgb_matrix::FrameCanvas *)__pyx_t_1)->Fill(__pyx_v_red, __pyx_v_green, __pyx_v_blue); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->__pyx___length); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_v_state = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "rgbmatrix/core.pyx":66 - * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") - * - * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< - * (self.__getCanvas()).Fill(red, green, blue) - * + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = (self.__data, self.__length) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) */ + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v__dict = __pyx_t_3; + __pyx_t_3 = 0; - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.Fill", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + /* "(tree fragment)":7 + * state = (self.__data, self.__length) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_4 = (__pyx_v__dict != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = (self.__data, self.__length) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, None), state + * else: + */ + __pyx_t_5 = (__pyx_v_use_setstate != 0); + if (__pyx_t_5) { + + /* "(tree fragment)":13 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_FrameData); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_153139642); + __Pyx_GIVEREF(__pyx_int_153139642); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_153139642); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, None), state + * else: + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FrameData__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_FrameData); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_153139642); + __Pyx_GIVEREF(__pyx_int_153139642); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_153139642); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("rgbmatrix.core.FrameData.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "rgbmatrix/core.pyx":69 +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FrameData__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9rgbmatrix_4core_9FrameData_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9FrameData_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_9rgbmatrix_4core_9FrameData_2__setstate_cython__(((struct __pyx_obj_9rgbmatrix_4core_FrameData *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9rgbmatrix_4core_9FrameData_2__setstate_cython__(struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":17 + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FrameData__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_9rgbmatrix_4core___pyx_unpickle_FrameData__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_FrameData, (type(self), 0x920b9ba, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FrameData__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("rgbmatrix.core.FrameData.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "rgbmatrix/core.pyx":63 + * + * cdef class FrameCanvas(Canvas): + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.__canvas != NULL: + * self.__canvas = NULL + */ + +/* Python wrapper */ +static void __pyx_pw_9rgbmatrix_4core_11FrameCanvas_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_9rgbmatrix_4core_11FrameCanvas_1__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_9rgbmatrix_4core_11FrameCanvas___dealloc__(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_9rgbmatrix_4core_11FrameCanvas___dealloc__(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "rgbmatrix/core.pyx":64 + * cdef class FrameCanvas(Canvas): + * def __dealloc__(self): + * if self.__canvas != NULL: # <<<<<<<<<<<<<< + * self.__canvas = NULL + * + */ + __pyx_t_1 = ((((void *)__pyx_v_self->__pyx___canvas) != NULL) != 0); + if (__pyx_t_1) { + + /* "rgbmatrix/core.pyx":65 + * def __dealloc__(self): + * if self.__canvas != NULL: + * self.__canvas = NULL # <<<<<<<<<<<<<< + * + * cdef cppinc.Canvas* __getCanvas(self) except *: + */ + __pyx_v_self->__pyx___canvas = NULL; + + /* "rgbmatrix/core.pyx":64 + * cdef class FrameCanvas(Canvas): + * def __dealloc__(self): + * if self.__canvas != NULL: # <<<<<<<<<<<<<< + * self.__canvas = NULL + * + */ + } + + /* "rgbmatrix/core.pyx":63 + * + * cdef class FrameCanvas(Canvas): + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.__canvas != NULL: + * self.__canvas = NULL + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "rgbmatrix/core.pyx":67 + * self.__canvas = NULL + * + * cdef cppinc.Canvas* __getCanvas(self) except *: # <<<<<<<<<<<<<< + * if self.__canvas != NULL: + * return self.__canvas + */ + +rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { + rgb_matrix::Canvas *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getCanvas", 0); + + /* "rgbmatrix/core.pyx":68 + * + * cdef cppinc.Canvas* __getCanvas(self) except *: + * if self.__canvas != NULL: # <<<<<<<<<<<<<< + * return self.__canvas + * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") + */ + __pyx_t_1 = ((((void *)__pyx_v_self->__pyx___canvas) != NULL) != 0); + if (__pyx_t_1) { + + /* "rgbmatrix/core.pyx":69 + * cdef cppinc.Canvas* __getCanvas(self) except *: + * if self.__canvas != NULL: + * return self.__canvas # <<<<<<<<<<<<<< + * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") + * + */ + __pyx_r = __pyx_v_self->__pyx___canvas; + goto __pyx_L0; + + /* "rgbmatrix/core.pyx":68 + * + * cdef cppinc.Canvas* __getCanvas(self) except *: + * if self.__canvas != NULL: # <<<<<<<<<<<<<< + * return self.__canvas + * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") + */ + } + + /* "rgbmatrix/core.pyx":70 + * if self.__canvas != NULL: + * return self.__canvas + * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") # <<<<<<<<<<<<<< + * + * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 70, __pyx_L1_error) + + /* "rgbmatrix/core.pyx":67 + * self.__canvas = NULL + * + * cdef cppinc.Canvas* __getCanvas(self) except *: # <<<<<<<<<<<<<< + * if self.__canvas != NULL: + * return self.__canvas + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.__getCanvas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas__pyx_wrap_1(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { + return __pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas(__pyx_v_self); +} + +/* "rgbmatrix/core.pyx":72 + * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") + * + * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< + * (self.__getCanvas()).Fill(red, green, blue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_3Fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_3Fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + uint8_t __pyx_v_red; + uint8_t __pyx_v_green; + uint8_t __pyx_v_blue; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("Fill (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Fill") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_red = __Pyx_PyInt_As_uint8_t(values[0]); if (unlikely((__pyx_v_red == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) + __pyx_v_green = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_green == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) + __pyx_v_blue = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_blue == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.Fill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_2Fill(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_2Fill(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, uint8_t __pyx_v_red, uint8_t __pyx_v_green, uint8_t __pyx_v_blue) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + rgb_matrix::Canvas *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("Fill", 0); + + /* "rgbmatrix/core.pyx":73 + * + * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): + * (self.__getCanvas()).Fill(red, green, blue) # <<<<<<<<<<<<<< + * + * def Clear(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) + ((rgb_matrix::FrameCanvas *)__pyx_t_1)->Fill(__pyx_v_red, __pyx_v_green, __pyx_v_blue); + + /* "rgbmatrix/core.pyx":72 + * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") + * + * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< + * (self.__getCanvas()).Fill(red, green, blue) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.Fill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "rgbmatrix/core.pyx":75 * (self.__getCanvas()).Fill(red, green, blue) * * def Clear(self): # <<<<<<<<<<<<<< @@ -3596,17 +4027,17 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_4Clear(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Clear", 0); - /* "rgbmatrix/core.pyx":70 + /* "rgbmatrix/core.pyx":76 * * def Clear(self): * (self.__getCanvas()).Clear() # <<<<<<<<<<<<<< * * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) ((rgb_matrix::FrameCanvas *)__pyx_t_1)->Clear(); - /* "rgbmatrix/core.pyx":69 + /* "rgbmatrix/core.pyx":75 * (self.__getCanvas()).Fill(red, green, blue) * * def Clear(self): # <<<<<<<<<<<<<< @@ -3626,7 +4057,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_4Clear(struct __pyx_obj return __pyx_r; } -/* "rgbmatrix/core.pyx":72 +/* "rgbmatrix/core.pyx":78 * (self.__getCanvas()).Clear() * * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< @@ -3677,29 +4108,29 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_7SetPixel(PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 1); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 1); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 2); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 2); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 3); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 3); __PYX_ERR(0, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 4); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 4); __PYX_ERR(0, 78, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SetPixel") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SetPixel") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -3710,59 +4141,245 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_7SetPixel(PyObject *__p values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_x = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) - __pyx_v_y = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) - __pyx_v_red = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_red == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) - __pyx_v_green = __Pyx_PyInt_As_uint8_t(values[3]); if (unlikely((__pyx_v_green == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) - __pyx_v_blue = __Pyx_PyInt_As_uint8_t(values[4]); if (unlikely((__pyx_v_blue == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) + __pyx_v_x = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + __pyx_v_y = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + __pyx_v_red = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_red == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + __pyx_v_green = __Pyx_PyInt_As_uint8_t(values[3]); if (unlikely((__pyx_v_green == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) + __pyx_v_blue = __Pyx_PyInt_As_uint8_t(values[4]); if (unlikely((__pyx_v_blue == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 78, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.SetPixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_6SetPixel(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_red, __pyx_v_green, __pyx_v_blue); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_6SetPixel(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_red, __pyx_v_green, __pyx_v_blue); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_6SetPixel(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, int __pyx_v_x, int __pyx_v_y, uint8_t __pyx_v_red, uint8_t __pyx_v_green, uint8_t __pyx_v_blue) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + rgb_matrix::Canvas *__pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("SetPixel", 0); + + /* "rgbmatrix/core.pyx":79 + * + * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): + * (self.__getCanvas()).SetPixel(x, y, red, green, blue) # <<<<<<<<<<<<<< + * + * def Serialize(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) + ((rgb_matrix::FrameCanvas *)__pyx_t_1)->SetPixel(__pyx_v_x, __pyx_v_y, __pyx_v_red, __pyx_v_green, __pyx_v_blue); + + /* "rgbmatrix/core.pyx":78 + * (self.__getCanvas()).Clear() + * + * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< + * (self.__getCanvas()).SetPixel(x, y, red, green, blue) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.SetPixel", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "rgbmatrix/core.pyx":81 + * (self.__getCanvas()).SetPixel(x, y, red, green, blue) + * + * def Serialize(self): # <<<<<<<<<<<<<< + * cdef const char* data + * cdef size_t length + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_9Serialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_9Serialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("Serialize (wrapper)", 0); + __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_8Serialize(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_8Serialize(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { + char const *__pyx_v_data; + size_t __pyx_v_length; + struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_framedata = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + rgb_matrix::Canvas *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("Serialize", 0); + + /* "rgbmatrix/core.pyx":84 + * cdef const char* data + * cdef size_t length + * (self.__getCanvas()).Serialize(&data, &length) # <<<<<<<<<<<<<< + * framedata = FrameData() + * framedata.__length = length + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) + ((rgb_matrix::FrameCanvas *)__pyx_t_1)->Serialize((&__pyx_v_data), (&__pyx_v_length)); + + /* "rgbmatrix/core.pyx":85 + * cdef size_t length + * (self.__getCanvas()).Serialize(&data, &length) + * framedata = FrameData() # <<<<<<<<<<<<<< + * framedata.__length = length + * framedata.__data = data + */ + __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_9rgbmatrix_4core_FrameData)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_framedata = ((struct __pyx_obj_9rgbmatrix_4core_FrameData *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "rgbmatrix/core.pyx":86 + * (self.__getCanvas()).Serialize(&data, &length) + * framedata = FrameData() + * framedata.__length = length # <<<<<<<<<<<<<< + * framedata.__data = data + * return framedata + */ + __pyx_v_framedata->__pyx___length = __pyx_v_length; + + /* "rgbmatrix/core.pyx":87 + * framedata = FrameData() + * framedata.__length = length + * framedata.__data = data # <<<<<<<<<<<<<< + * return framedata + * + */ + __pyx_v_framedata->__pyx___data = __pyx_v_data; + + /* "rgbmatrix/core.pyx":88 + * framedata.__length = length + * framedata.__data = data + * return framedata # <<<<<<<<<<<<<< + * + * def Deserialize(self, FrameData framedata): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_framedata)); + __pyx_r = ((PyObject *)__pyx_v_framedata); + goto __pyx_L0; + + /* "rgbmatrix/core.pyx":81 + * (self.__getCanvas()).SetPixel(x, y, red, green, blue) + * + * def Serialize(self): # <<<<<<<<<<<<<< + * cdef const char* data + * cdef size_t length + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.Serialize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_framedata); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "rgbmatrix/core.pyx":90 + * return framedata + * + * def Deserialize(self, FrameData framedata): # <<<<<<<<<<<<<< + * return (self.__getCanvas()).Deserialize(framedata.__getData(), framedata.__length) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_11Deserialize(PyObject *__pyx_v_self, PyObject *__pyx_v_framedata); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_11Deserialize(PyObject *__pyx_v_self, PyObject *__pyx_v_framedata) { + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("Deserialize (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_framedata), __pyx_ptype_9rgbmatrix_4core_FrameData, 1, "framedata", 0))) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_10Deserialize(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self), ((struct __pyx_obj_9rgbmatrix_4core_FrameData *)__pyx_v_framedata)); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_6SetPixel(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, int __pyx_v_x, int __pyx_v_y, uint8_t __pyx_v_red, uint8_t __pyx_v_green, uint8_t __pyx_v_blue) { +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10Deserialize(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v_framedata) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations rgb_matrix::Canvas *__pyx_t_1; + char const *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("SetPixel", 0); + __Pyx_RefNannySetupContext("Deserialize", 0); - /* "rgbmatrix/core.pyx":73 - * - * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): - * (self.__getCanvas()).SetPixel(x, y, red, green, blue) # <<<<<<<<<<<<<< + /* "rgbmatrix/core.pyx":91 * + * def Deserialize(self, FrameData framedata): + * return (self.__getCanvas()).Deserialize(framedata.__getData(), framedata.__length) # <<<<<<<<<<<<<< * + * property width: */ - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) - ((rgb_matrix::FrameCanvas *)__pyx_t_1)->SetPixel(__pyx_v_x, __pyx_v_y, __pyx_v_red, __pyx_v_green, __pyx_v_blue); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) + try { + __pyx_t_2 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData *)__pyx_v_framedata->__pyx_vtab)->__pyx___getData(__pyx_v_framedata); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 91, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyBool_FromLong(((rgb_matrix::FrameCanvas *)__pyx_t_1)->Deserialize(__pyx_t_2, __pyx_v_framedata->__pyx___length)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "rgbmatrix/core.pyx":72 - * (self.__getCanvas()).Clear() + /* "rgbmatrix/core.pyx":90 + * return framedata * - * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< - * (self.__getCanvas()).SetPixel(x, y, red, green, blue) + * def Deserialize(self, FrameData framedata): # <<<<<<<<<<<<<< + * return (self.__getCanvas()).Deserialize(framedata.__getData(), framedata.__length) * */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.SetPixel", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("rgbmatrix.core.FrameCanvas.Deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3770,7 +4387,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_6SetPixel(struct __pyx_ return __pyx_r; } -/* "rgbmatrix/core.pyx":77 +/* "rgbmatrix/core.pyx":94 * * property width: * def __get__(self): return (self.__getCanvas()).width() # <<<<<<<<<<<<<< @@ -3801,8 +4418,8 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_5width___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(((rgb_matrix::FrameCanvas *)__pyx_t_1)->width()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(((rgb_matrix::FrameCanvas *)__pyx_t_1)->width()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3819,7 +4436,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_5width___get__(struct _ return __pyx_r; } -/* "rgbmatrix/core.pyx":80 +/* "rgbmatrix/core.pyx":97 * * property height: * def __get__(self): return (self.__getCanvas()).height() # <<<<<<<<<<<<<< @@ -3850,8 +4467,8 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_6height___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(((rgb_matrix::FrameCanvas *)__pyx_t_1)->height()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(((rgb_matrix::FrameCanvas *)__pyx_t_1)->height()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3868,7 +4485,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_6height___get__(struct return __pyx_r; } -/* "rgbmatrix/core.pyx":83 +/* "rgbmatrix/core.pyx":100 * * property pwmBits: * def __get__(self): return (self.__getCanvas()).pwmbits() # <<<<<<<<<<<<<< @@ -3899,8 +4516,8 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_7pwmBits___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_uint8_t(((rgb_matrix::FrameCanvas *)__pyx_t_1)->pwmbits()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_uint8_t(((rgb_matrix::FrameCanvas *)__pyx_t_1)->pwmbits()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3917,7 +4534,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_7pwmBits___get__(struct return __pyx_r; } -/* "rgbmatrix/core.pyx":84 +/* "rgbmatrix/core.pyx":101 * property pwmBits: * def __get__(self): return (self.__getCanvas()).pwmbits() * def __set__(self, pwmBits): (self.__getCanvas()).SetPWMBits(pwmBits) # <<<<<<<<<<<<<< @@ -3947,8 +4564,8 @@ static int __pyx_pf_9rgbmatrix_4core_11FrameCanvas_7pwmBits_2__set__(struct __py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_uint8_t(__pyx_v_pwmBits); if (unlikely((__pyx_t_2 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint8_t(__pyx_v_pwmBits); if (unlikely((__pyx_t_2 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error) (void)(((rgb_matrix::FrameCanvas *)__pyx_t_1)->SetPWMBits(__pyx_t_2)); /* function exit code */ @@ -3962,7 +4579,7 @@ static int __pyx_pf_9rgbmatrix_4core_11FrameCanvas_7pwmBits_2__set__(struct __py return __pyx_r; } -/* "rgbmatrix/core.pyx":87 +/* "rgbmatrix/core.pyx":104 * * property brightness: * def __get__(self): return (self.__getCanvas()).brightness() # <<<<<<<<<<<<<< @@ -3993,8 +4610,8 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10brightness___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_uint8_t(((rgb_matrix::FrameCanvas *)__pyx_t_1)->brightness()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_uint8_t(((rgb_matrix::FrameCanvas *)__pyx_t_1)->brightness()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4011,7 +4628,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10brightness___get__(st return __pyx_r; } -/* "rgbmatrix/core.pyx":88 +/* "rgbmatrix/core.pyx":105 * property brightness: * def __get__(self): return (self.__getCanvas()).brightness() * def __set__(self, val): (self.__getCanvas()).SetBrightness(val) # <<<<<<<<<<<<<< @@ -4041,8 +4658,8 @@ static int __pyx_pf_9rgbmatrix_4core_11FrameCanvas_10brightness_2__set__(struct const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_2 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___getCanvas(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_2 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) ((rgb_matrix::FrameCanvas *)__pyx_t_1)->SetBrightness(__pyx_t_2); /* function exit code */ @@ -4063,19 +4680,19 @@ static int __pyx_pf_9rgbmatrix_4core_11FrameCanvas_10brightness_2__set__(struct */ /* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_8__reduce_cython__(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self)); + __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_12__reduce_cython__(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4090,7 +4707,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_8__reduce_cython__(CYTH * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.__canvas cannot be converted to a Python object for pickling") */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4120,19 +4737,19 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_8__reduce_cython__(CYTH */ /* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_11FrameCanvas_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_10__setstate_cython__(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_9rgbmatrix_4core_11FrameCanvas_14__setstate_cython__(((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4146,7 +4763,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10__setstate_cython__(C * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.__canvas cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4169,7 +4786,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_11FrameCanvas_10__setstate_cython__(C return __pyx_r; } -/* "rgbmatrix/core.pyx":92 +/* "rgbmatrix/core.pyx":109 * * cdef class RGBMatrixOptions: * def __cinit__(self): # <<<<<<<<<<<<<< @@ -4200,7 +4817,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions___cinit__(struct __pyx_o struct rgb_matrix::RuntimeOptions __pyx_t_2; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "rgbmatrix/core.pyx":93 + /* "rgbmatrix/core.pyx":110 * cdef class RGBMatrixOptions: * def __cinit__(self): * self.__options = cppinc.Options() # <<<<<<<<<<<<<< @@ -4209,7 +4826,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions___cinit__(struct __pyx_o */ __pyx_v_self->__pyx___options = __pyx_t_1; - /* "rgbmatrix/core.pyx":94 + /* "rgbmatrix/core.pyx":111 * def __cinit__(self): * self.__options = cppinc.Options() * self.__runtime_options = cppinc.RuntimeOptions() # <<<<<<<<<<<<<< @@ -4218,7 +4835,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions___cinit__(struct __pyx_o */ __pyx_v_self->__pyx___runtime_options = __pyx_t_2; - /* "rgbmatrix/core.pyx":92 + /* "rgbmatrix/core.pyx":109 * * cdef class RGBMatrixOptions: * def __cinit__(self): # <<<<<<<<<<<<<< @@ -4232,7 +4849,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions___cinit__(struct __pyx_o return __pyx_r; } -/* "rgbmatrix/core.pyx":98 +/* "rgbmatrix/core.pyx":115 * # RGBMatrix::Options properties * property hardware_mapping: * def __get__(self): return self.__options.hardware_mapping # <<<<<<<<<<<<<< @@ -4262,7 +4879,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16hardware_mapping int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___options.hardware_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___options.hardware_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4279,7 +4896,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16hardware_mapping return __pyx_r; } -/* "rgbmatrix/core.pyx":99 +/* "rgbmatrix/core.pyx":116 * property hardware_mapping: * def __get__(self): return self.__options.hardware_mapping * def __set__(self, value): # <<<<<<<<<<<<<< @@ -4312,14 +4929,14 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16hardware_mapping_2__se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "rgbmatrix/core.pyx":100 + /* "rgbmatrix/core.pyx":117 * def __get__(self): return self.__options.hardware_mapping * def __set__(self, value): * self.__py_encoded_hardware_mapping = value.encode('utf-8') # <<<<<<<<<<<<<< * self.__options.hardware_mapping = self.__py_encoded_hardware_mapping * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -4333,17 +4950,17 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16hardware_mapping_2__se } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 100, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___py_encoded_hardware_mapping); __Pyx_DECREF(__pyx_v_self->__pyx___py_encoded_hardware_mapping); __pyx_v_self->__pyx___py_encoded_hardware_mapping = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":101 + /* "rgbmatrix/core.pyx":118 * def __set__(self, value): * self.__py_encoded_hardware_mapping = value.encode('utf-8') * self.__options.hardware_mapping = self.__py_encoded_hardware_mapping # <<<<<<<<<<<<<< @@ -4352,12 +4969,12 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16hardware_mapping_2__se */ if (unlikely(__pyx_v_self->__pyx___py_encoded_hardware_mapping == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 101, __pyx_L1_error) + __PYX_ERR(0, 118, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_self->__pyx___py_encoded_hardware_mapping); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_self->__pyx___py_encoded_hardware_mapping); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) __pyx_v_self->__pyx___options.hardware_mapping = __pyx_t_4; - /* "rgbmatrix/core.pyx":99 + /* "rgbmatrix/core.pyx":116 * property hardware_mapping: * def __get__(self): return self.__options.hardware_mapping * def __set__(self, value): # <<<<<<<<<<<<<< @@ -4379,7 +4996,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16hardware_mapping_2__se return __pyx_r; } -/* "rgbmatrix/core.pyx":104 +/* "rgbmatrix/core.pyx":121 * * property rows: * def __get__(self): return self.__options.rows # <<<<<<<<<<<<<< @@ -4409,7 +5026,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_4rows___get__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4426,7 +5043,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_4rows___get__(stru return __pyx_r; } -/* "rgbmatrix/core.pyx":105 +/* "rgbmatrix/core.pyx":122 * property rows: * def __get__(self): return self.__options.rows * def __set__(self, uint8_t value): self.__options.rows = value # <<<<<<<<<<<<<< @@ -4445,7 +5062,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_4rows_3__set__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4472,7 +5089,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_4rows_2__set__(struct __ return __pyx_r; } -/* "rgbmatrix/core.pyx":108 +/* "rgbmatrix/core.pyx":125 * * property cols: * def __get__(self): return self.__options.cols # <<<<<<<<<<<<<< @@ -4502,7 +5119,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_4cols___get__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4519,7 +5136,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_4cols___get__(stru return __pyx_r; } -/* "rgbmatrix/core.pyx":109 +/* "rgbmatrix/core.pyx":126 * property cols: * def __get__(self): return self.__options.cols * def __set__(self, uint32_t value): self.__options.cols = value # <<<<<<<<<<<<<< @@ -4538,7 +5155,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_4cols_3__set__(PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint32_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint32_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4565,7 +5182,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_4cols_2__set__(struct __ return __pyx_r; } -/* "rgbmatrix/core.pyx":112 +/* "rgbmatrix/core.pyx":129 * * property chain_length: * def __get__(self): return self.__options.chain_length # <<<<<<<<<<<<<< @@ -4595,7 +5212,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_12chain_length___g int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.chain_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.chain_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4612,7 +5229,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_12chain_length___g return __pyx_r; } -/* "rgbmatrix/core.pyx":113 +/* "rgbmatrix/core.pyx":130 * property chain_length: * def __get__(self): return self.__options.chain_length * def __set__(self, uint8_t value): self.__options.chain_length = value # <<<<<<<<<<<<<< @@ -4631,7 +5248,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_12chain_length_3__set__( __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4658,7 +5275,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_12chain_length_2__set__( return __pyx_r; } -/* "rgbmatrix/core.pyx":116 +/* "rgbmatrix/core.pyx":133 * * property parallel: * def __get__(self): return self.__options.parallel # <<<<<<<<<<<<<< @@ -4688,7 +5305,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_8parallel___get__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.parallel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.parallel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4705,7 +5322,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_8parallel___get__( return __pyx_r; } -/* "rgbmatrix/core.pyx":117 +/* "rgbmatrix/core.pyx":134 * property parallel: * def __get__(self): return self.__options.parallel * def __set__(self, uint8_t value): self.__options.parallel = value # <<<<<<<<<<<<<< @@ -4724,7 +5341,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_8parallel_3__set__(PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4751,7 +5368,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_8parallel_2__set__(struc return __pyx_r; } -/* "rgbmatrix/core.pyx":120 +/* "rgbmatrix/core.pyx":137 * * property pwm_bits: * def __get__(self): return self.__options.pwm_bits # <<<<<<<<<<<<<< @@ -4781,7 +5398,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_8pwm_bits___get__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.pwm_bits); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.pwm_bits); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4798,7 +5415,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_8pwm_bits___get__( return __pyx_r; } -/* "rgbmatrix/core.pyx":121 +/* "rgbmatrix/core.pyx":138 * property pwm_bits: * def __get__(self): return self.__options.pwm_bits * def __set__(self, uint8_t value): self.__options.pwm_bits = value # <<<<<<<<<<<<<< @@ -4817,7 +5434,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_8pwm_bits_3__set__(PyObj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4844,7 +5461,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_8pwm_bits_2__set__(struc return __pyx_r; } -/* "rgbmatrix/core.pyx":124 +/* "rgbmatrix/core.pyx":141 * * property pwm_lsb_nanoseconds: * def __get__(self): return self.__options.pwm_lsb_nanoseconds # <<<<<<<<<<<<<< @@ -4874,7 +5491,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pwm_lsb_nanoseco int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.pwm_lsb_nanoseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.pwm_lsb_nanoseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4891,7 +5508,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pwm_lsb_nanoseco return __pyx_r; } -/* "rgbmatrix/core.pyx":125 +/* "rgbmatrix/core.pyx":142 * property pwm_lsb_nanoseconds: * def __get__(self): return self.__options.pwm_lsb_nanoseconds * def __set__(self, uint32_t value): self.__options.pwm_lsb_nanoseconds = value # <<<<<<<<<<<<<< @@ -4910,7 +5527,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_19pwm_lsb_nanoseconds_3_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint32_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint32_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4937,7 +5554,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pwm_lsb_nanoseconds_2_ return __pyx_r; } -/* "rgbmatrix/core.pyx":128 +/* "rgbmatrix/core.pyx":145 * * property brightness: * def __get__(self): return self.__options.brightness # <<<<<<<<<<<<<< @@ -4967,7 +5584,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10brightness___get int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.brightness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.brightness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4984,7 +5601,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10brightness___get return __pyx_r; } -/* "rgbmatrix/core.pyx":129 +/* "rgbmatrix/core.pyx":146 * property brightness: * def __get__(self): return self.__options.brightness * def __set__(self, uint8_t value): self.__options.brightness = value # <<<<<<<<<<<<<< @@ -5003,7 +5620,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_10brightness_3__set__(Py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5030,7 +5647,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10brightness_2__set__(st return __pyx_r; } -/* "rgbmatrix/core.pyx":132 +/* "rgbmatrix/core.pyx":149 * * property scan_mode: * def __get__(self): return self.__options.scan_mode # <<<<<<<<<<<<<< @@ -5060,7 +5677,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_9scan_mode___get__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.scan_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.scan_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5077,7 +5694,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_9scan_mode___get__ return __pyx_r; } -/* "rgbmatrix/core.pyx":133 +/* "rgbmatrix/core.pyx":150 * property scan_mode: * def __get__(self): return self.__options.scan_mode * def __set__(self, uint8_t value): self.__options.scan_mode = value # <<<<<<<<<<<<<< @@ -5096,7 +5713,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_9scan_mode_3__set__(PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5123,7 +5740,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_9scan_mode_2__set__(stru return __pyx_r; } -/* "rgbmatrix/core.pyx":136 +/* "rgbmatrix/core.pyx":153 * * property multiplexing: * def __get__(self): return self.__options.multiplexing # <<<<<<<<<<<<<< @@ -5153,7 +5770,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_12multiplexing___g int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.multiplexing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.multiplexing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5170,7 +5787,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_12multiplexing___g return __pyx_r; } -/* "rgbmatrix/core.pyx":137 +/* "rgbmatrix/core.pyx":154 * property multiplexing: * def __get__(self): return self.__options.multiplexing * def __set__(self, uint8_t value): self.__options.multiplexing = value # <<<<<<<<<<<<<< @@ -5189,7 +5806,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_12multiplexing_3__set__( __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5216,7 +5833,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_12multiplexing_2__set__( return __pyx_r; } -/* "rgbmatrix/core.pyx":140 +/* "rgbmatrix/core.pyx":157 * * property row_address_type: * def __get__(self): return self.__options.row_address_type # <<<<<<<<<<<<<< @@ -5246,7 +5863,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16row_address_type int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.row_address_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.row_address_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5263,7 +5880,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16row_address_type return __pyx_r; } -/* "rgbmatrix/core.pyx":141 +/* "rgbmatrix/core.pyx":158 * property row_address_type: * def __get__(self): return self.__options.row_address_type * def __set__(self, uint8_t value): self.__options.row_address_type = value # <<<<<<<<<<<<<< @@ -5282,7 +5899,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_16row_address_type_3__se __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5309,7 +5926,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16row_address_type_2__se return __pyx_r; } -/* "rgbmatrix/core.pyx":144 +/* "rgbmatrix/core.pyx":161 * * property disable_hardware_pulsing: * def __get__(self): return self.__options.disable_hardware_pulsing # <<<<<<<<<<<<<< @@ -5339,7 +5956,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_24disable_hardware int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___options.disable_hardware_pulsing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___options.disable_hardware_pulsing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5356,7 +5973,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_24disable_hardware return __pyx_r; } -/* "rgbmatrix/core.pyx":145 +/* "rgbmatrix/core.pyx":162 * property disable_hardware_pulsing: * def __get__(self): return self.__options.disable_hardware_pulsing * def __set__(self, value): self.__options.disable_hardware_pulsing = value # <<<<<<<<<<<<<< @@ -5385,7 +6002,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_24disable_hardware_pulsi const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error) __pyx_v_self->__pyx___options.disable_hardware_pulsing = __pyx_t_1; /* function exit code */ @@ -5399,7 +6016,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_24disable_hardware_pulsi return __pyx_r; } -/* "rgbmatrix/core.pyx":148 +/* "rgbmatrix/core.pyx":165 * * property show_refresh_rate: * def __get__(self): return self.__options.show_refresh_rate # <<<<<<<<<<<<<< @@ -5429,7 +6046,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_17show_refresh_rat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___options.show_refresh_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___options.show_refresh_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5446,7 +6063,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_17show_refresh_rat return __pyx_r; } -/* "rgbmatrix/core.pyx":149 +/* "rgbmatrix/core.pyx":166 * property show_refresh_rate: * def __get__(self): return self.__options.show_refresh_rate * def __set__(self, value): self.__options.show_refresh_rate = value # <<<<<<<<<<<<<< @@ -5475,7 +6092,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_17show_refresh_rate_2__s const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error) __pyx_v_self->__pyx___options.show_refresh_rate = __pyx_t_1; /* function exit code */ @@ -5489,7 +6106,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_17show_refresh_rate_2__s return __pyx_r; } -/* "rgbmatrix/core.pyx":152 +/* "rgbmatrix/core.pyx":169 * * property inverse_colors: * def __get__(self): return self.__options.inverse_colors # <<<<<<<<<<<<<< @@ -5519,7 +6136,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_14inverse_colors__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___options.inverse_colors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___options.inverse_colors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5536,7 +6153,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_14inverse_colors__ return __pyx_r; } -/* "rgbmatrix/core.pyx":153 +/* "rgbmatrix/core.pyx":170 * property inverse_colors: * def __get__(self): return self.__options.inverse_colors * def __set__(self, value): self.__options.inverse_colors = value # <<<<<<<<<<<<<< @@ -5565,7 +6182,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_14inverse_colors_2__set_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error) __pyx_v_self->__pyx___options.inverse_colors = __pyx_t_1; /* function exit code */ @@ -5579,7 +6196,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_14inverse_colors_2__set_ return __pyx_r; } -/* "rgbmatrix/core.pyx":156 +/* "rgbmatrix/core.pyx":173 * * property led_rgb_sequence: * def __get__(self): return self.__options.led_rgb_sequence # <<<<<<<<<<<<<< @@ -5609,7 +6226,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16led_rgb_sequence int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___options.led_rgb_sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___options.led_rgb_sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5626,7 +6243,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16led_rgb_sequence return __pyx_r; } -/* "rgbmatrix/core.pyx":157 +/* "rgbmatrix/core.pyx":174 * property led_rgb_sequence: * def __get__(self): return self.__options.led_rgb_sequence * def __set__(self, value): # <<<<<<<<<<<<<< @@ -5659,14 +6276,14 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16led_rgb_sequence_2__se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "rgbmatrix/core.pyx":158 + /* "rgbmatrix/core.pyx":175 * def __get__(self): return self.__options.led_rgb_sequence * def __set__(self, value): * self.__py_encoded_led_rgb_sequence = value.encode('utf-8') # <<<<<<<<<<<<<< * self.__options.led_rgb_sequence = self.__py_encoded_led_rgb_sequence * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -5680,17 +6297,17 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16led_rgb_sequence_2__se } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 158, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___py_encoded_led_rgb_sequence); __Pyx_DECREF(__pyx_v_self->__pyx___py_encoded_led_rgb_sequence); __pyx_v_self->__pyx___py_encoded_led_rgb_sequence = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":159 + /* "rgbmatrix/core.pyx":176 * def __set__(self, value): * self.__py_encoded_led_rgb_sequence = value.encode('utf-8') * self.__options.led_rgb_sequence = self.__py_encoded_led_rgb_sequence # <<<<<<<<<<<<<< @@ -5699,12 +6316,12 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16led_rgb_sequence_2__se */ if (unlikely(__pyx_v_self->__pyx___py_encoded_led_rgb_sequence == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 159, __pyx_L1_error) + __PYX_ERR(0, 176, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_self->__pyx___py_encoded_led_rgb_sequence); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_self->__pyx___py_encoded_led_rgb_sequence); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_v_self->__pyx___options.led_rgb_sequence = __pyx_t_4; - /* "rgbmatrix/core.pyx":157 + /* "rgbmatrix/core.pyx":174 * property led_rgb_sequence: * def __get__(self): return self.__options.led_rgb_sequence * def __set__(self, value): # <<<<<<<<<<<<<< @@ -5726,7 +6343,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_16led_rgb_sequence_2__se return __pyx_r; } -/* "rgbmatrix/core.pyx":162 +/* "rgbmatrix/core.pyx":179 * * property pixel_mapper_config: * def __get__(self): return self.__options.pixel_mapper_config # <<<<<<<<<<<<<< @@ -5756,7 +6373,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pixel_mapper_con int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___options.pixel_mapper_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___options.pixel_mapper_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5773,7 +6390,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pixel_mapper_con return __pyx_r; } -/* "rgbmatrix/core.pyx":163 +/* "rgbmatrix/core.pyx":180 * property pixel_mapper_config: * def __get__(self): return self.__options.pixel_mapper_config * def __set__(self, value): # <<<<<<<<<<<<<< @@ -5806,14 +6423,14 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pixel_mapper_config_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "rgbmatrix/core.pyx":164 + /* "rgbmatrix/core.pyx":181 * def __get__(self): return self.__options.pixel_mapper_config * def __set__(self, value): * self.__py_encoded_pixel_mapper_config = value.encode('utf-8') # <<<<<<<<<<<<<< * self.__options.pixel_mapper_config = self.__py_encoded_pixel_mapper_config * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -5827,17 +6444,17 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pixel_mapper_config_2_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 164, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___py_encoded_pixel_mapper_config); __Pyx_DECREF(__pyx_v_self->__pyx___py_encoded_pixel_mapper_config); __pyx_v_self->__pyx___py_encoded_pixel_mapper_config = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":165 + /* "rgbmatrix/core.pyx":182 * def __set__(self, value): * self.__py_encoded_pixel_mapper_config = value.encode('utf-8') * self.__options.pixel_mapper_config = self.__py_encoded_pixel_mapper_config # <<<<<<<<<<<<<< @@ -5846,12 +6463,12 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pixel_mapper_config_2_ */ if (unlikely(__pyx_v_self->__pyx___py_encoded_pixel_mapper_config == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 165, __pyx_L1_error) + __PYX_ERR(0, 182, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_self->__pyx___py_encoded_pixel_mapper_config); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_self->__pyx___py_encoded_pixel_mapper_config); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_v_self->__pyx___options.pixel_mapper_config = __pyx_t_4; - /* "rgbmatrix/core.pyx":163 + /* "rgbmatrix/core.pyx":180 * property pixel_mapper_config: * def __get__(self): return self.__options.pixel_mapper_config * def __set__(self, value): # <<<<<<<<<<<<<< @@ -5873,7 +6490,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_19pixel_mapper_config_2_ return __pyx_r; } -/* "rgbmatrix/core.pyx":168 +/* "rgbmatrix/core.pyx":185 * * property panel_type: * def __get__(self): return self.__options.panel_type # <<<<<<<<<<<<<< @@ -5903,7 +6520,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10panel_type___get int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___options.panel_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx___options.panel_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5920,7 +6537,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10panel_type___get return __pyx_r; } -/* "rgbmatrix/core.pyx":169 +/* "rgbmatrix/core.pyx":186 * property panel_type: * def __get__(self): return self.__options.panel_type * def __set__(self, value): # <<<<<<<<<<<<<< @@ -5953,14 +6570,14 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10panel_type_2__set__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "rgbmatrix/core.pyx":170 + /* "rgbmatrix/core.pyx":187 * def __get__(self): return self.__options.panel_type * def __set__(self, value): * self.__py_encoded_panel_type = value.encode('utf-8') # <<<<<<<<<<<<<< * self.__options.panel_type = self.__py_encoded_panel_type * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -5974,17 +6591,17 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10panel_type_2__set__(st } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 170, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx___py_encoded_panel_type); __Pyx_DECREF(__pyx_v_self->__pyx___py_encoded_panel_type); __pyx_v_self->__pyx___py_encoded_panel_type = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":171 + /* "rgbmatrix/core.pyx":188 * def __set__(self, value): * self.__py_encoded_panel_type = value.encode('utf-8') * self.__options.panel_type = self.__py_encoded_panel_type # <<<<<<<<<<<<<< @@ -5993,12 +6610,12 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10panel_type_2__set__(st */ if (unlikely(__pyx_v_self->__pyx___py_encoded_panel_type == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 171, __pyx_L1_error) + __PYX_ERR(0, 188, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_self->__pyx___py_encoded_panel_type); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_self->__pyx___py_encoded_panel_type); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) __pyx_v_self->__pyx___options.panel_type = __pyx_t_4; - /* "rgbmatrix/core.pyx":169 + /* "rgbmatrix/core.pyx":186 * property panel_type: * def __get__(self): return self.__options.panel_type * def __set__(self, value): # <<<<<<<<<<<<<< @@ -6020,7 +6637,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_10panel_type_2__set__(st return __pyx_r; } -/* "rgbmatrix/core.pyx":174 +/* "rgbmatrix/core.pyx":191 * * property pwm_dither_bits: * def __get__(self): return self.__options.pwm_dither_bits # <<<<<<<<<<<<<< @@ -6050,7 +6667,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_15pwm_dither_bits_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.pwm_dither_bits); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.pwm_dither_bits); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6067,7 +6684,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_15pwm_dither_bits_ return __pyx_r; } -/* "rgbmatrix/core.pyx":175 +/* "rgbmatrix/core.pyx":192 * property pwm_dither_bits: * def __get__(self): return self.__options.pwm_dither_bits * def __set__(self, uint8_t value): self.__options.pwm_dither_bits = value # <<<<<<<<<<<<<< @@ -6086,7 +6703,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_15pwm_dither_bits_3__set __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6113,7 +6730,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_15pwm_dither_bits_2__set return __pyx_r; } -/* "rgbmatrix/core.pyx":178 +/* "rgbmatrix/core.pyx":195 * * property limit_refresh_rate_hz: * def __get__(self): return self.__options.limit_refresh_rate_hz # <<<<<<<<<<<<<< @@ -6143,7 +6760,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_21limit_refresh_ra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.limit_refresh_rate_hz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___options.limit_refresh_rate_hz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6160,7 +6777,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_21limit_refresh_ra return __pyx_r; } -/* "rgbmatrix/core.pyx":179 +/* "rgbmatrix/core.pyx":196 * property limit_refresh_rate_hz: * def __get__(self): return self.__options.limit_refresh_rate_hz * def __set__(self, value): self.__options.limit_refresh_rate_hz = value # <<<<<<<<<<<<<< @@ -6189,7 +6806,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_21limit_refresh_rate_hz_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_v_self->__pyx___options.limit_refresh_rate_hz = __pyx_t_1; /* function exit code */ @@ -6203,7 +6820,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_21limit_refresh_rate_hz_ return __pyx_r; } -/* "rgbmatrix/core.pyx":185 +/* "rgbmatrix/core.pyx":202 * * property gpio_slowdown: * def __get__(self): return self.__runtime_options.gpio_slowdown # <<<<<<<<<<<<<< @@ -6233,7 +6850,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_13gpio_slowdown___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___runtime_options.gpio_slowdown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___runtime_options.gpio_slowdown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6250,7 +6867,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_13gpio_slowdown___ return __pyx_r; } -/* "rgbmatrix/core.pyx":186 +/* "rgbmatrix/core.pyx":203 * property gpio_slowdown: * def __get__(self): return self.__runtime_options.gpio_slowdown * def __set__(self, uint8_t value): self.__runtime_options.gpio_slowdown = value # <<<<<<<<<<<<<< @@ -6269,7 +6886,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_13gpio_slowdown_3__set__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6296,7 +6913,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_13gpio_slowdown_2__set__ return __pyx_r; } -/* "rgbmatrix/core.pyx":189 +/* "rgbmatrix/core.pyx":206 * * property daemon: * def __get__(self): return self.__runtime_options.daemon # <<<<<<<<<<<<<< @@ -6326,7 +6943,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_6daemon___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___runtime_options.daemon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___runtime_options.daemon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6343,7 +6960,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_6daemon___get__(st return __pyx_r; } -/* "rgbmatrix/core.pyx":190 +/* "rgbmatrix/core.pyx":207 * property daemon: * def __get__(self): return self.__runtime_options.daemon * def __set__(self, uint8_t value): self.__runtime_options.daemon = value # <<<<<<<<<<<<<< @@ -6362,7 +6979,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_6daemon_3__set__(PyObjec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6389,7 +7006,7 @@ static int __pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_6daemon_2__set__(struct return __pyx_r; } -/* "rgbmatrix/core.pyx":193 +/* "rgbmatrix/core.pyx":210 * * property drop_privileges: * def __get__(self): return self.__runtime_options.drop_privileges # <<<<<<<<<<<<<< @@ -6419,7 +7036,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_15drop_privileges_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___runtime_options.drop_privileges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___runtime_options.drop_privileges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6436,7 +7053,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_15drop_privileges_ return __pyx_r; } -/* "rgbmatrix/core.pyx":194 +/* "rgbmatrix/core.pyx":211 * property drop_privileges: * def __get__(self): return self.__runtime_options.drop_privileges * def __set__(self, uint8_t value): self.__runtime_options.drop_privileges = value # <<<<<<<<<<<<<< @@ -6455,7 +7072,7 @@ static int __pyx_pw_9rgbmatrix_4core_16RGBMatrixOptions_15drop_privileges_3__set __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error) + __pyx_v_value = __Pyx_PyInt_As_uint8_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6516,7 +7133,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_2__reduce_cython__ * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6572,7 +7189,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_4__setstate_cython * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6595,7 +7212,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_16RGBMatrixOptions_4__setstate_cython return __pyx_r; } -/* "rgbmatrix/core.pyx":197 +/* "rgbmatrix/core.pyx":214 * * cdef class RGBMatrix(Canvas): * def __cinit__(self, int rows = 0, int chains = 0, int parallel = 0, # <<<<<<<<<<<<<< @@ -6620,7 +7237,7 @@ static int __pyx_pw_9rgbmatrix_4core_9RGBMatrix_1__cinit__(PyObject *__pyx_v_sel static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_chains,&__pyx_n_s_parallel,&__pyx_n_s_options,0}; PyObject* values[4] = {0,0,0,0}; - /* "rgbmatrix/core.pyx":198 + /* "rgbmatrix/core.pyx":215 * cdef class RGBMatrix(Canvas): * def __cinit__(self, int rows = 0, int chains = 0, int parallel = 0, * RGBMatrixOptions options = None): # <<<<<<<<<<<<<< @@ -6670,7 +7287,7 @@ static int __pyx_pw_9rgbmatrix_4core_9RGBMatrix_1__cinit__(PyObject *__pyx_v_sel } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 197, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 214, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6687,17 +7304,17 @@ static int __pyx_pw_9rgbmatrix_4core_9RGBMatrix_1__cinit__(PyObject *__pyx_v_sel } } if (values[0]) { - __pyx_v_rows = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) + __pyx_v_rows = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) } else { __pyx_v_rows = ((int)0); } if (values[1]) { - __pyx_v_chains = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_chains == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) + __pyx_v_chains = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_chains == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) } else { __pyx_v_chains = ((int)0); } if (values[2]) { - __pyx_v_parallel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_parallel == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) + __pyx_v_parallel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_parallel == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) } else { __pyx_v_parallel = ((int)0); } @@ -6705,16 +7322,16 @@ static int __pyx_pw_9rgbmatrix_4core_9RGBMatrix_1__cinit__(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 197, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 214, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions, 1, "options", 0))) __PYX_ERR(0, 198, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions, 1, "options", 0))) __PYX_ERR(0, 215, __pyx_L1_error) __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), __pyx_v_rows, __pyx_v_chains, __pyx_v_parallel, __pyx_v_options); - /* "rgbmatrix/core.pyx":197 + /* "rgbmatrix/core.pyx":214 * * cdef class RGBMatrix(Canvas): * def __cinit__(self, int rows = 0, int chains = 0, int parallel = 0, # <<<<<<<<<<<<<< @@ -6742,31 +7359,31 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF((PyObject *)__pyx_v_options); - /* "rgbmatrix/core.pyx":202 + /* "rgbmatrix/core.pyx":219 * # If RGBMatrixOptions not provided, create defaults and set any optional * # parameters supplied * if options == None: # <<<<<<<<<<<<<< * options = RGBMatrixOptions() * */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_options), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_options), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "rgbmatrix/core.pyx":203 + /* "rgbmatrix/core.pyx":220 * # parameters supplied * if options == None: * options = RGBMatrixOptions() # <<<<<<<<<<<<<< * * if rows > 0: */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_options, ((struct __pyx_obj_9rgbmatrix_4core_RGBMatrixOptions *)__pyx_t_1)); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":202 + /* "rgbmatrix/core.pyx":219 * # If RGBMatrixOptions not provided, create defaults and set any optional * # parameters supplied * if options == None: # <<<<<<<<<<<<<< @@ -6775,7 +7392,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm */ } - /* "rgbmatrix/core.pyx":205 + /* "rgbmatrix/core.pyx":222 * options = RGBMatrixOptions() * * if rows > 0: # <<<<<<<<<<<<<< @@ -6785,19 +7402,19 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm __pyx_t_2 = ((__pyx_v_rows > 0) != 0); if (__pyx_t_2) { - /* "rgbmatrix/core.pyx":206 + /* "rgbmatrix/core.pyx":223 * * if rows > 0: * options.rows = rows # <<<<<<<<<<<<<< * if chains > 0: * options.chain_length = chains */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_options), __pyx_n_s_rows, __pyx_t_1) < 0) __PYX_ERR(0, 206, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_options), __pyx_n_s_rows, __pyx_t_1) < 0) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":205 + /* "rgbmatrix/core.pyx":222 * options = RGBMatrixOptions() * * if rows > 0: # <<<<<<<<<<<<<< @@ -6806,7 +7423,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm */ } - /* "rgbmatrix/core.pyx":207 + /* "rgbmatrix/core.pyx":224 * if rows > 0: * options.rows = rows * if chains > 0: # <<<<<<<<<<<<<< @@ -6816,19 +7433,19 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm __pyx_t_2 = ((__pyx_v_chains > 0) != 0); if (__pyx_t_2) { - /* "rgbmatrix/core.pyx":208 + /* "rgbmatrix/core.pyx":225 * options.rows = rows * if chains > 0: * options.chain_length = chains # <<<<<<<<<<<<<< * if parallel > 0: * options.parallel = parallel */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_chains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_chains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_options), __pyx_n_s_chain_length, __pyx_t_1) < 0) __PYX_ERR(0, 208, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_options), __pyx_n_s_chain_length, __pyx_t_1) < 0) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":207 + /* "rgbmatrix/core.pyx":224 * if rows > 0: * options.rows = rows * if chains > 0: # <<<<<<<<<<<<<< @@ -6837,7 +7454,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm */ } - /* "rgbmatrix/core.pyx":209 + /* "rgbmatrix/core.pyx":226 * if chains > 0: * options.chain_length = chains * if parallel > 0: # <<<<<<<<<<<<<< @@ -6847,19 +7464,19 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm __pyx_t_2 = ((__pyx_v_parallel > 0) != 0); if (__pyx_t_2) { - /* "rgbmatrix/core.pyx":210 + /* "rgbmatrix/core.pyx":227 * options.chain_length = chains * if parallel > 0: * options.parallel = parallel # <<<<<<<<<<<<<< * * self.__matrix = cppinc.CreateMatrixFromOptions(options.__options, */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_parallel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_parallel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_options), __pyx_n_s_parallel, __pyx_t_1) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_options), __pyx_n_s_parallel, __pyx_t_1) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "rgbmatrix/core.pyx":209 + /* "rgbmatrix/core.pyx":226 * if chains > 0: * options.chain_length = chains * if parallel > 0: # <<<<<<<<<<<<<< @@ -6868,7 +7485,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm */ } - /* "rgbmatrix/core.pyx":212 + /* "rgbmatrix/core.pyx":229 * options.parallel = parallel * * self.__matrix = cppinc.CreateMatrixFromOptions(options.__options, # <<<<<<<<<<<<<< @@ -6877,7 +7494,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm */ __pyx_v_self->__pyx___matrix = rgb_matrix::CreateMatrixFromOptions(__pyx_v_options->__pyx___options, __pyx_v_options->__pyx___runtime_options); - /* "rgbmatrix/core.pyx":197 + /* "rgbmatrix/core.pyx":214 * * cdef class RGBMatrix(Canvas): * def __cinit__(self, int rows = 0, int chains = 0, int parallel = 0, # <<<<<<<<<<<<<< @@ -6898,7 +7515,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix___cinit__(struct __pyx_obj_9rgbm return __pyx_r; } -/* "rgbmatrix/core.pyx":215 +/* "rgbmatrix/core.pyx":232 * options.__runtime_options) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -6921,7 +7538,7 @@ static void __pyx_pf_9rgbmatrix_4core_9RGBMatrix_2__dealloc__(struct __pyx_obj_9 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "rgbmatrix/core.pyx":216 + /* "rgbmatrix/core.pyx":233 * * def __dealloc__(self): * self.__matrix.Clear() # <<<<<<<<<<<<<< @@ -6930,7 +7547,7 @@ static void __pyx_pf_9rgbmatrix_4core_9RGBMatrix_2__dealloc__(struct __pyx_obj_9 */ __pyx_v_self->__pyx___matrix->Clear(); - /* "rgbmatrix/core.pyx":217 + /* "rgbmatrix/core.pyx":234 * def __dealloc__(self): * self.__matrix.Clear() * del self.__matrix # <<<<<<<<<<<<<< @@ -6939,7 +7556,7 @@ static void __pyx_pf_9rgbmatrix_4core_9RGBMatrix_2__dealloc__(struct __pyx_obj_9 */ delete __pyx_v_self->__pyx___matrix; - /* "rgbmatrix/core.pyx":215 + /* "rgbmatrix/core.pyx":232 * options.__runtime_options) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -6951,7 +7568,7 @@ static void __pyx_pf_9rgbmatrix_4core_9RGBMatrix_2__dealloc__(struct __pyx_obj_9 __Pyx_RefNannyFinishContext(); } -/* "rgbmatrix/core.pyx":219 +/* "rgbmatrix/core.pyx":236 * del self.__matrix * * cdef cppinc.Canvas* __getCanvas(self) except *: # <<<<<<<<<<<<<< @@ -6969,7 +7586,7 @@ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getCanvas", 0); - /* "rgbmatrix/core.pyx":220 + /* "rgbmatrix/core.pyx":237 * * cdef cppinc.Canvas* __getCanvas(self) except *: * if self.__matrix != NULL: # <<<<<<<<<<<<<< @@ -6979,7 +7596,7 @@ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas(struct __pyx __pyx_t_1 = ((((void *)__pyx_v_self->__pyx___matrix) != NULL) != 0); if (__pyx_t_1) { - /* "rgbmatrix/core.pyx":221 + /* "rgbmatrix/core.pyx":238 * cdef cppinc.Canvas* __getCanvas(self) except *: * if self.__matrix != NULL: * return self.__matrix # <<<<<<<<<<<<<< @@ -6989,7 +7606,7 @@ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas(struct __pyx __pyx_r = __pyx_v_self->__pyx___matrix; goto __pyx_L0; - /* "rgbmatrix/core.pyx":220 + /* "rgbmatrix/core.pyx":237 * * cdef cppinc.Canvas* __getCanvas(self) except *: * if self.__matrix != NULL: # <<<<<<<<<<<<<< @@ -6998,20 +7615,20 @@ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas(struct __pyx */ } - /* "rgbmatrix/core.pyx":222 + /* "rgbmatrix/core.pyx":239 * if self.__matrix != NULL: * return self.__matrix * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") # <<<<<<<<<<<<<< * * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 222, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) - /* "rgbmatrix/core.pyx":219 + /* "rgbmatrix/core.pyx":236 * del self.__matrix * * cdef cppinc.Canvas* __getCanvas(self) except *: # <<<<<<<<<<<<<< @@ -7033,7 +7650,7 @@ rgb_matrix::Canvas *__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas__pyx_wrap_1( return __pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas(__pyx_v_self); } -/* "rgbmatrix/core.pyx":224 +/* "rgbmatrix/core.pyx":241 * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") * * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< @@ -7078,17 +7695,17 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_5Fill(PyObject *__pyx_v_se case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, 1); __PYX_ERR(0, 224, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, 1); __PYX_ERR(0, 241, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, 2); __PYX_ERR(0, 224, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, 2); __PYX_ERR(0, 241, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Fill") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Fill") < 0)) __PYX_ERR(0, 241, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -7097,13 +7714,13 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_5Fill(PyObject *__pyx_v_se values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_red = __Pyx_PyInt_As_uint8_t(values[0]); if (unlikely((__pyx_v_red == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) - __pyx_v_green = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_green == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) - __pyx_v_blue = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_blue == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_v_red = __Pyx_PyInt_As_uint8_t(values[0]); if (unlikely((__pyx_v_red == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L3_error) + __pyx_v_green = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_green == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L3_error) + __pyx_v_blue = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_blue == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("Fill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 241, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.Fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7121,7 +7738,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_4Fill(struct __pyx_obj_9rg __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Fill", 0); - /* "rgbmatrix/core.pyx":225 + /* "rgbmatrix/core.pyx":242 * * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): * self.__matrix.Fill(red, green, blue) # <<<<<<<<<<<<<< @@ -7130,7 +7747,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_4Fill(struct __pyx_obj_9rg */ __pyx_v_self->__pyx___matrix->Fill(__pyx_v_red, __pyx_v_green, __pyx_v_blue); - /* "rgbmatrix/core.pyx":224 + /* "rgbmatrix/core.pyx":241 * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") * * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< @@ -7145,7 +7762,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_4Fill(struct __pyx_obj_9rg return __pyx_r; } -/* "rgbmatrix/core.pyx":227 +/* "rgbmatrix/core.pyx":244 * self.__matrix.Fill(red, green, blue) * * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< @@ -7196,29 +7813,29 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_7SetPixel(PyObject *__pyx_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 1); __PYX_ERR(0, 227, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 1); __PYX_ERR(0, 244, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 2); __PYX_ERR(0, 227, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 2); __PYX_ERR(0, 244, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 3); __PYX_ERR(0, 227, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 3); __PYX_ERR(0, 244, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 4); __PYX_ERR(0, 227, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, 4); __PYX_ERR(0, 244, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SetPixel") < 0)) __PYX_ERR(0, 227, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SetPixel") < 0)) __PYX_ERR(0, 244, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -7229,15 +7846,15 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_7SetPixel(PyObject *__pyx_ values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } - __pyx_v_x = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error) - __pyx_v_y = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error) - __pyx_v_red = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_red == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error) - __pyx_v_green = __Pyx_PyInt_As_uint8_t(values[3]); if (unlikely((__pyx_v_green == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error) - __pyx_v_blue = __Pyx_PyInt_As_uint8_t(values[4]); if (unlikely((__pyx_v_blue == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error) + __pyx_v_x = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) + __pyx_v_y = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_y == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) + __pyx_v_red = __Pyx_PyInt_As_uint8_t(values[2]); if (unlikely((__pyx_v_red == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) + __pyx_v_green = __Pyx_PyInt_As_uint8_t(values[3]); if (unlikely((__pyx_v_green == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) + __pyx_v_blue = __Pyx_PyInt_As_uint8_t(values[4]); if (unlikely((__pyx_v_blue == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 227, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SetPixel", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 244, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.SetPixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7255,7 +7872,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6SetPixel(struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("SetPixel", 0); - /* "rgbmatrix/core.pyx":228 + /* "rgbmatrix/core.pyx":245 * * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): * self.__matrix.SetPixel(x, y, red, green, blue) # <<<<<<<<<<<<<< @@ -7264,7 +7881,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6SetPixel(struct __pyx_obj */ __pyx_v_self->__pyx___matrix->SetPixel(__pyx_v_x, __pyx_v_y, __pyx_v_red, __pyx_v_green, __pyx_v_blue); - /* "rgbmatrix/core.pyx":227 + /* "rgbmatrix/core.pyx":244 * self.__matrix.Fill(red, green, blue) * * def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): # <<<<<<<<<<<<<< @@ -7279,7 +7896,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6SetPixel(struct __pyx_obj return __pyx_r; } -/* "rgbmatrix/core.pyx":230 +/* "rgbmatrix/core.pyx":247 * self.__matrix.SetPixel(x, y, red, green, blue) * * def Clear(self): # <<<<<<<<<<<<<< @@ -7305,7 +7922,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_8Clear(struct __pyx_obj_9r __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Clear", 0); - /* "rgbmatrix/core.pyx":231 + /* "rgbmatrix/core.pyx":248 * * def Clear(self): * self.__matrix.Clear() # <<<<<<<<<<<<<< @@ -7314,7 +7931,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_8Clear(struct __pyx_obj_9r */ __pyx_v_self->__pyx___matrix->Clear(); - /* "rgbmatrix/core.pyx":230 + /* "rgbmatrix/core.pyx":247 * self.__matrix.SetPixel(x, y, red, green, blue) * * def Clear(self): # <<<<<<<<<<<<<< @@ -7329,7 +7946,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_8Clear(struct __pyx_obj_9r return __pyx_r; } -/* "rgbmatrix/core.pyx":245 +/* "rgbmatrix/core.pyx":262 * # memory as they are only deleted when the RGBMatrix is deleted or by * # calling DeleteFrameCanvas(). * def CreateFrameCanvas(self): # <<<<<<<<<<<<<< @@ -7359,7 +7976,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10CreateFrameCanvas(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("CreateFrameCanvas", 0); - /* "rgbmatrix/core.pyx":246 + /* "rgbmatrix/core.pyx":263 * # calling DeleteFrameCanvas(). * def CreateFrameCanvas(self): * return __createFrameCanvas(self.__matrix.CreateFrameCanvas()) # <<<<<<<<<<<<<< @@ -7367,13 +7984,13 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10CreateFrameCanvas(struct * # Delete a FrameCanvas associated with the RGBMatrix */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_9rgbmatrix_4core___createFrameCanvas(__pyx_v_self->__pyx___matrix->CreateFrameCanvas()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __pyx_f_9rgbmatrix_4core___createFrameCanvas(__pyx_v_self->__pyx___matrix->CreateFrameCanvas()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "rgbmatrix/core.pyx":245 + /* "rgbmatrix/core.pyx":262 * # memory as they are only deleted when the RGBMatrix is deleted or by * # calling DeleteFrameCanvas(). * def CreateFrameCanvas(self): # <<<<<<<<<<<<<< @@ -7392,7 +8009,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10CreateFrameCanvas(struct return __pyx_r; } -/* "rgbmatrix/core.pyx":251 +/* "rgbmatrix/core.pyx":268 * # Otherwise FrameCanvas objects created by CreateFrameCanvas() are never deleted * # until the RGBMatrix is deleted * def DeleteFrameCanvas(self, FrameCanvas frame): # <<<<<<<<<<<<<< @@ -7409,7 +8026,7 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_13DeleteFrameCanvas(PyObje PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("DeleteFrameCanvas (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame), __pyx_ptype_9rgbmatrix_4core_FrameCanvas, 1, "frame", 0))) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame), __pyx_ptype_9rgbmatrix_4core_FrameCanvas, 1, "frame", 0))) __PYX_ERR(0, 268, __pyx_L1_error) __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_12DeleteFrameCanvas(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), ((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_v_frame)); /* function exit code */ @@ -7427,7 +8044,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12DeleteFrameCanvas(struct __Pyx_RefNannySetupContext("DeleteFrameCanvas", 0); __Pyx_INCREF((PyObject *)__pyx_v_frame); - /* "rgbmatrix/core.pyx":252 + /* "rgbmatrix/core.pyx":269 * # until the RGBMatrix is deleted * def DeleteFrameCanvas(self, FrameCanvas frame): * self.__matrix.DeleteFrameCanvas(frame.__canvas) # <<<<<<<<<<<<<< @@ -7436,7 +8053,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12DeleteFrameCanvas(struct */ __pyx_v_self->__pyx___matrix->DeleteFrameCanvas(__pyx_v_frame->__pyx___canvas); - /* "rgbmatrix/core.pyx":253 + /* "rgbmatrix/core.pyx":270 * def DeleteFrameCanvas(self, FrameCanvas frame): * self.__matrix.DeleteFrameCanvas(frame.__canvas) * del frame # <<<<<<<<<<<<<< @@ -7446,7 +8063,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12DeleteFrameCanvas(struct __Pyx_DECREF(((PyObject *)__pyx_v_frame)); __pyx_v_frame = NULL; - /* "rgbmatrix/core.pyx":251 + /* "rgbmatrix/core.pyx":268 * # Otherwise FrameCanvas objects created by CreateFrameCanvas() are never deleted * # until the RGBMatrix is deleted * def DeleteFrameCanvas(self, FrameCanvas frame): # <<<<<<<<<<<<<< @@ -7462,7 +8079,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_12DeleteFrameCanvas(struct return __pyx_r; } -/* "rgbmatrix/core.pyx":263 +/* "rgbmatrix/core.pyx":280 * # If you combine this with RGBMatrixOptions.limit_refresh_rate_hz you can create * # time-correct animations. * def SwapOnVSync(self, FrameCanvas newFrame, uint8_t framerate_fraction = 1): # <<<<<<<<<<<<<< @@ -7508,7 +8125,7 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_15SwapOnVSync(PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SwapOnVSync") < 0)) __PYX_ERR(0, 263, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SwapOnVSync") < 0)) __PYX_ERR(0, 280, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7521,20 +8138,20 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_15SwapOnVSync(PyObject *__ } __pyx_v_newFrame = ((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)values[0]); if (values[1]) { - __pyx_v_framerate_fraction = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_framerate_fraction == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 263, __pyx_L3_error) + __pyx_v_framerate_fraction = __Pyx_PyInt_As_uint8_t(values[1]); if (unlikely((__pyx_v_framerate_fraction == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L3_error) } else { __pyx_v_framerate_fraction = ((uint8_t)1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("SwapOnVSync", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 263, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("SwapOnVSync", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 280, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.SwapOnVSync", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newFrame), __pyx_ptype_9rgbmatrix_4core_FrameCanvas, 1, "newFrame", 0))) __PYX_ERR(0, 263, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newFrame), __pyx_ptype_9rgbmatrix_4core_FrameCanvas, 1, "newFrame", 0))) __PYX_ERR(0, 280, __pyx_L1_error) __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_14SwapOnVSync(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), __pyx_v_newFrame, __pyx_v_framerate_fraction); /* function exit code */ @@ -7555,7 +8172,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_14SwapOnVSync(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SwapOnVSync", 0); - /* "rgbmatrix/core.pyx":264 + /* "rgbmatrix/core.pyx":281 * # time-correct animations. * def SwapOnVSync(self, FrameCanvas newFrame, uint8_t framerate_fraction = 1): * return __createFrameCanvas(self.__matrix.SwapOnVSync(newFrame.__canvas, framerate_fraction)) # <<<<<<<<<<<<<< @@ -7563,13 +8180,13 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_14SwapOnVSync(struct __pyx * property luminanceCorrect: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_9rgbmatrix_4core___createFrameCanvas(__pyx_v_self->__pyx___matrix->SwapOnVSync(__pyx_v_newFrame->__pyx___canvas, __pyx_v_framerate_fraction)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_1 = __pyx_f_9rgbmatrix_4core___createFrameCanvas(__pyx_v_self->__pyx___matrix->SwapOnVSync(__pyx_v_newFrame->__pyx___canvas, __pyx_v_framerate_fraction)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "rgbmatrix/core.pyx":263 + /* "rgbmatrix/core.pyx":280 * # If you combine this with RGBMatrixOptions.limit_refresh_rate_hz you can create * # time-correct animations. * def SwapOnVSync(self, FrameCanvas newFrame, uint8_t framerate_fraction = 1): # <<<<<<<<<<<<<< @@ -7588,7 +8205,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_14SwapOnVSync(struct __pyx return __pyx_r; } -/* "rgbmatrix/core.pyx":267 +/* "rgbmatrix/core.pyx":284 * * property luminanceCorrect: * def __get__(self): return self.__matrix.luminance_correct() # <<<<<<<<<<<<<< @@ -7618,7 +8235,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect___get__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___matrix->luminance_correct()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx___matrix->luminance_correct()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7635,7 +8252,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect___get__ return __pyx_r; } -/* "rgbmatrix/core.pyx":268 +/* "rgbmatrix/core.pyx":285 * property luminanceCorrect: * def __get__(self): return self.__matrix.luminance_correct() * def __set__(self, luminanceCorrect): self.__matrix.set_luminance_correct(luminanceCorrect) # <<<<<<<<<<<<<< @@ -7664,7 +8281,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect_2__set__(stru const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_luminanceCorrect); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_luminanceCorrect); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error) __pyx_v_self->__pyx___matrix->set_luminance_correct(__pyx_t_1); /* function exit code */ @@ -7678,7 +8295,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16luminanceCorrect_2__set__(stru return __pyx_r; } -/* "rgbmatrix/core.pyx":271 +/* "rgbmatrix/core.pyx":288 * * property pwmBits: * def __get__(self): return self.__matrix.pwmbits() # <<<<<<<<<<<<<< @@ -7708,7 +8325,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits___get__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->__pyx___matrix->pwmbits()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->__pyx___matrix->pwmbits()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7725,7 +8342,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits___get__(struct __ return __pyx_r; } -/* "rgbmatrix/core.pyx":272 +/* "rgbmatrix/core.pyx":289 * property pwmBits: * def __get__(self): return self.__matrix.pwmbits() * def __set__(self, pwmBits): self.__matrix.SetPWMBits(pwmBits) # <<<<<<<<<<<<<< @@ -7754,7 +8371,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits_2__set__(struct __pyx_o const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_pwmBits); if (unlikely((__pyx_t_1 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_pwmBits); if (unlikely((__pyx_t_1 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L1_error) (void)(__pyx_v_self->__pyx___matrix->SetPWMBits(__pyx_t_1)); /* function exit code */ @@ -7768,7 +8385,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_7pwmBits_2__set__(struct __pyx_o return __pyx_r; } -/* "rgbmatrix/core.pyx":275 +/* "rgbmatrix/core.pyx":292 * * property brightness: * def __get__(self): return self.__matrix.brightness() # <<<<<<<<<<<<<< @@ -7798,7 +8415,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->__pyx___matrix->brightness()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->__pyx___matrix->brightness()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7815,7 +8432,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness___get__(struc return __pyx_r; } -/* "rgbmatrix/core.pyx":276 +/* "rgbmatrix/core.pyx":293 * property brightness: * def __get__(self): return self.__matrix.brightness() * def __set__(self, brightness): self.__matrix.SetBrightness(brightness) # <<<<<<<<<<<<<< @@ -7844,7 +8461,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness_2__set__(struct __p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_brightness); if (unlikely((__pyx_t_1 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_brightness); if (unlikely((__pyx_t_1 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L1_error) __pyx_v_self->__pyx___matrix->SetBrightness(__pyx_t_1); /* function exit code */ @@ -7858,7 +8475,7 @@ static int __pyx_pf_9rgbmatrix_4core_9RGBMatrix_10brightness_2__set__(struct __p return __pyx_r; } -/* "rgbmatrix/core.pyx":279 +/* "rgbmatrix/core.pyx":296 * * property height: * def __get__(self): return self.__matrix.height() # <<<<<<<<<<<<<< @@ -7888,7 +8505,54 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6height___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___matrix->height()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___matrix->height()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "rgbmatrix/core.pyx":299 + * + * property width: + * def __get__(self): return self.__matrix.width() # <<<<<<<<<<<<<< + * + * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_5width_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_5width___get__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_5width___get__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___matrix->width()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7897,255 +8561,590 @@ static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_6height___get__(struct __p /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__reduce_cython__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_18__setstate_cython__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "rgbmatrix/core.pyx":282 - * - * property width: - * def __get__(self): return self.__matrix.width() # <<<<<<<<<<<<<< +/* "rgbmatrix/core.pyx":301 + * def __get__(self): return self.__matrix.width() * - * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): + * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): # <<<<<<<<<<<<<< + * canvas = FrameCanvas() + * canvas.__canvas = newCanvas */ -/* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_5width_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_5width___get__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_5width___get__(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self) { +static PyObject *__pyx_f_9rgbmatrix_4core___createFrameCanvas(rgb_matrix::FrameCanvas *__pyx_v_newCanvas) { + struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_canvas = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx___matrix->width()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_RefNannySetupContext("__createFrameCanvas", 0); + + /* "rgbmatrix/core.pyx":302 + * + * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): + * canvas = FrameCanvas() # <<<<<<<<<<<<<< + * canvas.__canvas = newCanvas + * return canvas + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_9rgbmatrix_4core_FrameCanvas)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; + __pyx_v_canvas = ((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_t_1); __pyx_t_1 = 0; + + /* "rgbmatrix/core.pyx":303 + * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): + * canvas = FrameCanvas() + * canvas.__canvas = newCanvas # <<<<<<<<<<<<<< + * return canvas + * + */ + __pyx_v_canvas->__pyx___canvas = __pyx_v_newCanvas; + + /* "rgbmatrix/core.pyx":304 + * canvas = FrameCanvas() + * canvas.__canvas = newCanvas + * return canvas # <<<<<<<<<<<<<< + * + * # Local Variables: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_canvas)); + __pyx_r = ((PyObject *)__pyx_v_canvas); goto __pyx_L0; + /* "rgbmatrix/core.pyx":301 + * def __get__(self): return self.__matrix.width() + * + * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): # <<<<<<<<<<<<<< + * canvas = FrameCanvas() + * canvas.__canvas = newCanvas + */ + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_AddTraceback("rgbmatrix.core.__createFrameCanvas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_canvas); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): + * def __pyx_unpickle_Canvas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result */ /* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_9rgbmatrix_4core_1__pyx_unpickle_Canvas = {"__pyx_unpickle_Canvas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__reduce_cython__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__pyx_unpickle_Canvas (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Canvas", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Canvas", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Canvas") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Canvas", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_Canvas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self) { +static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_Canvas", 0); - /* "(tree fragment)":2 - * def __reduce_cython__(self): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum not in (0xd41d8cd, 0xe3b0c44, 0xda39a3e): # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__11, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum not in (0xd41d8cd, 0xe3b0c44, 0xda39a3e): + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) + * __pyx_result = Canvas.__new__(__pyx_type) + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v___pyx_PickleError = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum not in (0xd41d8cd, 0xe3b0c44, 0xda39a3e): + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = Canvas.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum not in (0xd41d8cd, 0xe3b0c44, 0xda39a3e): # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) + * __pyx_result = Canvas.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9rgbmatrix_4core_Canvas), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_v___pyx_result = __pyx_t_4; + __pyx_t_4 = 0; - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) + * __pyx_result = Canvas.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * return __pyx_result */ + __pyx_t_3 = (__pyx_v___pyx_state != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + /* "(tree fragment)":9 + * __pyx_result = Canvas.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_4 = __pyx_f_9rgbmatrix_4core___pyx_unpickle_Canvas__set_state(((struct __pyx_obj_9rgbmatrix_4core_Canvas *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static PyObject *__pyx_pw_9rgbmatrix_4core_9RGBMatrix_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_9rgbmatrix_4core_9RGBMatrix_18__setstate_cython__(((struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_9rgbmatrix_4core_9RGBMatrix_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + /* "(tree fragment)":8 + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) + * __pyx_result = Canvas.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } - /* "(tree fragment)":4 - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + /* "(tree fragment)":1 + * def __pyx_unpickle_Canvas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rgbmatrix.core.RGBMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_Canvas", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "rgbmatrix/core.pyx":284 - * def __get__(self): return self.__matrix.width() - * - * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): # <<<<<<<<<<<<<< - * canvas = FrameCanvas() - * canvas.__canvas = newCanvas +/* "(tree fragment)":11 + * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) */ -static PyObject *__pyx_f_9rgbmatrix_4core___createFrameCanvas(rgb_matrix::FrameCanvas *__pyx_v_newCanvas) { - struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *__pyx_v_canvas = NULL; +static PyObject *__pyx_f_9rgbmatrix_4core___pyx_unpickle_Canvas__set_state(struct __pyx_obj_9rgbmatrix_4core_Canvas *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__createFrameCanvas", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_Canvas__set_state", 0); - /* "rgbmatrix/core.pyx":285 - * - * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): - * canvas = FrameCanvas() # <<<<<<<<<<<<<< - * canvas.__canvas = newCanvas - * return canvas + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_9rgbmatrix_4core_FrameCanvas)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_canvas = ((struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *)__pyx_t_1); - __pyx_t_1 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_2 > 0) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { - /* "rgbmatrix/core.pyx":286 - * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): - * canvas = FrameCanvas() - * canvas.__canvas = newCanvas # <<<<<<<<<<<<<< - * return canvas - * + /* "(tree fragment)":13 + * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< */ - __pyx_v_canvas->__pyx___canvas = __pyx_v_newCanvas; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 13, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "rgbmatrix/core.pyx":287 - * canvas = FrameCanvas() - * canvas.__canvas = newCanvas - * return canvas # <<<<<<<<<<<<<< - * - * # Local Variables: + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[0]) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_canvas)); - __pyx_r = ((PyObject *)__pyx_v_canvas); - goto __pyx_L0; + } - /* "rgbmatrix/core.pyx":284 - * def __get__(self): return self.__matrix.width() - * - * cdef __createFrameCanvas(cppinc.FrameCanvas* newCanvas): # <<<<<<<<<<<<<< - * canvas = FrameCanvas() - * canvas.__canvas = newCanvas + /* "(tree fragment)":11 + * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rgbmatrix.core.__createFrameCanvas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_Canvas__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_canvas); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 - * def __pyx_unpickle_Canvas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * def __pyx_unpickle_FrameData(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ -static PyObject *__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_9rgbmatrix_4core_1__pyx_unpickle_Canvas = {"__pyx_unpickle_Canvas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_9rgbmatrix_4core_3__pyx_unpickle_FrameData(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_9rgbmatrix_4core_3__pyx_unpickle_FrameData = {"__pyx_unpickle_FrameData", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9rgbmatrix_4core_3__pyx_unpickle_FrameData, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_9rgbmatrix_4core_3__pyx_unpickle_FrameData(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; @@ -8154,7 +9153,7 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas(PyObject *__py int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_Canvas (wrapper)", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_FrameData (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; @@ -8180,17 +9179,17 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas(PyObject *__py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Canvas", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameData", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Canvas", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameData", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Canvas") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_FrameData") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -8205,20 +9204,20 @@ static PyObject *__pyx_pw_9rgbmatrix_4core_1__pyx_unpickle_Canvas(PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Canvas", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FrameData", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_Canvas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_FrameData", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __pyx_r = __pyx_pf_9rgbmatrix_4core_2__pyx_unpickle_FrameData(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_9rgbmatrix_4core_2__pyx_unpickle_FrameData(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; @@ -8232,28 +9231,28 @@ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED P int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_Canvas", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_FrameData", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum not in (0xd41d8cd, 0xe3b0c44, 0xda39a3e): # <<<<<<<<<<<<<< + * if __pyx_checksum not in (0x920b9ba, 0x5bce662, 0x176a391): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x920b9ba, 0x5bce662, 0x176a391) = (__data, __length))" % __pyx_checksum) */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__10, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__12, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "(tree fragment)":5 * cdef object __pyx_result - * if __pyx_checksum not in (0xd41d8cd, 0xe3b0c44, 0xda39a3e): + * if __pyx_checksum not in (0x920b9ba, 0x5bce662, 0x176a391): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) - * __pyx_result = Canvas.__new__(__pyx_type) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x920b9ba, 0x5bce662, 0x176a391) = (__data, __length))" % __pyx_checksum) + * __pyx_result = FrameData.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8271,15 +9270,15 @@ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":6 - * if __pyx_checksum not in (0xd41d8cd, 0xe3b0c44, 0xda39a3e): + * if __pyx_checksum not in (0x920b9ba, 0x5bce662, 0x176a391): * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = Canvas.__new__(__pyx_type) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x920b9ba, 0x5bce662, 0x176a391) = (__data, __length))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = FrameData.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); @@ -8306,20 +9305,20 @@ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED P /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum not in (0xd41d8cd, 0xe3b0c44, 0xda39a3e): # <<<<<<<<<<<<<< + * if __pyx_checksum not in (0x920b9ba, 0x5bce662, 0x176a391): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x920b9ba, 0x5bce662, 0x176a391) = (__data, __length))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) - * __pyx_result = Canvas.__new__(__pyx_type) # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x920b9ba, 0x5bce662, 0x176a391) = (__data, __length))" % __pyx_checksum) + * __pyx_result = FrameData.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: - * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * __pyx_unpickle_FrameData__set_state( __pyx_result, __pyx_state) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9rgbmatrix_4core_Canvas), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9rgbmatrix_4core_FrameData), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -8340,10 +9339,10 @@ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED P __pyx_t_4 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) - * __pyx_result = Canvas.__new__(__pyx_type) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x920b9ba, 0x5bce662, 0x176a391) = (__data, __length))" % __pyx_checksum) + * __pyx_result = FrameData.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * __pyx_unpickle_FrameData__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_3 = (__pyx_v___pyx_state != Py_None); @@ -8351,32 +9350,32 @@ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED P if (__pyx_t_2) { /* "(tree fragment)":9 - * __pyx_result = Canvas.__new__(__pyx_type) + * __pyx_result = FrameData.__new__(__pyx_type) * if __pyx_state is not None: - * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * __pyx_unpickle_FrameData__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result - * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): + * cdef __pyx_unpickle_FrameData__set_state(FrameData __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_4 = __pyx_f_9rgbmatrix_4core___pyx_unpickle_Canvas__set_state(((struct __pyx_obj_9rgbmatrix_4core_Canvas *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_4 = __pyx_f_9rgbmatrix_4core___pyx_unpickle_FrameData__set_state(((struct __pyx_obj_9rgbmatrix_4core_FrameData *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xd41d8cd, 0xe3b0c44, 0xda39a3e) = ())" % __pyx_checksum) - * __pyx_result = Canvas.__new__(__pyx_type) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x920b9ba, 0x5bce662, 0x176a391) = (__data, __length))" % __pyx_checksum) + * __pyx_result = FrameData.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * __pyx_unpickle_FrameData__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: - * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * __pyx_unpickle_FrameData__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): - * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * cdef __pyx_unpickle_FrameData__set_state(FrameData __pyx_result, tuple __pyx_state): + * __pyx_result.__data = __pyx_state[0]; __pyx_result.__length = __pyx_state[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); @@ -8384,7 +9383,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED P goto __pyx_L0; /* "(tree fragment)":1 - * def __pyx_unpickle_Canvas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * def __pyx_unpickle_FrameData(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ @@ -8395,7 +9394,7 @@ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_Canvas", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_FrameData", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); @@ -8406,111 +9405,139 @@ static PyObject *__pyx_pf_9rgbmatrix_4core___pyx_unpickle_Canvas(CYTHON_UNUSED P } /* "(tree fragment)":11 - * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * __pyx_unpickle_FrameData__set_state( __pyx_result, __pyx_state) * return __pyx_result - * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[0]) + * cdef __pyx_unpickle_FrameData__set_state(FrameData __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.__data = __pyx_state[0]; __pyx_result.__length = __pyx_state[1] + * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ -static PyObject *__pyx_f_9rgbmatrix_4core___pyx_unpickle_Canvas__set_state(struct __pyx_obj_9rgbmatrix_4core_Canvas *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_f_9rgbmatrix_4core___pyx_unpickle_FrameData__set_state(struct __pyx_obj_9rgbmatrix_4core_FrameData *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + size_t __pyx_t_3; int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_Canvas__set_state", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_FrameData__set_state", 0); /* "(tree fragment)":12 * return __pyx_result - * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): - * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[0]) + * cdef __pyx_unpickle_FrameData__set_state(FrameData __pyx_result, tuple __pyx_state): + * __pyx_result.__data = __pyx_state[0]; __pyx_result.__length = __pyx_state[1] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_t_3 = ((__pyx_t_2 > 0) != 0); - if (__pyx_t_3) { + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_v___pyx_result->__pyx___data = __pyx_t_2; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result->__pyx___length = __pyx_t_3; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_FrameData__set_state(FrameData __pyx_result, tuple __pyx_state): + * __pyx_result.__data = __pyx_state[0]; __pyx_result.__length = __pyx_state[1] + * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[2]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 13, __pyx_L1_error) + } + __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_6 = ((__pyx_t_5 > 2) != 0); + if (__pyx_t_6) { } else { - __pyx_t_1 = __pyx_t_3; + __pyx_t_4 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_t_4 = (__pyx_t_3 != 0); - __pyx_t_1 = __pyx_t_4; + __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_6 != 0); + __pyx_t_4 = __pyx_t_7; __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { + if (__pyx_t_4) { - /* "(tree fragment)":13 - * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): - * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< + /* "(tree fragment)":14 + * __pyx_result.__data = __pyx_state[0]; __pyx_result.__length = __pyx_state[1] + * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 13, __pyx_L1_error) + __PYX_ERR(1, 14, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); + __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); + __Pyx_DECREF_SET(__pyx_t_9, function); } } - __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): - * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[0]) + /* "(tree fragment)":13 + * cdef __pyx_unpickle_FrameData__set_state(FrameData __pyx_result, tuple __pyx_state): + * __pyx_result.__data = __pyx_state[0]; __pyx_result.__length = __pyx_state[1] + * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[2]) */ } /* "(tree fragment)":11 - * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * __pyx_unpickle_FrameData__set_state( __pyx_result, __pyx_state) * return __pyx_result - * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[0]) + * cdef __pyx_unpickle_FrameData__set_state(FrameData __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.__data = __pyx_state[0]; __pyx_result.__length = __pyx_state[1] + * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_Canvas__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("rgbmatrix.core.__pyx_unpickle_FrameData__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -8621,6 +9648,108 @@ static PyTypeObject __pyx_type_9rgbmatrix_4core_Canvas = { 0, /*tp_pypy_flags*/ #endif }; +static struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData __pyx_vtable_9rgbmatrix_4core_FrameData; + +static PyObject *__pyx_tp_new_9rgbmatrix_4core_FrameData(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_9rgbmatrix_4core_FrameData *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_9rgbmatrix_4core_FrameData *)o); + p->__pyx_vtab = __pyx_vtabptr_9rgbmatrix_4core_FrameData; + return o; +} + +static void __pyx_tp_dealloc_9rgbmatrix_4core_FrameData(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_9rgbmatrix_4core_FrameData[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9FrameData_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_9FrameData_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_9rgbmatrix_4core_FrameData = { + PyVarObject_HEAD_INIT(0, 0) + "rgbmatrix.core.FrameData", /*tp_name*/ + sizeof(struct __pyx_obj_9rgbmatrix_4core_FrameData), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_9rgbmatrix_4core_FrameData, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_9rgbmatrix_4core_FrameData, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_9rgbmatrix_4core_FrameData, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + 0, /*tp_pypy_flags*/ + #endif +}; static struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas __pyx_vtable_9rgbmatrix_4core_FrameCanvas; static PyObject *__pyx_tp_new_9rgbmatrix_4core_FrameCanvas(PyTypeObject *t, PyObject *a, PyObject *k) { @@ -8689,8 +9818,10 @@ static PyMethodDef __pyx_methods_9rgbmatrix_4core_FrameCanvas[] = { {"Fill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_3Fill, METH_VARARGS|METH_KEYWORDS, 0}, {"Clear", (PyCFunction)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_5Clear, METH_NOARGS, 0}, {"SetPixel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_7SetPixel, METH_VARARGS|METH_KEYWORDS, 0}, - {"__reduce_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_9__reduce_cython__, METH_NOARGS, 0}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_11__setstate_cython__, METH_O, 0}, + {"Serialize", (PyCFunction)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_9Serialize, METH_NOARGS, 0}, + {"Deserialize", (PyCFunction)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_11Deserialize, METH_O, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_13__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_9rgbmatrix_4core_11FrameCanvas_15__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -9445,8 +10576,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Canvas_was_destroyed_or_not_init, __pyx_k_Canvas_was_destroyed_or_not_init, sizeof(__pyx_k_Canvas_was_destroyed_or_not_init), 0, 0, 1, 0}, {&__pyx_kp_s_Currently_only_RGB_mode_is_suppo, __pyx_k_Currently_only_RGB_mode_is_suppo, sizeof(__pyx_k_Currently_only_RGB_mode_is_suppo), 0, 0, 1, 0}, {&__pyx_n_s_FrameCanvas, __pyx_k_FrameCanvas, sizeof(__pyx_k_FrameCanvas), 0, 0, 1, 1}, + {&__pyx_n_s_FrameData, __pyx_k_FrameData, sizeof(__pyx_k_FrameData), 0, 0, 1, 1}, + {&__pyx_kp_s_FrameData_ptr_was_destroyed_or_n, __pyx_k_FrameData_ptr_was_destroyed_or_n, sizeof(__pyx_k_FrameData_ptr_was_destroyed_or_n), 0, 0, 1, 0}, {&__pyx_n_s_Image, __pyx_k_Image, sizeof(__pyx_k_Image), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_k_Incompatible_checksums_0x_x_vs_0_2, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 0, 1, 0}, {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_PIL, __pyx_k_PIL, sizeof(__pyx_k_PIL), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, @@ -9488,6 +10622,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_Canvas, __pyx_k_pyx_unpickle_Canvas, sizeof(__pyx_k_pyx_unpickle_Canvas), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_FrameData, __pyx_k_pyx_unpickle_FrameData, sizeof(__pyx_k_pyx_unpickle_FrameData), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, @@ -9547,16 +10682,27 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "rgbmatrix/core.pyx":64 + /* "rgbmatrix/core.pyx":60 + * if self.__data != NULL: + * return self.__data + * raise Exception("FrameData ptr was destroyed or not initialized, you cannot use this object anymore") # <<<<<<<<<<<<<< + * + * cdef class FrameCanvas(Canvas): + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_FrameData_ptr_was_destroyed_or_n); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "rgbmatrix/core.pyx":70 * if self.__canvas != NULL: * return self.__canvas * raise Exception("Canvas was destroyed or not initialized, you cannot use this object anymore") # <<<<<<<<<<<<<< * * def Fill(self, uint8_t red, uint8_t green, uint8_t blue): */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Canvas_was_destroyed_or_not_init); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Canvas_was_destroyed_or_not_init); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -9564,18 +10710,18 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.__canvas cannot be converted to a Python object for pickling") */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self___canvas_cannot_be_converte); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self___canvas_cannot_be_converte); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); /* "(tree fragment)":4 * raise TypeError("self.__canvas cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.__canvas cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self___canvas_cannot_be_converte); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self___canvas_cannot_be_converte); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -9583,18 +10729,18 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -9602,31 +10748,38 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_tuple__10 = PyTuple_Pack(3, __pyx_int_222419149, __pyx_int_238750788, __pyx_int_228825662); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__11 = PyTuple_Pack(3, __pyx_int_222419149, __pyx_int_238750788, __pyx_int_228825662); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__12 = PyTuple_Pack(3, __pyx_int_153139642, __pyx_int_96265826, __pyx_int_24552337); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "(tree fragment)":1 * def __pyx_unpickle_Canvas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Canvas, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Canvas, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FrameData, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -9636,6 +10789,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_24552337 = PyInt_FromLong(24552337L); if (unlikely(!__pyx_int_24552337)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_96265826 = PyInt_FromLong(96265826L); if (unlikely(!__pyx_int_96265826)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_153139642 = PyInt_FromLong(153139642L); if (unlikely(!__pyx_int_153139642)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_228825662 = PyInt_FromLong(228825662L); if (unlikely(!__pyx_int_228825662)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_238750788 = PyInt_FromLong(238750788L); if (unlikely(!__pyx_int_238750788)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -9696,47 +10852,60 @@ static int __Pyx_modinit_type_init_code(void) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Canvas, (PyObject *)&__pyx_type_9rgbmatrix_4core_Canvas) < 0) __PYX_ERR(0, 8, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9rgbmatrix_4core_Canvas) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __pyx_ptype_9rgbmatrix_4core_Canvas = &__pyx_type_9rgbmatrix_4core_Canvas; + __pyx_vtabptr_9rgbmatrix_4core_FrameData = &__pyx_vtable_9rgbmatrix_4core_FrameData; + __pyx_vtable_9rgbmatrix_4core_FrameData.__pyx___getData = (char const *(*)(struct __pyx_obj_9rgbmatrix_4core_FrameData *))__pyx_f_9rgbmatrix_4core_9FrameData___getData; + if (PyType_Ready(&__pyx_type_9rgbmatrix_4core_FrameData) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_9rgbmatrix_4core_FrameData.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9rgbmatrix_4core_FrameData.tp_dictoffset && __pyx_type_9rgbmatrix_4core_FrameData.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_9rgbmatrix_4core_FrameData.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_9rgbmatrix_4core_FrameData.tp_dict, __pyx_vtabptr_9rgbmatrix_4core_FrameData) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FrameData, (PyObject *)&__pyx_type_9rgbmatrix_4core_FrameData) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9rgbmatrix_4core_FrameData) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_ptype_9rgbmatrix_4core_FrameData = &__pyx_type_9rgbmatrix_4core_FrameData; __pyx_vtabptr_9rgbmatrix_4core_FrameCanvas = &__pyx_vtable_9rgbmatrix_4core_FrameCanvas; __pyx_vtable_9rgbmatrix_4core_FrameCanvas.__pyx_base = *__pyx_vtabptr_9rgbmatrix_4core_Canvas; __pyx_vtable_9rgbmatrix_4core_FrameCanvas.__pyx_base.__pyx___getCanvas = (rgb_matrix::Canvas *(*)(struct __pyx_obj_9rgbmatrix_4core_Canvas *))__pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas__pyx_wrap_1; __pyx_vtable_9rgbmatrix_4core_FrameCanvas.__pyx___getCanvas = (rgb_matrix::Canvas *(*)(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas *))__pyx_f_9rgbmatrix_4core_11FrameCanvas___getCanvas; __pyx_type_9rgbmatrix_4core_FrameCanvas.tp_base = __pyx_ptype_9rgbmatrix_4core_Canvas; - if (PyType_Ready(&__pyx_type_9rgbmatrix_4core_FrameCanvas) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_9rgbmatrix_4core_FrameCanvas) < 0) __PYX_ERR(0, 62, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_9rgbmatrix_4core_FrameCanvas.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9rgbmatrix_4core_FrameCanvas.tp_dictoffset && __pyx_type_9rgbmatrix_4core_FrameCanvas.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_9rgbmatrix_4core_FrameCanvas.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type_9rgbmatrix_4core_FrameCanvas.tp_dict, __pyx_vtabptr_9rgbmatrix_4core_FrameCanvas) < 0) __PYX_ERR(0, 56, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FrameCanvas, (PyObject *)&__pyx_type_9rgbmatrix_4core_FrameCanvas) < 0) __PYX_ERR(0, 56, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9rgbmatrix_4core_FrameCanvas) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_9rgbmatrix_4core_FrameCanvas.tp_dict, __pyx_vtabptr_9rgbmatrix_4core_FrameCanvas) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FrameCanvas, (PyObject *)&__pyx_type_9rgbmatrix_4core_FrameCanvas) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9rgbmatrix_4core_FrameCanvas) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __pyx_ptype_9rgbmatrix_4core_FrameCanvas = &__pyx_type_9rgbmatrix_4core_FrameCanvas; __pyx_vtabptr_9rgbmatrix_4core_RGBMatrix = &__pyx_vtable_9rgbmatrix_4core_RGBMatrix; __pyx_vtable_9rgbmatrix_4core_RGBMatrix.__pyx_base = *__pyx_vtabptr_9rgbmatrix_4core_Canvas; __pyx_vtable_9rgbmatrix_4core_RGBMatrix.__pyx_base.__pyx___getCanvas = (rgb_matrix::Canvas *(*)(struct __pyx_obj_9rgbmatrix_4core_Canvas *))__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas__pyx_wrap_1; __pyx_vtable_9rgbmatrix_4core_RGBMatrix.__pyx___getCanvas = (rgb_matrix::Canvas *(*)(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix *))__pyx_f_9rgbmatrix_4core_9RGBMatrix___getCanvas; __pyx_type_9rgbmatrix_4core_RGBMatrix.tp_base = __pyx_ptype_9rgbmatrix_4core_Canvas; - if (PyType_Ready(&__pyx_type_9rgbmatrix_4core_RGBMatrix) < 0) __PYX_ERR(0, 196, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_9rgbmatrix_4core_RGBMatrix) < 0) __PYX_ERR(0, 213, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_9rgbmatrix_4core_RGBMatrix.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9rgbmatrix_4core_RGBMatrix.tp_dictoffset && __pyx_type_9rgbmatrix_4core_RGBMatrix.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_9rgbmatrix_4core_RGBMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type_9rgbmatrix_4core_RGBMatrix.tp_dict, __pyx_vtabptr_9rgbmatrix_4core_RGBMatrix) < 0) __PYX_ERR(0, 196, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RGBMatrix, (PyObject *)&__pyx_type_9rgbmatrix_4core_RGBMatrix) < 0) __PYX_ERR(0, 196, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9rgbmatrix_4core_RGBMatrix) < 0) __PYX_ERR(0, 196, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_9rgbmatrix_4core_RGBMatrix.tp_dict, __pyx_vtabptr_9rgbmatrix_4core_RGBMatrix) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RGBMatrix, (PyObject *)&__pyx_type_9rgbmatrix_4core_RGBMatrix) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9rgbmatrix_4core_RGBMatrix) < 0) __PYX_ERR(0, 213, __pyx_L1_error) __pyx_ptype_9rgbmatrix_4core_RGBMatrix = &__pyx_type_9rgbmatrix_4core_RGBMatrix; - if (PyType_Ready(&__pyx_type_9rgbmatrix_4core_RGBMatrixOptions) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_9rgbmatrix_4core_RGBMatrixOptions) < 0) __PYX_ERR(0, 108, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_9rgbmatrix_4core_RGBMatrixOptions.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9rgbmatrix_4core_RGBMatrixOptions.tp_dictoffset && __pyx_type_9rgbmatrix_4core_RGBMatrixOptions.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_9rgbmatrix_4core_RGBMatrixOptions.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RGBMatrixOptions, (PyObject *)&__pyx_type_9rgbmatrix_4core_RGBMatrixOptions) < 0) __PYX_ERR(0, 91, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9rgbmatrix_4core_RGBMatrixOptions) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RGBMatrixOptions, (PyObject *)&__pyx_type_9rgbmatrix_4core_RGBMatrixOptions) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9rgbmatrix_4core_RGBMatrixOptions) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions = &__pyx_type_9rgbmatrix_4core_RGBMatrixOptions; __Pyx_RefNannyFinishContext(); return 0; @@ -9996,9 +11165,21 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9rgbmatrix_4core_1__pyx_unpickle_Canvas, NULL, __pyx_n_s_rgbmatrix_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9rgbmatrix_4core_1__pyx_unpickle_Canvas, NULL, __pyx_n_s_rgbmatrix_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Canvas, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":11 + * __pyx_unpickle_Canvas__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Canvas__set_state(Canvas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[0]) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9rgbmatrix_4core_3__pyx_unpickle_FrameData, NULL, __pyx_n_s_rgbmatrix_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Canvas, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FrameData, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "rgbmatrix/core.pyx":1 @@ -11114,6 +12295,27 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) return __Pyx_GetBuiltinName(name); } +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kwdict, @@ -11183,27 +12385,6 @@ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyOb return result; } -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { @@ -11721,45 +12902,241 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, Py_XDECREF(ptraceback); goto bad; } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; } - py_frame = PyFrame_New( - tstate, /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; } -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC @@ -12620,202 +13997,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } } -/* CIntFromPy */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(size_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (size_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (size_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) - case 2: - if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { - return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { - return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { - return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (size_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(size_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (size_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) - case -2: - if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { - return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - } -#endif - if (sizeof(size_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - size_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (size_t) -1; - } - } else { - size_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (size_t) -1; - val = __Pyx_PyInt_As_size_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to size_t"); - return (size_t) -1; -} - /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC diff --git a/bindings/python/rgbmatrix/core.pxd b/bindings/python/rgbmatrix/core.pxd index f1828afcb..8f7817a83 100755 --- a/bindings/python/rgbmatrix/core.pxd +++ b/bindings/python/rgbmatrix/core.pxd @@ -3,6 +3,11 @@ cimport cppinc cdef class Canvas: cdef cppinc.Canvas *__getCanvas(self) except + +cdef class FrameData: + cdef const char *__data + cdef size_t __length + cdef const char *__getData(self) except + + cdef class FrameCanvas(Canvas): cdef cppinc.FrameCanvas *__canvas diff --git a/bindings/python/rgbmatrix/core.pyx b/bindings/python/rgbmatrix/core.pyx index 172ec392b..0cba3de8f 100755 --- a/bindings/python/rgbmatrix/core.pyx +++ b/bindings/python/rgbmatrix/core.pyx @@ -53,6 +53,12 @@ cdef class Canvas: b = (pixel >> 16) & 0xFF my_canvas.SetPixel(xstart+col, ystart+row, r, g, b) +cdef class FrameData: + cdef const char *__getData(self) except +: + if self.__data != NULL: + return self.__data + raise Exception("FrameData ptr was destroyed or not initialized, you cannot use this object anymore") + cdef class FrameCanvas(Canvas): def __dealloc__(self): if self.__canvas != NULL: @@ -72,6 +78,17 @@ cdef class FrameCanvas(Canvas): def SetPixel(self, int x, int y, uint8_t red, uint8_t green, uint8_t blue): (self.__getCanvas()).SetPixel(x, y, red, green, blue) + def Serialize(self): + cdef const char* data + cdef size_t length + (self.__getCanvas()).Serialize(&data, &length) + framedata = FrameData() + framedata.__length = length + framedata.__data = data + return framedata + + def Deserialize(self, FrameData framedata): + return (self.__getCanvas()).Deserialize(framedata.__getData(), framedata.__length) property width: def __get__(self): return (self.__getCanvas()).width() diff --git a/bindings/python/rgbmatrix/cppinc.pxd b/bindings/python/rgbmatrix/cppinc.pxd index 35ecc559e..10c65b2fa 100755 --- a/bindings/python/rgbmatrix/cppinc.pxd +++ b/bindings/python/rgbmatrix/cppinc.pxd @@ -30,6 +30,8 @@ cdef extern from "led-matrix.h" namespace "rgb_matrix": uint8_t pwmbits() void SetBrightness(uint8_t) uint8_t brightness() + void Serialize(const char **data, size_t *len) + bool Deserialize(const char *data, size_t len) struct RuntimeOptions: RuntimeOptions() except + diff --git a/bindings/python/rgbmatrix/graphics.cpp b/bindings/python/rgbmatrix/graphics.cpp index 7bf293be7..a35a292f3 100644 --- a/bindings/python/rgbmatrix/graphics.cpp +++ b/bindings/python/rgbmatrix/graphics.cpp @@ -931,6 +931,7 @@ static const char *__pyx_f[] = { /*--- Type declarations ---*/ struct __pyx_obj_9rgbmatrix_4core_Canvas; +struct __pyx_obj_9rgbmatrix_4core_FrameData; struct __pyx_obj_9rgbmatrix_4core_FrameCanvas; struct __pyx_obj_9rgbmatrix_4core_RGBMatrix; struct __pyx_obj_9rgbmatrix_4core_RGBMatrixOptions; @@ -953,6 +954,21 @@ struct __pyx_obj_9rgbmatrix_4core_Canvas { /* "core.pxd":6 * cdef cppinc.Canvas *__getCanvas(self) except + * + * cdef class FrameData: # <<<<<<<<<<<<<< + * cdef const char *__data + * cdef size_t __length + */ +struct __pyx_obj_9rgbmatrix_4core_FrameData { + PyObject_HEAD + struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData *__pyx_vtab; + char const *__pyx___data; + size_t __pyx___length; +}; + + +/* "core.pxd":11 + * cdef const char *__getData(self) except + + * * cdef class FrameCanvas(Canvas): # <<<<<<<<<<<<<< * cdef cppinc.FrameCanvas *__canvas * @@ -963,7 +979,7 @@ struct __pyx_obj_9rgbmatrix_4core_FrameCanvas { }; -/* "core.pxd":9 +/* "core.pxd":14 * cdef cppinc.FrameCanvas *__canvas * * cdef class RGBMatrix(Canvas): # <<<<<<<<<<<<<< @@ -976,7 +992,7 @@ struct __pyx_obj_9rgbmatrix_4core_RGBMatrix { }; -/* "core.pxd":12 +/* "core.pxd":17 * cdef cppinc.RGBMatrix *__matrix * * cdef class RGBMatrixOptions: # <<<<<<<<<<<<<< @@ -1038,6 +1054,20 @@ static struct __pyx_vtabstruct_9rgbmatrix_4core_Canvas *__pyx_vtabptr_9rgbmatrix /* "core.pxd":6 * cdef cppinc.Canvas *__getCanvas(self) except + * + * cdef class FrameData: # <<<<<<<<<<<<<< + * cdef const char *__data + * cdef size_t __length + */ + +struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData { + char const *(*__pyx___getData)(struct __pyx_obj_9rgbmatrix_4core_FrameData *); +}; +static struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData *__pyx_vtabptr_9rgbmatrix_4core_FrameData; + + +/* "core.pxd":11 + * cdef const char *__getData(self) except + + * * cdef class FrameCanvas(Canvas): # <<<<<<<<<<<<<< * cdef cppinc.FrameCanvas *__canvas * @@ -1049,7 +1079,7 @@ struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas { static struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas *__pyx_vtabptr_9rgbmatrix_4core_FrameCanvas; -/* "core.pxd":9 +/* "core.pxd":14 * cdef cppinc.FrameCanvas *__canvas * * cdef class RGBMatrix(Canvas): # <<<<<<<<<<<<<< @@ -1442,6 +1472,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'rgbmatrix.core' */ static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_Canvas = 0; +static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_FrameData = 0; static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_FrameCanvas = 0; static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_RGBMatrix = 0; static PyTypeObject *__pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions = 0; @@ -3711,14 +3742,17 @@ static int __Pyx_modinit_type_import_code(void) { __pyx_ptype_9rgbmatrix_4core_Canvas = __Pyx_ImportType(__pyx_t_1, "rgbmatrix.core", "Canvas", sizeof(struct __pyx_obj_9rgbmatrix_4core_Canvas), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_9rgbmatrix_4core_Canvas) __PYX_ERR(2, 3, __pyx_L1_error) __pyx_vtabptr_9rgbmatrix_4core_Canvas = (struct __pyx_vtabstruct_9rgbmatrix_4core_Canvas*)__Pyx_GetVtable(__pyx_ptype_9rgbmatrix_4core_Canvas->tp_dict); if (unlikely(!__pyx_vtabptr_9rgbmatrix_4core_Canvas)) __PYX_ERR(2, 3, __pyx_L1_error) + __pyx_ptype_9rgbmatrix_4core_FrameData = __Pyx_ImportType(__pyx_t_1, "rgbmatrix.core", "FrameData", sizeof(struct __pyx_obj_9rgbmatrix_4core_FrameData), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_9rgbmatrix_4core_FrameData) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_vtabptr_9rgbmatrix_4core_FrameData = (struct __pyx_vtabstruct_9rgbmatrix_4core_FrameData*)__Pyx_GetVtable(__pyx_ptype_9rgbmatrix_4core_FrameData->tp_dict); if (unlikely(!__pyx_vtabptr_9rgbmatrix_4core_FrameData)) __PYX_ERR(2, 6, __pyx_L1_error) __pyx_ptype_9rgbmatrix_4core_FrameCanvas = __Pyx_ImportType(__pyx_t_1, "rgbmatrix.core", "FrameCanvas", sizeof(struct __pyx_obj_9rgbmatrix_4core_FrameCanvas), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_9rgbmatrix_4core_FrameCanvas) __PYX_ERR(2, 6, __pyx_L1_error) - __pyx_vtabptr_9rgbmatrix_4core_FrameCanvas = (struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas*)__Pyx_GetVtable(__pyx_ptype_9rgbmatrix_4core_FrameCanvas->tp_dict); if (unlikely(!__pyx_vtabptr_9rgbmatrix_4core_FrameCanvas)) __PYX_ERR(2, 6, __pyx_L1_error) + if (!__pyx_ptype_9rgbmatrix_4core_FrameCanvas) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_vtabptr_9rgbmatrix_4core_FrameCanvas = (struct __pyx_vtabstruct_9rgbmatrix_4core_FrameCanvas*)__Pyx_GetVtable(__pyx_ptype_9rgbmatrix_4core_FrameCanvas->tp_dict); if (unlikely(!__pyx_vtabptr_9rgbmatrix_4core_FrameCanvas)) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_ptype_9rgbmatrix_4core_RGBMatrix = __Pyx_ImportType(__pyx_t_1, "rgbmatrix.core", "RGBMatrix", sizeof(struct __pyx_obj_9rgbmatrix_4core_RGBMatrix), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_9rgbmatrix_4core_RGBMatrix) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_vtabptr_9rgbmatrix_4core_RGBMatrix = (struct __pyx_vtabstruct_9rgbmatrix_4core_RGBMatrix*)__Pyx_GetVtable(__pyx_ptype_9rgbmatrix_4core_RGBMatrix->tp_dict); if (unlikely(!__pyx_vtabptr_9rgbmatrix_4core_RGBMatrix)) __PYX_ERR(2, 9, __pyx_L1_error) + if (!__pyx_ptype_9rgbmatrix_4core_RGBMatrix) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_vtabptr_9rgbmatrix_4core_RGBMatrix = (struct __pyx_vtabstruct_9rgbmatrix_4core_RGBMatrix*)__Pyx_GetVtable(__pyx_ptype_9rgbmatrix_4core_RGBMatrix->tp_dict); if (unlikely(!__pyx_vtabptr_9rgbmatrix_4core_RGBMatrix)) __PYX_ERR(2, 14, __pyx_L1_error) __pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions = __Pyx_ImportType(__pyx_t_1, "rgbmatrix.core", "RGBMatrixOptions", sizeof(struct __pyx_obj_9rgbmatrix_4core_RGBMatrixOptions), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions) __PYX_ERR(2, 12, __pyx_L1_error) + if (!__pyx_ptype_9rgbmatrix_4core_RGBMatrixOptions) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0;