1 /* Generated by Cython 0.29.20 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6     #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8     #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_20"
11 #define CYTHON_HEX_VERSION 0x001D14F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18   #ifndef __stdcall
19     #define __stdcall
20   #endif
21   #ifndef __cdecl
22     #define __cdecl
23   #endif
24   #ifndef __fastcall
25     #define __fastcall
26   #endif
27 #endif
28 #ifndef DL_IMPORT
29   #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32   #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36   #if PY_VERSION_HEX >= 0x02070000
37     #define HAVE_LONG_LONG
38   #endif
39 #endif
40 #ifndef PY_LONG_LONG
41   #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44   #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47   #define CYTHON_COMPILING_IN_PYPY 1
48   #define CYTHON_COMPILING_IN_PYSTON 0
49   #define CYTHON_COMPILING_IN_CPYTHON 0
50   #undef CYTHON_USE_TYPE_SLOTS
51   #define CYTHON_USE_TYPE_SLOTS 0
52   #undef CYTHON_USE_PYTYPE_LOOKUP
53   #define CYTHON_USE_PYTYPE_LOOKUP 0
54   #if PY_VERSION_HEX < 0x03050000
55     #undef CYTHON_USE_ASYNC_SLOTS
56     #define CYTHON_USE_ASYNC_SLOTS 0
57   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58     #define CYTHON_USE_ASYNC_SLOTS 1
59   #endif
60   #undef CYTHON_USE_PYLIST_INTERNALS
61   #define CYTHON_USE_PYLIST_INTERNALS 0
62   #undef CYTHON_USE_UNICODE_INTERNALS
63   #define CYTHON_USE_UNICODE_INTERNALS 0
64   #undef CYTHON_USE_UNICODE_WRITER
65   #define CYTHON_USE_UNICODE_WRITER 0
66   #undef CYTHON_USE_PYLONG_INTERNALS
67   #define CYTHON_USE_PYLONG_INTERNALS 0
68   #undef CYTHON_AVOID_BORROWED_REFS
69   #define CYTHON_AVOID_BORROWED_REFS 1
70   #undef CYTHON_ASSUME_SAFE_MACROS
71   #define CYTHON_ASSUME_SAFE_MACROS 0
72   #undef CYTHON_UNPACK_METHODS
73   #define CYTHON_UNPACK_METHODS 0
74   #undef CYTHON_FAST_THREAD_STATE
75   #define CYTHON_FAST_THREAD_STATE 0
76   #undef CYTHON_FAST_PYCALL
77   #define CYTHON_FAST_PYCALL 0
78   #undef CYTHON_PEP489_MULTI_PHASE_INIT
79   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80   #undef CYTHON_USE_TP_FINALIZE
81   #define CYTHON_USE_TP_FINALIZE 0
82   #undef CYTHON_USE_DICT_VERSIONS
83   #define CYTHON_USE_DICT_VERSIONS 0
84   #undef CYTHON_USE_EXC_INFO_STACK
85   #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87   #define CYTHON_COMPILING_IN_PYPY 0
88   #define CYTHON_COMPILING_IN_PYSTON 1
89   #define CYTHON_COMPILING_IN_CPYTHON 0
90   #ifndef CYTHON_USE_TYPE_SLOTS
91     #define CYTHON_USE_TYPE_SLOTS 1
92   #endif
93   #undef CYTHON_USE_PYTYPE_LOOKUP
94   #define CYTHON_USE_PYTYPE_LOOKUP 0
95   #undef CYTHON_USE_ASYNC_SLOTS
96   #define CYTHON_USE_ASYNC_SLOTS 0
97   #undef CYTHON_USE_PYLIST_INTERNALS
98   #define CYTHON_USE_PYLIST_INTERNALS 0
99   #ifndef CYTHON_USE_UNICODE_INTERNALS
100     #define CYTHON_USE_UNICODE_INTERNALS 1
101   #endif
102   #undef CYTHON_USE_UNICODE_WRITER
103   #define CYTHON_USE_UNICODE_WRITER 0
104   #undef CYTHON_USE_PYLONG_INTERNALS
105   #define CYTHON_USE_PYLONG_INTERNALS 0
106   #ifndef CYTHON_AVOID_BORROWED_REFS
107     #define CYTHON_AVOID_BORROWED_REFS 0
108   #endif
109   #ifndef CYTHON_ASSUME_SAFE_MACROS
110     #define CYTHON_ASSUME_SAFE_MACROS 1
111   #endif
112   #ifndef CYTHON_UNPACK_METHODS
113     #define CYTHON_UNPACK_METHODS 1
114   #endif
115   #undef CYTHON_FAST_THREAD_STATE
116   #define CYTHON_FAST_THREAD_STATE 0
117   #undef CYTHON_FAST_PYCALL
118   #define CYTHON_FAST_PYCALL 0
119   #undef CYTHON_PEP489_MULTI_PHASE_INIT
120   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121   #undef CYTHON_USE_TP_FINALIZE
122   #define CYTHON_USE_TP_FINALIZE 0
123   #undef CYTHON_USE_DICT_VERSIONS
124   #define CYTHON_USE_DICT_VERSIONS 0
125   #undef CYTHON_USE_EXC_INFO_STACK
126   #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128   #define CYTHON_COMPILING_IN_PYPY 0
129   #define CYTHON_COMPILING_IN_PYSTON 0
130   #define CYTHON_COMPILING_IN_CPYTHON 1
131   #ifndef CYTHON_USE_TYPE_SLOTS
132     #define CYTHON_USE_TYPE_SLOTS 1
133   #endif
134   #if PY_VERSION_HEX < 0x02070000
135     #undef CYTHON_USE_PYTYPE_LOOKUP
136     #define CYTHON_USE_PYTYPE_LOOKUP 0
137   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138     #define CYTHON_USE_PYTYPE_LOOKUP 1
139   #endif
140   #if PY_MAJOR_VERSION < 3
141     #undef CYTHON_USE_ASYNC_SLOTS
142     #define CYTHON_USE_ASYNC_SLOTS 0
143   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144     #define CYTHON_USE_ASYNC_SLOTS 1
145   #endif
146   #if PY_VERSION_HEX < 0x02070000
147     #undef CYTHON_USE_PYLONG_INTERNALS
148     #define CYTHON_USE_PYLONG_INTERNALS 0
149   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150     #define CYTHON_USE_PYLONG_INTERNALS 1
151   #endif
152   #ifndef CYTHON_USE_PYLIST_INTERNALS
153     #define CYTHON_USE_PYLIST_INTERNALS 1
154   #endif
155   #ifndef CYTHON_USE_UNICODE_INTERNALS
156     #define CYTHON_USE_UNICODE_INTERNALS 1
157   #endif
158   #if PY_VERSION_HEX < 0x030300F0
159     #undef CYTHON_USE_UNICODE_WRITER
160     #define CYTHON_USE_UNICODE_WRITER 0
161   #elif !defined(CYTHON_USE_UNICODE_WRITER)
162     #define CYTHON_USE_UNICODE_WRITER 1
163   #endif
164   #ifndef CYTHON_AVOID_BORROWED_REFS
165     #define CYTHON_AVOID_BORROWED_REFS 0
166   #endif
167   #ifndef CYTHON_ASSUME_SAFE_MACROS
168     #define CYTHON_ASSUME_SAFE_MACROS 1
169   #endif
170   #ifndef CYTHON_UNPACK_METHODS
171     #define CYTHON_UNPACK_METHODS 1
172   #endif
173   #ifndef CYTHON_FAST_THREAD_STATE
174     #define CYTHON_FAST_THREAD_STATE 1
175   #endif
176   #ifndef CYTHON_FAST_PYCALL
177     #define CYTHON_FAST_PYCALL 1
178   #endif
179   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181   #endif
182   #ifndef CYTHON_USE_TP_FINALIZE
183     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184   #endif
185   #ifndef CYTHON_USE_DICT_VERSIONS
186     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187   #endif
188   #ifndef CYTHON_USE_EXC_INFO_STACK
189     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190   #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196   #include "longintrepr.h"
197   #undef SHIFT
198   #undef BASE
199   #undef MASK
200   #ifdef SIZEOF_VOID_P
201     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202   #endif
203 #endif
204 #ifndef __has_attribute
205   #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208   #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211   #if defined(__GNUC__)
212     #define CYTHON_RESTRICT __restrict__
213   #elif defined(_MSC_VER) && _MSC_VER >= 1400
214     #define CYTHON_RESTRICT __restrict
215   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216     #define CYTHON_RESTRICT restrict
217   #else
218     #define CYTHON_RESTRICT
219   #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 #     define CYTHON_UNUSED __attribute__ ((__unused__))
225 #   else
226 #     define CYTHON_UNUSED
227 #   endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 #   define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 #   define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)236      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 #  else
238 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 #  endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 #  define CYTHON_NCP_UNUSED
244 # else
245 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250     #ifndef _MSC_STDINT_H_
251         #if _MSC_VER < 1300
252            typedef unsigned char     uint8_t;
253            typedef unsigned int      uint32_t;
254         #else
255            typedef unsigned __int8   uint8_t;
256            typedef unsigned __int32  uint32_t;
257         #endif
258     #endif
259 #else
260    #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263   #if defined(__cplusplus) && __cplusplus >= 201103L
264     #if __has_cpp_attribute(fallthrough)
265       #define CYTHON_FALLTHROUGH [[fallthrough]]
266     #elif __has_cpp_attribute(clang::fallthrough)
267       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268     #elif __has_cpp_attribute(gnu::fallthrough)
269       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270     #endif
271   #endif
272   #ifndef CYTHON_FALLTHROUGH
273     #if __has_attribute(fallthrough)
274       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275     #else
276       #define CYTHON_FALLTHROUGH
277     #endif
278   #endif
279   #if defined(__clang__ ) && defined(__apple_build_version__)
280     #if __apple_build_version__ < 7000000
281       #undef  CYTHON_FALLTHROUGH
282       #define CYTHON_FALLTHROUGH
283     #endif
284   #endif
285 #endif
286 
287 #ifndef CYTHON_INLINE
288   #if defined(__clang__)
289     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290   #elif defined(__GNUC__)
291     #define CYTHON_INLINE __inline__
292   #elif defined(_MSC_VER)
293     #define CYTHON_INLINE __inline
294   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295     #define CYTHON_INLINE inline
296   #else
297     #define CYTHON_INLINE
298   #endif
299 #endif
300 
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302   #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310   #define __Pyx_DefaultClassType PyClass_Type
311 #else
312   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320   #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323   #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326   #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332   #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335   #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338   #ifndef METH_FASTCALL
339      #define METH_FASTCALL 0x80
340   #endif
341   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343                                                           Py_ssize_t nargs, PyObject *kwnames);
344 #else
345   #define __Pyx_PyCFunctionFast _PyCFunctionFast
346   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355   #define PyObject_Malloc(s)   PyMem_Malloc(s)
356   #define PyObject_Free(p)     PyMem_Free(p)
357   #define PyObject_Realloc(p)  PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
361   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
362   #define PyMem_RawFree(p)             PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
366   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
369   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372   #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376   #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378   #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385   *key = PyThread_create_key();
386   return 0;
387 }
PyThread_tss_alloc(void)388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390   *key = Py_tss_NEEDS_INIT;
391   return key;
392 }
PyThread_tss_free(Py_tss_t * key)393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394   PyObject_Free(key);
395 }
PyThread_tss_is_created(Py_tss_t * key)396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397   return *key != Py_tss_NEEDS_INIT;
398 }
PyThread_tss_delete(Py_tss_t * key)399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400   PyThread_delete_key(*key);
401   *key = Py_tss_NEEDS_INIT;
402 }
PyThread_tss_set(Py_tss_t * key,void * value)403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404   return PyThread_set_key_value(*key, value);
405 }
PyThread_tss_get(Py_tss_t * key)406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407   return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
417   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
418 #else
419   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
420   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428   #define CYTHON_PEP393_ENABLED 1
429   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
430                                               0 : _PyUnicode_Ready((PyObject *)(op)))
431   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
432   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
434   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
435   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
436   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
437   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
438   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
439 #else
440   #define CYTHON_PEP393_ENABLED 0
441   #define PyUnicode_1BYTE_KIND  1
442   #define PyUnicode_2BYTE_KIND  2
443   #define PyUnicode_4BYTE_KIND  4
444   #define __Pyx_PyUnicode_READY(op)       (0)
445   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
446   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
447   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
448   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
449   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
450   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
451   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
452   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
453 #endif
454 #if CYTHON_COMPILING_IN_PYPY
455   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
456   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
457 #else
458   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
459   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
460       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
461 #endif
462 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
463   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
464 #endif
465 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
466   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
469   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
470 #endif
471 #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
472 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
473 #if PY_MAJOR_VERSION >= 3
474   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
475 #else
476   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
477 #endif
478 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
479   #define PyObject_ASCII(o)            PyObject_Repr(o)
480 #endif
481 #if PY_MAJOR_VERSION >= 3
482   #define PyBaseString_Type            PyUnicode_Type
483   #define PyStringObject               PyUnicodeObject
484   #define PyString_Type                PyUnicode_Type
485   #define PyString_Check               PyUnicode_Check
486   #define PyString_CheckExact          PyUnicode_CheckExact
487 #ifndef PyObject_Unicode
488   #define PyObject_Unicode             PyObject_Str
489 #endif
490 #endif
491 #if PY_MAJOR_VERSION >= 3
492   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
493   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
494 #else
495   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
496   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
497 #endif
498 #ifndef PySet_CheckExact
499   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
500 #endif
501 #if PY_VERSION_HEX >= 0x030900A4
502   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
503   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
504 #else
505   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
506   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
507 #endif
508 #if CYTHON_ASSUME_SAFE_MACROS
509   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
510 #else
511   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
512 #endif
513 #if PY_MAJOR_VERSION >= 3
514   #define PyIntObject                  PyLongObject
515   #define PyInt_Type                   PyLong_Type
516   #define PyInt_Check(op)              PyLong_Check(op)
517   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
518   #define PyInt_FromString             PyLong_FromString
519   #define PyInt_FromUnicode            PyLong_FromUnicode
520   #define PyInt_FromLong               PyLong_FromLong
521   #define PyInt_FromSize_t             PyLong_FromSize_t
522   #define PyInt_FromSsize_t            PyLong_FromSsize_t
523   #define PyInt_AsLong                 PyLong_AsLong
524   #define PyInt_AS_LONG                PyLong_AS_LONG
525   #define PyInt_AsSsize_t              PyLong_AsSsize_t
526   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
527   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
528   #define PyNumber_Int                 PyNumber_Long
529 #endif
530 #if PY_MAJOR_VERSION >= 3
531   #define PyBoolObject                 PyLongObject
532 #endif
533 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
534   #ifndef PyUnicode_InternFromString
535     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
536   #endif
537 #endif
538 #if PY_VERSION_HEX < 0x030200A4
539   typedef long Py_hash_t;
540   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
541   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
542 #else
543   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
544   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
545 #endif
546 #if PY_MAJOR_VERSION >= 3
547   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
548 #else
549   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
550 #endif
551 #if CYTHON_USE_ASYNC_SLOTS
552   #if PY_VERSION_HEX >= 0x030500B1
553     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
554     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
555   #else
556     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
557   #endif
558 #else
559   #define __Pyx_PyType_AsAsync(obj) NULL
560 #endif
561 #ifndef __Pyx_PyAsyncMethodsStruct
562     typedef struct {
563         unaryfunc am_await;
564         unaryfunc am_aiter;
565         unaryfunc am_anext;
566     } __Pyx_PyAsyncMethodsStruct;
567 #endif
568 
569 #if defined(WIN32) || defined(MS_WINDOWS)
570   #define _USE_MATH_DEFINES
571 #endif
572 #include <math.h>
573 #ifdef NAN
574 #define __PYX_NAN() ((float) NAN)
575 #else
__PYX_NAN()576 static CYTHON_INLINE float __PYX_NAN() {
577   float value;
578   memset(&value, 0xFF, sizeof(value));
579   return value;
580 }
581 #endif
582 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
583 #define __Pyx_truncl trunc
584 #else
585 #define __Pyx_truncl truncl
586 #endif
587 
588 #define __PYX_MARK_ERR_POS(f_index, lineno) \
589     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
590 #define __PYX_ERR(f_index, lineno, Ln_error) \
591     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
592 
593 #ifndef __PYX_EXTERN_C
594   #ifdef __cplusplus
595     #define __PYX_EXTERN_C extern "C"
596   #else
597     #define __PYX_EXTERN_C extern
598   #endif
599 #endif
600 
601 #define __PYX_HAVE__pygame_sdl2__gfxdraw
602 #define __PYX_HAVE_API__pygame_sdl2__gfxdraw
603 /* Early includes */
604 #include <stdint.h>
605 #include <string.h>
606 #include <stdio.h>
607 #include <stddef.h>
608 #include "SDL.h"
609 #include "SDL2_rotozoom.h"
610 #include "SDL_gfxPrimitives.h"
611 #include <stdlib.h>
612 #ifdef _OPENMP
613 #include <omp.h>
614 #endif /* _OPENMP */
615 
616 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
617 #define CYTHON_WITHOUT_ASSERTIONS
618 #endif
619 
620 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
621                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
622 
623 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
624 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
625 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
626 #define __PYX_DEFAULT_STRING_ENCODING ""
627 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
628 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
629 #define __Pyx_uchar_cast(c) ((unsigned char)c)
630 #define __Pyx_long_cast(x) ((long)x)
631 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
632     (sizeof(type) < sizeof(Py_ssize_t))  ||\
633     (sizeof(type) > sizeof(Py_ssize_t) &&\
634           likely(v < (type)PY_SSIZE_T_MAX ||\
635                  v == (type)PY_SSIZE_T_MAX)  &&\
636           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
637                                 v == (type)PY_SSIZE_T_MIN)))  ||\
638     (sizeof(type) == sizeof(Py_ssize_t) &&\
639           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
640                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)641 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
642     return (size_t) i < (size_t) limit;
643 }
644 #if defined (__cplusplus) && __cplusplus >= 201103L
645     #include <cstdlib>
646     #define __Pyx_sst_abs(value) std::abs(value)
647 #elif SIZEOF_INT >= SIZEOF_SIZE_T
648     #define __Pyx_sst_abs(value) abs(value)
649 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
650     #define __Pyx_sst_abs(value) labs(value)
651 #elif defined (_MSC_VER)
652     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
653 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
654     #define __Pyx_sst_abs(value) llabs(value)
655 #elif defined (__GNUC__)
656     #define __Pyx_sst_abs(value) __builtin_llabs(value)
657 #else
658     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
659 #endif
660 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
661 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
662 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
663 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
664 #define __Pyx_PyBytes_FromString        PyBytes_FromString
665 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
666 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
667 #if PY_MAJOR_VERSION < 3
668     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
669     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
670 #else
671     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
672     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
673 #endif
674 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
675 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
676 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
677 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
678 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
679 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
680 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
681 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
682 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
683 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
684 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
685 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
686 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
687 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
688 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
689 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)690 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
691     const Py_UNICODE *u_end = u;
692     while (*u_end++) ;
693     return (size_t)(u_end - u - 1);
694 }
695 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
696 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
697 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
698 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
699 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
700 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
701 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
702 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
703 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
704 #define __Pyx_PySequence_Tuple(obj)\
705     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
706 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
707 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
708 #if CYTHON_ASSUME_SAFE_MACROS
709 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
710 #else
711 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
712 #endif
713 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
714 #if PY_MAJOR_VERSION >= 3
715 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
716 #else
717 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
718 #endif
719 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
720 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
721 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)722 static int __Pyx_init_sys_getdefaultencoding_params(void) {
723     PyObject* sys;
724     PyObject* default_encoding = NULL;
725     PyObject* ascii_chars_u = NULL;
726     PyObject* ascii_chars_b = NULL;
727     const char* default_encoding_c;
728     sys = PyImport_ImportModule("sys");
729     if (!sys) goto bad;
730     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
731     Py_DECREF(sys);
732     if (!default_encoding) goto bad;
733     default_encoding_c = PyBytes_AsString(default_encoding);
734     if (!default_encoding_c) goto bad;
735     if (strcmp(default_encoding_c, "ascii") == 0) {
736         __Pyx_sys_getdefaultencoding_not_ascii = 0;
737     } else {
738         char ascii_chars[128];
739         int c;
740         for (c = 0; c < 128; c++) {
741             ascii_chars[c] = c;
742         }
743         __Pyx_sys_getdefaultencoding_not_ascii = 1;
744         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
745         if (!ascii_chars_u) goto bad;
746         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
747         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
748             PyErr_Format(
749                 PyExc_ValueError,
750                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
751                 default_encoding_c);
752             goto bad;
753         }
754         Py_DECREF(ascii_chars_u);
755         Py_DECREF(ascii_chars_b);
756     }
757     Py_DECREF(default_encoding);
758     return 0;
759 bad:
760     Py_XDECREF(default_encoding);
761     Py_XDECREF(ascii_chars_u);
762     Py_XDECREF(ascii_chars_b);
763     return -1;
764 }
765 #endif
766 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
767 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
768 #else
769 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
770 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
771 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)772 static int __Pyx_init_sys_getdefaultencoding_params(void) {
773     PyObject* sys;
774     PyObject* default_encoding = NULL;
775     char* default_encoding_c;
776     sys = PyImport_ImportModule("sys");
777     if (!sys) goto bad;
778     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
779     Py_DECREF(sys);
780     if (!default_encoding) goto bad;
781     default_encoding_c = PyBytes_AsString(default_encoding);
782     if (!default_encoding_c) goto bad;
783     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
784     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
785     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
786     Py_DECREF(default_encoding);
787     return 0;
788 bad:
789     Py_XDECREF(default_encoding);
790     return -1;
791 }
792 #endif
793 #endif
794 
795 
796 /* Test for GCC > 2.95 */
797 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
798   #define likely(x)   __builtin_expect(!!(x), 1)
799   #define unlikely(x) __builtin_expect(!!(x), 0)
800 #else /* !__GNUC__ or GCC < 2.95 */
801   #define likely(x)   (x)
802   #define unlikely(x) (x)
803 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)804 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
805 
806 static PyObject *__pyx_m = NULL;
807 static PyObject *__pyx_d;
808 static PyObject *__pyx_b;
809 static PyObject *__pyx_cython_runtime = NULL;
810 static PyObject *__pyx_empty_tuple;
811 static PyObject *__pyx_empty_bytes;
812 static PyObject *__pyx_empty_unicode;
813 static int __pyx_lineno;
814 static int __pyx_clineno = 0;
815 static const char * __pyx_cfilenm= __FILE__;
816 static const char *__pyx_filename;
817 
818 
819 static const char *__pyx_f[] = {
820   "src/pygame_sdl2/gfxdraw.pyx",
821   "src/pygame_sdl2/surface.pxd",
822   "src/pygame_sdl2/color.pxd",
823 };
824 
825 /*--- Type declarations ---*/
826 struct __pyx_obj_11pygame_sdl2_7surface_Surface;
827 struct __pyx_obj_11pygame_sdl2_5color_Color;
828 
829 /* "pygame_sdl2/surface.pxd":23
830  * from sdl2 cimport SDL_Surface
831  *
832  * cdef class Surface:             # <<<<<<<<<<<<<<
833  *     # Allow weak references.
834  *     cdef object __weakref__
835  */
836 struct __pyx_obj_11pygame_sdl2_7surface_Surface {
837   PyObject_HEAD
838   struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab;
839   PyObject *__weakref__;
840   SDL_Surface *surface;
841   int owns_surface;
842   int window_surface;
843   PyObject *locklist;
844   struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent;
845   struct __pyx_obj_11pygame_sdl2_7surface_Surface *root;
846   int offset_x;
847   int offset_y;
848   PyObject *get_window_flags;
849   int has_alpha;
850 };
851 
852 
853 /* "pygame_sdl2/color.pxd":26
854  * cdef to_sdl_color(color, SDL_Color *out)
855  *
856  * cdef class Color:             # <<<<<<<<<<<<<<
857  *     # Allow weak references.
858  *     cdef object __weakref__
859  */
860 struct __pyx_obj_11pygame_sdl2_5color_Color {
861   PyObject_HEAD
862   struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab;
863   PyObject *__weakref__;
864   Uint8 r;
865   Uint8 g;
866   Uint8 b;
867   Uint8 a;
868   uint8_t length;
869 };
870 
871 
872 
873 /* "pygame_sdl2/surface.pxd":23
874  * from sdl2 cimport SDL_Surface
875  *
876  * cdef class Surface:             # <<<<<<<<<<<<<<
877  *     # Allow weak references.
878  *     cdef object __weakref__
879  */
880 
881 struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface {
882   void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *);
883 };
884 static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface;
885 
886 
887 /* "pygame_sdl2/color.pxd":26
888  * cdef to_sdl_color(color, SDL_Color *out)
889  *
890  * cdef class Color:             # <<<<<<<<<<<<<<
891  *     # Allow weak references.
892  *     cdef object __weakref__
893  */
894 
895 struct __pyx_vtabstruct_11pygame_sdl2_5color_Color {
896   PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8);
897   PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *);
898   PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *);
899 };
900 static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color;
901 
902 /* --- Runtime support code (head) --- */
903 /* Refnanny.proto */
904 #ifndef CYTHON_REFNANNY
905   #define CYTHON_REFNANNY 0
906 #endif
907 #if CYTHON_REFNANNY
908   typedef struct {
909     void (*INCREF)(void*, PyObject*, int);
910     void (*DECREF)(void*, PyObject*, int);
911     void (*GOTREF)(void*, PyObject*, int);
912     void (*GIVEREF)(void*, PyObject*, int);
913     void* (*SetupContext)(const char*, int, const char*);
914     void (*FinishContext)(void**);
915   } __Pyx_RefNannyAPIStruct;
916   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
917   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
918   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
919 #ifdef WITH_THREAD
920   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
921           if (acquire_gil) {\
922               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
923               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
924               PyGILState_Release(__pyx_gilstate_save);\
925           } else {\
926               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
927           }
928 #else
929   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
930           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
931 #endif
932   #define __Pyx_RefNannyFinishContext()\
933           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
934   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
935   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
936   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
937   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
938   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
939   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
940   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
941   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
942 #else
943   #define __Pyx_RefNannyDeclarations
944   #define __Pyx_RefNannySetupContext(name, acquire_gil)
945   #define __Pyx_RefNannyFinishContext()
946   #define __Pyx_INCREF(r) Py_INCREF(r)
947   #define __Pyx_DECREF(r) Py_DECREF(r)
948   #define __Pyx_GOTREF(r)
949   #define __Pyx_GIVEREF(r)
950   #define __Pyx_XINCREF(r) Py_XINCREF(r)
951   #define __Pyx_XDECREF(r) Py_XDECREF(r)
952   #define __Pyx_XGOTREF(r)
953   #define __Pyx_XGIVEREF(r)
954 #endif
955 #define __Pyx_XDECREF_SET(r, v) do {\
956         PyObject *tmp = (PyObject *) r;\
957         r = v; __Pyx_XDECREF(tmp);\
958     } while (0)
959 #define __Pyx_DECREF_SET(r, v) do {\
960         PyObject *tmp = (PyObject *) r;\
961         r = v; __Pyx_DECREF(tmp);\
962     } while (0)
963 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
964 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
965 
966 /* PyObjectGetAttrStr.proto */
967 #if CYTHON_USE_TYPE_SLOTS
968 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
969 #else
970 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
971 #endif
972 
973 /* GetBuiltinName.proto */
974 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
975 
976 /* RaiseArgTupleInvalid.proto */
977 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
978     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
979 
980 /* RaiseDoubleKeywords.proto */
981 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
982 
983 /* ParseKeywords.proto */
984 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
985     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
986     const char* function_name);
987 
988 /* ArgTypeTest.proto */
989 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
990     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
991         __Pyx__ArgTypeTest(obj, type, name, exact))
992 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
993 
994 /* PyCFunctionFastCall.proto */
995 #if CYTHON_FAST_PYCCALL
996 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
997 #else
998 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
999 #endif
1000 
1001 /* PyFunctionFastCall.proto */
1002 #if CYTHON_FAST_PYCALL
1003 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1004     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1005 #if 1 || PY_VERSION_HEX < 0x030600B1
1006 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1007 #else
1008 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1009 #endif
1010 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1011     (sizeof(char [1 - 2*!(cond)]) - 1)
1012 #ifndef Py_MEMBER_SIZE
1013 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1014 #endif
1015   static size_t __pyx_pyframe_localsplus_offset = 0;
1016   #include "frameobject.h"
1017   #define __Pxy_PyFrame_Initialize_Offsets()\
1018     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1019      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1020   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1021     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1022 #endif
1023 
1024 /* PyObjectCall.proto */
1025 #if CYTHON_COMPILING_IN_CPYTHON
1026 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1027 #else
1028 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1029 #endif
1030 
1031 /* PyObjectCallMethO.proto */
1032 #if CYTHON_COMPILING_IN_CPYTHON
1033 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1034 #endif
1035 
1036 /* PyObjectCallOneArg.proto */
1037 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1038 
1039 /* PyDictVersioning.proto */
1040 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1041 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1042 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1043 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1044     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1045     (cache_var) = (value);
1046 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1047     static PY_UINT64_T __pyx_dict_version = 0;\
1048     static PyObject *__pyx_dict_cached_value = NULL;\
1049     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1050         (VAR) = __pyx_dict_cached_value;\
1051     } else {\
1052         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1053         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1054     }\
1055 }
1056 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1057 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1058 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1059 #else
1060 #define __PYX_GET_DICT_VERSION(dict)  (0)
1061 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1062 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1063 #endif
1064 
1065 /* GetModuleGlobalName.proto */
1066 #if CYTHON_USE_DICT_VERSIONS
1067 #define __Pyx_GetModuleGlobalName(var, name)  {\
1068     static PY_UINT64_T __pyx_dict_version = 0;\
1069     static PyObject *__pyx_dict_cached_value = NULL;\
1070     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1071         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1072         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1073 }
1074 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1075     PY_UINT64_T __pyx_dict_version;\
1076     PyObject *__pyx_dict_cached_value;\
1077     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1078 }
1079 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1080 #else
1081 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1082 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1083 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1084 #endif
1085 
1086 /* PyObjectCall2Args.proto */
1087 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1088 
1089 /* RaiseTooManyValuesToUnpack.proto */
1090 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1091 
1092 /* RaiseNeedMoreValuesToUnpack.proto */
1093 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1094 
1095 /* IterFinish.proto */
1096 static CYTHON_INLINE int __Pyx_IterFinish(void);
1097 
1098 /* UnpackItemEndCheck.proto */
1099 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1100 
1101 /* GetItemInt.proto */
1102 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1103     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1104     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1105     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1106                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1107 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1108     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1109     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1110     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1111 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1112                                                               int wraparound, int boundscheck);
1113 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1114     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1115     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1116     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1117 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1118                                                               int wraparound, int boundscheck);
1119 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1120 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1121                                                      int is_list, int wraparound, int boundscheck);
1122 
1123 /* ObjectGetItem.proto */
1124 #if CYTHON_USE_TYPE_SLOTS
1125 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1126 #else
1127 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1128 #endif
1129 
1130 /* TypeImport.proto */
1131 #ifndef __PYX_HAVE_RT_ImportType_proto
1132 #define __PYX_HAVE_RT_ImportType_proto
1133 enum __Pyx_ImportType_CheckSize {
1134    __Pyx_ImportType_CheckSize_Error = 0,
1135    __Pyx_ImportType_CheckSize_Warn = 1,
1136    __Pyx_ImportType_CheckSize_Ignore = 2
1137 };
1138 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1139 #endif
1140 
1141 /* GetVTable.proto */
1142 static void* __Pyx_GetVtable(PyObject *dict);
1143 
1144 /* Import.proto */
1145 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1146 
1147 /* ImportFrom.proto */
1148 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1149 
1150 /* PyThreadStateGet.proto */
1151 #if CYTHON_FAST_THREAD_STATE
1152 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1153 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1154 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1155 #else
1156 #define __Pyx_PyThreadState_declare
1157 #define __Pyx_PyThreadState_assign
1158 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1159 #endif
1160 
1161 /* PyErrFetchRestore.proto */
1162 #if CYTHON_FAST_THREAD_STATE
1163 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1164 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1165 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1166 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1167 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1168 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1169 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1170 #if CYTHON_COMPILING_IN_CPYTHON
1171 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1172 #else
1173 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1174 #endif
1175 #else
1176 #define __Pyx_PyErr_Clear() PyErr_Clear()
1177 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1178 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1179 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1180 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1181 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1182 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1183 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1184 #endif
1185 
1186 /* CLineInTraceback.proto */
1187 #ifdef CYTHON_CLINE_IN_TRACEBACK
1188 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1189 #else
1190 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1191 #endif
1192 
1193 /* CodeObjectCache.proto */
1194 typedef struct {
1195     PyCodeObject* code_object;
1196     int code_line;
1197 } __Pyx_CodeObjectCacheEntry;
1198 struct __Pyx_CodeObjectCache {
1199     int count;
1200     int max_count;
1201     __Pyx_CodeObjectCacheEntry* entries;
1202 };
1203 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1204 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1205 static PyCodeObject *__pyx_find_code_object(int code_line);
1206 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1207 
1208 /* AddTraceback.proto */
1209 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1210                                int py_line, const char *filename);
1211 
1212 /* CIntFromPy.proto */
1213 static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *);
1214 
1215 /* CIntFromPy.proto */
1216 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1217 
1218 /* CIntFromPy.proto */
1219 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *);
1220 
1221 /* CIntToPy.proto */
1222 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1223 
1224 /* CIntFromPy.proto */
1225 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1226 
1227 /* FastTypeChecks.proto */
1228 #if CYTHON_COMPILING_IN_CPYTHON
1229 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1230 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1231 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1232 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1233 #else
1234 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1235 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1236 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1237 #endif
1238 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1239 
1240 /* CheckBinaryVersion.proto */
1241 static int __Pyx_check_binary_version(void);
1242 
1243 /* InitStrings.proto */
1244 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1245 
1246 
1247 /* Module declarations from 'libc.stdint' */
1248 
1249 /* Module declarations from 'libc.string' */
1250 
1251 /* Module declarations from 'libc.stdio' */
1252 
1253 /* Module declarations from 'libc.stddef' */
1254 
1255 /* Module declarations from 'sdl2' */
1256 
1257 /* Module declarations from 'sdl2_gfx' */
1258 
1259 /* Module declarations from 'libc.stdlib' */
1260 
1261 /* Module declarations from 'pygame_sdl2.surface' */
1262 static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0;
1263 
1264 /* Module declarations from 'pygame_sdl2.color' */
1265 static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0;
1266 
1267 /* Module declarations from 'pygame_sdl2.gfxdraw' */
1268 #define __Pyx_MODULE_NAME "pygame_sdl2.gfxdraw"
1269 extern int __pyx_module_is_main_pygame_sdl2__gfxdraw;
1270 int __pyx_module_is_main_pygame_sdl2__gfxdraw = 0;
1271 
1272 /* Implementation of 'pygame_sdl2.gfxdraw' */
1273 static PyObject *__pyx_builtin_zip;
1274 static PyObject *__pyx_builtin_range;
1275 static const char __pyx_k_c[] = "c";
1276 static const char __pyx_k_h[] = "h";
1277 static const char __pyx_k_n[] = "n";
1278 static const char __pyx_k_r[] = "r";
1279 static const char __pyx_k_w[] = "w";
1280 static const char __pyx_k_x[] = "x";
1281 static const char __pyx_k_y[] = "y";
1282 static const char __pyx_k_pt[] = "pt";
1283 static const char __pyx_k_rx[] = "rx";
1284 static const char __pyx_k_ry[] = "ry";
1285 static const char __pyx_k_tx[] = "tx";
1286 static const char __pyx_k_ty[] = "ty";
1287 static const char __pyx_k_vx[] = "vx";
1288 static const char __pyx_k_vy[] = "vy";
1289 static const char __pyx_k_x1[] = "x1";
1290 static const char __pyx_k_x2[] = "x2";
1291 static const char __pyx_k_x3[] = "x3";
1292 static const char __pyx_k_y1[] = "y1";
1293 static const char __pyx_k_y2[] = "y2";
1294 static const char __pyx_k_y3[] = "y3";
1295 static const char __pyx_k_arc[] = "arc";
1296 static const char __pyx_k_box[] = "box";
1297 static const char __pyx_k_end[] = "end";
1298 static const char __pyx_k_pie[] = "pie";
1299 static const char __pyx_k_rad[] = "rad";
1300 static const char __pyx_k_zip[] = "zip";
1301 static const char __pyx_k_Rect[] = "Rect";
1302 static const char __pyx_k_line[] = "line";
1303 static const char __pyx_k_main[] = "__main__";
1304 static const char __pyx_k_name[] = "__name__";
1305 static const char __pyx_k_rect[] = "rect";
1306 static const char __pyx_k_test[] = "__test__";
1307 static const char __pyx_k_color[] = "color";
1308 static const char __pyx_k_error[] = "error";
1309 static const char __pyx_k_hline[] = "hline";
1310 static const char __pyx_k_pixel[] = "pixel";
1311 static const char __pyx_k_range[] = "range";
1312 static const char __pyx_k_start[] = "start";
1313 static const char __pyx_k_steps[] = "steps";
1314 static const char __pyx_k_vline[] = "vline";
1315 static const char __pyx_k_width[] = "width";
1316 static const char __pyx_k_x1int[] = "x1int";
1317 static const char __pyx_k_x2int[] = "x2int";
1318 static const char __pyx_k_y1int[] = "y1int";
1319 static const char __pyx_k_y2int[] = "y2int";
1320 static const char __pyx_k_aaline[] = "aaline";
1321 static const char __pyx_k_bezier[] = "bezier";
1322 static const char __pyx_k_circle[] = "circle";
1323 static const char __pyx_k_import[] = "__import__";
1324 static const char __pyx_k_points[] = "points";
1325 static const char __pyx_k_trigon[] = "trigon";
1326 static const char __pyx_k_ellipse[] = "ellipse";
1327 static const char __pyx_k_polygon[] = "polygon";
1328 static const char __pyx_k_surface[] = "surface";
1329 static const char __pyx_k_texture[] = "texture";
1330 static const char __pyx_k_aacircle[] = "aacircle";
1331 static const char __pyx_k_aatrigon[] = "aatrigon";
1332 static const char __pyx_k_aaellipse[] = "aaellipse";
1333 static const char __pyx_k_aapolygon[] = "aapolygon";
1334 static const char __pyx_k_rectangle[] = "rectangle";
1335 static const char __pyx_k_filled_pie[] = "filled_pie";
1336 static const char __pyx_k_num_points[] = "num_points";
1337 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
1338 static const char __pyx_k_thick_line[] = "thick_line";
1339 static const char __pyx_k_rounded_box[] = "rounded_box";
1340 static const char __pyx_k_filled_circle[] = "filled_circle";
1341 static const char __pyx_k_filled_trigon[] = "filled_trigon";
1342 static const char __pyx_k_filled_ellipse[] = "filled_ellipse";
1343 static const char __pyx_k_filled_polygon[] = "filled_polygon";
1344 static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect";
1345 static const char __pyx_k_textured_polygon[] = "textured_polygon";
1346 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1347 static const char __pyx_k_rounded_rectangle[] = "rounded_rectangle";
1348 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1349 static const char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw";
1350 static const char __pyx_k_src_pygame_sdl2_gfxdraw_pyx[] = "src/pygame_sdl2/gfxdraw.pyx";
1351 static PyObject *__pyx_n_s_Rect;
1352 static PyObject *__pyx_n_s_aacircle;
1353 static PyObject *__pyx_n_s_aaellipse;
1354 static PyObject *__pyx_n_s_aaline;
1355 static PyObject *__pyx_n_s_aapolygon;
1356 static PyObject *__pyx_n_s_aatrigon;
1357 static PyObject *__pyx_n_s_arc;
1358 static PyObject *__pyx_n_s_bezier;
1359 static PyObject *__pyx_n_s_box;
1360 static PyObject *__pyx_n_s_c;
1361 static PyObject *__pyx_n_s_circle;
1362 static PyObject *__pyx_n_s_cline_in_traceback;
1363 static PyObject *__pyx_n_s_color;
1364 static PyObject *__pyx_n_s_ellipse;
1365 static PyObject *__pyx_n_s_end;
1366 static PyObject *__pyx_n_s_error;
1367 static PyObject *__pyx_n_s_filled_circle;
1368 static PyObject *__pyx_n_s_filled_ellipse;
1369 static PyObject *__pyx_n_s_filled_pie;
1370 static PyObject *__pyx_n_s_filled_polygon;
1371 static PyObject *__pyx_n_s_filled_trigon;
1372 static PyObject *__pyx_n_s_h;
1373 static PyObject *__pyx_n_s_hline;
1374 static PyObject *__pyx_n_s_import;
1375 static PyObject *__pyx_n_s_line;
1376 static PyObject *__pyx_n_s_main;
1377 static PyObject *__pyx_n_s_n;
1378 static PyObject *__pyx_n_s_name;
1379 static PyObject *__pyx_n_s_num_points;
1380 static PyObject *__pyx_n_s_pie;
1381 static PyObject *__pyx_n_s_pixel;
1382 static PyObject *__pyx_n_s_points;
1383 static PyObject *__pyx_n_s_polygon;
1384 static PyObject *__pyx_n_s_pt;
1385 static PyObject *__pyx_n_s_pygame_sdl2_error;
1386 static PyObject *__pyx_n_s_pygame_sdl2_gfxdraw;
1387 static PyObject *__pyx_n_s_pygame_sdl2_rect;
1388 static PyObject *__pyx_n_s_pyx_vtable;
1389 static PyObject *__pyx_n_s_r;
1390 static PyObject *__pyx_n_s_rad;
1391 static PyObject *__pyx_n_s_range;
1392 static PyObject *__pyx_n_s_rect;
1393 static PyObject *__pyx_n_s_rectangle;
1394 static PyObject *__pyx_n_s_rounded_box;
1395 static PyObject *__pyx_n_s_rounded_rectangle;
1396 static PyObject *__pyx_n_s_rx;
1397 static PyObject *__pyx_n_s_ry;
1398 static PyObject *__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx;
1399 static PyObject *__pyx_n_s_start;
1400 static PyObject *__pyx_n_s_steps;
1401 static PyObject *__pyx_n_s_surface;
1402 static PyObject *__pyx_n_s_test;
1403 static PyObject *__pyx_n_s_texture;
1404 static PyObject *__pyx_n_s_textured_polygon;
1405 static PyObject *__pyx_n_s_thick_line;
1406 static PyObject *__pyx_n_s_trigon;
1407 static PyObject *__pyx_n_s_tx;
1408 static PyObject *__pyx_n_s_ty;
1409 static PyObject *__pyx_n_s_vline;
1410 static PyObject *__pyx_n_s_vx;
1411 static PyObject *__pyx_n_s_vy;
1412 static PyObject *__pyx_n_s_w;
1413 static PyObject *__pyx_n_s_width;
1414 static PyObject *__pyx_n_s_x;
1415 static PyObject *__pyx_n_s_x1;
1416 static PyObject *__pyx_n_s_x1int;
1417 static PyObject *__pyx_n_s_x2;
1418 static PyObject *__pyx_n_s_x2int;
1419 static PyObject *__pyx_n_s_x3;
1420 static PyObject *__pyx_n_s_y;
1421 static PyObject *__pyx_n_s_y1;
1422 static PyObject *__pyx_n_s_y1int;
1423 static PyObject *__pyx_n_s_y2;
1424 static PyObject *__pyx_n_s_y2int;
1425 static PyObject *__pyx_n_s_y3;
1426 static PyObject *__pyx_n_s_zip;
1427 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */
1428 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */
1429 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */
1430 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */
1431 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */
1432 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */
1433 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */
1434 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */
1435 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */
1436 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color); /* proto */
1437 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */
1438 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */
1439 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */
1440 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */
1441 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */
1442 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */
1443 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */
1444 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */
1445 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */
1446 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */
1447 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */
1448 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */
1449 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */
1450 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */
1451 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */
1452 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty); /* proto */
1453 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color); /* proto */
1454 static PyObject *__pyx_tuple_;
1455 static PyObject *__pyx_tuple__3;
1456 static PyObject *__pyx_tuple__5;
1457 static PyObject *__pyx_tuple__7;
1458 static PyObject *__pyx_tuple__9;
1459 static PyObject *__pyx_tuple__11;
1460 static PyObject *__pyx_tuple__13;
1461 static PyObject *__pyx_tuple__15;
1462 static PyObject *__pyx_tuple__17;
1463 static PyObject *__pyx_tuple__19;
1464 static PyObject *__pyx_tuple__21;
1465 static PyObject *__pyx_tuple__23;
1466 static PyObject *__pyx_tuple__25;
1467 static PyObject *__pyx_tuple__27;
1468 static PyObject *__pyx_tuple__29;
1469 static PyObject *__pyx_tuple__31;
1470 static PyObject *__pyx_tuple__33;
1471 static PyObject *__pyx_tuple__35;
1472 static PyObject *__pyx_tuple__37;
1473 static PyObject *__pyx_tuple__39;
1474 static PyObject *__pyx_tuple__41;
1475 static PyObject *__pyx_tuple__43;
1476 static PyObject *__pyx_tuple__45;
1477 static PyObject *__pyx_tuple__47;
1478 static PyObject *__pyx_tuple__49;
1479 static PyObject *__pyx_tuple__51;
1480 static PyObject *__pyx_tuple__53;
1481 static PyObject *__pyx_codeobj__2;
1482 static PyObject *__pyx_codeobj__4;
1483 static PyObject *__pyx_codeobj__6;
1484 static PyObject *__pyx_codeobj__8;
1485 static PyObject *__pyx_codeobj__10;
1486 static PyObject *__pyx_codeobj__12;
1487 static PyObject *__pyx_codeobj__14;
1488 static PyObject *__pyx_codeobj__16;
1489 static PyObject *__pyx_codeobj__18;
1490 static PyObject *__pyx_codeobj__20;
1491 static PyObject *__pyx_codeobj__22;
1492 static PyObject *__pyx_codeobj__24;
1493 static PyObject *__pyx_codeobj__26;
1494 static PyObject *__pyx_codeobj__28;
1495 static PyObject *__pyx_codeobj__30;
1496 static PyObject *__pyx_codeobj__32;
1497 static PyObject *__pyx_codeobj__34;
1498 static PyObject *__pyx_codeobj__36;
1499 static PyObject *__pyx_codeobj__38;
1500 static PyObject *__pyx_codeobj__40;
1501 static PyObject *__pyx_codeobj__42;
1502 static PyObject *__pyx_codeobj__44;
1503 static PyObject *__pyx_codeobj__46;
1504 static PyObject *__pyx_codeobj__48;
1505 static PyObject *__pyx_codeobj__50;
1506 static PyObject *__pyx_codeobj__52;
1507 static PyObject *__pyx_codeobj__54;
1508 /* Late includes */
1509 
1510 /* "pygame_sdl2/gfxdraw.pyx":29
1511  *
1512  *
1513  * def pixel(Surface surface, x, y, color):             # <<<<<<<<<<<<<<
1514  *     cdef Color c = Color(color)
1515  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
1516  */
1517 
1518 /* Python wrapper */
1519 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1520 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel = {"pixel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1521 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1522   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
1523   PyObject *__pyx_v_x = 0;
1524   PyObject *__pyx_v_y = 0;
1525   PyObject *__pyx_v_color = 0;
1526   int __pyx_lineno = 0;
1527   const char *__pyx_filename = NULL;
1528   int __pyx_clineno = 0;
1529   PyObject *__pyx_r = 0;
1530   __Pyx_RefNannyDeclarations
1531   __Pyx_RefNannySetupContext("pixel (wrapper)", 0);
1532   {
1533     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_color,0};
1534     PyObject* values[4] = {0,0,0,0};
1535     if (unlikely(__pyx_kwds)) {
1536       Py_ssize_t kw_args;
1537       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1538       switch (pos_args) {
1539         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1540         CYTHON_FALLTHROUGH;
1541         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1542         CYTHON_FALLTHROUGH;
1543         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1544         CYTHON_FALLTHROUGH;
1545         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1546         CYTHON_FALLTHROUGH;
1547         case  0: break;
1548         default: goto __pyx_L5_argtuple_error;
1549       }
1550       kw_args = PyDict_Size(__pyx_kwds);
1551       switch (pos_args) {
1552         case  0:
1553         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1554         else goto __pyx_L5_argtuple_error;
1555         CYTHON_FALLTHROUGH;
1556         case  1:
1557         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
1558         else {
1559           __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error)
1560         }
1561         CYTHON_FALLTHROUGH;
1562         case  2:
1563         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
1564         else {
1565           __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error)
1566         }
1567         CYTHON_FALLTHROUGH;
1568         case  3:
1569         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
1570         else {
1571           __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error)
1572         }
1573       }
1574       if (unlikely(kw_args > 0)) {
1575         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixel") < 0)) __PYX_ERR(0, 29, __pyx_L3_error)
1576       }
1577     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
1578       goto __pyx_L5_argtuple_error;
1579     } else {
1580       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1581       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1582       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1583       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1584     }
1585     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
1586     __pyx_v_x = values[1];
1587     __pyx_v_y = values[2];
1588     __pyx_v_color = values[3];
1589   }
1590   goto __pyx_L4_argument_unpacking_done;
1591   __pyx_L5_argtuple_error:;
1592   __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error)
1593   __pyx_L3_error:;
1594   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename);
1595   __Pyx_RefNannyFinishContext();
1596   return NULL;
1597   __pyx_L4_argument_unpacking_done:;
1598   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 29, __pyx_L1_error)
1599   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_pixel(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_color);
1600 
1601   /* function exit code */
1602   goto __pyx_L0;
1603   __pyx_L1_error:;
1604   __pyx_r = NULL;
1605   __pyx_L0:;
1606   __Pyx_RefNannyFinishContext();
1607   return __pyx_r;
1608 }
1609 
__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_color)1610 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color) {
1611   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
1612   PyObject *__pyx_r = NULL;
1613   __Pyx_RefNannyDeclarations
1614   PyObject *__pyx_t_1 = NULL;
1615   Sint16 __pyx_t_2;
1616   Sint16 __pyx_t_3;
1617   int __pyx_lineno = 0;
1618   const char *__pyx_filename = NULL;
1619   int __pyx_clineno = 0;
1620   __Pyx_RefNannySetupContext("pixel", 0);
1621 
1622   /* "pygame_sdl2/gfxdraw.pyx":30
1623  *
1624  * def pixel(Surface surface, x, y, color):
1625  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
1626  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
1627  *
1628  */
1629   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
1630   __Pyx_GOTREF(__pyx_t_1);
1631   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
1632   __pyx_t_1 = 0;
1633 
1634   /* "pygame_sdl2/gfxdraw.pyx":31
1635  * def pixel(Surface surface, x, y, color):
1636  *     cdef Color c = Color(color)
1637  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
1638  *
1639  * def hline(Surface surface, x1, x2, y, color):
1640  */
1641   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
1642   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
1643   (void)(pixelRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
1644 
1645   /* "pygame_sdl2/gfxdraw.pyx":29
1646  *
1647  *
1648  * def pixel(Surface surface, x, y, color):             # <<<<<<<<<<<<<<
1649  *     cdef Color c = Color(color)
1650  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
1651  */
1652 
1653   /* function exit code */
1654   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1655   goto __pyx_L0;
1656   __pyx_L1_error:;
1657   __Pyx_XDECREF(__pyx_t_1);
1658   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename);
1659   __pyx_r = NULL;
1660   __pyx_L0:;
1661   __Pyx_XDECREF((PyObject *)__pyx_v_c);
1662   __Pyx_XGIVEREF(__pyx_r);
1663   __Pyx_RefNannyFinishContext();
1664   return __pyx_r;
1665 }
1666 
1667 /* "pygame_sdl2/gfxdraw.pyx":33
1668  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
1669  *
1670  * def hline(Surface surface, x1, x2, y, color):             # <<<<<<<<<<<<<<
1671  *     cdef Color c = Color(color)
1672  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
1673  */
1674 
1675 /* Python wrapper */
1676 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1677 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_3hline = {"hline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_3hline, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1678 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1679   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
1680   PyObject *__pyx_v_x1 = 0;
1681   PyObject *__pyx_v_x2 = 0;
1682   PyObject *__pyx_v_y = 0;
1683   PyObject *__pyx_v_color = 0;
1684   int __pyx_lineno = 0;
1685   const char *__pyx_filename = NULL;
1686   int __pyx_clineno = 0;
1687   PyObject *__pyx_r = 0;
1688   __Pyx_RefNannyDeclarations
1689   __Pyx_RefNannySetupContext("hline (wrapper)", 0);
1690   {
1691     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_x2,&__pyx_n_s_y,&__pyx_n_s_color,0};
1692     PyObject* values[5] = {0,0,0,0,0};
1693     if (unlikely(__pyx_kwds)) {
1694       Py_ssize_t kw_args;
1695       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1696       switch (pos_args) {
1697         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1698         CYTHON_FALLTHROUGH;
1699         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1700         CYTHON_FALLTHROUGH;
1701         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1702         CYTHON_FALLTHROUGH;
1703         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1704         CYTHON_FALLTHROUGH;
1705         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1706         CYTHON_FALLTHROUGH;
1707         case  0: break;
1708         default: goto __pyx_L5_argtuple_error;
1709       }
1710       kw_args = PyDict_Size(__pyx_kwds);
1711       switch (pos_args) {
1712         case  0:
1713         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1714         else goto __pyx_L5_argtuple_error;
1715         CYTHON_FALLTHROUGH;
1716         case  1:
1717         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
1718         else {
1719           __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 1); __PYX_ERR(0, 33, __pyx_L3_error)
1720         }
1721         CYTHON_FALLTHROUGH;
1722         case  2:
1723         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
1724         else {
1725           __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 2); __PYX_ERR(0, 33, __pyx_L3_error)
1726         }
1727         CYTHON_FALLTHROUGH;
1728         case  3:
1729         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
1730         else {
1731           __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 3); __PYX_ERR(0, 33, __pyx_L3_error)
1732         }
1733         CYTHON_FALLTHROUGH;
1734         case  4:
1735         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
1736         else {
1737           __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 4); __PYX_ERR(0, 33, __pyx_L3_error)
1738         }
1739       }
1740       if (unlikely(kw_args > 0)) {
1741         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hline") < 0)) __PYX_ERR(0, 33, __pyx_L3_error)
1742       }
1743     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
1744       goto __pyx_L5_argtuple_error;
1745     } else {
1746       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1747       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1748       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1749       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1750       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1751     }
1752     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
1753     __pyx_v_x1 = values[1];
1754     __pyx_v_x2 = values[2];
1755     __pyx_v_y = values[3];
1756     __pyx_v_color = values[4];
1757   }
1758   goto __pyx_L4_argument_unpacking_done;
1759   __pyx_L5_argtuple_error:;
1760   __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 33, __pyx_L3_error)
1761   __pyx_L3_error:;
1762   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename);
1763   __Pyx_RefNannyFinishContext();
1764   return NULL;
1765   __pyx_L4_argument_unpacking_done:;
1766   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 33, __pyx_L1_error)
1767   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_2hline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_x2, __pyx_v_y, __pyx_v_color);
1768 
1769   /* function exit code */
1770   goto __pyx_L0;
1771   __pyx_L1_error:;
1772   __pyx_r = NULL;
1773   __pyx_L0:;
1774   __Pyx_RefNannyFinishContext();
1775   return __pyx_r;
1776 }
1777 
__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x1,PyObject * __pyx_v_x2,PyObject * __pyx_v_y,PyObject * __pyx_v_color)1778 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color) {
1779   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
1780   PyObject *__pyx_r = NULL;
1781   __Pyx_RefNannyDeclarations
1782   PyObject *__pyx_t_1 = NULL;
1783   Sint16 __pyx_t_2;
1784   Sint16 __pyx_t_3;
1785   Sint16 __pyx_t_4;
1786   int __pyx_lineno = 0;
1787   const char *__pyx_filename = NULL;
1788   int __pyx_clineno = 0;
1789   __Pyx_RefNannySetupContext("hline", 0);
1790 
1791   /* "pygame_sdl2/gfxdraw.pyx":34
1792  *
1793  * def hline(Surface surface, x1, x2, y, color):
1794  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
1795  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
1796  *
1797  */
1798   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
1799   __Pyx_GOTREF(__pyx_t_1);
1800   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
1801   __pyx_t_1 = 0;
1802 
1803   /* "pygame_sdl2/gfxdraw.pyx":35
1804  * def hline(Surface surface, x1, x2, y, color):
1805  *     cdef Color c = Color(color)
1806  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
1807  *
1808  * def vline(Surface surface, x, y1, y2, color):
1809  */
1810   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1811   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1812   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1813   (void)(hlineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
1814 
1815   /* "pygame_sdl2/gfxdraw.pyx":33
1816  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
1817  *
1818  * def hline(Surface surface, x1, x2, y, color):             # <<<<<<<<<<<<<<
1819  *     cdef Color c = Color(color)
1820  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
1821  */
1822 
1823   /* function exit code */
1824   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1825   goto __pyx_L0;
1826   __pyx_L1_error:;
1827   __Pyx_XDECREF(__pyx_t_1);
1828   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename);
1829   __pyx_r = NULL;
1830   __pyx_L0:;
1831   __Pyx_XDECREF((PyObject *)__pyx_v_c);
1832   __Pyx_XGIVEREF(__pyx_r);
1833   __Pyx_RefNannyFinishContext();
1834   return __pyx_r;
1835 }
1836 
1837 /* "pygame_sdl2/gfxdraw.pyx":37
1838  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
1839  *
1840  * def vline(Surface surface, x, y1, y2, color):             # <<<<<<<<<<<<<<
1841  *     cdef Color c = Color(color)
1842  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
1843  */
1844 
1845 /* Python wrapper */
1846 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1847 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_5vline = {"vline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_5vline, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1848 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1849   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
1850   PyObject *__pyx_v_x = 0;
1851   PyObject *__pyx_v_y1 = 0;
1852   PyObject *__pyx_v_y2 = 0;
1853   PyObject *__pyx_v_color = 0;
1854   int __pyx_lineno = 0;
1855   const char *__pyx_filename = NULL;
1856   int __pyx_clineno = 0;
1857   PyObject *__pyx_r = 0;
1858   __Pyx_RefNannyDeclarations
1859   __Pyx_RefNannySetupContext("vline (wrapper)", 0);
1860   {
1861     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y1,&__pyx_n_s_y2,&__pyx_n_s_color,0};
1862     PyObject* values[5] = {0,0,0,0,0};
1863     if (unlikely(__pyx_kwds)) {
1864       Py_ssize_t kw_args;
1865       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1866       switch (pos_args) {
1867         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1868         CYTHON_FALLTHROUGH;
1869         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1870         CYTHON_FALLTHROUGH;
1871         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1872         CYTHON_FALLTHROUGH;
1873         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1874         CYTHON_FALLTHROUGH;
1875         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1876         CYTHON_FALLTHROUGH;
1877         case  0: break;
1878         default: goto __pyx_L5_argtuple_error;
1879       }
1880       kw_args = PyDict_Size(__pyx_kwds);
1881       switch (pos_args) {
1882         case  0:
1883         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1884         else goto __pyx_L5_argtuple_error;
1885         CYTHON_FALLTHROUGH;
1886         case  1:
1887         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
1888         else {
1889           __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 1); __PYX_ERR(0, 37, __pyx_L3_error)
1890         }
1891         CYTHON_FALLTHROUGH;
1892         case  2:
1893         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
1894         else {
1895           __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 2); __PYX_ERR(0, 37, __pyx_L3_error)
1896         }
1897         CYTHON_FALLTHROUGH;
1898         case  3:
1899         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
1900         else {
1901           __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 3); __PYX_ERR(0, 37, __pyx_L3_error)
1902         }
1903         CYTHON_FALLTHROUGH;
1904         case  4:
1905         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
1906         else {
1907           __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 4); __PYX_ERR(0, 37, __pyx_L3_error)
1908         }
1909       }
1910       if (unlikely(kw_args > 0)) {
1911         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vline") < 0)) __PYX_ERR(0, 37, __pyx_L3_error)
1912       }
1913     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
1914       goto __pyx_L5_argtuple_error;
1915     } else {
1916       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1917       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1918       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1919       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1920       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1921     }
1922     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
1923     __pyx_v_x = values[1];
1924     __pyx_v_y1 = values[2];
1925     __pyx_v_y2 = values[3];
1926     __pyx_v_color = values[4];
1927   }
1928   goto __pyx_L4_argument_unpacking_done;
1929   __pyx_L5_argtuple_error:;
1930   __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 37, __pyx_L3_error)
1931   __pyx_L3_error:;
1932   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename);
1933   __Pyx_RefNannyFinishContext();
1934   return NULL;
1935   __pyx_L4_argument_unpacking_done:;
1936   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 37, __pyx_L1_error)
1937   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_4vline(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y1, __pyx_v_y2, __pyx_v_color);
1938 
1939   /* function exit code */
1940   goto __pyx_L0;
1941   __pyx_L1_error:;
1942   __pyx_r = NULL;
1943   __pyx_L0:;
1944   __Pyx_RefNannyFinishContext();
1945   return __pyx_r;
1946 }
1947 
__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y1,PyObject * __pyx_v_y2,PyObject * __pyx_v_color)1948 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) {
1949   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
1950   PyObject *__pyx_r = NULL;
1951   __Pyx_RefNannyDeclarations
1952   PyObject *__pyx_t_1 = NULL;
1953   Sint16 __pyx_t_2;
1954   Sint16 __pyx_t_3;
1955   Sint16 __pyx_t_4;
1956   int __pyx_lineno = 0;
1957   const char *__pyx_filename = NULL;
1958   int __pyx_clineno = 0;
1959   __Pyx_RefNannySetupContext("vline", 0);
1960 
1961   /* "pygame_sdl2/gfxdraw.pyx":38
1962  *
1963  * def vline(Surface surface, x, y1, y2, color):
1964  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
1965  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
1966  *
1967  */
1968   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
1969   __Pyx_GOTREF(__pyx_t_1);
1970   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
1971   __pyx_t_1 = 0;
1972 
1973   /* "pygame_sdl2/gfxdraw.pyx":39
1974  * def vline(Surface surface, x, y1, y2, color):
1975  *     cdef Color c = Color(color)
1976  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
1977  *
1978  * def rectangle(Surface surface, rect, color):
1979  */
1980   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1981   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1982   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1983   (void)(vlineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
1984 
1985   /* "pygame_sdl2/gfxdraw.pyx":37
1986  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
1987  *
1988  * def vline(Surface surface, x, y1, y2, color):             # <<<<<<<<<<<<<<
1989  *     cdef Color c = Color(color)
1990  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
1991  */
1992 
1993   /* function exit code */
1994   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1995   goto __pyx_L0;
1996   __pyx_L1_error:;
1997   __Pyx_XDECREF(__pyx_t_1);
1998   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename);
1999   __pyx_r = NULL;
2000   __pyx_L0:;
2001   __Pyx_XDECREF((PyObject *)__pyx_v_c);
2002   __Pyx_XGIVEREF(__pyx_r);
2003   __Pyx_RefNannyFinishContext();
2004   return __pyx_r;
2005 }
2006 
2007 /* "pygame_sdl2/gfxdraw.pyx":41
2008  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
2009  *
2010  * def rectangle(Surface surface, rect, color):             # <<<<<<<<<<<<<<
2011  *     cdef Color c = Color(color)
2012  *     if not isinstance(rect, Rect):
2013  */
2014 
2015 /* Python wrapper */
2016 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2017 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle = {"rectangle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2018 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2019   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
2020   PyObject *__pyx_v_rect = 0;
2021   PyObject *__pyx_v_color = 0;
2022   int __pyx_lineno = 0;
2023   const char *__pyx_filename = NULL;
2024   int __pyx_clineno = 0;
2025   PyObject *__pyx_r = 0;
2026   __Pyx_RefNannyDeclarations
2027   __Pyx_RefNannySetupContext("rectangle (wrapper)", 0);
2028   {
2029     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0};
2030     PyObject* values[3] = {0,0,0};
2031     if (unlikely(__pyx_kwds)) {
2032       Py_ssize_t kw_args;
2033       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2034       switch (pos_args) {
2035         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2036         CYTHON_FALLTHROUGH;
2037         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2038         CYTHON_FALLTHROUGH;
2039         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2040         CYTHON_FALLTHROUGH;
2041         case  0: break;
2042         default: goto __pyx_L5_argtuple_error;
2043       }
2044       kw_args = PyDict_Size(__pyx_kwds);
2045       switch (pos_args) {
2046         case  0:
2047         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2048         else goto __pyx_L5_argtuple_error;
2049         CYTHON_FALLTHROUGH;
2050         case  1:
2051         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
2052         else {
2053           __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 1); __PYX_ERR(0, 41, __pyx_L3_error)
2054         }
2055         CYTHON_FALLTHROUGH;
2056         case  2:
2057         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2058         else {
2059           __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 2); __PYX_ERR(0, 41, __pyx_L3_error)
2060         }
2061       }
2062       if (unlikely(kw_args > 0)) {
2063         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rectangle") < 0)) __PYX_ERR(0, 41, __pyx_L3_error)
2064       }
2065     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2066       goto __pyx_L5_argtuple_error;
2067     } else {
2068       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2069       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2070       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2071     }
2072     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
2073     __pyx_v_rect = values[1];
2074     __pyx_v_color = values[2];
2075   }
2076   goto __pyx_L4_argument_unpacking_done;
2077   __pyx_L5_argtuple_error:;
2078   __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error)
2079   __pyx_L3_error:;
2080   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
2081   __Pyx_RefNannyFinishContext();
2082   return NULL;
2083   __pyx_L4_argument_unpacking_done:;
2084   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 41, __pyx_L1_error)
2085   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color);
2086 
2087   /* function exit code */
2088   goto __pyx_L0;
2089   __pyx_L1_error:;
2090   __pyx_r = NULL;
2091   __pyx_L0:;
2092   __Pyx_RefNannyFinishContext();
2093   return __pyx_r;
2094 }
2095 
__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_rect,PyObject * __pyx_v_color)2096 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) {
2097   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
2098   PyObject *__pyx_r = NULL;
2099   __Pyx_RefNannyDeclarations
2100   PyObject *__pyx_t_1 = NULL;
2101   int __pyx_t_2;
2102   int __pyx_t_3;
2103   PyObject *__pyx_t_4 = NULL;
2104   PyObject *__pyx_t_5 = NULL;
2105   Sint16 __pyx_t_6;
2106   Sint16 __pyx_t_7;
2107   Sint16 __pyx_t_8;
2108   Sint16 __pyx_t_9;
2109   int __pyx_lineno = 0;
2110   const char *__pyx_filename = NULL;
2111   int __pyx_clineno = 0;
2112   __Pyx_RefNannySetupContext("rectangle", 0);
2113   __Pyx_INCREF(__pyx_v_rect);
2114 
2115   /* "pygame_sdl2/gfxdraw.pyx":42
2116  *
2117  * def rectangle(Surface surface, rect, color):
2118  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
2119  *     if not isinstance(rect, Rect):
2120  *         rect = Rect(rect)
2121  */
2122   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
2123   __Pyx_GOTREF(__pyx_t_1);
2124   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
2125   __pyx_t_1 = 0;
2126 
2127   /* "pygame_sdl2/gfxdraw.pyx":43
2128  * def rectangle(Surface surface, rect, color):
2129  *     cdef Color c = Color(color)
2130  *     if not isinstance(rect, Rect):             # <<<<<<<<<<<<<<
2131  *         rect = Rect(rect)
2132  *     rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2133  */
2134   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2135   __Pyx_GOTREF(__pyx_t_1);
2136   __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 43, __pyx_L1_error)
2137   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2138   __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
2139   if (__pyx_t_3) {
2140 
2141     /* "pygame_sdl2/gfxdraw.pyx":44
2142  *     cdef Color c = Color(color)
2143  *     if not isinstance(rect, Rect):
2144  *         rect = Rect(rect)             # <<<<<<<<<<<<<<
2145  *     rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2146  *
2147  */
2148     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
2149     __Pyx_GOTREF(__pyx_t_4);
2150     __pyx_t_5 = NULL;
2151     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2152       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
2153       if (likely(__pyx_t_5)) {
2154         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2155         __Pyx_INCREF(__pyx_t_5);
2156         __Pyx_INCREF(function);
2157         __Pyx_DECREF_SET(__pyx_t_4, function);
2158       }
2159     }
2160     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_rect) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect);
2161     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2162     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
2163     __Pyx_GOTREF(__pyx_t_1);
2164     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2165     __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1);
2166     __pyx_t_1 = 0;
2167 
2168     /* "pygame_sdl2/gfxdraw.pyx":43
2169  * def rectangle(Surface surface, rect, color):
2170  *     cdef Color c = Color(color)
2171  *     if not isinstance(rect, Rect):             # <<<<<<<<<<<<<<
2172  *         rect = Rect(rect)
2173  *     rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2174  */
2175   }
2176 
2177   /* "pygame_sdl2/gfxdraw.pyx":45
2178  *     if not isinstance(rect, Rect):
2179  *         rect = Rect(rect)
2180  *     rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
2181  *
2182  * def rounded_rectangle(Surface surface, rect, rad, color):
2183  */
2184   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2185   __Pyx_GOTREF(__pyx_t_1);
2186   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
2187   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2188   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2189   __Pyx_GOTREF(__pyx_t_1);
2190   __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
2191   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2192   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2193   __Pyx_GOTREF(__pyx_t_1);
2194   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
2195   __Pyx_GOTREF(__pyx_t_4);
2196   __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
2197   __Pyx_GOTREF(__pyx_t_5);
2198   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2199   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2200   __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
2201   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2202   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
2203   __Pyx_GOTREF(__pyx_t_5);
2204   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
2205   __Pyx_GOTREF(__pyx_t_4);
2206   __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2207   __Pyx_GOTREF(__pyx_t_1);
2208   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2209   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2210   __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
2211   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2212   (void)(rectangleRGBA(__pyx_v_surface->surface, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
2213 
2214   /* "pygame_sdl2/gfxdraw.pyx":41
2215  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
2216  *
2217  * def rectangle(Surface surface, rect, color):             # <<<<<<<<<<<<<<
2218  *     cdef Color c = Color(color)
2219  *     if not isinstance(rect, Rect):
2220  */
2221 
2222   /* function exit code */
2223   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2224   goto __pyx_L0;
2225   __pyx_L1_error:;
2226   __Pyx_XDECREF(__pyx_t_1);
2227   __Pyx_XDECREF(__pyx_t_4);
2228   __Pyx_XDECREF(__pyx_t_5);
2229   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
2230   __pyx_r = NULL;
2231   __pyx_L0:;
2232   __Pyx_XDECREF((PyObject *)__pyx_v_c);
2233   __Pyx_XDECREF(__pyx_v_rect);
2234   __Pyx_XGIVEREF(__pyx_r);
2235   __Pyx_RefNannyFinishContext();
2236   return __pyx_r;
2237 }
2238 
2239 /* "pygame_sdl2/gfxdraw.pyx":47
2240  *     rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2241  *
2242  * def rounded_rectangle(Surface surface, rect, rad, color):             # <<<<<<<<<<<<<<
2243  *     cdef Color c = Color(color)
2244  *     if not isinstance(rect, Rect):
2245  */
2246 
2247 /* Python wrapper */
2248 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2249 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle = {"rounded_rectangle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2250 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2251   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
2252   PyObject *__pyx_v_rect = 0;
2253   PyObject *__pyx_v_rad = 0;
2254   PyObject *__pyx_v_color = 0;
2255   int __pyx_lineno = 0;
2256   const char *__pyx_filename = NULL;
2257   int __pyx_clineno = 0;
2258   PyObject *__pyx_r = 0;
2259   __Pyx_RefNannyDeclarations
2260   __Pyx_RefNannySetupContext("rounded_rectangle (wrapper)", 0);
2261   {
2262     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0};
2263     PyObject* values[4] = {0,0,0,0};
2264     if (unlikely(__pyx_kwds)) {
2265       Py_ssize_t kw_args;
2266       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2267       switch (pos_args) {
2268         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2269         CYTHON_FALLTHROUGH;
2270         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2271         CYTHON_FALLTHROUGH;
2272         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2273         CYTHON_FALLTHROUGH;
2274         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2275         CYTHON_FALLTHROUGH;
2276         case  0: break;
2277         default: goto __pyx_L5_argtuple_error;
2278       }
2279       kw_args = PyDict_Size(__pyx_kwds);
2280       switch (pos_args) {
2281         case  0:
2282         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2283         else goto __pyx_L5_argtuple_error;
2284         CYTHON_FALLTHROUGH;
2285         case  1:
2286         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
2287         else {
2288           __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 1); __PYX_ERR(0, 47, __pyx_L3_error)
2289         }
2290         CYTHON_FALLTHROUGH;
2291         case  2:
2292         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--;
2293         else {
2294           __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 2); __PYX_ERR(0, 47, __pyx_L3_error)
2295         }
2296         CYTHON_FALLTHROUGH;
2297         case  3:
2298         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2299         else {
2300           __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 3); __PYX_ERR(0, 47, __pyx_L3_error)
2301         }
2302       }
2303       if (unlikely(kw_args > 0)) {
2304         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rounded_rectangle") < 0)) __PYX_ERR(0, 47, __pyx_L3_error)
2305       }
2306     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2307       goto __pyx_L5_argtuple_error;
2308     } else {
2309       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2310       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2311       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2312       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2313     }
2314     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
2315     __pyx_v_rect = values[1];
2316     __pyx_v_rad = values[2];
2317     __pyx_v_color = values[3];
2318   }
2319   goto __pyx_L4_argument_unpacking_done;
2320   __pyx_L5_argtuple_error:;
2321   __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 47, __pyx_L3_error)
2322   __pyx_L3_error:;
2323   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
2324   __Pyx_RefNannyFinishContext();
2325   return NULL;
2326   __pyx_L4_argument_unpacking_done:;
2327   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 47, __pyx_L1_error)
2328   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color);
2329 
2330   /* function exit code */
2331   goto __pyx_L0;
2332   __pyx_L1_error:;
2333   __pyx_r = NULL;
2334   __pyx_L0:;
2335   __Pyx_RefNannyFinishContext();
2336   return __pyx_r;
2337 }
2338 
__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_rect,PyObject * __pyx_v_rad,PyObject * __pyx_v_color)2339 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) {
2340   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
2341   PyObject *__pyx_r = NULL;
2342   __Pyx_RefNannyDeclarations
2343   PyObject *__pyx_t_1 = NULL;
2344   int __pyx_t_2;
2345   int __pyx_t_3;
2346   PyObject *__pyx_t_4 = NULL;
2347   PyObject *__pyx_t_5 = NULL;
2348   Sint16 __pyx_t_6;
2349   Sint16 __pyx_t_7;
2350   Sint16 __pyx_t_8;
2351   Sint16 __pyx_t_9;
2352   Sint16 __pyx_t_10;
2353   int __pyx_lineno = 0;
2354   const char *__pyx_filename = NULL;
2355   int __pyx_clineno = 0;
2356   __Pyx_RefNannySetupContext("rounded_rectangle", 0);
2357   __Pyx_INCREF(__pyx_v_rect);
2358 
2359   /* "pygame_sdl2/gfxdraw.pyx":48
2360  *
2361  * def rounded_rectangle(Surface surface, rect, rad, color):
2362  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
2363  *     if not isinstance(rect, Rect):
2364  *         rect = Rect(rect)
2365  */
2366   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
2367   __Pyx_GOTREF(__pyx_t_1);
2368   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
2369   __pyx_t_1 = 0;
2370 
2371   /* "pygame_sdl2/gfxdraw.pyx":49
2372  * def rounded_rectangle(Surface surface, rect, rad, color):
2373  *     cdef Color c = Color(color)
2374  *     if not isinstance(rect, Rect):             # <<<<<<<<<<<<<<
2375  *         rect = Rect(rect)
2376  *     roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2377  */
2378   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
2379   __Pyx_GOTREF(__pyx_t_1);
2380   __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 49, __pyx_L1_error)
2381   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2382   __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
2383   if (__pyx_t_3) {
2384 
2385     /* "pygame_sdl2/gfxdraw.pyx":50
2386  *     cdef Color c = Color(color)
2387  *     if not isinstance(rect, Rect):
2388  *         rect = Rect(rect)             # <<<<<<<<<<<<<<
2389  *     roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2390  *
2391  */
2392     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
2393     __Pyx_GOTREF(__pyx_t_4);
2394     __pyx_t_5 = NULL;
2395     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2396       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
2397       if (likely(__pyx_t_5)) {
2398         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2399         __Pyx_INCREF(__pyx_t_5);
2400         __Pyx_INCREF(function);
2401         __Pyx_DECREF_SET(__pyx_t_4, function);
2402       }
2403     }
2404     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_rect) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect);
2405     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2406     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
2407     __Pyx_GOTREF(__pyx_t_1);
2408     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2409     __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1);
2410     __pyx_t_1 = 0;
2411 
2412     /* "pygame_sdl2/gfxdraw.pyx":49
2413  * def rounded_rectangle(Surface surface, rect, rad, color):
2414  *     cdef Color c = Color(color)
2415  *     if not isinstance(rect, Rect):             # <<<<<<<<<<<<<<
2416  *         rect = Rect(rect)
2417  *     roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2418  */
2419   }
2420 
2421   /* "pygame_sdl2/gfxdraw.pyx":51
2422  *     if not isinstance(rect, Rect):
2423  *         rect = Rect(rect)
2424  *     roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
2425  *
2426  * def box(Surface surface, rect, color):
2427  */
2428   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2429   __Pyx_GOTREF(__pyx_t_1);
2430   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2431   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2432   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2433   __Pyx_GOTREF(__pyx_t_1);
2434   __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2435   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2436   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2437   __Pyx_GOTREF(__pyx_t_1);
2438   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
2439   __Pyx_GOTREF(__pyx_t_4);
2440   __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)
2441   __Pyx_GOTREF(__pyx_t_5);
2442   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2443   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2444   __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2445   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2446   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)
2447   __Pyx_GOTREF(__pyx_t_5);
2448   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
2449   __Pyx_GOTREF(__pyx_t_4);
2450   __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2451   __Pyx_GOTREF(__pyx_t_1);
2452   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2453   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2454   __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2455   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2456   __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2457   (void)(roundedRectangleRGBA(__pyx_v_surface->surface, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
2458 
2459   /* "pygame_sdl2/gfxdraw.pyx":47
2460  *     rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2461  *
2462  * def rounded_rectangle(Surface surface, rect, rad, color):             # <<<<<<<<<<<<<<
2463  *     cdef Color c = Color(color)
2464  *     if not isinstance(rect, Rect):
2465  */
2466 
2467   /* function exit code */
2468   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2469   goto __pyx_L0;
2470   __pyx_L1_error:;
2471   __Pyx_XDECREF(__pyx_t_1);
2472   __Pyx_XDECREF(__pyx_t_4);
2473   __Pyx_XDECREF(__pyx_t_5);
2474   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
2475   __pyx_r = NULL;
2476   __pyx_L0:;
2477   __Pyx_XDECREF((PyObject *)__pyx_v_c);
2478   __Pyx_XDECREF(__pyx_v_rect);
2479   __Pyx_XGIVEREF(__pyx_r);
2480   __Pyx_RefNannyFinishContext();
2481   return __pyx_r;
2482 }
2483 
2484 /* "pygame_sdl2/gfxdraw.pyx":53
2485  *     roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2486  *
2487  * def box(Surface surface, rect, color):             # <<<<<<<<<<<<<<
2488  *     cdef Color c = Color(color)
2489  *     if not isinstance(rect, Rect):
2490  */
2491 
2492 /* Python wrapper */
2493 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2494 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_11box = {"box", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_11box, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2495 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2496   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
2497   PyObject *__pyx_v_rect = 0;
2498   PyObject *__pyx_v_color = 0;
2499   int __pyx_lineno = 0;
2500   const char *__pyx_filename = NULL;
2501   int __pyx_clineno = 0;
2502   PyObject *__pyx_r = 0;
2503   __Pyx_RefNannyDeclarations
2504   __Pyx_RefNannySetupContext("box (wrapper)", 0);
2505   {
2506     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0};
2507     PyObject* values[3] = {0,0,0};
2508     if (unlikely(__pyx_kwds)) {
2509       Py_ssize_t kw_args;
2510       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2511       switch (pos_args) {
2512         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2513         CYTHON_FALLTHROUGH;
2514         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2515         CYTHON_FALLTHROUGH;
2516         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2517         CYTHON_FALLTHROUGH;
2518         case  0: break;
2519         default: goto __pyx_L5_argtuple_error;
2520       }
2521       kw_args = PyDict_Size(__pyx_kwds);
2522       switch (pos_args) {
2523         case  0:
2524         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2525         else goto __pyx_L5_argtuple_error;
2526         CYTHON_FALLTHROUGH;
2527         case  1:
2528         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
2529         else {
2530           __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 1); __PYX_ERR(0, 53, __pyx_L3_error)
2531         }
2532         CYTHON_FALLTHROUGH;
2533         case  2:
2534         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2535         else {
2536           __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 2); __PYX_ERR(0, 53, __pyx_L3_error)
2537         }
2538       }
2539       if (unlikely(kw_args > 0)) {
2540         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "box") < 0)) __PYX_ERR(0, 53, __pyx_L3_error)
2541       }
2542     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2543       goto __pyx_L5_argtuple_error;
2544     } else {
2545       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2546       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2547       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2548     }
2549     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
2550     __pyx_v_rect = values[1];
2551     __pyx_v_color = values[2];
2552   }
2553   goto __pyx_L4_argument_unpacking_done;
2554   __pyx_L5_argtuple_error:;
2555   __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 53, __pyx_L3_error)
2556   __pyx_L3_error:;
2557   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename);
2558   __Pyx_RefNannyFinishContext();
2559   return NULL;
2560   __pyx_L4_argument_unpacking_done:;
2561   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
2562   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_10box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color);
2563 
2564   /* function exit code */
2565   goto __pyx_L0;
2566   __pyx_L1_error:;
2567   __pyx_r = NULL;
2568   __pyx_L0:;
2569   __Pyx_RefNannyFinishContext();
2570   return __pyx_r;
2571 }
2572 
__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_rect,PyObject * __pyx_v_color)2573 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) {
2574   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
2575   PyObject *__pyx_r = NULL;
2576   __Pyx_RefNannyDeclarations
2577   PyObject *__pyx_t_1 = NULL;
2578   int __pyx_t_2;
2579   int __pyx_t_3;
2580   PyObject *__pyx_t_4 = NULL;
2581   PyObject *__pyx_t_5 = NULL;
2582   Sint16 __pyx_t_6;
2583   Sint16 __pyx_t_7;
2584   Sint16 __pyx_t_8;
2585   Sint16 __pyx_t_9;
2586   int __pyx_lineno = 0;
2587   const char *__pyx_filename = NULL;
2588   int __pyx_clineno = 0;
2589   __Pyx_RefNannySetupContext("box", 0);
2590   __Pyx_INCREF(__pyx_v_rect);
2591 
2592   /* "pygame_sdl2/gfxdraw.pyx":54
2593  *
2594  * def box(Surface surface, rect, color):
2595  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
2596  *     if not isinstance(rect, Rect):
2597  *         rect = Rect(rect)
2598  */
2599   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
2600   __Pyx_GOTREF(__pyx_t_1);
2601   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
2602   __pyx_t_1 = 0;
2603 
2604   /* "pygame_sdl2/gfxdraw.pyx":55
2605  * def box(Surface surface, rect, color):
2606  *     cdef Color c = Color(color)
2607  *     if not isinstance(rect, Rect):             # <<<<<<<<<<<<<<
2608  *         rect = Rect(rect)
2609  *     boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2610  */
2611   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
2612   __Pyx_GOTREF(__pyx_t_1);
2613   __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 55, __pyx_L1_error)
2614   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2615   __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
2616   if (__pyx_t_3) {
2617 
2618     /* "pygame_sdl2/gfxdraw.pyx":56
2619  *     cdef Color c = Color(color)
2620  *     if not isinstance(rect, Rect):
2621  *         rect = Rect(rect)             # <<<<<<<<<<<<<<
2622  *     boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2623  *
2624  */
2625     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
2626     __Pyx_GOTREF(__pyx_t_4);
2627     __pyx_t_5 = NULL;
2628     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2629       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
2630       if (likely(__pyx_t_5)) {
2631         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2632         __Pyx_INCREF(__pyx_t_5);
2633         __Pyx_INCREF(function);
2634         __Pyx_DECREF_SET(__pyx_t_4, function);
2635       }
2636     }
2637     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_rect) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect);
2638     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2639     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
2640     __Pyx_GOTREF(__pyx_t_1);
2641     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2642     __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1);
2643     __pyx_t_1 = 0;
2644 
2645     /* "pygame_sdl2/gfxdraw.pyx":55
2646  * def box(Surface surface, rect, color):
2647  *     cdef Color c = Color(color)
2648  *     if not isinstance(rect, Rect):             # <<<<<<<<<<<<<<
2649  *         rect = Rect(rect)
2650  *     boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2651  */
2652   }
2653 
2654   /* "pygame_sdl2/gfxdraw.pyx":57
2655  *     if not isinstance(rect, Rect):
2656  *         rect = Rect(rect)
2657  *     boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
2658  *
2659  * def rounded_box(Surface surface, rect, rad, color):
2660  */
2661   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
2662   __Pyx_GOTREF(__pyx_t_1);
2663   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2664   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2665   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
2666   __Pyx_GOTREF(__pyx_t_1);
2667   __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2668   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2669   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
2670   __Pyx_GOTREF(__pyx_t_1);
2671   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
2672   __Pyx_GOTREF(__pyx_t_4);
2673   __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
2674   __Pyx_GOTREF(__pyx_t_5);
2675   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2676   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2677   __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2678   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2679   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
2680   __Pyx_GOTREF(__pyx_t_5);
2681   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
2682   __Pyx_GOTREF(__pyx_t_4);
2683   __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
2684   __Pyx_GOTREF(__pyx_t_1);
2685   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2686   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2687   __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2688   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2689   (void)(boxRGBA(__pyx_v_surface->surface, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
2690 
2691   /* "pygame_sdl2/gfxdraw.pyx":53
2692  *     roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2693  *
2694  * def box(Surface surface, rect, color):             # <<<<<<<<<<<<<<
2695  *     cdef Color c = Color(color)
2696  *     if not isinstance(rect, Rect):
2697  */
2698 
2699   /* function exit code */
2700   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2701   goto __pyx_L0;
2702   __pyx_L1_error:;
2703   __Pyx_XDECREF(__pyx_t_1);
2704   __Pyx_XDECREF(__pyx_t_4);
2705   __Pyx_XDECREF(__pyx_t_5);
2706   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename);
2707   __pyx_r = NULL;
2708   __pyx_L0:;
2709   __Pyx_XDECREF((PyObject *)__pyx_v_c);
2710   __Pyx_XDECREF(__pyx_v_rect);
2711   __Pyx_XGIVEREF(__pyx_r);
2712   __Pyx_RefNannyFinishContext();
2713   return __pyx_r;
2714 }
2715 
2716 /* "pygame_sdl2/gfxdraw.pyx":59
2717  *     boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2718  *
2719  * def rounded_box(Surface surface, rect, rad, color):             # <<<<<<<<<<<<<<
2720  *     cdef Color c = Color(color)
2721  *     if not isinstance(rect, Rect):
2722  */
2723 
2724 /* Python wrapper */
2725 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2726 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box = {"rounded_box", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2727 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2728   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
2729   PyObject *__pyx_v_rect = 0;
2730   PyObject *__pyx_v_rad = 0;
2731   PyObject *__pyx_v_color = 0;
2732   int __pyx_lineno = 0;
2733   const char *__pyx_filename = NULL;
2734   int __pyx_clineno = 0;
2735   PyObject *__pyx_r = 0;
2736   __Pyx_RefNannyDeclarations
2737   __Pyx_RefNannySetupContext("rounded_box (wrapper)", 0);
2738   {
2739     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0};
2740     PyObject* values[4] = {0,0,0,0};
2741     if (unlikely(__pyx_kwds)) {
2742       Py_ssize_t kw_args;
2743       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2744       switch (pos_args) {
2745         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2746         CYTHON_FALLTHROUGH;
2747         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2748         CYTHON_FALLTHROUGH;
2749         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2750         CYTHON_FALLTHROUGH;
2751         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2752         CYTHON_FALLTHROUGH;
2753         case  0: break;
2754         default: goto __pyx_L5_argtuple_error;
2755       }
2756       kw_args = PyDict_Size(__pyx_kwds);
2757       switch (pos_args) {
2758         case  0:
2759         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2760         else goto __pyx_L5_argtuple_error;
2761         CYTHON_FALLTHROUGH;
2762         case  1:
2763         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
2764         else {
2765           __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 1); __PYX_ERR(0, 59, __pyx_L3_error)
2766         }
2767         CYTHON_FALLTHROUGH;
2768         case  2:
2769         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--;
2770         else {
2771           __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 2); __PYX_ERR(0, 59, __pyx_L3_error)
2772         }
2773         CYTHON_FALLTHROUGH;
2774         case  3:
2775         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2776         else {
2777           __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 3); __PYX_ERR(0, 59, __pyx_L3_error)
2778         }
2779       }
2780       if (unlikely(kw_args > 0)) {
2781         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rounded_box") < 0)) __PYX_ERR(0, 59, __pyx_L3_error)
2782       }
2783     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2784       goto __pyx_L5_argtuple_error;
2785     } else {
2786       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2787       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2788       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2789       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2790     }
2791     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
2792     __pyx_v_rect = values[1];
2793     __pyx_v_rad = values[2];
2794     __pyx_v_color = values[3];
2795   }
2796   goto __pyx_L4_argument_unpacking_done;
2797   __pyx_L5_argtuple_error:;
2798   __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 59, __pyx_L3_error)
2799   __pyx_L3_error:;
2800   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename);
2801   __Pyx_RefNannyFinishContext();
2802   return NULL;
2803   __pyx_L4_argument_unpacking_done:;
2804   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 59, __pyx_L1_error)
2805   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color);
2806 
2807   /* function exit code */
2808   goto __pyx_L0;
2809   __pyx_L1_error:;
2810   __pyx_r = NULL;
2811   __pyx_L0:;
2812   __Pyx_RefNannyFinishContext();
2813   return __pyx_r;
2814 }
2815 
__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_rect,PyObject * __pyx_v_rad,PyObject * __pyx_v_color)2816 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) {
2817   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
2818   PyObject *__pyx_r = NULL;
2819   __Pyx_RefNannyDeclarations
2820   PyObject *__pyx_t_1 = NULL;
2821   int __pyx_t_2;
2822   int __pyx_t_3;
2823   PyObject *__pyx_t_4 = NULL;
2824   PyObject *__pyx_t_5 = NULL;
2825   Sint16 __pyx_t_6;
2826   Sint16 __pyx_t_7;
2827   Sint16 __pyx_t_8;
2828   Sint16 __pyx_t_9;
2829   Sint16 __pyx_t_10;
2830   int __pyx_lineno = 0;
2831   const char *__pyx_filename = NULL;
2832   int __pyx_clineno = 0;
2833   __Pyx_RefNannySetupContext("rounded_box", 0);
2834   __Pyx_INCREF(__pyx_v_rect);
2835 
2836   /* "pygame_sdl2/gfxdraw.pyx":60
2837  *
2838  * def rounded_box(Surface surface, rect, rad, color):
2839  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
2840  *     if not isinstance(rect, Rect):
2841  *         rect = Rect(rect)
2842  */
2843   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
2844   __Pyx_GOTREF(__pyx_t_1);
2845   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
2846   __pyx_t_1 = 0;
2847 
2848   /* "pygame_sdl2/gfxdraw.pyx":61
2849  * def rounded_box(Surface surface, rect, rad, color):
2850  *     cdef Color c = Color(color)
2851  *     if not isinstance(rect, Rect):             # <<<<<<<<<<<<<<
2852  *         rect = Rect(rect)
2853  *     roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2854  */
2855   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
2856   __Pyx_GOTREF(__pyx_t_1);
2857   __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 61, __pyx_L1_error)
2858   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2859   __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
2860   if (__pyx_t_3) {
2861 
2862     /* "pygame_sdl2/gfxdraw.pyx":62
2863  *     cdef Color c = Color(color)
2864  *     if not isinstance(rect, Rect):
2865  *         rect = Rect(rect)             # <<<<<<<<<<<<<<
2866  *     roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2867  *
2868  */
2869     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
2870     __Pyx_GOTREF(__pyx_t_4);
2871     __pyx_t_5 = NULL;
2872     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2873       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
2874       if (likely(__pyx_t_5)) {
2875         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2876         __Pyx_INCREF(__pyx_t_5);
2877         __Pyx_INCREF(function);
2878         __Pyx_DECREF_SET(__pyx_t_4, function);
2879       }
2880     }
2881     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_rect) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect);
2882     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2883     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2884     __Pyx_GOTREF(__pyx_t_1);
2885     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2886     __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1);
2887     __pyx_t_1 = 0;
2888 
2889     /* "pygame_sdl2/gfxdraw.pyx":61
2890  * def rounded_box(Surface surface, rect, rad, color):
2891  *     cdef Color c = Color(color)
2892  *     if not isinstance(rect, Rect):             # <<<<<<<<<<<<<<
2893  *         rect = Rect(rect)
2894  *     roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2895  */
2896   }
2897 
2898   /* "pygame_sdl2/gfxdraw.pyx":63
2899  *     if not isinstance(rect, Rect):
2900  *         rect = Rect(rect)
2901  *     roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
2902  *
2903  * def line(Surface surface, x1, y1, x2, y2, color):
2904  */
2905   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
2906   __Pyx_GOTREF(__pyx_t_1);
2907   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2908   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2909   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
2910   __Pyx_GOTREF(__pyx_t_1);
2911   __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2912   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2913   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
2914   __Pyx_GOTREF(__pyx_t_1);
2915   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
2916   __Pyx_GOTREF(__pyx_t_4);
2917   __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error)
2918   __Pyx_GOTREF(__pyx_t_5);
2919   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2920   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2921   __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2922   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2923   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error)
2924   __Pyx_GOTREF(__pyx_t_5);
2925   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
2926   __Pyx_GOTREF(__pyx_t_4);
2927   __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
2928   __Pyx_GOTREF(__pyx_t_1);
2929   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2930   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2931   __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2932   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2933   __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2934   (void)(roundedBoxRGBA(__pyx_v_surface->surface, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
2935 
2936   /* "pygame_sdl2/gfxdraw.pyx":59
2937  *     boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
2938  *
2939  * def rounded_box(Surface surface, rect, rad, color):             # <<<<<<<<<<<<<<
2940  *     cdef Color c = Color(color)
2941  *     if not isinstance(rect, Rect):
2942  */
2943 
2944   /* function exit code */
2945   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2946   goto __pyx_L0;
2947   __pyx_L1_error:;
2948   __Pyx_XDECREF(__pyx_t_1);
2949   __Pyx_XDECREF(__pyx_t_4);
2950   __Pyx_XDECREF(__pyx_t_5);
2951   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename);
2952   __pyx_r = NULL;
2953   __pyx_L0:;
2954   __Pyx_XDECREF((PyObject *)__pyx_v_c);
2955   __Pyx_XDECREF(__pyx_v_rect);
2956   __Pyx_XGIVEREF(__pyx_r);
2957   __Pyx_RefNannyFinishContext();
2958   return __pyx_r;
2959 }
2960 
2961 /* "pygame_sdl2/gfxdraw.pyx":65
2962  *     roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
2963  *
2964  * def line(Surface surface, x1, y1, x2, y2, color):             # <<<<<<<<<<<<<<
2965  *     cdef Color c = Color(color)
2966  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
2967  */
2968 
2969 /* Python wrapper */
2970 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2971 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_15line = {"line", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_15line, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2972 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2973   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
2974   PyObject *__pyx_v_x1 = 0;
2975   PyObject *__pyx_v_y1 = 0;
2976   PyObject *__pyx_v_x2 = 0;
2977   PyObject *__pyx_v_y2 = 0;
2978   PyObject *__pyx_v_color = 0;
2979   int __pyx_lineno = 0;
2980   const char *__pyx_filename = NULL;
2981   int __pyx_clineno = 0;
2982   PyObject *__pyx_r = 0;
2983   __Pyx_RefNannyDeclarations
2984   __Pyx_RefNannySetupContext("line (wrapper)", 0);
2985   {
2986     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0};
2987     PyObject* values[6] = {0,0,0,0,0,0};
2988     if (unlikely(__pyx_kwds)) {
2989       Py_ssize_t kw_args;
2990       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2991       switch (pos_args) {
2992         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2993         CYTHON_FALLTHROUGH;
2994         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2995         CYTHON_FALLTHROUGH;
2996         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2997         CYTHON_FALLTHROUGH;
2998         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2999         CYTHON_FALLTHROUGH;
3000         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3001         CYTHON_FALLTHROUGH;
3002         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3003         CYTHON_FALLTHROUGH;
3004         case  0: break;
3005         default: goto __pyx_L5_argtuple_error;
3006       }
3007       kw_args = PyDict_Size(__pyx_kwds);
3008       switch (pos_args) {
3009         case  0:
3010         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3011         else goto __pyx_L5_argtuple_error;
3012         CYTHON_FALLTHROUGH;
3013         case  1:
3014         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
3015         else {
3016           __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 1); __PYX_ERR(0, 65, __pyx_L3_error)
3017         }
3018         CYTHON_FALLTHROUGH;
3019         case  2:
3020         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
3021         else {
3022           __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 2); __PYX_ERR(0, 65, __pyx_L3_error)
3023         }
3024         CYTHON_FALLTHROUGH;
3025         case  3:
3026         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
3027         else {
3028           __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 3); __PYX_ERR(0, 65, __pyx_L3_error)
3029         }
3030         CYTHON_FALLTHROUGH;
3031         case  4:
3032         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
3033         else {
3034           __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 4); __PYX_ERR(0, 65, __pyx_L3_error)
3035         }
3036         CYTHON_FALLTHROUGH;
3037         case  5:
3038         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3039         else {
3040           __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 5); __PYX_ERR(0, 65, __pyx_L3_error)
3041         }
3042       }
3043       if (unlikely(kw_args > 0)) {
3044         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "line") < 0)) __PYX_ERR(0, 65, __pyx_L3_error)
3045       }
3046     } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
3047       goto __pyx_L5_argtuple_error;
3048     } else {
3049       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3050       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3051       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3052       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3053       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3054       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3055     }
3056     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
3057     __pyx_v_x1 = values[1];
3058     __pyx_v_y1 = values[2];
3059     __pyx_v_x2 = values[3];
3060     __pyx_v_y2 = values[4];
3061     __pyx_v_color = values[5];
3062   }
3063   goto __pyx_L4_argument_unpacking_done;
3064   __pyx_L5_argtuple_error:;
3065   __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error)
3066   __pyx_L3_error:;
3067   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename);
3068   __Pyx_RefNannyFinishContext();
3069   return NULL;
3070   __pyx_L4_argument_unpacking_done:;
3071   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
3072   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_14line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color);
3073 
3074   /* function exit code */
3075   goto __pyx_L0;
3076   __pyx_L1_error:;
3077   __pyx_r = NULL;
3078   __pyx_L0:;
3079   __Pyx_RefNannyFinishContext();
3080   return __pyx_r;
3081 }
3082 
__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x1,PyObject * __pyx_v_y1,PyObject * __pyx_v_x2,PyObject * __pyx_v_y2,PyObject * __pyx_v_color)3083 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) {
3084   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
3085   PyObject *__pyx_r = NULL;
3086   __Pyx_RefNannyDeclarations
3087   PyObject *__pyx_t_1 = NULL;
3088   Sint16 __pyx_t_2;
3089   Sint16 __pyx_t_3;
3090   Sint16 __pyx_t_4;
3091   Sint16 __pyx_t_5;
3092   int __pyx_lineno = 0;
3093   const char *__pyx_filename = NULL;
3094   int __pyx_clineno = 0;
3095   __Pyx_RefNannySetupContext("line", 0);
3096 
3097   /* "pygame_sdl2/gfxdraw.pyx":66
3098  *
3099  * def line(Surface surface, x1, y1, x2, y2, color):
3100  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
3101  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3102  *
3103  */
3104   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
3105   __Pyx_GOTREF(__pyx_t_1);
3106   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3107   __pyx_t_1 = 0;
3108 
3109   /* "pygame_sdl2/gfxdraw.pyx":67
3110  * def line(Surface surface, x1, y1, x2, y2, color):
3111  *     cdef Color c = Color(color)
3112  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
3113  *
3114  * def aaline(Surface surface, x1, y1, x2, y2, color):
3115  */
3116   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3117   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3118   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3119   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3120   (void)(lineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
3121 
3122   /* "pygame_sdl2/gfxdraw.pyx":65
3123  *     roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
3124  *
3125  * def line(Surface surface, x1, y1, x2, y2, color):             # <<<<<<<<<<<<<<
3126  *     cdef Color c = Color(color)
3127  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3128  */
3129 
3130   /* function exit code */
3131   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3132   goto __pyx_L0;
3133   __pyx_L1_error:;
3134   __Pyx_XDECREF(__pyx_t_1);
3135   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename);
3136   __pyx_r = NULL;
3137   __pyx_L0:;
3138   __Pyx_XDECREF((PyObject *)__pyx_v_c);
3139   __Pyx_XGIVEREF(__pyx_r);
3140   __Pyx_RefNannyFinishContext();
3141   return __pyx_r;
3142 }
3143 
3144 /* "pygame_sdl2/gfxdraw.pyx":69
3145  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3146  *
3147  * def aaline(Surface surface, x1, y1, x2, y2, color):             # <<<<<<<<<<<<<<
3148  *     cdef Color c = Color(color)
3149  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3150  */
3151 
3152 /* Python wrapper */
3153 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3154 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline = {"aaline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3155 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3156   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
3157   PyObject *__pyx_v_x1 = 0;
3158   PyObject *__pyx_v_y1 = 0;
3159   PyObject *__pyx_v_x2 = 0;
3160   PyObject *__pyx_v_y2 = 0;
3161   PyObject *__pyx_v_color = 0;
3162   int __pyx_lineno = 0;
3163   const char *__pyx_filename = NULL;
3164   int __pyx_clineno = 0;
3165   PyObject *__pyx_r = 0;
3166   __Pyx_RefNannyDeclarations
3167   __Pyx_RefNannySetupContext("aaline (wrapper)", 0);
3168   {
3169     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0};
3170     PyObject* values[6] = {0,0,0,0,0,0};
3171     if (unlikely(__pyx_kwds)) {
3172       Py_ssize_t kw_args;
3173       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3174       switch (pos_args) {
3175         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3176         CYTHON_FALLTHROUGH;
3177         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3178         CYTHON_FALLTHROUGH;
3179         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3180         CYTHON_FALLTHROUGH;
3181         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3182         CYTHON_FALLTHROUGH;
3183         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3184         CYTHON_FALLTHROUGH;
3185         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3186         CYTHON_FALLTHROUGH;
3187         case  0: break;
3188         default: goto __pyx_L5_argtuple_error;
3189       }
3190       kw_args = PyDict_Size(__pyx_kwds);
3191       switch (pos_args) {
3192         case  0:
3193         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3194         else goto __pyx_L5_argtuple_error;
3195         CYTHON_FALLTHROUGH;
3196         case  1:
3197         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
3198         else {
3199           __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 1); __PYX_ERR(0, 69, __pyx_L3_error)
3200         }
3201         CYTHON_FALLTHROUGH;
3202         case  2:
3203         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
3204         else {
3205           __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 2); __PYX_ERR(0, 69, __pyx_L3_error)
3206         }
3207         CYTHON_FALLTHROUGH;
3208         case  3:
3209         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
3210         else {
3211           __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 3); __PYX_ERR(0, 69, __pyx_L3_error)
3212         }
3213         CYTHON_FALLTHROUGH;
3214         case  4:
3215         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
3216         else {
3217           __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 4); __PYX_ERR(0, 69, __pyx_L3_error)
3218         }
3219         CYTHON_FALLTHROUGH;
3220         case  5:
3221         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3222         else {
3223           __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 5); __PYX_ERR(0, 69, __pyx_L3_error)
3224         }
3225       }
3226       if (unlikely(kw_args > 0)) {
3227         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaline") < 0)) __PYX_ERR(0, 69, __pyx_L3_error)
3228       }
3229     } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
3230       goto __pyx_L5_argtuple_error;
3231     } else {
3232       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3233       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3234       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3235       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3236       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3237       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3238     }
3239     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
3240     __pyx_v_x1 = values[1];
3241     __pyx_v_y1 = values[2];
3242     __pyx_v_x2 = values[3];
3243     __pyx_v_y2 = values[4];
3244     __pyx_v_color = values[5];
3245   }
3246   goto __pyx_L4_argument_unpacking_done;
3247   __pyx_L5_argtuple_error:;
3248   __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error)
3249   __pyx_L3_error:;
3250   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename);
3251   __Pyx_RefNannyFinishContext();
3252   return NULL;
3253   __pyx_L4_argument_unpacking_done:;
3254   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
3255   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color);
3256 
3257   /* function exit code */
3258   goto __pyx_L0;
3259   __pyx_L1_error:;
3260   __pyx_r = NULL;
3261   __pyx_L0:;
3262   __Pyx_RefNannyFinishContext();
3263   return __pyx_r;
3264 }
3265 
__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x1,PyObject * __pyx_v_y1,PyObject * __pyx_v_x2,PyObject * __pyx_v_y2,PyObject * __pyx_v_color)3266 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) {
3267   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
3268   PyObject *__pyx_r = NULL;
3269   __Pyx_RefNannyDeclarations
3270   PyObject *__pyx_t_1 = NULL;
3271   Sint16 __pyx_t_2;
3272   Sint16 __pyx_t_3;
3273   Sint16 __pyx_t_4;
3274   Sint16 __pyx_t_5;
3275   int __pyx_lineno = 0;
3276   const char *__pyx_filename = NULL;
3277   int __pyx_clineno = 0;
3278   __Pyx_RefNannySetupContext("aaline", 0);
3279 
3280   /* "pygame_sdl2/gfxdraw.pyx":70
3281  *
3282  * def aaline(Surface surface, x1, y1, x2, y2, color):
3283  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
3284  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3285  *
3286  */
3287   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3288   __Pyx_GOTREF(__pyx_t_1);
3289   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3290   __pyx_t_1 = 0;
3291 
3292   /* "pygame_sdl2/gfxdraw.pyx":71
3293  * def aaline(Surface surface, x1, y1, x2, y2, color):
3294  *     cdef Color c = Color(color)
3295  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
3296  *
3297  * def thick_line(Surface surface, x1, y1, x2, y2, width, color):
3298  */
3299   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3300   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3301   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3302   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3303   (void)(aalineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
3304 
3305   /* "pygame_sdl2/gfxdraw.pyx":69
3306  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3307  *
3308  * def aaline(Surface surface, x1, y1, x2, y2, color):             # <<<<<<<<<<<<<<
3309  *     cdef Color c = Color(color)
3310  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3311  */
3312 
3313   /* function exit code */
3314   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3315   goto __pyx_L0;
3316   __pyx_L1_error:;
3317   __Pyx_XDECREF(__pyx_t_1);
3318   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename);
3319   __pyx_r = NULL;
3320   __pyx_L0:;
3321   __Pyx_XDECREF((PyObject *)__pyx_v_c);
3322   __Pyx_XGIVEREF(__pyx_r);
3323   __Pyx_RefNannyFinishContext();
3324   return __pyx_r;
3325 }
3326 
3327 /* "pygame_sdl2/gfxdraw.pyx":73
3328  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3329  *
3330  * def thick_line(Surface surface, x1, y1, x2, y2, width, color):             # <<<<<<<<<<<<<<
3331  *     cdef Color c = Color(color)
3332  *
3333  */
3334 
3335 /* Python wrapper */
3336 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3337 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line = {"thick_line", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3338 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3339   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
3340   PyObject *__pyx_v_x1 = 0;
3341   PyObject *__pyx_v_y1 = 0;
3342   PyObject *__pyx_v_x2 = 0;
3343   PyObject *__pyx_v_y2 = 0;
3344   PyObject *__pyx_v_width = 0;
3345   PyObject *__pyx_v_color = 0;
3346   int __pyx_lineno = 0;
3347   const char *__pyx_filename = NULL;
3348   int __pyx_clineno = 0;
3349   PyObject *__pyx_r = 0;
3350   __Pyx_RefNannyDeclarations
3351   __Pyx_RefNannySetupContext("thick_line (wrapper)", 0);
3352   {
3353     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_width,&__pyx_n_s_color,0};
3354     PyObject* values[7] = {0,0,0,0,0,0,0};
3355     if (unlikely(__pyx_kwds)) {
3356       Py_ssize_t kw_args;
3357       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3358       switch (pos_args) {
3359         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3360         CYTHON_FALLTHROUGH;
3361         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3362         CYTHON_FALLTHROUGH;
3363         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3364         CYTHON_FALLTHROUGH;
3365         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3366         CYTHON_FALLTHROUGH;
3367         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3368         CYTHON_FALLTHROUGH;
3369         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3370         CYTHON_FALLTHROUGH;
3371         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3372         CYTHON_FALLTHROUGH;
3373         case  0: break;
3374         default: goto __pyx_L5_argtuple_error;
3375       }
3376       kw_args = PyDict_Size(__pyx_kwds);
3377       switch (pos_args) {
3378         case  0:
3379         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3380         else goto __pyx_L5_argtuple_error;
3381         CYTHON_FALLTHROUGH;
3382         case  1:
3383         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
3384         else {
3385           __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 1); __PYX_ERR(0, 73, __pyx_L3_error)
3386         }
3387         CYTHON_FALLTHROUGH;
3388         case  2:
3389         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
3390         else {
3391           __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 2); __PYX_ERR(0, 73, __pyx_L3_error)
3392         }
3393         CYTHON_FALLTHROUGH;
3394         case  3:
3395         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
3396         else {
3397           __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 3); __PYX_ERR(0, 73, __pyx_L3_error)
3398         }
3399         CYTHON_FALLTHROUGH;
3400         case  4:
3401         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
3402         else {
3403           __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 4); __PYX_ERR(0, 73, __pyx_L3_error)
3404         }
3405         CYTHON_FALLTHROUGH;
3406         case  5:
3407         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
3408         else {
3409           __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 5); __PYX_ERR(0, 73, __pyx_L3_error)
3410         }
3411         CYTHON_FALLTHROUGH;
3412         case  6:
3413         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3414         else {
3415           __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 6); __PYX_ERR(0, 73, __pyx_L3_error)
3416         }
3417       }
3418       if (unlikely(kw_args > 0)) {
3419         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "thick_line") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
3420       }
3421     } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
3422       goto __pyx_L5_argtuple_error;
3423     } else {
3424       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3425       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3426       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3427       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3428       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3429       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3430       values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3431     }
3432     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
3433     __pyx_v_x1 = values[1];
3434     __pyx_v_y1 = values[2];
3435     __pyx_v_x2 = values[3];
3436     __pyx_v_y2 = values[4];
3437     __pyx_v_width = values[5];
3438     __pyx_v_color = values[6];
3439   }
3440   goto __pyx_L4_argument_unpacking_done;
3441   __pyx_L5_argtuple_error:;
3442   __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
3443   __pyx_L3_error:;
3444   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
3445   __Pyx_RefNannyFinishContext();
3446   return NULL;
3447   __pyx_L4_argument_unpacking_done:;
3448   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 73, __pyx_L1_error)
3449   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_width, __pyx_v_color);
3450 
3451   /* function exit code */
3452   goto __pyx_L0;
3453   __pyx_L1_error:;
3454   __pyx_r = NULL;
3455   __pyx_L0:;
3456   __Pyx_RefNannyFinishContext();
3457   return __pyx_r;
3458 }
3459 
__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x1,PyObject * __pyx_v_y1,PyObject * __pyx_v_x2,PyObject * __pyx_v_y2,PyObject * __pyx_v_width,PyObject * __pyx_v_color)3460 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color) {
3461   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
3462   int __pyx_v_x1int;
3463   int __pyx_v_y1int;
3464   int __pyx_v_x2int;
3465   int __pyx_v_y2int;
3466   PyObject *__pyx_r = NULL;
3467   __Pyx_RefNannyDeclarations
3468   PyObject *__pyx_t_1 = NULL;
3469   int __pyx_t_2;
3470   int __pyx_t_3;
3471   int __pyx_t_4;
3472   Uint8 __pyx_t_5;
3473   int __pyx_lineno = 0;
3474   const char *__pyx_filename = NULL;
3475   int __pyx_clineno = 0;
3476   __Pyx_RefNannySetupContext("thick_line", 0);
3477 
3478   /* "pygame_sdl2/gfxdraw.pyx":74
3479  *
3480  * def thick_line(Surface surface, x1, y1, x2, y2, width, color):
3481  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
3482  *
3483  *     # This locks up in c code when trying to draw a zero-length line. So make
3484  */
3485   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
3486   __Pyx_GOTREF(__pyx_t_1);
3487   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3488   __pyx_t_1 = 0;
3489 
3490   /* "pygame_sdl2/gfxdraw.pyx":79
3491  *     # sure that doesn't happen.
3492  *     cdef int x1int, y1int, x2int, y2int
3493  *     x1int = x1             # <<<<<<<<<<<<<<
3494  *     y1int = y1
3495  *     x2int = x2
3496  */
3497   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
3498   __pyx_v_x1int = __pyx_t_2;
3499 
3500   /* "pygame_sdl2/gfxdraw.pyx":80
3501  *     cdef int x1int, y1int, x2int, y2int
3502  *     x1int = x1
3503  *     y1int = y1             # <<<<<<<<<<<<<<
3504  *     x2int = x2
3505  *     y2int = y2
3506  */
3507   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
3508   __pyx_v_y1int = __pyx_t_2;
3509 
3510   /* "pygame_sdl2/gfxdraw.pyx":81
3511  *     x1int = x1
3512  *     y1int = y1
3513  *     x2int = x2             # <<<<<<<<<<<<<<
3514  *     y2int = y2
3515  *
3516  */
3517   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
3518   __pyx_v_x2int = __pyx_t_2;
3519 
3520   /* "pygame_sdl2/gfxdraw.pyx":82
3521  *     y1int = y1
3522  *     x2int = x2
3523  *     y2int = y2             # <<<<<<<<<<<<<<
3524  *
3525  *
3526  */
3527   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
3528   __pyx_v_y2int = __pyx_t_2;
3529 
3530   /* "pygame_sdl2/gfxdraw.pyx":85
3531  *
3532  *
3533  *     if x1int == x2int and y1int == y2int:             # <<<<<<<<<<<<<<
3534  *         return
3535  *
3536  */
3537   __pyx_t_4 = ((__pyx_v_x1int == __pyx_v_x2int) != 0);
3538   if (__pyx_t_4) {
3539   } else {
3540     __pyx_t_3 = __pyx_t_4;
3541     goto __pyx_L4_bool_binop_done;
3542   }
3543   __pyx_t_4 = ((__pyx_v_y1int == __pyx_v_y2int) != 0);
3544   __pyx_t_3 = __pyx_t_4;
3545   __pyx_L4_bool_binop_done:;
3546   if (__pyx_t_3) {
3547 
3548     /* "pygame_sdl2/gfxdraw.pyx":86
3549  *
3550  *     if x1int == x2int and y1int == y2int:
3551  *         return             # <<<<<<<<<<<<<<
3552  *
3553  *     thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a)
3554  */
3555     __Pyx_XDECREF(__pyx_r);
3556     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3557     goto __pyx_L0;
3558 
3559     /* "pygame_sdl2/gfxdraw.pyx":85
3560  *
3561  *
3562  *     if x1int == x2int and y1int == y2int:             # <<<<<<<<<<<<<<
3563  *         return
3564  *
3565  */
3566   }
3567 
3568   /* "pygame_sdl2/gfxdraw.pyx":88
3569  *         return
3570  *
3571  *     thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
3572  *
3573  * def circle(Surface surface, x, y, r, color):
3574  */
3575   __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_width); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3576   (void)(thickLineRGBA(__pyx_v_surface->surface, __pyx_v_x1int, __pyx_v_y1int, __pyx_v_x2int, __pyx_v_y2int, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
3577 
3578   /* "pygame_sdl2/gfxdraw.pyx":73
3579  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
3580  *
3581  * def thick_line(Surface surface, x1, y1, x2, y2, width, color):             # <<<<<<<<<<<<<<
3582  *     cdef Color c = Color(color)
3583  *
3584  */
3585 
3586   /* function exit code */
3587   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3588   goto __pyx_L0;
3589   __pyx_L1_error:;
3590   __Pyx_XDECREF(__pyx_t_1);
3591   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
3592   __pyx_r = NULL;
3593   __pyx_L0:;
3594   __Pyx_XDECREF((PyObject *)__pyx_v_c);
3595   __Pyx_XGIVEREF(__pyx_r);
3596   __Pyx_RefNannyFinishContext();
3597   return __pyx_r;
3598 }
3599 
3600 /* "pygame_sdl2/gfxdraw.pyx":90
3601  *     thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a)
3602  *
3603  * def circle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
3604  *     cdef Color c = Color(color)
3605  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
3606  */
3607 
3608 /* Python wrapper */
3609 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3610 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_21circle = {"circle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_21circle, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3611 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3612   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
3613   PyObject *__pyx_v_x = 0;
3614   PyObject *__pyx_v_y = 0;
3615   PyObject *__pyx_v_r = 0;
3616   PyObject *__pyx_v_color = 0;
3617   int __pyx_lineno = 0;
3618   const char *__pyx_filename = NULL;
3619   int __pyx_clineno = 0;
3620   PyObject *__pyx_r = 0;
3621   __Pyx_RefNannyDeclarations
3622   __Pyx_RefNannySetupContext("circle (wrapper)", 0);
3623   {
3624     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0};
3625     PyObject* values[5] = {0,0,0,0,0};
3626     if (unlikely(__pyx_kwds)) {
3627       Py_ssize_t kw_args;
3628       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3629       switch (pos_args) {
3630         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3631         CYTHON_FALLTHROUGH;
3632         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3633         CYTHON_FALLTHROUGH;
3634         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3635         CYTHON_FALLTHROUGH;
3636         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3637         CYTHON_FALLTHROUGH;
3638         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3639         CYTHON_FALLTHROUGH;
3640         case  0: break;
3641         default: goto __pyx_L5_argtuple_error;
3642       }
3643       kw_args = PyDict_Size(__pyx_kwds);
3644       switch (pos_args) {
3645         case  0:
3646         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3647         else goto __pyx_L5_argtuple_error;
3648         CYTHON_FALLTHROUGH;
3649         case  1:
3650         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3651         else {
3652           __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 1); __PYX_ERR(0, 90, __pyx_L3_error)
3653         }
3654         CYTHON_FALLTHROUGH;
3655         case  2:
3656         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3657         else {
3658           __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 2); __PYX_ERR(0, 90, __pyx_L3_error)
3659         }
3660         CYTHON_FALLTHROUGH;
3661         case  3:
3662         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
3663         else {
3664           __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 3); __PYX_ERR(0, 90, __pyx_L3_error)
3665         }
3666         CYTHON_FALLTHROUGH;
3667         case  4:
3668         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3669         else {
3670           __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 4); __PYX_ERR(0, 90, __pyx_L3_error)
3671         }
3672       }
3673       if (unlikely(kw_args > 0)) {
3674         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "circle") < 0)) __PYX_ERR(0, 90, __pyx_L3_error)
3675       }
3676     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
3677       goto __pyx_L5_argtuple_error;
3678     } else {
3679       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3680       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3681       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3682       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3683       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3684     }
3685     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
3686     __pyx_v_x = values[1];
3687     __pyx_v_y = values[2];
3688     __pyx_v_r = values[3];
3689     __pyx_v_color = values[4];
3690   }
3691   goto __pyx_L4_argument_unpacking_done;
3692   __pyx_L5_argtuple_error:;
3693   __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 90, __pyx_L3_error)
3694   __pyx_L3_error:;
3695   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename);
3696   __Pyx_RefNannyFinishContext();
3697   return NULL;
3698   __pyx_L4_argument_unpacking_done:;
3699   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 90, __pyx_L1_error)
3700   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_20circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color);
3701 
3702   /* function exit code */
3703   goto __pyx_L0;
3704   __pyx_L1_error:;
3705   __pyx_r = NULL;
3706   __pyx_L0:;
3707   __Pyx_RefNannyFinishContext();
3708   return __pyx_r;
3709 }
3710 
__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_r,PyObject * __pyx_v_color)3711 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) {
3712   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
3713   PyObject *__pyx_r = NULL;
3714   __Pyx_RefNannyDeclarations
3715   PyObject *__pyx_t_1 = NULL;
3716   Sint16 __pyx_t_2;
3717   Sint16 __pyx_t_3;
3718   Sint16 __pyx_t_4;
3719   int __pyx_lineno = 0;
3720   const char *__pyx_filename = NULL;
3721   int __pyx_clineno = 0;
3722   __Pyx_RefNannySetupContext("circle", 0);
3723 
3724   /* "pygame_sdl2/gfxdraw.pyx":91
3725  *
3726  * def circle(Surface surface, x, y, r, color):
3727  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
3728  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
3729  *
3730  */
3731   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
3732   __Pyx_GOTREF(__pyx_t_1);
3733   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3734   __pyx_t_1 = 0;
3735 
3736   /* "pygame_sdl2/gfxdraw.pyx":92
3737  * def circle(Surface surface, x, y, r, color):
3738  *     cdef Color c = Color(color)
3739  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
3740  *
3741  * def arc(Surface surface, x, y, r, start, end, color):
3742  */
3743   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3744   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3745   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3746   (void)(circleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
3747 
3748   /* "pygame_sdl2/gfxdraw.pyx":90
3749  *     thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a)
3750  *
3751  * def circle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
3752  *     cdef Color c = Color(color)
3753  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
3754  */
3755 
3756   /* function exit code */
3757   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3758   goto __pyx_L0;
3759   __pyx_L1_error:;
3760   __Pyx_XDECREF(__pyx_t_1);
3761   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename);
3762   __pyx_r = NULL;
3763   __pyx_L0:;
3764   __Pyx_XDECREF((PyObject *)__pyx_v_c);
3765   __Pyx_XGIVEREF(__pyx_r);
3766   __Pyx_RefNannyFinishContext();
3767   return __pyx_r;
3768 }
3769 
3770 /* "pygame_sdl2/gfxdraw.pyx":94
3771  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
3772  *
3773  * def arc(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
3774  *     cdef Color c = Color(color)
3775  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
3776  */
3777 
3778 /* Python wrapper */
3779 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3780 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_23arc = {"arc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_23arc, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3781 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3782   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
3783   PyObject *__pyx_v_x = 0;
3784   PyObject *__pyx_v_y = 0;
3785   PyObject *__pyx_v_r = 0;
3786   PyObject *__pyx_v_start = 0;
3787   PyObject *__pyx_v_end = 0;
3788   PyObject *__pyx_v_color = 0;
3789   int __pyx_lineno = 0;
3790   const char *__pyx_filename = NULL;
3791   int __pyx_clineno = 0;
3792   PyObject *__pyx_r = 0;
3793   __Pyx_RefNannyDeclarations
3794   __Pyx_RefNannySetupContext("arc (wrapper)", 0);
3795   {
3796     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0};
3797     PyObject* values[7] = {0,0,0,0,0,0,0};
3798     if (unlikely(__pyx_kwds)) {
3799       Py_ssize_t kw_args;
3800       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3801       switch (pos_args) {
3802         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3803         CYTHON_FALLTHROUGH;
3804         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3805         CYTHON_FALLTHROUGH;
3806         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3807         CYTHON_FALLTHROUGH;
3808         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3809         CYTHON_FALLTHROUGH;
3810         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3811         CYTHON_FALLTHROUGH;
3812         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3813         CYTHON_FALLTHROUGH;
3814         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3815         CYTHON_FALLTHROUGH;
3816         case  0: break;
3817         default: goto __pyx_L5_argtuple_error;
3818       }
3819       kw_args = PyDict_Size(__pyx_kwds);
3820       switch (pos_args) {
3821         case  0:
3822         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3823         else goto __pyx_L5_argtuple_error;
3824         CYTHON_FALLTHROUGH;
3825         case  1:
3826         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3827         else {
3828           __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 1); __PYX_ERR(0, 94, __pyx_L3_error)
3829         }
3830         CYTHON_FALLTHROUGH;
3831         case  2:
3832         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3833         else {
3834           __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 2); __PYX_ERR(0, 94, __pyx_L3_error)
3835         }
3836         CYTHON_FALLTHROUGH;
3837         case  3:
3838         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
3839         else {
3840           __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 3); __PYX_ERR(0, 94, __pyx_L3_error)
3841         }
3842         CYTHON_FALLTHROUGH;
3843         case  4:
3844         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
3845         else {
3846           __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 4); __PYX_ERR(0, 94, __pyx_L3_error)
3847         }
3848         CYTHON_FALLTHROUGH;
3849         case  5:
3850         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
3851         else {
3852           __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 5); __PYX_ERR(0, 94, __pyx_L3_error)
3853         }
3854         CYTHON_FALLTHROUGH;
3855         case  6:
3856         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3857         else {
3858           __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 6); __PYX_ERR(0, 94, __pyx_L3_error)
3859         }
3860       }
3861       if (unlikely(kw_args > 0)) {
3862         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arc") < 0)) __PYX_ERR(0, 94, __pyx_L3_error)
3863       }
3864     } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
3865       goto __pyx_L5_argtuple_error;
3866     } else {
3867       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3868       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3869       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3870       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3871       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3872       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3873       values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3874     }
3875     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
3876     __pyx_v_x = values[1];
3877     __pyx_v_y = values[2];
3878     __pyx_v_r = values[3];
3879     __pyx_v_start = values[4];
3880     __pyx_v_end = values[5];
3881     __pyx_v_color = values[6];
3882   }
3883   goto __pyx_L4_argument_unpacking_done;
3884   __pyx_L5_argtuple_error:;
3885   __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 94, __pyx_L3_error)
3886   __pyx_L3_error:;
3887   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3888   __Pyx_RefNannyFinishContext();
3889   return NULL;
3890   __pyx_L4_argument_unpacking_done:;
3891   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
3892   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_22arc(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color);
3893 
3894   /* function exit code */
3895   goto __pyx_L0;
3896   __pyx_L1_error:;
3897   __pyx_r = NULL;
3898   __pyx_L0:;
3899   __Pyx_RefNannyFinishContext();
3900   return __pyx_r;
3901 }
3902 
__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_r,PyObject * __pyx_v_start,PyObject * __pyx_v_end,PyObject * __pyx_v_color)3903 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) {
3904   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
3905   PyObject *__pyx_r = NULL;
3906   __Pyx_RefNannyDeclarations
3907   PyObject *__pyx_t_1 = NULL;
3908   Sint16 __pyx_t_2;
3909   Sint16 __pyx_t_3;
3910   Sint16 __pyx_t_4;
3911   Sint16 __pyx_t_5;
3912   Sint16 __pyx_t_6;
3913   int __pyx_lineno = 0;
3914   const char *__pyx_filename = NULL;
3915   int __pyx_clineno = 0;
3916   __Pyx_RefNannySetupContext("arc", 0);
3917 
3918   /* "pygame_sdl2/gfxdraw.pyx":95
3919  *
3920  * def arc(Surface surface, x, y, r, start, end, color):
3921  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
3922  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
3923  *
3924  */
3925   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
3926   __Pyx_GOTREF(__pyx_t_1);
3927   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3928   __pyx_t_1 = 0;
3929 
3930   /* "pygame_sdl2/gfxdraw.pyx":96
3931  * def arc(Surface surface, x, y, r, start, end, color):
3932  *     cdef Color c = Color(color)
3933  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
3934  *
3935  * def aacircle(Surface surface, x, y, r, color):
3936  */
3937   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3938   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3939   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3940   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3941   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3942   (void)(arcRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
3943 
3944   /* "pygame_sdl2/gfxdraw.pyx":94
3945  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
3946  *
3947  * def arc(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
3948  *     cdef Color c = Color(color)
3949  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
3950  */
3951 
3952   /* function exit code */
3953   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3954   goto __pyx_L0;
3955   __pyx_L1_error:;
3956   __Pyx_XDECREF(__pyx_t_1);
3957   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3958   __pyx_r = NULL;
3959   __pyx_L0:;
3960   __Pyx_XDECREF((PyObject *)__pyx_v_c);
3961   __Pyx_XGIVEREF(__pyx_r);
3962   __Pyx_RefNannyFinishContext();
3963   return __pyx_r;
3964 }
3965 
3966 /* "pygame_sdl2/gfxdraw.pyx":98
3967  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
3968  *
3969  * def aacircle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
3970  *     cdef Color c = Color(color)
3971  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
3972  */
3973 
3974 /* Python wrapper */
3975 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3976 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle = {"aacircle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3977 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3978   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
3979   PyObject *__pyx_v_x = 0;
3980   PyObject *__pyx_v_y = 0;
3981   PyObject *__pyx_v_r = 0;
3982   PyObject *__pyx_v_color = 0;
3983   int __pyx_lineno = 0;
3984   const char *__pyx_filename = NULL;
3985   int __pyx_clineno = 0;
3986   PyObject *__pyx_r = 0;
3987   __Pyx_RefNannyDeclarations
3988   __Pyx_RefNannySetupContext("aacircle (wrapper)", 0);
3989   {
3990     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0};
3991     PyObject* values[5] = {0,0,0,0,0};
3992     if (unlikely(__pyx_kwds)) {
3993       Py_ssize_t kw_args;
3994       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3995       switch (pos_args) {
3996         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3997         CYTHON_FALLTHROUGH;
3998         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3999         CYTHON_FALLTHROUGH;
4000         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4001         CYTHON_FALLTHROUGH;
4002         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4003         CYTHON_FALLTHROUGH;
4004         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4005         CYTHON_FALLTHROUGH;
4006         case  0: break;
4007         default: goto __pyx_L5_argtuple_error;
4008       }
4009       kw_args = PyDict_Size(__pyx_kwds);
4010       switch (pos_args) {
4011         case  0:
4012         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4013         else goto __pyx_L5_argtuple_error;
4014         CYTHON_FALLTHROUGH;
4015         case  1:
4016         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4017         else {
4018           __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 1); __PYX_ERR(0, 98, __pyx_L3_error)
4019         }
4020         CYTHON_FALLTHROUGH;
4021         case  2:
4022         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4023         else {
4024           __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 2); __PYX_ERR(0, 98, __pyx_L3_error)
4025         }
4026         CYTHON_FALLTHROUGH;
4027         case  3:
4028         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
4029         else {
4030           __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 3); __PYX_ERR(0, 98, __pyx_L3_error)
4031         }
4032         CYTHON_FALLTHROUGH;
4033         case  4:
4034         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4035         else {
4036           __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 4); __PYX_ERR(0, 98, __pyx_L3_error)
4037         }
4038       }
4039       if (unlikely(kw_args > 0)) {
4040         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aacircle") < 0)) __PYX_ERR(0, 98, __pyx_L3_error)
4041       }
4042     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4043       goto __pyx_L5_argtuple_error;
4044     } else {
4045       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4046       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4047       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4048       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4049       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4050     }
4051     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
4052     __pyx_v_x = values[1];
4053     __pyx_v_y = values[2];
4054     __pyx_v_r = values[3];
4055     __pyx_v_color = values[4];
4056   }
4057   goto __pyx_L4_argument_unpacking_done;
4058   __pyx_L5_argtuple_error:;
4059   __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 98, __pyx_L3_error)
4060   __pyx_L3_error:;
4061   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename);
4062   __Pyx_RefNannyFinishContext();
4063   return NULL;
4064   __pyx_L4_argument_unpacking_done:;
4065   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 98, __pyx_L1_error)
4066   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color);
4067 
4068   /* function exit code */
4069   goto __pyx_L0;
4070   __pyx_L1_error:;
4071   __pyx_r = NULL;
4072   __pyx_L0:;
4073   __Pyx_RefNannyFinishContext();
4074   return __pyx_r;
4075 }
4076 
__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_r,PyObject * __pyx_v_color)4077 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) {
4078   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
4079   PyObject *__pyx_r = NULL;
4080   __Pyx_RefNannyDeclarations
4081   PyObject *__pyx_t_1 = NULL;
4082   Sint16 __pyx_t_2;
4083   Sint16 __pyx_t_3;
4084   Sint16 __pyx_t_4;
4085   int __pyx_lineno = 0;
4086   const char *__pyx_filename = NULL;
4087   int __pyx_clineno = 0;
4088   __Pyx_RefNannySetupContext("aacircle", 0);
4089 
4090   /* "pygame_sdl2/gfxdraw.pyx":99
4091  *
4092  * def aacircle(Surface surface, x, y, r, color):
4093  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
4094  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4095  *
4096  */
4097   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
4098   __Pyx_GOTREF(__pyx_t_1);
4099   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4100   __pyx_t_1 = 0;
4101 
4102   /* "pygame_sdl2/gfxdraw.pyx":100
4103  * def aacircle(Surface surface, x, y, r, color):
4104  *     cdef Color c = Color(color)
4105  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
4106  *
4107  * def filled_circle(Surface surface, x, y, r, color):
4108  */
4109   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
4110   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
4111   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
4112   (void)(aacircleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
4113 
4114   /* "pygame_sdl2/gfxdraw.pyx":98
4115  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
4116  *
4117  * def aacircle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
4118  *     cdef Color c = Color(color)
4119  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4120  */
4121 
4122   /* function exit code */
4123   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4124   goto __pyx_L0;
4125   __pyx_L1_error:;
4126   __Pyx_XDECREF(__pyx_t_1);
4127   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename);
4128   __pyx_r = NULL;
4129   __pyx_L0:;
4130   __Pyx_XDECREF((PyObject *)__pyx_v_c);
4131   __Pyx_XGIVEREF(__pyx_r);
4132   __Pyx_RefNannyFinishContext();
4133   return __pyx_r;
4134 }
4135 
4136 /* "pygame_sdl2/gfxdraw.pyx":102
4137  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4138  *
4139  * def filled_circle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
4140  *     cdef Color c = Color(color)
4141  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4142  */
4143 
4144 /* Python wrapper */
4145 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4146 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle = {"filled_circle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4147 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4148   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
4149   PyObject *__pyx_v_x = 0;
4150   PyObject *__pyx_v_y = 0;
4151   PyObject *__pyx_v_r = 0;
4152   PyObject *__pyx_v_color = 0;
4153   int __pyx_lineno = 0;
4154   const char *__pyx_filename = NULL;
4155   int __pyx_clineno = 0;
4156   PyObject *__pyx_r = 0;
4157   __Pyx_RefNannyDeclarations
4158   __Pyx_RefNannySetupContext("filled_circle (wrapper)", 0);
4159   {
4160     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0};
4161     PyObject* values[5] = {0,0,0,0,0};
4162     if (unlikely(__pyx_kwds)) {
4163       Py_ssize_t kw_args;
4164       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4165       switch (pos_args) {
4166         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4167         CYTHON_FALLTHROUGH;
4168         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4169         CYTHON_FALLTHROUGH;
4170         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4171         CYTHON_FALLTHROUGH;
4172         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4173         CYTHON_FALLTHROUGH;
4174         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4175         CYTHON_FALLTHROUGH;
4176         case  0: break;
4177         default: goto __pyx_L5_argtuple_error;
4178       }
4179       kw_args = PyDict_Size(__pyx_kwds);
4180       switch (pos_args) {
4181         case  0:
4182         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4183         else goto __pyx_L5_argtuple_error;
4184         CYTHON_FALLTHROUGH;
4185         case  1:
4186         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4187         else {
4188           __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4189         }
4190         CYTHON_FALLTHROUGH;
4191         case  2:
4192         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4193         else {
4194           __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 2); __PYX_ERR(0, 102, __pyx_L3_error)
4195         }
4196         CYTHON_FALLTHROUGH;
4197         case  3:
4198         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
4199         else {
4200           __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 3); __PYX_ERR(0, 102, __pyx_L3_error)
4201         }
4202         CYTHON_FALLTHROUGH;
4203         case  4:
4204         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4205         else {
4206           __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 4); __PYX_ERR(0, 102, __pyx_L3_error)
4207         }
4208       }
4209       if (unlikely(kw_args > 0)) {
4210         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_circle") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4211       }
4212     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4213       goto __pyx_L5_argtuple_error;
4214     } else {
4215       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4216       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4217       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4218       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4219       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4220     }
4221     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
4222     __pyx_v_x = values[1];
4223     __pyx_v_y = values[2];
4224     __pyx_v_r = values[3];
4225     __pyx_v_color = values[4];
4226   }
4227   goto __pyx_L4_argument_unpacking_done;
4228   __pyx_L5_argtuple_error:;
4229   __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4230   __pyx_L3_error:;
4231   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename);
4232   __Pyx_RefNannyFinishContext();
4233   return NULL;
4234   __pyx_L4_argument_unpacking_done:;
4235   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 102, __pyx_L1_error)
4236   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color);
4237 
4238   /* function exit code */
4239   goto __pyx_L0;
4240   __pyx_L1_error:;
4241   __pyx_r = NULL;
4242   __pyx_L0:;
4243   __Pyx_RefNannyFinishContext();
4244   return __pyx_r;
4245 }
4246 
__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_r,PyObject * __pyx_v_color)4247 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) {
4248   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
4249   PyObject *__pyx_r = NULL;
4250   __Pyx_RefNannyDeclarations
4251   PyObject *__pyx_t_1 = NULL;
4252   Sint16 __pyx_t_2;
4253   Sint16 __pyx_t_3;
4254   Sint16 __pyx_t_4;
4255   int __pyx_lineno = 0;
4256   const char *__pyx_filename = NULL;
4257   int __pyx_clineno = 0;
4258   __Pyx_RefNannySetupContext("filled_circle", 0);
4259 
4260   /* "pygame_sdl2/gfxdraw.pyx":103
4261  *
4262  * def filled_circle(Surface surface, x, y, r, color):
4263  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
4264  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4265  *
4266  */
4267   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
4268   __Pyx_GOTREF(__pyx_t_1);
4269   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4270   __pyx_t_1 = 0;
4271 
4272   /* "pygame_sdl2/gfxdraw.pyx":104
4273  * def filled_circle(Surface surface, x, y, r, color):
4274  *     cdef Color c = Color(color)
4275  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
4276  *
4277  * def ellipse(Surface surface, x, y, rx, ry, color):
4278  */
4279   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4280   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4281   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4282   (void)(filledCircleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
4283 
4284   /* "pygame_sdl2/gfxdraw.pyx":102
4285  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4286  *
4287  * def filled_circle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
4288  *     cdef Color c = Color(color)
4289  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4290  */
4291 
4292   /* function exit code */
4293   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4294   goto __pyx_L0;
4295   __pyx_L1_error:;
4296   __Pyx_XDECREF(__pyx_t_1);
4297   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename);
4298   __pyx_r = NULL;
4299   __pyx_L0:;
4300   __Pyx_XDECREF((PyObject *)__pyx_v_c);
4301   __Pyx_XGIVEREF(__pyx_r);
4302   __Pyx_RefNannyFinishContext();
4303   return __pyx_r;
4304 }
4305 
4306 /* "pygame_sdl2/gfxdraw.pyx":106
4307  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4308  *
4309  * def ellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
4310  *     cdef Color c = Color(color)
4311  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4312  */
4313 
4314 /* Python wrapper */
4315 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4316 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse = {"ellipse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4317 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4318   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
4319   PyObject *__pyx_v_x = 0;
4320   PyObject *__pyx_v_y = 0;
4321   PyObject *__pyx_v_rx = 0;
4322   PyObject *__pyx_v_ry = 0;
4323   PyObject *__pyx_v_color = 0;
4324   int __pyx_lineno = 0;
4325   const char *__pyx_filename = NULL;
4326   int __pyx_clineno = 0;
4327   PyObject *__pyx_r = 0;
4328   __Pyx_RefNannyDeclarations
4329   __Pyx_RefNannySetupContext("ellipse (wrapper)", 0);
4330   {
4331     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0};
4332     PyObject* values[6] = {0,0,0,0,0,0};
4333     if (unlikely(__pyx_kwds)) {
4334       Py_ssize_t kw_args;
4335       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4336       switch (pos_args) {
4337         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4338         CYTHON_FALLTHROUGH;
4339         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4340         CYTHON_FALLTHROUGH;
4341         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4342         CYTHON_FALLTHROUGH;
4343         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4344         CYTHON_FALLTHROUGH;
4345         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4346         CYTHON_FALLTHROUGH;
4347         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4348         CYTHON_FALLTHROUGH;
4349         case  0: break;
4350         default: goto __pyx_L5_argtuple_error;
4351       }
4352       kw_args = PyDict_Size(__pyx_kwds);
4353       switch (pos_args) {
4354         case  0:
4355         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4356         else goto __pyx_L5_argtuple_error;
4357         CYTHON_FALLTHROUGH;
4358         case  1:
4359         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4360         else {
4361           __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 1); __PYX_ERR(0, 106, __pyx_L3_error)
4362         }
4363         CYTHON_FALLTHROUGH;
4364         case  2:
4365         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4366         else {
4367           __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 2); __PYX_ERR(0, 106, __pyx_L3_error)
4368         }
4369         CYTHON_FALLTHROUGH;
4370         case  3:
4371         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
4372         else {
4373           __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 3); __PYX_ERR(0, 106, __pyx_L3_error)
4374         }
4375         CYTHON_FALLTHROUGH;
4376         case  4:
4377         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
4378         else {
4379           __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 4); __PYX_ERR(0, 106, __pyx_L3_error)
4380         }
4381         CYTHON_FALLTHROUGH;
4382         case  5:
4383         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4384         else {
4385           __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 5); __PYX_ERR(0, 106, __pyx_L3_error)
4386         }
4387       }
4388       if (unlikely(kw_args > 0)) {
4389         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellipse") < 0)) __PYX_ERR(0, 106, __pyx_L3_error)
4390       }
4391     } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4392       goto __pyx_L5_argtuple_error;
4393     } else {
4394       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4395       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4396       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4397       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4398       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4399       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4400     }
4401     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
4402     __pyx_v_x = values[1];
4403     __pyx_v_y = values[2];
4404     __pyx_v_rx = values[3];
4405     __pyx_v_ry = values[4];
4406     __pyx_v_color = values[5];
4407   }
4408   goto __pyx_L4_argument_unpacking_done;
4409   __pyx_L5_argtuple_error:;
4410   __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 106, __pyx_L3_error)
4411   __pyx_L3_error:;
4412   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
4413   __Pyx_RefNannyFinishContext();
4414   return NULL;
4415   __pyx_L4_argument_unpacking_done:;
4416   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 106, __pyx_L1_error)
4417   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color);
4418 
4419   /* function exit code */
4420   goto __pyx_L0;
4421   __pyx_L1_error:;
4422   __pyx_r = NULL;
4423   __pyx_L0:;
4424   __Pyx_RefNannyFinishContext();
4425   return __pyx_r;
4426 }
4427 
__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_rx,PyObject * __pyx_v_ry,PyObject * __pyx_v_color)4428 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) {
4429   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
4430   PyObject *__pyx_r = NULL;
4431   __Pyx_RefNannyDeclarations
4432   PyObject *__pyx_t_1 = NULL;
4433   Sint16 __pyx_t_2;
4434   Sint16 __pyx_t_3;
4435   Sint16 __pyx_t_4;
4436   Sint16 __pyx_t_5;
4437   int __pyx_lineno = 0;
4438   const char *__pyx_filename = NULL;
4439   int __pyx_clineno = 0;
4440   __Pyx_RefNannySetupContext("ellipse", 0);
4441 
4442   /* "pygame_sdl2/gfxdraw.pyx":107
4443  *
4444  * def ellipse(Surface surface, x, y, rx, ry, color):
4445  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
4446  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4447  *
4448  */
4449   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
4450   __Pyx_GOTREF(__pyx_t_1);
4451   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4452   __pyx_t_1 = 0;
4453 
4454   /* "pygame_sdl2/gfxdraw.pyx":108
4455  * def ellipse(Surface surface, x, y, rx, ry, color):
4456  *     cdef Color c = Color(color)
4457  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
4458  *
4459  * def aaellipse(Surface surface, x, y, rx, ry, color):
4460  */
4461   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4462   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4463   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4464   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4465   (void)(ellipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
4466 
4467   /* "pygame_sdl2/gfxdraw.pyx":106
4468  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
4469  *
4470  * def ellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
4471  *     cdef Color c = Color(color)
4472  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4473  */
4474 
4475   /* function exit code */
4476   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4477   goto __pyx_L0;
4478   __pyx_L1_error:;
4479   __Pyx_XDECREF(__pyx_t_1);
4480   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
4481   __pyx_r = NULL;
4482   __pyx_L0:;
4483   __Pyx_XDECREF((PyObject *)__pyx_v_c);
4484   __Pyx_XGIVEREF(__pyx_r);
4485   __Pyx_RefNannyFinishContext();
4486   return __pyx_r;
4487 }
4488 
4489 /* "pygame_sdl2/gfxdraw.pyx":110
4490  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4491  *
4492  * def aaellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
4493  *     cdef Color c = Color(color)
4494  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4495  */
4496 
4497 /* Python wrapper */
4498 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4499 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse = {"aaellipse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4500 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4501   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
4502   PyObject *__pyx_v_x = 0;
4503   PyObject *__pyx_v_y = 0;
4504   PyObject *__pyx_v_rx = 0;
4505   PyObject *__pyx_v_ry = 0;
4506   PyObject *__pyx_v_color = 0;
4507   int __pyx_lineno = 0;
4508   const char *__pyx_filename = NULL;
4509   int __pyx_clineno = 0;
4510   PyObject *__pyx_r = 0;
4511   __Pyx_RefNannyDeclarations
4512   __Pyx_RefNannySetupContext("aaellipse (wrapper)", 0);
4513   {
4514     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0};
4515     PyObject* values[6] = {0,0,0,0,0,0};
4516     if (unlikely(__pyx_kwds)) {
4517       Py_ssize_t kw_args;
4518       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4519       switch (pos_args) {
4520         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4521         CYTHON_FALLTHROUGH;
4522         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4523         CYTHON_FALLTHROUGH;
4524         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4525         CYTHON_FALLTHROUGH;
4526         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4527         CYTHON_FALLTHROUGH;
4528         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4529         CYTHON_FALLTHROUGH;
4530         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4531         CYTHON_FALLTHROUGH;
4532         case  0: break;
4533         default: goto __pyx_L5_argtuple_error;
4534       }
4535       kw_args = PyDict_Size(__pyx_kwds);
4536       switch (pos_args) {
4537         case  0:
4538         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4539         else goto __pyx_L5_argtuple_error;
4540         CYTHON_FALLTHROUGH;
4541         case  1:
4542         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4543         else {
4544           __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 1); __PYX_ERR(0, 110, __pyx_L3_error)
4545         }
4546         CYTHON_FALLTHROUGH;
4547         case  2:
4548         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4549         else {
4550           __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 2); __PYX_ERR(0, 110, __pyx_L3_error)
4551         }
4552         CYTHON_FALLTHROUGH;
4553         case  3:
4554         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
4555         else {
4556           __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 3); __PYX_ERR(0, 110, __pyx_L3_error)
4557         }
4558         CYTHON_FALLTHROUGH;
4559         case  4:
4560         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
4561         else {
4562           __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 4); __PYX_ERR(0, 110, __pyx_L3_error)
4563         }
4564         CYTHON_FALLTHROUGH;
4565         case  5:
4566         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4567         else {
4568           __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 5); __PYX_ERR(0, 110, __pyx_L3_error)
4569         }
4570       }
4571       if (unlikely(kw_args > 0)) {
4572         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaellipse") < 0)) __PYX_ERR(0, 110, __pyx_L3_error)
4573       }
4574     } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4575       goto __pyx_L5_argtuple_error;
4576     } else {
4577       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4578       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4579       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4580       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4581       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4582       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4583     }
4584     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
4585     __pyx_v_x = values[1];
4586     __pyx_v_y = values[2];
4587     __pyx_v_rx = values[3];
4588     __pyx_v_ry = values[4];
4589     __pyx_v_color = values[5];
4590   }
4591   goto __pyx_L4_argument_unpacking_done;
4592   __pyx_L5_argtuple_error:;
4593   __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 110, __pyx_L3_error)
4594   __pyx_L3_error:;
4595   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
4596   __Pyx_RefNannyFinishContext();
4597   return NULL;
4598   __pyx_L4_argument_unpacking_done:;
4599   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 110, __pyx_L1_error)
4600   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color);
4601 
4602   /* function exit code */
4603   goto __pyx_L0;
4604   __pyx_L1_error:;
4605   __pyx_r = NULL;
4606   __pyx_L0:;
4607   __Pyx_RefNannyFinishContext();
4608   return __pyx_r;
4609 }
4610 
__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_rx,PyObject * __pyx_v_ry,PyObject * __pyx_v_color)4611 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) {
4612   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
4613   PyObject *__pyx_r = NULL;
4614   __Pyx_RefNannyDeclarations
4615   PyObject *__pyx_t_1 = NULL;
4616   Sint16 __pyx_t_2;
4617   Sint16 __pyx_t_3;
4618   Sint16 __pyx_t_4;
4619   Sint16 __pyx_t_5;
4620   int __pyx_lineno = 0;
4621   const char *__pyx_filename = NULL;
4622   int __pyx_clineno = 0;
4623   __Pyx_RefNannySetupContext("aaellipse", 0);
4624 
4625   /* "pygame_sdl2/gfxdraw.pyx":111
4626  *
4627  * def aaellipse(Surface surface, x, y, rx, ry, color):
4628  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
4629  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4630  *
4631  */
4632   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
4633   __Pyx_GOTREF(__pyx_t_1);
4634   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4635   __pyx_t_1 = 0;
4636 
4637   /* "pygame_sdl2/gfxdraw.pyx":112
4638  * def aaellipse(Surface surface, x, y, rx, ry, color):
4639  *     cdef Color c = Color(color)
4640  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
4641  *
4642  * def filled_ellipse(Surface surface, x, y, rx, ry, color):
4643  */
4644   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4645   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4646   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4647   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4648   (void)(aaellipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
4649 
4650   /* "pygame_sdl2/gfxdraw.pyx":110
4651  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4652  *
4653  * def aaellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
4654  *     cdef Color c = Color(color)
4655  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4656  */
4657 
4658   /* function exit code */
4659   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4660   goto __pyx_L0;
4661   __pyx_L1_error:;
4662   __Pyx_XDECREF(__pyx_t_1);
4663   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
4664   __pyx_r = NULL;
4665   __pyx_L0:;
4666   __Pyx_XDECREF((PyObject *)__pyx_v_c);
4667   __Pyx_XGIVEREF(__pyx_r);
4668   __Pyx_RefNannyFinishContext();
4669   return __pyx_r;
4670 }
4671 
4672 /* "pygame_sdl2/gfxdraw.pyx":114
4673  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4674  *
4675  * def filled_ellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
4676  *     cdef Color c = Color(color)
4677  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4678  */
4679 
4680 /* Python wrapper */
4681 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4682 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse = {"filled_ellipse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4683 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4684   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
4685   PyObject *__pyx_v_x = 0;
4686   PyObject *__pyx_v_y = 0;
4687   PyObject *__pyx_v_rx = 0;
4688   PyObject *__pyx_v_ry = 0;
4689   PyObject *__pyx_v_color = 0;
4690   int __pyx_lineno = 0;
4691   const char *__pyx_filename = NULL;
4692   int __pyx_clineno = 0;
4693   PyObject *__pyx_r = 0;
4694   __Pyx_RefNannyDeclarations
4695   __Pyx_RefNannySetupContext("filled_ellipse (wrapper)", 0);
4696   {
4697     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0};
4698     PyObject* values[6] = {0,0,0,0,0,0};
4699     if (unlikely(__pyx_kwds)) {
4700       Py_ssize_t kw_args;
4701       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4702       switch (pos_args) {
4703         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4704         CYTHON_FALLTHROUGH;
4705         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4706         CYTHON_FALLTHROUGH;
4707         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4708         CYTHON_FALLTHROUGH;
4709         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4710         CYTHON_FALLTHROUGH;
4711         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4712         CYTHON_FALLTHROUGH;
4713         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4714         CYTHON_FALLTHROUGH;
4715         case  0: break;
4716         default: goto __pyx_L5_argtuple_error;
4717       }
4718       kw_args = PyDict_Size(__pyx_kwds);
4719       switch (pos_args) {
4720         case  0:
4721         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4722         else goto __pyx_L5_argtuple_error;
4723         CYTHON_FALLTHROUGH;
4724         case  1:
4725         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4726         else {
4727           __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 1); __PYX_ERR(0, 114, __pyx_L3_error)
4728         }
4729         CYTHON_FALLTHROUGH;
4730         case  2:
4731         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4732         else {
4733           __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 2); __PYX_ERR(0, 114, __pyx_L3_error)
4734         }
4735         CYTHON_FALLTHROUGH;
4736         case  3:
4737         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
4738         else {
4739           __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 3); __PYX_ERR(0, 114, __pyx_L3_error)
4740         }
4741         CYTHON_FALLTHROUGH;
4742         case  4:
4743         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
4744         else {
4745           __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 4); __PYX_ERR(0, 114, __pyx_L3_error)
4746         }
4747         CYTHON_FALLTHROUGH;
4748         case  5:
4749         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4750         else {
4751           __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 5); __PYX_ERR(0, 114, __pyx_L3_error)
4752         }
4753       }
4754       if (unlikely(kw_args > 0)) {
4755         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_ellipse") < 0)) __PYX_ERR(0, 114, __pyx_L3_error)
4756       }
4757     } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4758       goto __pyx_L5_argtuple_error;
4759     } else {
4760       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4761       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4762       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4763       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4764       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4765       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4766     }
4767     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
4768     __pyx_v_x = values[1];
4769     __pyx_v_y = values[2];
4770     __pyx_v_rx = values[3];
4771     __pyx_v_ry = values[4];
4772     __pyx_v_color = values[5];
4773   }
4774   goto __pyx_L4_argument_unpacking_done;
4775   __pyx_L5_argtuple_error:;
4776   __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 114, __pyx_L3_error)
4777   __pyx_L3_error:;
4778   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
4779   __Pyx_RefNannyFinishContext();
4780   return NULL;
4781   __pyx_L4_argument_unpacking_done:;
4782   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 114, __pyx_L1_error)
4783   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color);
4784 
4785   /* function exit code */
4786   goto __pyx_L0;
4787   __pyx_L1_error:;
4788   __pyx_r = NULL;
4789   __pyx_L0:;
4790   __Pyx_RefNannyFinishContext();
4791   return __pyx_r;
4792 }
4793 
__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_rx,PyObject * __pyx_v_ry,PyObject * __pyx_v_color)4794 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) {
4795   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
4796   PyObject *__pyx_r = NULL;
4797   __Pyx_RefNannyDeclarations
4798   PyObject *__pyx_t_1 = NULL;
4799   Sint16 __pyx_t_2;
4800   Sint16 __pyx_t_3;
4801   Sint16 __pyx_t_4;
4802   Sint16 __pyx_t_5;
4803   int __pyx_lineno = 0;
4804   const char *__pyx_filename = NULL;
4805   int __pyx_clineno = 0;
4806   __Pyx_RefNannySetupContext("filled_ellipse", 0);
4807 
4808   /* "pygame_sdl2/gfxdraw.pyx":115
4809  *
4810  * def filled_ellipse(Surface surface, x, y, rx, ry, color):
4811  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
4812  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4813  *
4814  */
4815   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
4816   __Pyx_GOTREF(__pyx_t_1);
4817   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4818   __pyx_t_1 = 0;
4819 
4820   /* "pygame_sdl2/gfxdraw.pyx":116
4821  * def filled_ellipse(Surface surface, x, y, rx, ry, color):
4822  *     cdef Color c = Color(color)
4823  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
4824  *
4825  * def pie(Surface surface, x, y, r, start, end, color):
4826  */
4827   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4828   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4829   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4830   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4831   (void)(filledEllipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
4832 
4833   /* "pygame_sdl2/gfxdraw.pyx":114
4834  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4835  *
4836  * def filled_ellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
4837  *     cdef Color c = Color(color)
4838  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4839  */
4840 
4841   /* function exit code */
4842   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4843   goto __pyx_L0;
4844   __pyx_L1_error:;
4845   __Pyx_XDECREF(__pyx_t_1);
4846   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
4847   __pyx_r = NULL;
4848   __pyx_L0:;
4849   __Pyx_XDECREF((PyObject *)__pyx_v_c);
4850   __Pyx_XGIVEREF(__pyx_r);
4851   __Pyx_RefNannyFinishContext();
4852   return __pyx_r;
4853 }
4854 
4855 /* "pygame_sdl2/gfxdraw.pyx":118
4856  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
4857  *
4858  * def pie(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
4859  *     cdef Color c = Color(color)
4860  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
4861  */
4862 
4863 /* Python wrapper */
4864 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4865 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_35pie = {"pie", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_35pie, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4866 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4867   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
4868   PyObject *__pyx_v_x = 0;
4869   PyObject *__pyx_v_y = 0;
4870   PyObject *__pyx_v_r = 0;
4871   PyObject *__pyx_v_start = 0;
4872   PyObject *__pyx_v_end = 0;
4873   PyObject *__pyx_v_color = 0;
4874   int __pyx_lineno = 0;
4875   const char *__pyx_filename = NULL;
4876   int __pyx_clineno = 0;
4877   PyObject *__pyx_r = 0;
4878   __Pyx_RefNannyDeclarations
4879   __Pyx_RefNannySetupContext("pie (wrapper)", 0);
4880   {
4881     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0};
4882     PyObject* values[7] = {0,0,0,0,0,0,0};
4883     if (unlikely(__pyx_kwds)) {
4884       Py_ssize_t kw_args;
4885       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4886       switch (pos_args) {
4887         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4888         CYTHON_FALLTHROUGH;
4889         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4890         CYTHON_FALLTHROUGH;
4891         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4892         CYTHON_FALLTHROUGH;
4893         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4894         CYTHON_FALLTHROUGH;
4895         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4896         CYTHON_FALLTHROUGH;
4897         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4898         CYTHON_FALLTHROUGH;
4899         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4900         CYTHON_FALLTHROUGH;
4901         case  0: break;
4902         default: goto __pyx_L5_argtuple_error;
4903       }
4904       kw_args = PyDict_Size(__pyx_kwds);
4905       switch (pos_args) {
4906         case  0:
4907         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4908         else goto __pyx_L5_argtuple_error;
4909         CYTHON_FALLTHROUGH;
4910         case  1:
4911         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4912         else {
4913           __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 1); __PYX_ERR(0, 118, __pyx_L3_error)
4914         }
4915         CYTHON_FALLTHROUGH;
4916         case  2:
4917         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4918         else {
4919           __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 2); __PYX_ERR(0, 118, __pyx_L3_error)
4920         }
4921         CYTHON_FALLTHROUGH;
4922         case  3:
4923         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
4924         else {
4925           __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 3); __PYX_ERR(0, 118, __pyx_L3_error)
4926         }
4927         CYTHON_FALLTHROUGH;
4928         case  4:
4929         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
4930         else {
4931           __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 4); __PYX_ERR(0, 118, __pyx_L3_error)
4932         }
4933         CYTHON_FALLTHROUGH;
4934         case  5:
4935         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
4936         else {
4937           __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 5); __PYX_ERR(0, 118, __pyx_L3_error)
4938         }
4939         CYTHON_FALLTHROUGH;
4940         case  6:
4941         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4942         else {
4943           __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 6); __PYX_ERR(0, 118, __pyx_L3_error)
4944         }
4945       }
4946       if (unlikely(kw_args > 0)) {
4947         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pie") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
4948       }
4949     } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
4950       goto __pyx_L5_argtuple_error;
4951     } else {
4952       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4953       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4954       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4955       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4956       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4957       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4958       values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4959     }
4960     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
4961     __pyx_v_x = values[1];
4962     __pyx_v_y = values[2];
4963     __pyx_v_r = values[3];
4964     __pyx_v_start = values[4];
4965     __pyx_v_end = values[5];
4966     __pyx_v_color = values[6];
4967   }
4968   goto __pyx_L4_argument_unpacking_done;
4969   __pyx_L5_argtuple_error:;
4970   __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
4971   __pyx_L3_error:;
4972   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename);
4973   __Pyx_RefNannyFinishContext();
4974   return NULL;
4975   __pyx_L4_argument_unpacking_done:;
4976   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
4977   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_34pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color);
4978 
4979   /* function exit code */
4980   goto __pyx_L0;
4981   __pyx_L1_error:;
4982   __pyx_r = NULL;
4983   __pyx_L0:;
4984   __Pyx_RefNannyFinishContext();
4985   return __pyx_r;
4986 }
4987 
__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_r,PyObject * __pyx_v_start,PyObject * __pyx_v_end,PyObject * __pyx_v_color)4988 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) {
4989   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
4990   PyObject *__pyx_r = NULL;
4991   __Pyx_RefNannyDeclarations
4992   PyObject *__pyx_t_1 = NULL;
4993   Sint16 __pyx_t_2;
4994   Sint16 __pyx_t_3;
4995   Sint16 __pyx_t_4;
4996   Sint16 __pyx_t_5;
4997   Sint16 __pyx_t_6;
4998   int __pyx_lineno = 0;
4999   const char *__pyx_filename = NULL;
5000   int __pyx_clineno = 0;
5001   __Pyx_RefNannySetupContext("pie", 0);
5002 
5003   /* "pygame_sdl2/gfxdraw.pyx":119
5004  *
5005  * def pie(Surface surface, x, y, r, start, end, color):
5006  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
5007  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5008  *
5009  */
5010   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
5011   __Pyx_GOTREF(__pyx_t_1);
5012   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5013   __pyx_t_1 = 0;
5014 
5015   /* "pygame_sdl2/gfxdraw.pyx":120
5016  * def pie(Surface surface, x, y, r, start, end, color):
5017  *     cdef Color c = Color(color)
5018  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
5019  *
5020  * def filled_pie(Surface surface, x, y, r, start, end, color):
5021  */
5022   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
5023   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
5024   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
5025   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
5026   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
5027   (void)(pieRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
5028 
5029   /* "pygame_sdl2/gfxdraw.pyx":118
5030  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
5031  *
5032  * def pie(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
5033  *     cdef Color c = Color(color)
5034  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5035  */
5036 
5037   /* function exit code */
5038   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5039   goto __pyx_L0;
5040   __pyx_L1_error:;
5041   __Pyx_XDECREF(__pyx_t_1);
5042   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename);
5043   __pyx_r = NULL;
5044   __pyx_L0:;
5045   __Pyx_XDECREF((PyObject *)__pyx_v_c);
5046   __Pyx_XGIVEREF(__pyx_r);
5047   __Pyx_RefNannyFinishContext();
5048   return __pyx_r;
5049 }
5050 
5051 /* "pygame_sdl2/gfxdraw.pyx":122
5052  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5053  *
5054  * def filled_pie(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
5055  *     cdef Color c = Color(color)
5056  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5057  */
5058 
5059 /* Python wrapper */
5060 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5061 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie = {"filled_pie", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5062 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5063   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
5064   PyObject *__pyx_v_x = 0;
5065   PyObject *__pyx_v_y = 0;
5066   PyObject *__pyx_v_r = 0;
5067   PyObject *__pyx_v_start = 0;
5068   PyObject *__pyx_v_end = 0;
5069   PyObject *__pyx_v_color = 0;
5070   int __pyx_lineno = 0;
5071   const char *__pyx_filename = NULL;
5072   int __pyx_clineno = 0;
5073   PyObject *__pyx_r = 0;
5074   __Pyx_RefNannyDeclarations
5075   __Pyx_RefNannySetupContext("filled_pie (wrapper)", 0);
5076   {
5077     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0};
5078     PyObject* values[7] = {0,0,0,0,0,0,0};
5079     if (unlikely(__pyx_kwds)) {
5080       Py_ssize_t kw_args;
5081       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5082       switch (pos_args) {
5083         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5084         CYTHON_FALLTHROUGH;
5085         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5086         CYTHON_FALLTHROUGH;
5087         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5088         CYTHON_FALLTHROUGH;
5089         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5090         CYTHON_FALLTHROUGH;
5091         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5092         CYTHON_FALLTHROUGH;
5093         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5094         CYTHON_FALLTHROUGH;
5095         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5096         CYTHON_FALLTHROUGH;
5097         case  0: break;
5098         default: goto __pyx_L5_argtuple_error;
5099       }
5100       kw_args = PyDict_Size(__pyx_kwds);
5101       switch (pos_args) {
5102         case  0:
5103         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5104         else goto __pyx_L5_argtuple_error;
5105         CYTHON_FALLTHROUGH;
5106         case  1:
5107         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5108         else {
5109           __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 1); __PYX_ERR(0, 122, __pyx_L3_error)
5110         }
5111         CYTHON_FALLTHROUGH;
5112         case  2:
5113         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
5114         else {
5115           __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 2); __PYX_ERR(0, 122, __pyx_L3_error)
5116         }
5117         CYTHON_FALLTHROUGH;
5118         case  3:
5119         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
5120         else {
5121           __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 3); __PYX_ERR(0, 122, __pyx_L3_error)
5122         }
5123         CYTHON_FALLTHROUGH;
5124         case  4:
5125         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
5126         else {
5127           __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 4); __PYX_ERR(0, 122, __pyx_L3_error)
5128         }
5129         CYTHON_FALLTHROUGH;
5130         case  5:
5131         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
5132         else {
5133           __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 5); __PYX_ERR(0, 122, __pyx_L3_error)
5134         }
5135         CYTHON_FALLTHROUGH;
5136         case  6:
5137         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5138         else {
5139           __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 6); __PYX_ERR(0, 122, __pyx_L3_error)
5140         }
5141       }
5142       if (unlikely(kw_args > 0)) {
5143         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_pie") < 0)) __PYX_ERR(0, 122, __pyx_L3_error)
5144       }
5145     } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
5146       goto __pyx_L5_argtuple_error;
5147     } else {
5148       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5149       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5150       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5151       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5152       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5153       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5154       values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5155     }
5156     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
5157     __pyx_v_x = values[1];
5158     __pyx_v_y = values[2];
5159     __pyx_v_r = values[3];
5160     __pyx_v_start = values[4];
5161     __pyx_v_end = values[5];
5162     __pyx_v_color = values[6];
5163   }
5164   goto __pyx_L4_argument_unpacking_done;
5165   __pyx_L5_argtuple_error:;
5166   __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error)
5167   __pyx_L3_error:;
5168   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename);
5169   __Pyx_RefNannyFinishContext();
5170   return NULL;
5171   __pyx_L4_argument_unpacking_done:;
5172   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 122, __pyx_L1_error)
5173   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color);
5174 
5175   /* function exit code */
5176   goto __pyx_L0;
5177   __pyx_L1_error:;
5178   __pyx_r = NULL;
5179   __pyx_L0:;
5180   __Pyx_RefNannyFinishContext();
5181   return __pyx_r;
5182 }
5183 
__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x,PyObject * __pyx_v_y,PyObject * __pyx_v_r,PyObject * __pyx_v_start,PyObject * __pyx_v_end,PyObject * __pyx_v_color)5184 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) {
5185   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
5186   PyObject *__pyx_r = NULL;
5187   __Pyx_RefNannyDeclarations
5188   PyObject *__pyx_t_1 = NULL;
5189   Sint16 __pyx_t_2;
5190   Sint16 __pyx_t_3;
5191   Sint16 __pyx_t_4;
5192   Sint16 __pyx_t_5;
5193   Sint16 __pyx_t_6;
5194   int __pyx_lineno = 0;
5195   const char *__pyx_filename = NULL;
5196   int __pyx_clineno = 0;
5197   __Pyx_RefNannySetupContext("filled_pie", 0);
5198 
5199   /* "pygame_sdl2/gfxdraw.pyx":123
5200  *
5201  * def filled_pie(Surface surface, x, y, r, start, end, color):
5202  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
5203  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5204  *
5205  */
5206   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
5207   __Pyx_GOTREF(__pyx_t_1);
5208   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5209   __pyx_t_1 = 0;
5210 
5211   /* "pygame_sdl2/gfxdraw.pyx":124
5212  * def filled_pie(Surface surface, x, y, r, start, end, color):
5213  *     cdef Color c = Color(color)
5214  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
5215  *
5216  * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5217  */
5218   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5219   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5220   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5221   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5222   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5223   (void)(filledPieRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
5224 
5225   /* "pygame_sdl2/gfxdraw.pyx":122
5226  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5227  *
5228  * def filled_pie(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
5229  *     cdef Color c = Color(color)
5230  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5231  */
5232 
5233   /* function exit code */
5234   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5235   goto __pyx_L0;
5236   __pyx_L1_error:;
5237   __Pyx_XDECREF(__pyx_t_1);
5238   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename);
5239   __pyx_r = NULL;
5240   __pyx_L0:;
5241   __Pyx_XDECREF((PyObject *)__pyx_v_c);
5242   __Pyx_XGIVEREF(__pyx_r);
5243   __Pyx_RefNannyFinishContext();
5244   return __pyx_r;
5245 }
5246 
5247 /* "pygame_sdl2/gfxdraw.pyx":126
5248  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5249  *
5250  * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
5251  *     cdef Color c = Color(color)
5252  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5253  */
5254 
5255 /* Python wrapper */
5256 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5257 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon = {"trigon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5258 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5259   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
5260   PyObject *__pyx_v_x1 = 0;
5261   PyObject *__pyx_v_y1 = 0;
5262   PyObject *__pyx_v_x2 = 0;
5263   PyObject *__pyx_v_y2 = 0;
5264   PyObject *__pyx_v_x3 = 0;
5265   PyObject *__pyx_v_y3 = 0;
5266   PyObject *__pyx_v_color = 0;
5267   int __pyx_lineno = 0;
5268   const char *__pyx_filename = NULL;
5269   int __pyx_clineno = 0;
5270   PyObject *__pyx_r = 0;
5271   __Pyx_RefNannyDeclarations
5272   __Pyx_RefNannySetupContext("trigon (wrapper)", 0);
5273   {
5274     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0};
5275     PyObject* values[8] = {0,0,0,0,0,0,0,0};
5276     if (unlikely(__pyx_kwds)) {
5277       Py_ssize_t kw_args;
5278       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5279       switch (pos_args) {
5280         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5281         CYTHON_FALLTHROUGH;
5282         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5283         CYTHON_FALLTHROUGH;
5284         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5285         CYTHON_FALLTHROUGH;
5286         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5287         CYTHON_FALLTHROUGH;
5288         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5289         CYTHON_FALLTHROUGH;
5290         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5291         CYTHON_FALLTHROUGH;
5292         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5293         CYTHON_FALLTHROUGH;
5294         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5295         CYTHON_FALLTHROUGH;
5296         case  0: break;
5297         default: goto __pyx_L5_argtuple_error;
5298       }
5299       kw_args = PyDict_Size(__pyx_kwds);
5300       switch (pos_args) {
5301         case  0:
5302         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5303         else goto __pyx_L5_argtuple_error;
5304         CYTHON_FALLTHROUGH;
5305         case  1:
5306         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
5307         else {
5308           __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5309         }
5310         CYTHON_FALLTHROUGH;
5311         case  2:
5312         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
5313         else {
5314           __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 2); __PYX_ERR(0, 126, __pyx_L3_error)
5315         }
5316         CYTHON_FALLTHROUGH;
5317         case  3:
5318         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
5319         else {
5320           __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 3); __PYX_ERR(0, 126, __pyx_L3_error)
5321         }
5322         CYTHON_FALLTHROUGH;
5323         case  4:
5324         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
5325         else {
5326           __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 4); __PYX_ERR(0, 126, __pyx_L3_error)
5327         }
5328         CYTHON_FALLTHROUGH;
5329         case  5:
5330         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
5331         else {
5332           __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 5); __PYX_ERR(0, 126, __pyx_L3_error)
5333         }
5334         CYTHON_FALLTHROUGH;
5335         case  6:
5336         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
5337         else {
5338           __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 6); __PYX_ERR(0, 126, __pyx_L3_error)
5339         }
5340         CYTHON_FALLTHROUGH;
5341         case  7:
5342         if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5343         else {
5344           __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 7); __PYX_ERR(0, 126, __pyx_L3_error)
5345         }
5346       }
5347       if (unlikely(kw_args > 0)) {
5348         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trigon") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5349       }
5350     } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
5351       goto __pyx_L5_argtuple_error;
5352     } else {
5353       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5354       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5355       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5356       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5357       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5358       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5359       values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5360       values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5361     }
5362     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
5363     __pyx_v_x1 = values[1];
5364     __pyx_v_y1 = values[2];
5365     __pyx_v_x2 = values[3];
5366     __pyx_v_y2 = values[4];
5367     __pyx_v_x3 = values[5];
5368     __pyx_v_y3 = values[6];
5369     __pyx_v_color = values[7];
5370   }
5371   goto __pyx_L4_argument_unpacking_done;
5372   __pyx_L5_argtuple_error:;
5373   __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5374   __pyx_L3_error:;
5375   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
5376   __Pyx_RefNannyFinishContext();
5377   return NULL;
5378   __pyx_L4_argument_unpacking_done:;
5379   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 126, __pyx_L1_error)
5380   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color);
5381 
5382   /* function exit code */
5383   goto __pyx_L0;
5384   __pyx_L1_error:;
5385   __pyx_r = NULL;
5386   __pyx_L0:;
5387   __Pyx_RefNannyFinishContext();
5388   return __pyx_r;
5389 }
5390 
__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x1,PyObject * __pyx_v_y1,PyObject * __pyx_v_x2,PyObject * __pyx_v_y2,PyObject * __pyx_v_x3,PyObject * __pyx_v_y3,PyObject * __pyx_v_color)5391 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) {
5392   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
5393   PyObject *__pyx_r = NULL;
5394   __Pyx_RefNannyDeclarations
5395   PyObject *__pyx_t_1 = NULL;
5396   Sint16 __pyx_t_2;
5397   Sint16 __pyx_t_3;
5398   Sint16 __pyx_t_4;
5399   Sint16 __pyx_t_5;
5400   Sint16 __pyx_t_6;
5401   Sint16 __pyx_t_7;
5402   int __pyx_lineno = 0;
5403   const char *__pyx_filename = NULL;
5404   int __pyx_clineno = 0;
5405   __Pyx_RefNannySetupContext("trigon", 0);
5406 
5407   /* "pygame_sdl2/gfxdraw.pyx":127
5408  *
5409  * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5410  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
5411  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5412  *
5413  */
5414   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
5415   __Pyx_GOTREF(__pyx_t_1);
5416   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5417   __pyx_t_1 = 0;
5418 
5419   /* "pygame_sdl2/gfxdraw.pyx":128
5420  * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5421  *     cdef Color c = Color(color)
5422  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
5423  *
5424  * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5425  */
5426   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5427   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5428   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5429   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5430   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5431   __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5432   (void)(trigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
5433 
5434   /* "pygame_sdl2/gfxdraw.pyx":126
5435  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
5436  *
5437  * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
5438  *     cdef Color c = Color(color)
5439  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5440  */
5441 
5442   /* function exit code */
5443   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5444   goto __pyx_L0;
5445   __pyx_L1_error:;
5446   __Pyx_XDECREF(__pyx_t_1);
5447   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
5448   __pyx_r = NULL;
5449   __pyx_L0:;
5450   __Pyx_XDECREF((PyObject *)__pyx_v_c);
5451   __Pyx_XGIVEREF(__pyx_r);
5452   __Pyx_RefNannyFinishContext();
5453   return __pyx_r;
5454 }
5455 
5456 /* "pygame_sdl2/gfxdraw.pyx":130
5457  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5458  *
5459  * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
5460  *     cdef Color c = Color(color)
5461  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5462  */
5463 
5464 /* Python wrapper */
5465 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5466 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon = {"aatrigon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5467 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5468   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
5469   PyObject *__pyx_v_x1 = 0;
5470   PyObject *__pyx_v_y1 = 0;
5471   PyObject *__pyx_v_x2 = 0;
5472   PyObject *__pyx_v_y2 = 0;
5473   PyObject *__pyx_v_x3 = 0;
5474   PyObject *__pyx_v_y3 = 0;
5475   PyObject *__pyx_v_color = 0;
5476   int __pyx_lineno = 0;
5477   const char *__pyx_filename = NULL;
5478   int __pyx_clineno = 0;
5479   PyObject *__pyx_r = 0;
5480   __Pyx_RefNannyDeclarations
5481   __Pyx_RefNannySetupContext("aatrigon (wrapper)", 0);
5482   {
5483     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0};
5484     PyObject* values[8] = {0,0,0,0,0,0,0,0};
5485     if (unlikely(__pyx_kwds)) {
5486       Py_ssize_t kw_args;
5487       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5488       switch (pos_args) {
5489         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5490         CYTHON_FALLTHROUGH;
5491         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5492         CYTHON_FALLTHROUGH;
5493         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5494         CYTHON_FALLTHROUGH;
5495         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5496         CYTHON_FALLTHROUGH;
5497         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5498         CYTHON_FALLTHROUGH;
5499         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5500         CYTHON_FALLTHROUGH;
5501         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5502         CYTHON_FALLTHROUGH;
5503         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5504         CYTHON_FALLTHROUGH;
5505         case  0: break;
5506         default: goto __pyx_L5_argtuple_error;
5507       }
5508       kw_args = PyDict_Size(__pyx_kwds);
5509       switch (pos_args) {
5510         case  0:
5511         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5512         else goto __pyx_L5_argtuple_error;
5513         CYTHON_FALLTHROUGH;
5514         case  1:
5515         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
5516         else {
5517           __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 1); __PYX_ERR(0, 130, __pyx_L3_error)
5518         }
5519         CYTHON_FALLTHROUGH;
5520         case  2:
5521         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
5522         else {
5523           __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 2); __PYX_ERR(0, 130, __pyx_L3_error)
5524         }
5525         CYTHON_FALLTHROUGH;
5526         case  3:
5527         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
5528         else {
5529           __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 3); __PYX_ERR(0, 130, __pyx_L3_error)
5530         }
5531         CYTHON_FALLTHROUGH;
5532         case  4:
5533         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
5534         else {
5535           __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 4); __PYX_ERR(0, 130, __pyx_L3_error)
5536         }
5537         CYTHON_FALLTHROUGH;
5538         case  5:
5539         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
5540         else {
5541           __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 5); __PYX_ERR(0, 130, __pyx_L3_error)
5542         }
5543         CYTHON_FALLTHROUGH;
5544         case  6:
5545         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
5546         else {
5547           __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 6); __PYX_ERR(0, 130, __pyx_L3_error)
5548         }
5549         CYTHON_FALLTHROUGH;
5550         case  7:
5551         if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5552         else {
5553           __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 7); __PYX_ERR(0, 130, __pyx_L3_error)
5554         }
5555       }
5556       if (unlikely(kw_args > 0)) {
5557         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aatrigon") < 0)) __PYX_ERR(0, 130, __pyx_L3_error)
5558       }
5559     } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
5560       goto __pyx_L5_argtuple_error;
5561     } else {
5562       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5563       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5564       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5565       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5566       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5567       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5568       values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5569       values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5570     }
5571     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
5572     __pyx_v_x1 = values[1];
5573     __pyx_v_y1 = values[2];
5574     __pyx_v_x2 = values[3];
5575     __pyx_v_y2 = values[4];
5576     __pyx_v_x3 = values[5];
5577     __pyx_v_y3 = values[6];
5578     __pyx_v_color = values[7];
5579   }
5580   goto __pyx_L4_argument_unpacking_done;
5581   __pyx_L5_argtuple_error:;
5582   __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 130, __pyx_L3_error)
5583   __pyx_L3_error:;
5584   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
5585   __Pyx_RefNannyFinishContext();
5586   return NULL;
5587   __pyx_L4_argument_unpacking_done:;
5588   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 130, __pyx_L1_error)
5589   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color);
5590 
5591   /* function exit code */
5592   goto __pyx_L0;
5593   __pyx_L1_error:;
5594   __pyx_r = NULL;
5595   __pyx_L0:;
5596   __Pyx_RefNannyFinishContext();
5597   return __pyx_r;
5598 }
5599 
__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x1,PyObject * __pyx_v_y1,PyObject * __pyx_v_x2,PyObject * __pyx_v_y2,PyObject * __pyx_v_x3,PyObject * __pyx_v_y3,PyObject * __pyx_v_color)5600 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) {
5601   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
5602   PyObject *__pyx_r = NULL;
5603   __Pyx_RefNannyDeclarations
5604   PyObject *__pyx_t_1 = NULL;
5605   Sint16 __pyx_t_2;
5606   Sint16 __pyx_t_3;
5607   Sint16 __pyx_t_4;
5608   Sint16 __pyx_t_5;
5609   Sint16 __pyx_t_6;
5610   Sint16 __pyx_t_7;
5611   int __pyx_lineno = 0;
5612   const char *__pyx_filename = NULL;
5613   int __pyx_clineno = 0;
5614   __Pyx_RefNannySetupContext("aatrigon", 0);
5615 
5616   /* "pygame_sdl2/gfxdraw.pyx":131
5617  *
5618  * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5619  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
5620  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5621  *
5622  */
5623   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
5624   __Pyx_GOTREF(__pyx_t_1);
5625   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5626   __pyx_t_1 = 0;
5627 
5628   /* "pygame_sdl2/gfxdraw.pyx":132
5629  * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5630  *     cdef Color c = Color(color)
5631  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
5632  *
5633  * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5634  */
5635   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5636   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5637   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5638   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5639   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5640   __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5641   (void)(aatrigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
5642 
5643   /* "pygame_sdl2/gfxdraw.pyx":130
5644  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5645  *
5646  * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
5647  *     cdef Color c = Color(color)
5648  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5649  */
5650 
5651   /* function exit code */
5652   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5653   goto __pyx_L0;
5654   __pyx_L1_error:;
5655   __Pyx_XDECREF(__pyx_t_1);
5656   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
5657   __pyx_r = NULL;
5658   __pyx_L0:;
5659   __Pyx_XDECREF((PyObject *)__pyx_v_c);
5660   __Pyx_XGIVEREF(__pyx_r);
5661   __Pyx_RefNannyFinishContext();
5662   return __pyx_r;
5663 }
5664 
5665 /* "pygame_sdl2/gfxdraw.pyx":134
5666  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5667  *
5668  * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
5669  *     cdef Color c = Color(color)
5670  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5671  */
5672 
5673 /* Python wrapper */
5674 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5675 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon = {"filled_trigon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5676 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5677   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
5678   PyObject *__pyx_v_x1 = 0;
5679   PyObject *__pyx_v_y1 = 0;
5680   PyObject *__pyx_v_x2 = 0;
5681   PyObject *__pyx_v_y2 = 0;
5682   PyObject *__pyx_v_x3 = 0;
5683   PyObject *__pyx_v_y3 = 0;
5684   PyObject *__pyx_v_color = 0;
5685   int __pyx_lineno = 0;
5686   const char *__pyx_filename = NULL;
5687   int __pyx_clineno = 0;
5688   PyObject *__pyx_r = 0;
5689   __Pyx_RefNannyDeclarations
5690   __Pyx_RefNannySetupContext("filled_trigon (wrapper)", 0);
5691   {
5692     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0};
5693     PyObject* values[8] = {0,0,0,0,0,0,0,0};
5694     if (unlikely(__pyx_kwds)) {
5695       Py_ssize_t kw_args;
5696       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5697       switch (pos_args) {
5698         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5699         CYTHON_FALLTHROUGH;
5700         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5701         CYTHON_FALLTHROUGH;
5702         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5703         CYTHON_FALLTHROUGH;
5704         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5705         CYTHON_FALLTHROUGH;
5706         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5707         CYTHON_FALLTHROUGH;
5708         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5709         CYTHON_FALLTHROUGH;
5710         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5711         CYTHON_FALLTHROUGH;
5712         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5713         CYTHON_FALLTHROUGH;
5714         case  0: break;
5715         default: goto __pyx_L5_argtuple_error;
5716       }
5717       kw_args = PyDict_Size(__pyx_kwds);
5718       switch (pos_args) {
5719         case  0:
5720         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5721         else goto __pyx_L5_argtuple_error;
5722         CYTHON_FALLTHROUGH;
5723         case  1:
5724         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
5725         else {
5726           __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 1); __PYX_ERR(0, 134, __pyx_L3_error)
5727         }
5728         CYTHON_FALLTHROUGH;
5729         case  2:
5730         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
5731         else {
5732           __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 2); __PYX_ERR(0, 134, __pyx_L3_error)
5733         }
5734         CYTHON_FALLTHROUGH;
5735         case  3:
5736         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
5737         else {
5738           __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 3); __PYX_ERR(0, 134, __pyx_L3_error)
5739         }
5740         CYTHON_FALLTHROUGH;
5741         case  4:
5742         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
5743         else {
5744           __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 4); __PYX_ERR(0, 134, __pyx_L3_error)
5745         }
5746         CYTHON_FALLTHROUGH;
5747         case  5:
5748         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
5749         else {
5750           __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 5); __PYX_ERR(0, 134, __pyx_L3_error)
5751         }
5752         CYTHON_FALLTHROUGH;
5753         case  6:
5754         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
5755         else {
5756           __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 6); __PYX_ERR(0, 134, __pyx_L3_error)
5757         }
5758         CYTHON_FALLTHROUGH;
5759         case  7:
5760         if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5761         else {
5762           __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 7); __PYX_ERR(0, 134, __pyx_L3_error)
5763         }
5764       }
5765       if (unlikely(kw_args > 0)) {
5766         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_trigon") < 0)) __PYX_ERR(0, 134, __pyx_L3_error)
5767       }
5768     } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
5769       goto __pyx_L5_argtuple_error;
5770     } else {
5771       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5772       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5773       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5774       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5775       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5776       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5777       values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5778       values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5779     }
5780     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
5781     __pyx_v_x1 = values[1];
5782     __pyx_v_y1 = values[2];
5783     __pyx_v_x2 = values[3];
5784     __pyx_v_y2 = values[4];
5785     __pyx_v_x3 = values[5];
5786     __pyx_v_y3 = values[6];
5787     __pyx_v_color = values[7];
5788   }
5789   goto __pyx_L4_argument_unpacking_done;
5790   __pyx_L5_argtuple_error:;
5791   __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 134, __pyx_L3_error)
5792   __pyx_L3_error:;
5793   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
5794   __Pyx_RefNannyFinishContext();
5795   return NULL;
5796   __pyx_L4_argument_unpacking_done:;
5797   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 134, __pyx_L1_error)
5798   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color);
5799 
5800   /* function exit code */
5801   goto __pyx_L0;
5802   __pyx_L1_error:;
5803   __pyx_r = NULL;
5804   __pyx_L0:;
5805   __Pyx_RefNannyFinishContext();
5806   return __pyx_r;
5807 }
5808 
__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_x1,PyObject * __pyx_v_y1,PyObject * __pyx_v_x2,PyObject * __pyx_v_y2,PyObject * __pyx_v_x3,PyObject * __pyx_v_y3,PyObject * __pyx_v_color)5809 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) {
5810   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
5811   PyObject *__pyx_r = NULL;
5812   __Pyx_RefNannyDeclarations
5813   PyObject *__pyx_t_1 = NULL;
5814   Sint16 __pyx_t_2;
5815   Sint16 __pyx_t_3;
5816   Sint16 __pyx_t_4;
5817   Sint16 __pyx_t_5;
5818   Sint16 __pyx_t_6;
5819   Sint16 __pyx_t_7;
5820   int __pyx_lineno = 0;
5821   const char *__pyx_filename = NULL;
5822   int __pyx_clineno = 0;
5823   __Pyx_RefNannySetupContext("filled_trigon", 0);
5824 
5825   /* "pygame_sdl2/gfxdraw.pyx":135
5826  *
5827  * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5828  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
5829  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5830  *
5831  */
5832   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
5833   __Pyx_GOTREF(__pyx_t_1);
5834   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5835   __pyx_t_1 = 0;
5836 
5837   /* "pygame_sdl2/gfxdraw.pyx":136
5838  * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
5839  *     cdef Color c = Color(color)
5840  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
5841  *
5842  * def polygon(Surface surface, points, color):
5843  */
5844   __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5845   __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5846   __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5847   __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5848   __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5849   __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5850   (void)(filledTrigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
5851 
5852   /* "pygame_sdl2/gfxdraw.pyx":134
5853  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5854  *
5855  * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
5856  *     cdef Color c = Color(color)
5857  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5858  */
5859 
5860   /* function exit code */
5861   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5862   goto __pyx_L0;
5863   __pyx_L1_error:;
5864   __Pyx_XDECREF(__pyx_t_1);
5865   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
5866   __pyx_r = NULL;
5867   __pyx_L0:;
5868   __Pyx_XDECREF((PyObject *)__pyx_v_c);
5869   __Pyx_XGIVEREF(__pyx_r);
5870   __Pyx_RefNannyFinishContext();
5871   return __pyx_r;
5872 }
5873 
5874 /* "pygame_sdl2/gfxdraw.pyx":138
5875  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
5876  *
5877  * def polygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
5878  *     cdef Color c = Color(color)
5879  *     cdef Sint16 *vx
5880  */
5881 
5882 /* Python wrapper */
5883 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5884 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon = {"polygon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5885 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5886   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
5887   PyObject *__pyx_v_points = 0;
5888   PyObject *__pyx_v_color = 0;
5889   int __pyx_lineno = 0;
5890   const char *__pyx_filename = NULL;
5891   int __pyx_clineno = 0;
5892   PyObject *__pyx_r = 0;
5893   __Pyx_RefNannyDeclarations
5894   __Pyx_RefNannySetupContext("polygon (wrapper)", 0);
5895   {
5896     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0};
5897     PyObject* values[3] = {0,0,0};
5898     if (unlikely(__pyx_kwds)) {
5899       Py_ssize_t kw_args;
5900       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5901       switch (pos_args) {
5902         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5903         CYTHON_FALLTHROUGH;
5904         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5905         CYTHON_FALLTHROUGH;
5906         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5907         CYTHON_FALLTHROUGH;
5908         case  0: break;
5909         default: goto __pyx_L5_argtuple_error;
5910       }
5911       kw_args = PyDict_Size(__pyx_kwds);
5912       switch (pos_args) {
5913         case  0:
5914         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5915         else goto __pyx_L5_argtuple_error;
5916         CYTHON_FALLTHROUGH;
5917         case  1:
5918         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
5919         else {
5920           __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 1); __PYX_ERR(0, 138, __pyx_L3_error)
5921         }
5922         CYTHON_FALLTHROUGH;
5923         case  2:
5924         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5925         else {
5926           __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 2); __PYX_ERR(0, 138, __pyx_L3_error)
5927         }
5928       }
5929       if (unlikely(kw_args > 0)) {
5930         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polygon") < 0)) __PYX_ERR(0, 138, __pyx_L3_error)
5931       }
5932     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5933       goto __pyx_L5_argtuple_error;
5934     } else {
5935       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5936       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5937       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5938     }
5939     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
5940     __pyx_v_points = values[1];
5941     __pyx_v_color = values[2];
5942   }
5943   goto __pyx_L4_argument_unpacking_done;
5944   __pyx_L5_argtuple_error:;
5945   __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 138, __pyx_L3_error)
5946   __pyx_L3_error:;
5947   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
5948   __Pyx_RefNannyFinishContext();
5949   return NULL;
5950   __pyx_L4_argument_unpacking_done:;
5951   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 138, __pyx_L1_error)
5952   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color);
5953 
5954   /* function exit code */
5955   goto __pyx_L0;
5956   __pyx_L1_error:;
5957   __pyx_r = NULL;
5958   __pyx_L0:;
5959   __Pyx_RefNannyFinishContext();
5960   return __pyx_r;
5961 }
5962 
__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_points,PyObject * __pyx_v_color)5963 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) {
5964   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
5965   Sint16 *__pyx_v_vx;
5966   Sint16 *__pyx_v_vy;
5967   size_t __pyx_v_num_points;
5968   PyObject *__pyx_v_n = NULL;
5969   CYTHON_UNUSED PyObject *__pyx_v_pt = NULL;
5970   PyObject *__pyx_r = NULL;
5971   __Pyx_RefNannyDeclarations
5972   PyObject *__pyx_t_1 = NULL;
5973   Py_ssize_t __pyx_t_2;
5974   PyObject *__pyx_t_3 = NULL;
5975   PyObject *(*__pyx_t_4)(PyObject *);
5976   PyObject *__pyx_t_5 = NULL;
5977   PyObject *__pyx_t_6 = NULL;
5978   PyObject *__pyx_t_7 = NULL;
5979   PyObject *(*__pyx_t_8)(PyObject *);
5980   Sint16 __pyx_t_9;
5981   Sint16 __pyx_t_10;
5982   Py_ssize_t __pyx_t_11;
5983   int __pyx_lineno = 0;
5984   const char *__pyx_filename = NULL;
5985   int __pyx_clineno = 0;
5986   __Pyx_RefNannySetupContext("polygon", 0);
5987 
5988   /* "pygame_sdl2/gfxdraw.pyx":139
5989  *
5990  * def polygon(Surface surface, points, color):
5991  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
5992  *     cdef Sint16 *vx
5993  *     cdef Sint16 *vy
5994  */
5995   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
5996   __Pyx_GOTREF(__pyx_t_1);
5997   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5998   __pyx_t_1 = 0;
5999 
6000   /* "pygame_sdl2/gfxdraw.pyx":142
6001  *     cdef Sint16 *vx
6002  *     cdef Sint16 *vy
6003  *     cdef size_t num_points = len(points)             # <<<<<<<<<<<<<<
6004  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6005  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6006  */
6007   __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 142, __pyx_L1_error)
6008   __pyx_v_num_points = __pyx_t_2;
6009 
6010   /* "pygame_sdl2/gfxdraw.pyx":143
6011  *     cdef Sint16 *vy
6012  *     cdef size_t num_points = len(points)
6013  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
6014  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6015  *     for n, pt in zip(range(num_points), points):
6016  */
6017   __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
6018 
6019   /* "pygame_sdl2/gfxdraw.pyx":144
6020  *     cdef size_t num_points = len(points)
6021  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6022  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
6023  *     for n, pt in zip(range(num_points), points):
6024  *         vx[n], vy[n] = points[n]
6025  */
6026   __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
6027 
6028   /* "pygame_sdl2/gfxdraw.pyx":145
6029  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6030  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6031  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
6032  *         vx[n], vy[n] = points[n]
6033  *     polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6034  */
6035   __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
6036   __Pyx_GOTREF(__pyx_t_1);
6037   __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
6038   __Pyx_GOTREF(__pyx_t_3);
6039   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6040   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
6041   __Pyx_GOTREF(__pyx_t_1);
6042   __Pyx_GIVEREF(__pyx_t_3);
6043   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
6044   __Pyx_INCREF(__pyx_v_points);
6045   __Pyx_GIVEREF(__pyx_v_points);
6046   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points);
6047   __pyx_t_3 = 0;
6048   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
6049   __Pyx_GOTREF(__pyx_t_3);
6050   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6051   if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
6052     __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6053     __pyx_t_4 = NULL;
6054   } else {
6055     __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
6056     __Pyx_GOTREF(__pyx_t_1);
6057     __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
6058   }
6059   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6060   for (;;) {
6061     if (likely(!__pyx_t_4)) {
6062       if (likely(PyList_CheckExact(__pyx_t_1))) {
6063         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
6064         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6065         __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
6066         #else
6067         __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
6068         __Pyx_GOTREF(__pyx_t_3);
6069         #endif
6070       } else {
6071         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6072         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6073         __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
6074         #else
6075         __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
6076         __Pyx_GOTREF(__pyx_t_3);
6077         #endif
6078       }
6079     } else {
6080       __pyx_t_3 = __pyx_t_4(__pyx_t_1);
6081       if (unlikely(!__pyx_t_3)) {
6082         PyObject* exc_type = PyErr_Occurred();
6083         if (exc_type) {
6084           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6085           else __PYX_ERR(0, 145, __pyx_L1_error)
6086         }
6087         break;
6088       }
6089       __Pyx_GOTREF(__pyx_t_3);
6090     }
6091     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6092       PyObject* sequence = __pyx_t_3;
6093       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6094       if (unlikely(size != 2)) {
6095         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6096         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6097         __PYX_ERR(0, 145, __pyx_L1_error)
6098       }
6099       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6100       if (likely(PyTuple_CheckExact(sequence))) {
6101         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
6102         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
6103       } else {
6104         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
6105         __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
6106       }
6107       __Pyx_INCREF(__pyx_t_5);
6108       __Pyx_INCREF(__pyx_t_6);
6109       #else
6110       __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error)
6111       __Pyx_GOTREF(__pyx_t_5);
6112       __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error)
6113       __Pyx_GOTREF(__pyx_t_6);
6114       #endif
6115       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6116     } else {
6117       Py_ssize_t index = -1;
6118       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L1_error)
6119       __Pyx_GOTREF(__pyx_t_7);
6120       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6121       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
6122       index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
6123       __Pyx_GOTREF(__pyx_t_5);
6124       index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
6125       __Pyx_GOTREF(__pyx_t_6);
6126       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
6127       __pyx_t_8 = NULL;
6128       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6129       goto __pyx_L6_unpacking_done;
6130       __pyx_L5_unpacking_failed:;
6131       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6132       __pyx_t_8 = NULL;
6133       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6134       __PYX_ERR(0, 145, __pyx_L1_error)
6135       __pyx_L6_unpacking_done:;
6136     }
6137     __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
6138     __pyx_t_5 = 0;
6139     __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6);
6140     __pyx_t_6 = 0;
6141 
6142     /* "pygame_sdl2/gfxdraw.pyx":146
6143  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6144  *     for n, pt in zip(range(num_points), points):
6145  *         vx[n], vy[n] = points[n]             # <<<<<<<<<<<<<<
6146  *     polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6147  *     free(vx)
6148  */
6149     __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
6150     __Pyx_GOTREF(__pyx_t_3);
6151     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6152       PyObject* sequence = __pyx_t_3;
6153       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6154       if (unlikely(size != 2)) {
6155         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6156         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6157         __PYX_ERR(0, 146, __pyx_L1_error)
6158       }
6159       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6160       if (likely(PyTuple_CheckExact(sequence))) {
6161         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
6162         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
6163       } else {
6164         __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
6165         __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
6166       }
6167       __Pyx_INCREF(__pyx_t_6);
6168       __Pyx_INCREF(__pyx_t_5);
6169       #else
6170       __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error)
6171       __Pyx_GOTREF(__pyx_t_6);
6172       __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
6173       __Pyx_GOTREF(__pyx_t_5);
6174       #endif
6175       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6176     } else {
6177       Py_ssize_t index = -1;
6178       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
6179       __Pyx_GOTREF(__pyx_t_7);
6180       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6181       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
6182       index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
6183       __Pyx_GOTREF(__pyx_t_6);
6184       index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
6185       __Pyx_GOTREF(__pyx_t_5);
6186       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
6187       __pyx_t_8 = NULL;
6188       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6189       goto __pyx_L8_unpacking_done;
6190       __pyx_L7_unpacking_failed:;
6191       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6192       __pyx_t_8 = NULL;
6193       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6194       __PYX_ERR(0, 146, __pyx_L1_error)
6195       __pyx_L8_unpacking_done:;
6196     }
6197     __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
6198     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6199     __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
6200     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6201     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
6202     (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9;
6203     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
6204     (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10;
6205 
6206     /* "pygame_sdl2/gfxdraw.pyx":145
6207  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6208  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6209  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
6210  *         vx[n], vy[n] = points[n]
6211  *     polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6212  */
6213   }
6214   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6215 
6216   /* "pygame_sdl2/gfxdraw.pyx":147
6217  *     for n, pt in zip(range(num_points), points):
6218  *         vx[n], vy[n] = points[n]
6219  *     polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
6220  *     free(vx)
6221  *     free(vy)
6222  */
6223   (void)(polygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
6224 
6225   /* "pygame_sdl2/gfxdraw.pyx":148
6226  *         vx[n], vy[n] = points[n]
6227  *     polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6228  *     free(vx)             # <<<<<<<<<<<<<<
6229  *     free(vy)
6230  *
6231  */
6232   free(__pyx_v_vx);
6233 
6234   /* "pygame_sdl2/gfxdraw.pyx":149
6235  *     polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6236  *     free(vx)
6237  *     free(vy)             # <<<<<<<<<<<<<<
6238  *
6239  * def aapolygon(Surface surface, points, color):
6240  */
6241   free(__pyx_v_vy);
6242 
6243   /* "pygame_sdl2/gfxdraw.pyx":138
6244  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
6245  *
6246  * def polygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
6247  *     cdef Color c = Color(color)
6248  *     cdef Sint16 *vx
6249  */
6250 
6251   /* function exit code */
6252   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6253   goto __pyx_L0;
6254   __pyx_L1_error:;
6255   __Pyx_XDECREF(__pyx_t_1);
6256   __Pyx_XDECREF(__pyx_t_3);
6257   __Pyx_XDECREF(__pyx_t_5);
6258   __Pyx_XDECREF(__pyx_t_6);
6259   __Pyx_XDECREF(__pyx_t_7);
6260   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
6261   __pyx_r = NULL;
6262   __pyx_L0:;
6263   __Pyx_XDECREF((PyObject *)__pyx_v_c);
6264   __Pyx_XDECREF(__pyx_v_n);
6265   __Pyx_XDECREF(__pyx_v_pt);
6266   __Pyx_XGIVEREF(__pyx_r);
6267   __Pyx_RefNannyFinishContext();
6268   return __pyx_r;
6269 }
6270 
6271 /* "pygame_sdl2/gfxdraw.pyx":151
6272  *     free(vy)
6273  *
6274  * def aapolygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
6275  *     cdef Color c = Color(color)
6276  *     cdef Sint16 *vx
6277  */
6278 
6279 /* Python wrapper */
6280 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6281 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon = {"aapolygon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6282 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6283   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
6284   PyObject *__pyx_v_points = 0;
6285   PyObject *__pyx_v_color = 0;
6286   int __pyx_lineno = 0;
6287   const char *__pyx_filename = NULL;
6288   int __pyx_clineno = 0;
6289   PyObject *__pyx_r = 0;
6290   __Pyx_RefNannyDeclarations
6291   __Pyx_RefNannySetupContext("aapolygon (wrapper)", 0);
6292   {
6293     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0};
6294     PyObject* values[3] = {0,0,0};
6295     if (unlikely(__pyx_kwds)) {
6296       Py_ssize_t kw_args;
6297       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6298       switch (pos_args) {
6299         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6300         CYTHON_FALLTHROUGH;
6301         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6302         CYTHON_FALLTHROUGH;
6303         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6304         CYTHON_FALLTHROUGH;
6305         case  0: break;
6306         default: goto __pyx_L5_argtuple_error;
6307       }
6308       kw_args = PyDict_Size(__pyx_kwds);
6309       switch (pos_args) {
6310         case  0:
6311         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
6312         else goto __pyx_L5_argtuple_error;
6313         CYTHON_FALLTHROUGH;
6314         case  1:
6315         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
6316         else {
6317           __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 1); __PYX_ERR(0, 151, __pyx_L3_error)
6318         }
6319         CYTHON_FALLTHROUGH;
6320         case  2:
6321         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
6322         else {
6323           __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 2); __PYX_ERR(0, 151, __pyx_L3_error)
6324         }
6325       }
6326       if (unlikely(kw_args > 0)) {
6327         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aapolygon") < 0)) __PYX_ERR(0, 151, __pyx_L3_error)
6328       }
6329     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6330       goto __pyx_L5_argtuple_error;
6331     } else {
6332       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6333       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6334       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6335     }
6336     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
6337     __pyx_v_points = values[1];
6338     __pyx_v_color = values[2];
6339   }
6340   goto __pyx_L4_argument_unpacking_done;
6341   __pyx_L5_argtuple_error:;
6342   __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 151, __pyx_L3_error)
6343   __pyx_L3_error:;
6344   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
6345   __Pyx_RefNannyFinishContext();
6346   return NULL;
6347   __pyx_L4_argument_unpacking_done:;
6348   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 151, __pyx_L1_error)
6349   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color);
6350 
6351   /* function exit code */
6352   goto __pyx_L0;
6353   __pyx_L1_error:;
6354   __pyx_r = NULL;
6355   __pyx_L0:;
6356   __Pyx_RefNannyFinishContext();
6357   return __pyx_r;
6358 }
6359 
__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_points,PyObject * __pyx_v_color)6360 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) {
6361   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
6362   Sint16 *__pyx_v_vx;
6363   Sint16 *__pyx_v_vy;
6364   size_t __pyx_v_num_points;
6365   PyObject *__pyx_v_n = NULL;
6366   CYTHON_UNUSED PyObject *__pyx_v_pt = NULL;
6367   PyObject *__pyx_r = NULL;
6368   __Pyx_RefNannyDeclarations
6369   PyObject *__pyx_t_1 = NULL;
6370   Py_ssize_t __pyx_t_2;
6371   PyObject *__pyx_t_3 = NULL;
6372   PyObject *(*__pyx_t_4)(PyObject *);
6373   PyObject *__pyx_t_5 = NULL;
6374   PyObject *__pyx_t_6 = NULL;
6375   PyObject *__pyx_t_7 = NULL;
6376   PyObject *(*__pyx_t_8)(PyObject *);
6377   Sint16 __pyx_t_9;
6378   Sint16 __pyx_t_10;
6379   Py_ssize_t __pyx_t_11;
6380   int __pyx_lineno = 0;
6381   const char *__pyx_filename = NULL;
6382   int __pyx_clineno = 0;
6383   __Pyx_RefNannySetupContext("aapolygon", 0);
6384 
6385   /* "pygame_sdl2/gfxdraw.pyx":152
6386  *
6387  * def aapolygon(Surface surface, points, color):
6388  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
6389  *     cdef Sint16 *vx
6390  *     cdef Sint16 *vy
6391  */
6392   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
6393   __Pyx_GOTREF(__pyx_t_1);
6394   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
6395   __pyx_t_1 = 0;
6396 
6397   /* "pygame_sdl2/gfxdraw.pyx":155
6398  *     cdef Sint16 *vx
6399  *     cdef Sint16 *vy
6400  *     cdef size_t num_points = len(points)             # <<<<<<<<<<<<<<
6401  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6402  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6403  */
6404   __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 155, __pyx_L1_error)
6405   __pyx_v_num_points = __pyx_t_2;
6406 
6407   /* "pygame_sdl2/gfxdraw.pyx":156
6408  *     cdef Sint16 *vy
6409  *     cdef size_t num_points = len(points)
6410  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
6411  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6412  *     for n, pt in zip(range(num_points), points):
6413  */
6414   __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
6415 
6416   /* "pygame_sdl2/gfxdraw.pyx":157
6417  *     cdef size_t num_points = len(points)
6418  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6419  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
6420  *     for n, pt in zip(range(num_points), points):
6421  *         vx[n], vy[n] = points[n]
6422  */
6423   __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
6424 
6425   /* "pygame_sdl2/gfxdraw.pyx":158
6426  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6427  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6428  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
6429  *         vx[n], vy[n] = points[n]
6430  *     aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6431  */
6432   __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
6433   __Pyx_GOTREF(__pyx_t_1);
6434   __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6435   __Pyx_GOTREF(__pyx_t_3);
6436   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6437   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
6438   __Pyx_GOTREF(__pyx_t_1);
6439   __Pyx_GIVEREF(__pyx_t_3);
6440   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
6441   __Pyx_INCREF(__pyx_v_points);
6442   __Pyx_GIVEREF(__pyx_v_points);
6443   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points);
6444   __pyx_t_3 = 0;
6445   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6446   __Pyx_GOTREF(__pyx_t_3);
6447   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6448   if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
6449     __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6450     __pyx_t_4 = NULL;
6451   } else {
6452     __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
6453     __Pyx_GOTREF(__pyx_t_1);
6454     __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
6455   }
6456   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6457   for (;;) {
6458     if (likely(!__pyx_t_4)) {
6459       if (likely(PyList_CheckExact(__pyx_t_1))) {
6460         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
6461         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6462         __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
6463         #else
6464         __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6465         __Pyx_GOTREF(__pyx_t_3);
6466         #endif
6467       } else {
6468         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6469         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6470         __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
6471         #else
6472         __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6473         __Pyx_GOTREF(__pyx_t_3);
6474         #endif
6475       }
6476     } else {
6477       __pyx_t_3 = __pyx_t_4(__pyx_t_1);
6478       if (unlikely(!__pyx_t_3)) {
6479         PyObject* exc_type = PyErr_Occurred();
6480         if (exc_type) {
6481           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6482           else __PYX_ERR(0, 158, __pyx_L1_error)
6483         }
6484         break;
6485       }
6486       __Pyx_GOTREF(__pyx_t_3);
6487     }
6488     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6489       PyObject* sequence = __pyx_t_3;
6490       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6491       if (unlikely(size != 2)) {
6492         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6493         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6494         __PYX_ERR(0, 158, __pyx_L1_error)
6495       }
6496       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6497       if (likely(PyTuple_CheckExact(sequence))) {
6498         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
6499         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
6500       } else {
6501         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
6502         __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
6503       }
6504       __Pyx_INCREF(__pyx_t_5);
6505       __Pyx_INCREF(__pyx_t_6);
6506       #else
6507       __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
6508       __Pyx_GOTREF(__pyx_t_5);
6509       __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
6510       __Pyx_GOTREF(__pyx_t_6);
6511       #endif
6512       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6513     } else {
6514       Py_ssize_t index = -1;
6515       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
6516       __Pyx_GOTREF(__pyx_t_7);
6517       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6518       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
6519       index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
6520       __Pyx_GOTREF(__pyx_t_5);
6521       index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
6522       __Pyx_GOTREF(__pyx_t_6);
6523       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
6524       __pyx_t_8 = NULL;
6525       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6526       goto __pyx_L6_unpacking_done;
6527       __pyx_L5_unpacking_failed:;
6528       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6529       __pyx_t_8 = NULL;
6530       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6531       __PYX_ERR(0, 158, __pyx_L1_error)
6532       __pyx_L6_unpacking_done:;
6533     }
6534     __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
6535     __pyx_t_5 = 0;
6536     __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6);
6537     __pyx_t_6 = 0;
6538 
6539     /* "pygame_sdl2/gfxdraw.pyx":159
6540  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6541  *     for n, pt in zip(range(num_points), points):
6542  *         vx[n], vy[n] = points[n]             # <<<<<<<<<<<<<<
6543  *     aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6544  *     free(vx)
6545  */
6546     __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
6547     __Pyx_GOTREF(__pyx_t_3);
6548     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6549       PyObject* sequence = __pyx_t_3;
6550       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6551       if (unlikely(size != 2)) {
6552         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6553         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6554         __PYX_ERR(0, 159, __pyx_L1_error)
6555       }
6556       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6557       if (likely(PyTuple_CheckExact(sequence))) {
6558         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
6559         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
6560       } else {
6561         __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
6562         __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
6563       }
6564       __Pyx_INCREF(__pyx_t_6);
6565       __Pyx_INCREF(__pyx_t_5);
6566       #else
6567       __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
6568       __Pyx_GOTREF(__pyx_t_6);
6569       __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
6570       __Pyx_GOTREF(__pyx_t_5);
6571       #endif
6572       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6573     } else {
6574       Py_ssize_t index = -1;
6575       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
6576       __Pyx_GOTREF(__pyx_t_7);
6577       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6578       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
6579       index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
6580       __Pyx_GOTREF(__pyx_t_6);
6581       index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
6582       __Pyx_GOTREF(__pyx_t_5);
6583       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
6584       __pyx_t_8 = NULL;
6585       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6586       goto __pyx_L8_unpacking_done;
6587       __pyx_L7_unpacking_failed:;
6588       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6589       __pyx_t_8 = NULL;
6590       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6591       __PYX_ERR(0, 159, __pyx_L1_error)
6592       __pyx_L8_unpacking_done:;
6593     }
6594     __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
6595     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6596     __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
6597     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6598     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
6599     (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9;
6600     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
6601     (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10;
6602 
6603     /* "pygame_sdl2/gfxdraw.pyx":158
6604  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6605  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6606  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
6607  *         vx[n], vy[n] = points[n]
6608  *     aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6609  */
6610   }
6611   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6612 
6613   /* "pygame_sdl2/gfxdraw.pyx":160
6614  *     for n, pt in zip(range(num_points), points):
6615  *         vx[n], vy[n] = points[n]
6616  *     aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
6617  *     free(vx)
6618  *     free(vy)
6619  */
6620   (void)(aapolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
6621 
6622   /* "pygame_sdl2/gfxdraw.pyx":161
6623  *         vx[n], vy[n] = points[n]
6624  *     aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6625  *     free(vx)             # <<<<<<<<<<<<<<
6626  *     free(vy)
6627  *
6628  */
6629   free(__pyx_v_vx);
6630 
6631   /* "pygame_sdl2/gfxdraw.pyx":162
6632  *     aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6633  *     free(vx)
6634  *     free(vy)             # <<<<<<<<<<<<<<
6635  *
6636  * def filled_polygon(Surface surface, points, color):
6637  */
6638   free(__pyx_v_vy);
6639 
6640   /* "pygame_sdl2/gfxdraw.pyx":151
6641  *     free(vy)
6642  *
6643  * def aapolygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
6644  *     cdef Color c = Color(color)
6645  *     cdef Sint16 *vx
6646  */
6647 
6648   /* function exit code */
6649   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6650   goto __pyx_L0;
6651   __pyx_L1_error:;
6652   __Pyx_XDECREF(__pyx_t_1);
6653   __Pyx_XDECREF(__pyx_t_3);
6654   __Pyx_XDECREF(__pyx_t_5);
6655   __Pyx_XDECREF(__pyx_t_6);
6656   __Pyx_XDECREF(__pyx_t_7);
6657   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
6658   __pyx_r = NULL;
6659   __pyx_L0:;
6660   __Pyx_XDECREF((PyObject *)__pyx_v_c);
6661   __Pyx_XDECREF(__pyx_v_n);
6662   __Pyx_XDECREF(__pyx_v_pt);
6663   __Pyx_XGIVEREF(__pyx_r);
6664   __Pyx_RefNannyFinishContext();
6665   return __pyx_r;
6666 }
6667 
6668 /* "pygame_sdl2/gfxdraw.pyx":164
6669  *     free(vy)
6670  *
6671  * def filled_polygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
6672  *     cdef Color c = Color(color)
6673  *     cdef Sint16 *vx
6674  */
6675 
6676 /* Python wrapper */
6677 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6678 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon = {"filled_polygon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6679 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6680   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
6681   PyObject *__pyx_v_points = 0;
6682   PyObject *__pyx_v_color = 0;
6683   int __pyx_lineno = 0;
6684   const char *__pyx_filename = NULL;
6685   int __pyx_clineno = 0;
6686   PyObject *__pyx_r = 0;
6687   __Pyx_RefNannyDeclarations
6688   __Pyx_RefNannySetupContext("filled_polygon (wrapper)", 0);
6689   {
6690     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0};
6691     PyObject* values[3] = {0,0,0};
6692     if (unlikely(__pyx_kwds)) {
6693       Py_ssize_t kw_args;
6694       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6695       switch (pos_args) {
6696         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6697         CYTHON_FALLTHROUGH;
6698         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6699         CYTHON_FALLTHROUGH;
6700         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6701         CYTHON_FALLTHROUGH;
6702         case  0: break;
6703         default: goto __pyx_L5_argtuple_error;
6704       }
6705       kw_args = PyDict_Size(__pyx_kwds);
6706       switch (pos_args) {
6707         case  0:
6708         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
6709         else goto __pyx_L5_argtuple_error;
6710         CYTHON_FALLTHROUGH;
6711         case  1:
6712         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
6713         else {
6714           __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 1); __PYX_ERR(0, 164, __pyx_L3_error)
6715         }
6716         CYTHON_FALLTHROUGH;
6717         case  2:
6718         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
6719         else {
6720           __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 2); __PYX_ERR(0, 164, __pyx_L3_error)
6721         }
6722       }
6723       if (unlikely(kw_args > 0)) {
6724         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_polygon") < 0)) __PYX_ERR(0, 164, __pyx_L3_error)
6725       }
6726     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6727       goto __pyx_L5_argtuple_error;
6728     } else {
6729       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6730       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6731       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6732     }
6733     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
6734     __pyx_v_points = values[1];
6735     __pyx_v_color = values[2];
6736   }
6737   goto __pyx_L4_argument_unpacking_done;
6738   __pyx_L5_argtuple_error:;
6739   __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 164, __pyx_L3_error)
6740   __pyx_L3_error:;
6741   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
6742   __Pyx_RefNannyFinishContext();
6743   return NULL;
6744   __pyx_L4_argument_unpacking_done:;
6745   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 164, __pyx_L1_error)
6746   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color);
6747 
6748   /* function exit code */
6749   goto __pyx_L0;
6750   __pyx_L1_error:;
6751   __pyx_r = NULL;
6752   __pyx_L0:;
6753   __Pyx_RefNannyFinishContext();
6754   return __pyx_r;
6755 }
6756 
__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_points,PyObject * __pyx_v_color)6757 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) {
6758   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
6759   Sint16 *__pyx_v_vx;
6760   Sint16 *__pyx_v_vy;
6761   size_t __pyx_v_num_points;
6762   PyObject *__pyx_v_n = NULL;
6763   CYTHON_UNUSED PyObject *__pyx_v_pt = NULL;
6764   PyObject *__pyx_r = NULL;
6765   __Pyx_RefNannyDeclarations
6766   PyObject *__pyx_t_1 = NULL;
6767   Py_ssize_t __pyx_t_2;
6768   PyObject *__pyx_t_3 = NULL;
6769   PyObject *(*__pyx_t_4)(PyObject *);
6770   PyObject *__pyx_t_5 = NULL;
6771   PyObject *__pyx_t_6 = NULL;
6772   PyObject *__pyx_t_7 = NULL;
6773   PyObject *(*__pyx_t_8)(PyObject *);
6774   Sint16 __pyx_t_9;
6775   Sint16 __pyx_t_10;
6776   Py_ssize_t __pyx_t_11;
6777   int __pyx_lineno = 0;
6778   const char *__pyx_filename = NULL;
6779   int __pyx_clineno = 0;
6780   __Pyx_RefNannySetupContext("filled_polygon", 0);
6781 
6782   /* "pygame_sdl2/gfxdraw.pyx":165
6783  *
6784  * def filled_polygon(Surface surface, points, color):
6785  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
6786  *     cdef Sint16 *vx
6787  *     cdef Sint16 *vy
6788  */
6789   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
6790   __Pyx_GOTREF(__pyx_t_1);
6791   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
6792   __pyx_t_1 = 0;
6793 
6794   /* "pygame_sdl2/gfxdraw.pyx":168
6795  *     cdef Sint16 *vx
6796  *     cdef Sint16 *vy
6797  *     cdef size_t num_points = len(points)             # <<<<<<<<<<<<<<
6798  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6799  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6800  */
6801   __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 168, __pyx_L1_error)
6802   __pyx_v_num_points = __pyx_t_2;
6803 
6804   /* "pygame_sdl2/gfxdraw.pyx":169
6805  *     cdef Sint16 *vy
6806  *     cdef size_t num_points = len(points)
6807  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
6808  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6809  *     for n, pt in zip(range(num_points), points):
6810  */
6811   __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
6812 
6813   /* "pygame_sdl2/gfxdraw.pyx":170
6814  *     cdef size_t num_points = len(points)
6815  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6816  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
6817  *     for n, pt in zip(range(num_points), points):
6818  *         vx[n], vy[n] = points[n]
6819  */
6820   __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
6821 
6822   /* "pygame_sdl2/gfxdraw.pyx":171
6823  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
6824  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6825  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
6826  *         vx[n], vy[n] = points[n]
6827  *     filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6828  */
6829   __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
6830   __Pyx_GOTREF(__pyx_t_1);
6831   __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
6832   __Pyx_GOTREF(__pyx_t_3);
6833   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6834   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
6835   __Pyx_GOTREF(__pyx_t_1);
6836   __Pyx_GIVEREF(__pyx_t_3);
6837   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
6838   __Pyx_INCREF(__pyx_v_points);
6839   __Pyx_GIVEREF(__pyx_v_points);
6840   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points);
6841   __pyx_t_3 = 0;
6842   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
6843   __Pyx_GOTREF(__pyx_t_3);
6844   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6845   if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
6846     __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6847     __pyx_t_4 = NULL;
6848   } else {
6849     __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
6850     __Pyx_GOTREF(__pyx_t_1);
6851     __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
6852   }
6853   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6854   for (;;) {
6855     if (likely(!__pyx_t_4)) {
6856       if (likely(PyList_CheckExact(__pyx_t_1))) {
6857         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
6858         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6859         __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
6860         #else
6861         __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
6862         __Pyx_GOTREF(__pyx_t_3);
6863         #endif
6864       } else {
6865         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6866         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6867         __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
6868         #else
6869         __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
6870         __Pyx_GOTREF(__pyx_t_3);
6871         #endif
6872       }
6873     } else {
6874       __pyx_t_3 = __pyx_t_4(__pyx_t_1);
6875       if (unlikely(!__pyx_t_3)) {
6876         PyObject* exc_type = PyErr_Occurred();
6877         if (exc_type) {
6878           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6879           else __PYX_ERR(0, 171, __pyx_L1_error)
6880         }
6881         break;
6882       }
6883       __Pyx_GOTREF(__pyx_t_3);
6884     }
6885     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6886       PyObject* sequence = __pyx_t_3;
6887       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6888       if (unlikely(size != 2)) {
6889         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6890         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6891         __PYX_ERR(0, 171, __pyx_L1_error)
6892       }
6893       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6894       if (likely(PyTuple_CheckExact(sequence))) {
6895         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
6896         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
6897       } else {
6898         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
6899         __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
6900       }
6901       __Pyx_INCREF(__pyx_t_5);
6902       __Pyx_INCREF(__pyx_t_6);
6903       #else
6904       __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
6905       __Pyx_GOTREF(__pyx_t_5);
6906       __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
6907       __Pyx_GOTREF(__pyx_t_6);
6908       #endif
6909       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6910     } else {
6911       Py_ssize_t index = -1;
6912       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
6913       __Pyx_GOTREF(__pyx_t_7);
6914       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6915       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
6916       index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
6917       __Pyx_GOTREF(__pyx_t_5);
6918       index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
6919       __Pyx_GOTREF(__pyx_t_6);
6920       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
6921       __pyx_t_8 = NULL;
6922       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6923       goto __pyx_L6_unpacking_done;
6924       __pyx_L5_unpacking_failed:;
6925       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6926       __pyx_t_8 = NULL;
6927       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6928       __PYX_ERR(0, 171, __pyx_L1_error)
6929       __pyx_L6_unpacking_done:;
6930     }
6931     __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
6932     __pyx_t_5 = 0;
6933     __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6);
6934     __pyx_t_6 = 0;
6935 
6936     /* "pygame_sdl2/gfxdraw.pyx":172
6937  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
6938  *     for n, pt in zip(range(num_points), points):
6939  *         vx[n], vy[n] = points[n]             # <<<<<<<<<<<<<<
6940  *     filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
6941  *     free(vx)
6942  */
6943     __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
6944     __Pyx_GOTREF(__pyx_t_3);
6945     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6946       PyObject* sequence = __pyx_t_3;
6947       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6948       if (unlikely(size != 2)) {
6949         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6950         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6951         __PYX_ERR(0, 172, __pyx_L1_error)
6952       }
6953       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6954       if (likely(PyTuple_CheckExact(sequence))) {
6955         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
6956         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
6957       } else {
6958         __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
6959         __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
6960       }
6961       __Pyx_INCREF(__pyx_t_6);
6962       __Pyx_INCREF(__pyx_t_5);
6963       #else
6964       __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
6965       __Pyx_GOTREF(__pyx_t_6);
6966       __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
6967       __Pyx_GOTREF(__pyx_t_5);
6968       #endif
6969       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6970     } else {
6971       Py_ssize_t index = -1;
6972       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
6973       __Pyx_GOTREF(__pyx_t_7);
6974       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6975       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
6976       index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
6977       __Pyx_GOTREF(__pyx_t_6);
6978       index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
6979       __Pyx_GOTREF(__pyx_t_5);
6980       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
6981       __pyx_t_8 = NULL;
6982       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6983       goto __pyx_L8_unpacking_done;
6984       __pyx_L7_unpacking_failed:;
6985       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6986       __pyx_t_8 = NULL;
6987       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6988       __PYX_ERR(0, 172, __pyx_L1_error)
6989       __pyx_L8_unpacking_done:;
6990     }
6991     __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
6992     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6993     __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
6994     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6995     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
6996     (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9;
6997     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
6998     (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10;
6999 
7000     /* "pygame_sdl2/gfxdraw.pyx":171
7001  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7002  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7003  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
7004  *         vx[n], vy[n] = points[n]
7005  *     filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
7006  */
7007   }
7008   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7009 
7010   /* "pygame_sdl2/gfxdraw.pyx":173
7011  *     for n, pt in zip(range(num_points), points):
7012  *         vx[n], vy[n] = points[n]
7013  *     filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
7014  *     free(vx)
7015  *     free(vy)
7016  */
7017   (void)(filledPolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
7018 
7019   /* "pygame_sdl2/gfxdraw.pyx":174
7020  *         vx[n], vy[n] = points[n]
7021  *     filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
7022  *     free(vx)             # <<<<<<<<<<<<<<
7023  *     free(vy)
7024  *
7025  */
7026   free(__pyx_v_vx);
7027 
7028   /* "pygame_sdl2/gfxdraw.pyx":175
7029  *     filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
7030  *     free(vx)
7031  *     free(vy)             # <<<<<<<<<<<<<<
7032  *
7033  * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty):
7034  */
7035   free(__pyx_v_vy);
7036 
7037   /* "pygame_sdl2/gfxdraw.pyx":164
7038  *     free(vy)
7039  *
7040  * def filled_polygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
7041  *     cdef Color c = Color(color)
7042  *     cdef Sint16 *vx
7043  */
7044 
7045   /* function exit code */
7046   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7047   goto __pyx_L0;
7048   __pyx_L1_error:;
7049   __Pyx_XDECREF(__pyx_t_1);
7050   __Pyx_XDECREF(__pyx_t_3);
7051   __Pyx_XDECREF(__pyx_t_5);
7052   __Pyx_XDECREF(__pyx_t_6);
7053   __Pyx_XDECREF(__pyx_t_7);
7054   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
7055   __pyx_r = NULL;
7056   __pyx_L0:;
7057   __Pyx_XDECREF((PyObject *)__pyx_v_c);
7058   __Pyx_XDECREF(__pyx_v_n);
7059   __Pyx_XDECREF(__pyx_v_pt);
7060   __Pyx_XGIVEREF(__pyx_r);
7061   __Pyx_RefNannyFinishContext();
7062   return __pyx_r;
7063 }
7064 
7065 /* "pygame_sdl2/gfxdraw.pyx":177
7066  *     free(vy)
7067  *
7068  * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty):             # <<<<<<<<<<<<<<
7069  *     cdef Sint16 *vx
7070  *     cdef Sint16 *vy
7071  */
7072 
7073 /* Python wrapper */
7074 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7075 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon = {"textured_polygon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7076 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7077   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
7078   PyObject *__pyx_v_points = 0;
7079   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture = 0;
7080   PyObject *__pyx_v_tx = 0;
7081   PyObject *__pyx_v_ty = 0;
7082   int __pyx_lineno = 0;
7083   const char *__pyx_filename = NULL;
7084   int __pyx_clineno = 0;
7085   PyObject *__pyx_r = 0;
7086   __Pyx_RefNannyDeclarations
7087   __Pyx_RefNannySetupContext("textured_polygon (wrapper)", 0);
7088   {
7089     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_texture,&__pyx_n_s_tx,&__pyx_n_s_ty,0};
7090     PyObject* values[5] = {0,0,0,0,0};
7091     if (unlikely(__pyx_kwds)) {
7092       Py_ssize_t kw_args;
7093       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7094       switch (pos_args) {
7095         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7096         CYTHON_FALLTHROUGH;
7097         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7098         CYTHON_FALLTHROUGH;
7099         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7100         CYTHON_FALLTHROUGH;
7101         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7102         CYTHON_FALLTHROUGH;
7103         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7104         CYTHON_FALLTHROUGH;
7105         case  0: break;
7106         default: goto __pyx_L5_argtuple_error;
7107       }
7108       kw_args = PyDict_Size(__pyx_kwds);
7109       switch (pos_args) {
7110         case  0:
7111         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
7112         else goto __pyx_L5_argtuple_error;
7113         CYTHON_FALLTHROUGH;
7114         case  1:
7115         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
7116         else {
7117           __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 1); __PYX_ERR(0, 177, __pyx_L3_error)
7118         }
7119         CYTHON_FALLTHROUGH;
7120         case  2:
7121         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_texture)) != 0)) kw_args--;
7122         else {
7123           __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 2); __PYX_ERR(0, 177, __pyx_L3_error)
7124         }
7125         CYTHON_FALLTHROUGH;
7126         case  3:
7127         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tx)) != 0)) kw_args--;
7128         else {
7129           __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 3); __PYX_ERR(0, 177, __pyx_L3_error)
7130         }
7131         CYTHON_FALLTHROUGH;
7132         case  4:
7133         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ty)) != 0)) kw_args--;
7134         else {
7135           __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 4); __PYX_ERR(0, 177, __pyx_L3_error)
7136         }
7137       }
7138       if (unlikely(kw_args > 0)) {
7139         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "textured_polygon") < 0)) __PYX_ERR(0, 177, __pyx_L3_error)
7140       }
7141     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
7142       goto __pyx_L5_argtuple_error;
7143     } else {
7144       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7145       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7146       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7147       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7148       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7149     }
7150     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
7151     __pyx_v_points = values[1];
7152     __pyx_v_texture = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]);
7153     __pyx_v_tx = values[3];
7154     __pyx_v_ty = values[4];
7155   }
7156   goto __pyx_L4_argument_unpacking_done;
7157   __pyx_L5_argtuple_error:;
7158   __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error)
7159   __pyx_L3_error:;
7160   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
7161   __Pyx_RefNannyFinishContext();
7162   return NULL;
7163   __pyx_L4_argument_unpacking_done:;
7164   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 177, __pyx_L1_error)
7165   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_texture), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "texture", 0))) __PYX_ERR(0, 177, __pyx_L1_error)
7166   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_texture, __pyx_v_tx, __pyx_v_ty);
7167 
7168   /* function exit code */
7169   goto __pyx_L0;
7170   __pyx_L1_error:;
7171   __pyx_r = NULL;
7172   __pyx_L0:;
7173   __Pyx_RefNannyFinishContext();
7174   return __pyx_r;
7175 }
7176 
__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_points,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_texture,PyObject * __pyx_v_tx,PyObject * __pyx_v_ty)7177 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty) {
7178   Sint16 *__pyx_v_vx;
7179   Sint16 *__pyx_v_vy;
7180   size_t __pyx_v_num_points;
7181   PyObject *__pyx_v_n = NULL;
7182   CYTHON_UNUSED PyObject *__pyx_v_pt = NULL;
7183   PyObject *__pyx_r = NULL;
7184   __Pyx_RefNannyDeclarations
7185   Py_ssize_t __pyx_t_1;
7186   PyObject *__pyx_t_2 = NULL;
7187   PyObject *__pyx_t_3 = NULL;
7188   PyObject *(*__pyx_t_4)(PyObject *);
7189   PyObject *__pyx_t_5 = NULL;
7190   PyObject *__pyx_t_6 = NULL;
7191   PyObject *__pyx_t_7 = NULL;
7192   PyObject *(*__pyx_t_8)(PyObject *);
7193   Sint16 __pyx_t_9;
7194   Sint16 __pyx_t_10;
7195   Py_ssize_t __pyx_t_11;
7196   int __pyx_t_12;
7197   int __pyx_t_13;
7198   int __pyx_lineno = 0;
7199   const char *__pyx_filename = NULL;
7200   int __pyx_clineno = 0;
7201   __Pyx_RefNannySetupContext("textured_polygon", 0);
7202 
7203   /* "pygame_sdl2/gfxdraw.pyx":180
7204  *     cdef Sint16 *vx
7205  *     cdef Sint16 *vy
7206  *     cdef size_t num_points = len(points)             # <<<<<<<<<<<<<<
7207  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7208  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7209  */
7210   __pyx_t_1 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 180, __pyx_L1_error)
7211   __pyx_v_num_points = __pyx_t_1;
7212 
7213   /* "pygame_sdl2/gfxdraw.pyx":181
7214  *     cdef Sint16 *vy
7215  *     cdef size_t num_points = len(points)
7216  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
7217  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7218  *     for n, pt in zip(range(num_points), points):
7219  */
7220   __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
7221 
7222   /* "pygame_sdl2/gfxdraw.pyx":182
7223  *     cdef size_t num_points = len(points)
7224  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7225  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
7226  *     for n, pt in zip(range(num_points), points):
7227  *         vx[n], vy[n] = points[n]
7228  */
7229   __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
7230 
7231   /* "pygame_sdl2/gfxdraw.pyx":183
7232  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7233  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7234  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
7235  *         vx[n], vy[n] = points[n]
7236  *     texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty)
7237  */
7238   __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7239   __Pyx_GOTREF(__pyx_t_2);
7240   __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7241   __Pyx_GOTREF(__pyx_t_3);
7242   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7243   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7244   __Pyx_GOTREF(__pyx_t_2);
7245   __Pyx_GIVEREF(__pyx_t_3);
7246   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
7247   __Pyx_INCREF(__pyx_v_points);
7248   __Pyx_GIVEREF(__pyx_v_points);
7249   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_points);
7250   __pyx_t_3 = 0;
7251   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7252   __Pyx_GOTREF(__pyx_t_3);
7253   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7254   if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
7255     __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
7256     __pyx_t_4 = NULL;
7257   } else {
7258     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7259     __Pyx_GOTREF(__pyx_t_2);
7260     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
7261   }
7262   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7263   for (;;) {
7264     if (likely(!__pyx_t_4)) {
7265       if (likely(PyList_CheckExact(__pyx_t_2))) {
7266         if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
7267         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7268         __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
7269         #else
7270         __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7271         __Pyx_GOTREF(__pyx_t_3);
7272         #endif
7273       } else {
7274         if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
7275         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7276         __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
7277         #else
7278         __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7279         __Pyx_GOTREF(__pyx_t_3);
7280         #endif
7281       }
7282     } else {
7283       __pyx_t_3 = __pyx_t_4(__pyx_t_2);
7284       if (unlikely(!__pyx_t_3)) {
7285         PyObject* exc_type = PyErr_Occurred();
7286         if (exc_type) {
7287           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7288           else __PYX_ERR(0, 183, __pyx_L1_error)
7289         }
7290         break;
7291       }
7292       __Pyx_GOTREF(__pyx_t_3);
7293     }
7294     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7295       PyObject* sequence = __pyx_t_3;
7296       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7297       if (unlikely(size != 2)) {
7298         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7299         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7300         __PYX_ERR(0, 183, __pyx_L1_error)
7301       }
7302       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7303       if (likely(PyTuple_CheckExact(sequence))) {
7304         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
7305         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
7306       } else {
7307         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
7308         __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
7309       }
7310       __Pyx_INCREF(__pyx_t_5);
7311       __Pyx_INCREF(__pyx_t_6);
7312       #else
7313       __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error)
7314       __Pyx_GOTREF(__pyx_t_5);
7315       __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error)
7316       __Pyx_GOTREF(__pyx_t_6);
7317       #endif
7318       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7319     } else {
7320       Py_ssize_t index = -1;
7321       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error)
7322       __Pyx_GOTREF(__pyx_t_7);
7323       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7324       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
7325       index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
7326       __Pyx_GOTREF(__pyx_t_5);
7327       index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
7328       __Pyx_GOTREF(__pyx_t_6);
7329       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
7330       __pyx_t_8 = NULL;
7331       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7332       goto __pyx_L6_unpacking_done;
7333       __pyx_L5_unpacking_failed:;
7334       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7335       __pyx_t_8 = NULL;
7336       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7337       __PYX_ERR(0, 183, __pyx_L1_error)
7338       __pyx_L6_unpacking_done:;
7339     }
7340     __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
7341     __pyx_t_5 = 0;
7342     __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6);
7343     __pyx_t_6 = 0;
7344 
7345     /* "pygame_sdl2/gfxdraw.pyx":184
7346  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7347  *     for n, pt in zip(range(num_points), points):
7348  *         vx[n], vy[n] = points[n]             # <<<<<<<<<<<<<<
7349  *     texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty)
7350  *     free(vx)
7351  */
7352     __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
7353     __Pyx_GOTREF(__pyx_t_3);
7354     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7355       PyObject* sequence = __pyx_t_3;
7356       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7357       if (unlikely(size != 2)) {
7358         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7359         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7360         __PYX_ERR(0, 184, __pyx_L1_error)
7361       }
7362       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7363       if (likely(PyTuple_CheckExact(sequence))) {
7364         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
7365         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
7366       } else {
7367         __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
7368         __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
7369       }
7370       __Pyx_INCREF(__pyx_t_6);
7371       __Pyx_INCREF(__pyx_t_5);
7372       #else
7373       __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
7374       __Pyx_GOTREF(__pyx_t_6);
7375       __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
7376       __Pyx_GOTREF(__pyx_t_5);
7377       #endif
7378       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7379     } else {
7380       Py_ssize_t index = -1;
7381       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
7382       __Pyx_GOTREF(__pyx_t_7);
7383       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7384       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
7385       index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
7386       __Pyx_GOTREF(__pyx_t_6);
7387       index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
7388       __Pyx_GOTREF(__pyx_t_5);
7389       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
7390       __pyx_t_8 = NULL;
7391       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7392       goto __pyx_L8_unpacking_done;
7393       __pyx_L7_unpacking_failed:;
7394       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7395       __pyx_t_8 = NULL;
7396       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7397       __PYX_ERR(0, 184, __pyx_L1_error)
7398       __pyx_L8_unpacking_done:;
7399     }
7400     __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
7401     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7402     __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
7403     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7404     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
7405     (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9;
7406     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
7407     (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10;
7408 
7409     /* "pygame_sdl2/gfxdraw.pyx":183
7410  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7411  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7412  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
7413  *         vx[n], vy[n] = points[n]
7414  *     texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty)
7415  */
7416   }
7417   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7418 
7419   /* "pygame_sdl2/gfxdraw.pyx":185
7420  *     for n, pt in zip(range(num_points), points):
7421  *         vx[n], vy[n] = points[n]
7422  *     texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty)             # <<<<<<<<<<<<<<
7423  *     free(vx)
7424  *     free(vy)
7425  */
7426   __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_tx); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
7427   __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ty); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
7428   (void)(texturedPolygon(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_texture->surface, __pyx_t_12, __pyx_t_13));
7429 
7430   /* "pygame_sdl2/gfxdraw.pyx":186
7431  *         vx[n], vy[n] = points[n]
7432  *     texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty)
7433  *     free(vx)             # <<<<<<<<<<<<<<
7434  *     free(vy)
7435  *
7436  */
7437   free(__pyx_v_vx);
7438 
7439   /* "pygame_sdl2/gfxdraw.pyx":187
7440  *     texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty)
7441  *     free(vx)
7442  *     free(vy)             # <<<<<<<<<<<<<<
7443  *
7444  * def bezier(Surface surface, points, steps, color):
7445  */
7446   free(__pyx_v_vy);
7447 
7448   /* "pygame_sdl2/gfxdraw.pyx":177
7449  *     free(vy)
7450  *
7451  * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty):             # <<<<<<<<<<<<<<
7452  *     cdef Sint16 *vx
7453  *     cdef Sint16 *vy
7454  */
7455 
7456   /* function exit code */
7457   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7458   goto __pyx_L0;
7459   __pyx_L1_error:;
7460   __Pyx_XDECREF(__pyx_t_2);
7461   __Pyx_XDECREF(__pyx_t_3);
7462   __Pyx_XDECREF(__pyx_t_5);
7463   __Pyx_XDECREF(__pyx_t_6);
7464   __Pyx_XDECREF(__pyx_t_7);
7465   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
7466   __pyx_r = NULL;
7467   __pyx_L0:;
7468   __Pyx_XDECREF(__pyx_v_n);
7469   __Pyx_XDECREF(__pyx_v_pt);
7470   __Pyx_XGIVEREF(__pyx_r);
7471   __Pyx_RefNannyFinishContext();
7472   return __pyx_r;
7473 }
7474 
7475 /* "pygame_sdl2/gfxdraw.pyx":189
7476  *     free(vy)
7477  *
7478  * def bezier(Surface surface, points, steps, color):             # <<<<<<<<<<<<<<
7479  *     cdef Color c = Color(color)
7480  *     cdef Sint16 *vx
7481  */
7482 
7483 /* Python wrapper */
7484 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7485 static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier = {"bezier", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7486 static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7487   struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0;
7488   PyObject *__pyx_v_points = 0;
7489   PyObject *__pyx_v_steps = 0;
7490   PyObject *__pyx_v_color = 0;
7491   int __pyx_lineno = 0;
7492   const char *__pyx_filename = NULL;
7493   int __pyx_clineno = 0;
7494   PyObject *__pyx_r = 0;
7495   __Pyx_RefNannyDeclarations
7496   __Pyx_RefNannySetupContext("bezier (wrapper)", 0);
7497   {
7498     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_steps,&__pyx_n_s_color,0};
7499     PyObject* values[4] = {0,0,0,0};
7500     if (unlikely(__pyx_kwds)) {
7501       Py_ssize_t kw_args;
7502       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7503       switch (pos_args) {
7504         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7505         CYTHON_FALLTHROUGH;
7506         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7507         CYTHON_FALLTHROUGH;
7508         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7509         CYTHON_FALLTHROUGH;
7510         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7511         CYTHON_FALLTHROUGH;
7512         case  0: break;
7513         default: goto __pyx_L5_argtuple_error;
7514       }
7515       kw_args = PyDict_Size(__pyx_kwds);
7516       switch (pos_args) {
7517         case  0:
7518         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
7519         else goto __pyx_L5_argtuple_error;
7520         CYTHON_FALLTHROUGH;
7521         case  1:
7522         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
7523         else {
7524           __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 1); __PYX_ERR(0, 189, __pyx_L3_error)
7525         }
7526         CYTHON_FALLTHROUGH;
7527         case  2:
7528         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_steps)) != 0)) kw_args--;
7529         else {
7530           __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 2); __PYX_ERR(0, 189, __pyx_L3_error)
7531         }
7532         CYTHON_FALLTHROUGH;
7533         case  3:
7534         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
7535         else {
7536           __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 3); __PYX_ERR(0, 189, __pyx_L3_error)
7537         }
7538       }
7539       if (unlikely(kw_args > 0)) {
7540         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bezier") < 0)) __PYX_ERR(0, 189, __pyx_L3_error)
7541       }
7542     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
7543       goto __pyx_L5_argtuple_error;
7544     } else {
7545       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7546       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7547       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7548       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7549     }
7550     __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]);
7551     __pyx_v_points = values[1];
7552     __pyx_v_steps = values[2];
7553     __pyx_v_color = values[3];
7554   }
7555   goto __pyx_L4_argument_unpacking_done;
7556   __pyx_L5_argtuple_error:;
7557   __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 189, __pyx_L3_error)
7558   __pyx_L3_error:;
7559   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename);
7560   __Pyx_RefNannyFinishContext();
7561   return NULL;
7562   __pyx_L4_argument_unpacking_done:;
7563   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 189, __pyx_L1_error)
7564   __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_steps, __pyx_v_color);
7565 
7566   /* function exit code */
7567   goto __pyx_L0;
7568   __pyx_L1_error:;
7569   __pyx_r = NULL;
7570   __pyx_L0:;
7571   __Pyx_RefNannyFinishContext();
7572   return __pyx_r;
7573 }
7574 
__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_11pygame_sdl2_7surface_Surface * __pyx_v_surface,PyObject * __pyx_v_points,PyObject * __pyx_v_steps,PyObject * __pyx_v_color)7575 static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color) {
7576   struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0;
7577   Sint16 *__pyx_v_vx;
7578   Sint16 *__pyx_v_vy;
7579   size_t __pyx_v_num_points;
7580   PyObject *__pyx_v_n = NULL;
7581   CYTHON_UNUSED PyObject *__pyx_v_pt = NULL;
7582   PyObject *__pyx_r = NULL;
7583   __Pyx_RefNannyDeclarations
7584   PyObject *__pyx_t_1 = NULL;
7585   Py_ssize_t __pyx_t_2;
7586   PyObject *__pyx_t_3 = NULL;
7587   PyObject *(*__pyx_t_4)(PyObject *);
7588   PyObject *__pyx_t_5 = NULL;
7589   PyObject *__pyx_t_6 = NULL;
7590   PyObject *__pyx_t_7 = NULL;
7591   PyObject *(*__pyx_t_8)(PyObject *);
7592   Sint16 __pyx_t_9;
7593   Sint16 __pyx_t_10;
7594   Py_ssize_t __pyx_t_11;
7595   int __pyx_t_12;
7596   int __pyx_lineno = 0;
7597   const char *__pyx_filename = NULL;
7598   int __pyx_clineno = 0;
7599   __Pyx_RefNannySetupContext("bezier", 0);
7600 
7601   /* "pygame_sdl2/gfxdraw.pyx":190
7602  *
7603  * def bezier(Surface surface, points, steps, color):
7604  *     cdef Color c = Color(color)             # <<<<<<<<<<<<<<
7605  *     cdef Sint16 *vx
7606  *     cdef Sint16 *vy
7607  */
7608   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
7609   __Pyx_GOTREF(__pyx_t_1);
7610   __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
7611   __pyx_t_1 = 0;
7612 
7613   /* "pygame_sdl2/gfxdraw.pyx":193
7614  *     cdef Sint16 *vx
7615  *     cdef Sint16 *vy
7616  *     cdef size_t num_points = len(points)             # <<<<<<<<<<<<<<
7617  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7618  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7619  */
7620   __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
7621   __pyx_v_num_points = __pyx_t_2;
7622 
7623   /* "pygame_sdl2/gfxdraw.pyx":194
7624  *     cdef Sint16 *vy
7625  *     cdef size_t num_points = len(points)
7626  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
7627  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7628  *     for n, pt in zip(range(num_points), points):
7629  */
7630   __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
7631 
7632   /* "pygame_sdl2/gfxdraw.pyx":195
7633  *     cdef size_t num_points = len(points)
7634  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7635  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))             # <<<<<<<<<<<<<<
7636  *     for n, pt in zip(range(num_points), points):
7637  *         vx[n], vy[n] = points[n]
7638  */
7639   __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16)))));
7640 
7641   /* "pygame_sdl2/gfxdraw.pyx":196
7642  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7643  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7644  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
7645  *         vx[n], vy[n] = points[n]
7646  *     bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a)
7647  */
7648   __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
7649   __Pyx_GOTREF(__pyx_t_1);
7650   __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
7651   __Pyx_GOTREF(__pyx_t_3);
7652   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7653   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
7654   __Pyx_GOTREF(__pyx_t_1);
7655   __Pyx_GIVEREF(__pyx_t_3);
7656   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
7657   __Pyx_INCREF(__pyx_v_points);
7658   __Pyx_GIVEREF(__pyx_v_points);
7659   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points);
7660   __pyx_t_3 = 0;
7661   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
7662   __Pyx_GOTREF(__pyx_t_3);
7663   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7664   if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
7665     __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7666     __pyx_t_4 = NULL;
7667   } else {
7668     __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
7669     __Pyx_GOTREF(__pyx_t_1);
7670     __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
7671   }
7672   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7673   for (;;) {
7674     if (likely(!__pyx_t_4)) {
7675       if (likely(PyList_CheckExact(__pyx_t_1))) {
7676         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
7677         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7678         __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
7679         #else
7680         __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
7681         __Pyx_GOTREF(__pyx_t_3);
7682         #endif
7683       } else {
7684         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7685         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7686         __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
7687         #else
7688         __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
7689         __Pyx_GOTREF(__pyx_t_3);
7690         #endif
7691       }
7692     } else {
7693       __pyx_t_3 = __pyx_t_4(__pyx_t_1);
7694       if (unlikely(!__pyx_t_3)) {
7695         PyObject* exc_type = PyErr_Occurred();
7696         if (exc_type) {
7697           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7698           else __PYX_ERR(0, 196, __pyx_L1_error)
7699         }
7700         break;
7701       }
7702       __Pyx_GOTREF(__pyx_t_3);
7703     }
7704     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7705       PyObject* sequence = __pyx_t_3;
7706       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7707       if (unlikely(size != 2)) {
7708         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7709         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7710         __PYX_ERR(0, 196, __pyx_L1_error)
7711       }
7712       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7713       if (likely(PyTuple_CheckExact(sequence))) {
7714         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
7715         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
7716       } else {
7717         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
7718         __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
7719       }
7720       __Pyx_INCREF(__pyx_t_5);
7721       __Pyx_INCREF(__pyx_t_6);
7722       #else
7723       __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error)
7724       __Pyx_GOTREF(__pyx_t_5);
7725       __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
7726       __Pyx_GOTREF(__pyx_t_6);
7727       #endif
7728       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7729     } else {
7730       Py_ssize_t index = -1;
7731       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
7732       __Pyx_GOTREF(__pyx_t_7);
7733       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7734       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
7735       index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
7736       __Pyx_GOTREF(__pyx_t_5);
7737       index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
7738       __Pyx_GOTREF(__pyx_t_6);
7739       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
7740       __pyx_t_8 = NULL;
7741       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7742       goto __pyx_L6_unpacking_done;
7743       __pyx_L5_unpacking_failed:;
7744       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7745       __pyx_t_8 = NULL;
7746       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7747       __PYX_ERR(0, 196, __pyx_L1_error)
7748       __pyx_L6_unpacking_done:;
7749     }
7750     __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
7751     __pyx_t_5 = 0;
7752     __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6);
7753     __pyx_t_6 = 0;
7754 
7755     /* "pygame_sdl2/gfxdraw.pyx":197
7756  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7757  *     for n, pt in zip(range(num_points), points):
7758  *         vx[n], vy[n] = points[n]             # <<<<<<<<<<<<<<
7759  *     bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a)
7760  *     free(vx)
7761  */
7762     __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
7763     __Pyx_GOTREF(__pyx_t_3);
7764     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7765       PyObject* sequence = __pyx_t_3;
7766       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7767       if (unlikely(size != 2)) {
7768         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7769         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7770         __PYX_ERR(0, 197, __pyx_L1_error)
7771       }
7772       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7773       if (likely(PyTuple_CheckExact(sequence))) {
7774         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
7775         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
7776       } else {
7777         __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
7778         __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
7779       }
7780       __Pyx_INCREF(__pyx_t_6);
7781       __Pyx_INCREF(__pyx_t_5);
7782       #else
7783       __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
7784       __Pyx_GOTREF(__pyx_t_6);
7785       __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error)
7786       __Pyx_GOTREF(__pyx_t_5);
7787       #endif
7788       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7789     } else {
7790       Py_ssize_t index = -1;
7791       __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
7792       __Pyx_GOTREF(__pyx_t_7);
7793       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7794       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
7795       index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
7796       __Pyx_GOTREF(__pyx_t_6);
7797       index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
7798       __Pyx_GOTREF(__pyx_t_5);
7799       if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
7800       __pyx_t_8 = NULL;
7801       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7802       goto __pyx_L8_unpacking_done;
7803       __pyx_L7_unpacking_failed:;
7804       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7805       __pyx_t_8 = NULL;
7806       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7807       __PYX_ERR(0, 197, __pyx_L1_error)
7808       __pyx_L8_unpacking_done:;
7809     }
7810     __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error)
7811     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7812     __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error)
7813     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7814     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error)
7815     (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9;
7816     __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error)
7817     (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10;
7818 
7819     /* "pygame_sdl2/gfxdraw.pyx":196
7820  *     vx = <Sint16*>malloc(num_points * sizeof(Sint16))
7821  *     vy = <Sint16*>malloc(num_points * sizeof(Sint16))
7822  *     for n, pt in zip(range(num_points), points):             # <<<<<<<<<<<<<<
7823  *         vx[n], vy[n] = points[n]
7824  *     bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a)
7825  */
7826   }
7827   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7828 
7829   /* "pygame_sdl2/gfxdraw.pyx":198
7830  *     for n, pt in zip(range(num_points), points):
7831  *         vx[n], vy[n] = points[n]
7832  *     bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a)             # <<<<<<<<<<<<<<
7833  *     free(vx)
7834  *     free(vy)
7835  */
7836   __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_steps); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error)
7837   (void)(bezierRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_t_12, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
7838 
7839   /* "pygame_sdl2/gfxdraw.pyx":199
7840  *         vx[n], vy[n] = points[n]
7841  *     bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a)
7842  *     free(vx)             # <<<<<<<<<<<<<<
7843  *     free(vy)
7844  */
7845   free(__pyx_v_vx);
7846 
7847   /* "pygame_sdl2/gfxdraw.pyx":200
7848  *     bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a)
7849  *     free(vx)
7850  *     free(vy)             # <<<<<<<<<<<<<<
7851  */
7852   free(__pyx_v_vy);
7853 
7854   /* "pygame_sdl2/gfxdraw.pyx":189
7855  *     free(vy)
7856  *
7857  * def bezier(Surface surface, points, steps, color):             # <<<<<<<<<<<<<<
7858  *     cdef Color c = Color(color)
7859  *     cdef Sint16 *vx
7860  */
7861 
7862   /* function exit code */
7863   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7864   goto __pyx_L0;
7865   __pyx_L1_error:;
7866   __Pyx_XDECREF(__pyx_t_1);
7867   __Pyx_XDECREF(__pyx_t_3);
7868   __Pyx_XDECREF(__pyx_t_5);
7869   __Pyx_XDECREF(__pyx_t_6);
7870   __Pyx_XDECREF(__pyx_t_7);
7871   __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename);
7872   __pyx_r = NULL;
7873   __pyx_L0:;
7874   __Pyx_XDECREF((PyObject *)__pyx_v_c);
7875   __Pyx_XDECREF(__pyx_v_n);
7876   __Pyx_XDECREF(__pyx_v_pt);
7877   __Pyx_XGIVEREF(__pyx_r);
7878   __Pyx_RefNannyFinishContext();
7879   return __pyx_r;
7880 }
7881 
7882 static PyMethodDef __pyx_methods[] = {
7883   {0, 0, 0, 0}
7884 };
7885 
7886 #if PY_MAJOR_VERSION >= 3
7887 #if CYTHON_PEP489_MULTI_PHASE_INIT
7888 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
7889 static int __pyx_pymod_exec_gfxdraw(PyObject* module); /*proto*/
7890 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
7891   {Py_mod_create, (void*)__pyx_pymod_create},
7892   {Py_mod_exec, (void*)__pyx_pymod_exec_gfxdraw},
7893   {0, NULL}
7894 };
7895 #endif
7896 
7897 static struct PyModuleDef __pyx_moduledef = {
7898     PyModuleDef_HEAD_INIT,
7899     "pygame_sdl2.gfxdraw",
7900     0, /* m_doc */
7901   #if CYTHON_PEP489_MULTI_PHASE_INIT
7902     0, /* m_size */
7903   #else
7904     -1, /* m_size */
7905   #endif
7906     __pyx_methods /* m_methods */,
7907   #if CYTHON_PEP489_MULTI_PHASE_INIT
7908     __pyx_moduledef_slots, /* m_slots */
7909   #else
7910     NULL, /* m_reload */
7911   #endif
7912     NULL, /* m_traverse */
7913     NULL, /* m_clear */
7914     NULL /* m_free */
7915 };
7916 #endif
7917 #ifndef CYTHON_SMALL_CODE
7918 #if defined(__clang__)
7919     #define CYTHON_SMALL_CODE
7920 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
7921     #define CYTHON_SMALL_CODE __attribute__((cold))
7922 #else
7923     #define CYTHON_SMALL_CODE
7924 #endif
7925 #endif
7926 
7927 static __Pyx_StringTabEntry __pyx_string_tab[] = {
7928   {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1},
7929   {&__pyx_n_s_aacircle, __pyx_k_aacircle, sizeof(__pyx_k_aacircle), 0, 0, 1, 1},
7930   {&__pyx_n_s_aaellipse, __pyx_k_aaellipse, sizeof(__pyx_k_aaellipse), 0, 0, 1, 1},
7931   {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1},
7932   {&__pyx_n_s_aapolygon, __pyx_k_aapolygon, sizeof(__pyx_k_aapolygon), 0, 0, 1, 1},
7933   {&__pyx_n_s_aatrigon, __pyx_k_aatrigon, sizeof(__pyx_k_aatrigon), 0, 0, 1, 1},
7934   {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1},
7935   {&__pyx_n_s_bezier, __pyx_k_bezier, sizeof(__pyx_k_bezier), 0, 0, 1, 1},
7936   {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1},
7937   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
7938   {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1},
7939   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
7940   {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
7941   {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1},
7942   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
7943   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
7944   {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1},
7945   {&__pyx_n_s_filled_ellipse, __pyx_k_filled_ellipse, sizeof(__pyx_k_filled_ellipse), 0, 0, 1, 1},
7946   {&__pyx_n_s_filled_pie, __pyx_k_filled_pie, sizeof(__pyx_k_filled_pie), 0, 0, 1, 1},
7947   {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1},
7948   {&__pyx_n_s_filled_trigon, __pyx_k_filled_trigon, sizeof(__pyx_k_filled_trigon), 0, 0, 1, 1},
7949   {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
7950   {&__pyx_n_s_hline, __pyx_k_hline, sizeof(__pyx_k_hline), 0, 0, 1, 1},
7951   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
7952   {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
7953   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
7954   {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
7955   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
7956   {&__pyx_n_s_num_points, __pyx_k_num_points, sizeof(__pyx_k_num_points), 0, 0, 1, 1},
7957   {&__pyx_n_s_pie, __pyx_k_pie, sizeof(__pyx_k_pie), 0, 0, 1, 1},
7958   {&__pyx_n_s_pixel, __pyx_k_pixel, sizeof(__pyx_k_pixel), 0, 0, 1, 1},
7959   {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1},
7960   {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1},
7961   {&__pyx_n_s_pt, __pyx_k_pt, sizeof(__pyx_k_pt), 0, 0, 1, 1},
7962   {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1},
7963   {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1},
7964   {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1},
7965   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
7966   {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
7967   {&__pyx_n_s_rad, __pyx_k_rad, sizeof(__pyx_k_rad), 0, 0, 1, 1},
7968   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
7969   {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1},
7970   {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1},
7971   {&__pyx_n_s_rounded_box, __pyx_k_rounded_box, sizeof(__pyx_k_rounded_box), 0, 0, 1, 1},
7972   {&__pyx_n_s_rounded_rectangle, __pyx_k_rounded_rectangle, sizeof(__pyx_k_rounded_rectangle), 0, 0, 1, 1},
7973   {&__pyx_n_s_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 0, 1, 1},
7974   {&__pyx_n_s_ry, __pyx_k_ry, sizeof(__pyx_k_ry), 0, 0, 1, 1},
7975   {&__pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_k_src_pygame_sdl2_gfxdraw_pyx, sizeof(__pyx_k_src_pygame_sdl2_gfxdraw_pyx), 0, 0, 1, 0},
7976   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
7977   {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1},
7978   {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1},
7979   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
7980   {&__pyx_n_s_texture, __pyx_k_texture, sizeof(__pyx_k_texture), 0, 0, 1, 1},
7981   {&__pyx_n_s_textured_polygon, __pyx_k_textured_polygon, sizeof(__pyx_k_textured_polygon), 0, 0, 1, 1},
7982   {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1},
7983   {&__pyx_n_s_trigon, __pyx_k_trigon, sizeof(__pyx_k_trigon), 0, 0, 1, 1},
7984   {&__pyx_n_s_tx, __pyx_k_tx, sizeof(__pyx_k_tx), 0, 0, 1, 1},
7985   {&__pyx_n_s_ty, __pyx_k_ty, sizeof(__pyx_k_ty), 0, 0, 1, 1},
7986   {&__pyx_n_s_vline, __pyx_k_vline, sizeof(__pyx_k_vline), 0, 0, 1, 1},
7987   {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1},
7988   {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1},
7989   {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
7990   {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
7991   {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
7992   {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1},
7993   {&__pyx_n_s_x1int, __pyx_k_x1int, sizeof(__pyx_k_x1int), 0, 0, 1, 1},
7994   {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1},
7995   {&__pyx_n_s_x2int, __pyx_k_x2int, sizeof(__pyx_k_x2int), 0, 0, 1, 1},
7996   {&__pyx_n_s_x3, __pyx_k_x3, sizeof(__pyx_k_x3), 0, 0, 1, 1},
7997   {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
7998   {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1},
7999   {&__pyx_n_s_y1int, __pyx_k_y1int, sizeof(__pyx_k_y1int), 0, 0, 1, 1},
8000   {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1},
8001   {&__pyx_n_s_y2int, __pyx_k_y2int, sizeof(__pyx_k_y2int), 0, 0, 1, 1},
8002   {&__pyx_n_s_y3, __pyx_k_y3, sizeof(__pyx_k_y3), 0, 0, 1, 1},
8003   {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
8004   {0, 0, 0, 0, 0, 0, 0}
8005 };
__Pyx_InitCachedBuiltins(void)8006 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
8007   __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 145, __pyx_L1_error)
8008   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 145, __pyx_L1_error)
8009   return 0;
8010   __pyx_L1_error:;
8011   return -1;
8012 }
8013 
__Pyx_InitCachedConstants(void)8014 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8015   __Pyx_RefNannyDeclarations
8016   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
8017 
8018   /* "pygame_sdl2/gfxdraw.pyx":29
8019  *
8020  *
8021  * def pixel(Surface surface, x, y, color):             # <<<<<<<<<<<<<<
8022  *     cdef Color c = Color(color)
8023  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
8024  */
8025   __pyx_tuple_ = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 29, __pyx_L1_error)
8026   __Pyx_GOTREF(__pyx_tuple_);
8027   __Pyx_GIVEREF(__pyx_tuple_);
8028   __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pixel, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 29, __pyx_L1_error)
8029 
8030   /* "pygame_sdl2/gfxdraw.pyx":33
8031  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
8032  *
8033  * def hline(Surface surface, x1, x2, y, color):             # <<<<<<<<<<<<<<
8034  *     cdef Color c = Color(color)
8035  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
8036  */
8037   __pyx_tuple__3 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 33, __pyx_L1_error)
8038   __Pyx_GOTREF(__pyx_tuple__3);
8039   __Pyx_GIVEREF(__pyx_tuple__3);
8040   __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_hline, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 33, __pyx_L1_error)
8041 
8042   /* "pygame_sdl2/gfxdraw.pyx":37
8043  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
8044  *
8045  * def vline(Surface surface, x, y1, y2, color):             # <<<<<<<<<<<<<<
8046  *     cdef Color c = Color(color)
8047  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
8048  */
8049   __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 37, __pyx_L1_error)
8050   __Pyx_GOTREF(__pyx_tuple__5);
8051   __Pyx_GIVEREF(__pyx_tuple__5);
8052   __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_vline, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 37, __pyx_L1_error)
8053 
8054   /* "pygame_sdl2/gfxdraw.pyx":41
8055  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
8056  *
8057  * def rectangle(Surface surface, rect, color):             # <<<<<<<<<<<<<<
8058  *     cdef Color c = Color(color)
8059  *     if not isinstance(rect, Rect):
8060  */
8061   __pyx_tuple__7 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 41, __pyx_L1_error)
8062   __Pyx_GOTREF(__pyx_tuple__7);
8063   __Pyx_GIVEREF(__pyx_tuple__7);
8064   __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rectangle, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 41, __pyx_L1_error)
8065 
8066   /* "pygame_sdl2/gfxdraw.pyx":47
8067  *     rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
8068  *
8069  * def rounded_rectangle(Surface surface, rect, rad, color):             # <<<<<<<<<<<<<<
8070  *     cdef Color c = Color(color)
8071  *     if not isinstance(rect, Rect):
8072  */
8073   __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 47, __pyx_L1_error)
8074   __Pyx_GOTREF(__pyx_tuple__9);
8075   __Pyx_GIVEREF(__pyx_tuple__9);
8076   __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_rectangle, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 47, __pyx_L1_error)
8077 
8078   /* "pygame_sdl2/gfxdraw.pyx":53
8079  *     roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
8080  *
8081  * def box(Surface surface, rect, color):             # <<<<<<<<<<<<<<
8082  *     cdef Color c = Color(color)
8083  *     if not isinstance(rect, Rect):
8084  */
8085   __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 53, __pyx_L1_error)
8086   __Pyx_GOTREF(__pyx_tuple__11);
8087   __Pyx_GIVEREF(__pyx_tuple__11);
8088   __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 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_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_box, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 53, __pyx_L1_error)
8089 
8090   /* "pygame_sdl2/gfxdraw.pyx":59
8091  *     boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
8092  *
8093  * def rounded_box(Surface surface, rect, rad, color):             # <<<<<<<<<<<<<<
8094  *     cdef Color c = Color(color)
8095  *     if not isinstance(rect, Rect):
8096  */
8097   __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 59, __pyx_L1_error)
8098   __Pyx_GOTREF(__pyx_tuple__13);
8099   __Pyx_GIVEREF(__pyx_tuple__13);
8100   __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 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_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_box, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 59, __pyx_L1_error)
8101 
8102   /* "pygame_sdl2/gfxdraw.pyx":65
8103  *     roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
8104  *
8105  * def line(Surface surface, x1, y1, x2, y2, color):             # <<<<<<<<<<<<<<
8106  *     cdef Color c = Color(color)
8107  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
8108  */
8109   __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 65, __pyx_L1_error)
8110   __Pyx_GOTREF(__pyx_tuple__15);
8111   __Pyx_GIVEREF(__pyx_tuple__15);
8112   __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 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_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_line, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 65, __pyx_L1_error)
8113 
8114   /* "pygame_sdl2/gfxdraw.pyx":69
8115  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
8116  *
8117  * def aaline(Surface surface, x1, y1, x2, y2, color):             # <<<<<<<<<<<<<<
8118  *     cdef Color c = Color(color)
8119  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
8120  */
8121   __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 69, __pyx_L1_error)
8122   __Pyx_GOTREF(__pyx_tuple__17);
8123   __Pyx_GIVEREF(__pyx_tuple__17);
8124   __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaline, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 69, __pyx_L1_error)
8125 
8126   /* "pygame_sdl2/gfxdraw.pyx":73
8127  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
8128  *
8129  * def thick_line(Surface surface, x1, y1, x2, y2, width, color):             # <<<<<<<<<<<<<<
8130  *     cdef Color c = Color(color)
8131  *
8132  */
8133   __pyx_tuple__19 = PyTuple_Pack(12, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_width, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_x1int, __pyx_n_s_y1int, __pyx_n_s_x2int, __pyx_n_s_y2int); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 73, __pyx_L1_error)
8134   __Pyx_GOTREF(__pyx_tuple__19);
8135   __Pyx_GIVEREF(__pyx_tuple__19);
8136   __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_thick_line, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 73, __pyx_L1_error)
8137 
8138   /* "pygame_sdl2/gfxdraw.pyx":90
8139  *     thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a)
8140  *
8141  * def circle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
8142  *     cdef Color c = Color(color)
8143  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8144  */
8145   __pyx_tuple__21 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 90, __pyx_L1_error)
8146   __Pyx_GOTREF(__pyx_tuple__21);
8147   __Pyx_GIVEREF(__pyx_tuple__21);
8148   __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_circle, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 90, __pyx_L1_error)
8149 
8150   /* "pygame_sdl2/gfxdraw.pyx":94
8151  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8152  *
8153  * def arc(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
8154  *     cdef Color c = Color(color)
8155  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8156  */
8157   __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 94, __pyx_L1_error)
8158   __Pyx_GOTREF(__pyx_tuple__23);
8159   __Pyx_GIVEREF(__pyx_tuple__23);
8160   __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_arc, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 94, __pyx_L1_error)
8161 
8162   /* "pygame_sdl2/gfxdraw.pyx":98
8163  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8164  *
8165  * def aacircle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
8166  *     cdef Color c = Color(color)
8167  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8168  */
8169   __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 98, __pyx_L1_error)
8170   __Pyx_GOTREF(__pyx_tuple__25);
8171   __Pyx_GIVEREF(__pyx_tuple__25);
8172   __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aacircle, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 98, __pyx_L1_error)
8173 
8174   /* "pygame_sdl2/gfxdraw.pyx":102
8175  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8176  *
8177  * def filled_circle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
8178  *     cdef Color c = Color(color)
8179  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8180  */
8181   __pyx_tuple__27 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 102, __pyx_L1_error)
8182   __Pyx_GOTREF(__pyx_tuple__27);
8183   __Pyx_GIVEREF(__pyx_tuple__27);
8184   __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_circle, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 102, __pyx_L1_error)
8185 
8186   /* "pygame_sdl2/gfxdraw.pyx":106
8187  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8188  *
8189  * def ellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
8190  *     cdef Color c = Color(color)
8191  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8192  */
8193   __pyx_tuple__29 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 106, __pyx_L1_error)
8194   __Pyx_GOTREF(__pyx_tuple__29);
8195   __Pyx_GIVEREF(__pyx_tuple__29);
8196   __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_ellipse, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 106, __pyx_L1_error)
8197 
8198   /* "pygame_sdl2/gfxdraw.pyx":110
8199  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8200  *
8201  * def aaellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
8202  *     cdef Color c = Color(color)
8203  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8204  */
8205   __pyx_tuple__31 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 110, __pyx_L1_error)
8206   __Pyx_GOTREF(__pyx_tuple__31);
8207   __Pyx_GIVEREF(__pyx_tuple__31);
8208   __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaellipse, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 110, __pyx_L1_error)
8209 
8210   /* "pygame_sdl2/gfxdraw.pyx":114
8211  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8212  *
8213  * def filled_ellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
8214  *     cdef Color c = Color(color)
8215  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8216  */
8217   __pyx_tuple__33 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 114, __pyx_L1_error)
8218   __Pyx_GOTREF(__pyx_tuple__33);
8219   __Pyx_GIVEREF(__pyx_tuple__33);
8220   __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_ellipse, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 114, __pyx_L1_error)
8221 
8222   /* "pygame_sdl2/gfxdraw.pyx":118
8223  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8224  *
8225  * def pie(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
8226  *     cdef Color c = Color(color)
8227  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8228  */
8229   __pyx_tuple__35 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 118, __pyx_L1_error)
8230   __Pyx_GOTREF(__pyx_tuple__35);
8231   __Pyx_GIVEREF(__pyx_tuple__35);
8232   __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pie, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 118, __pyx_L1_error)
8233 
8234   /* "pygame_sdl2/gfxdraw.pyx":122
8235  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8236  *
8237  * def filled_pie(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
8238  *     cdef Color c = Color(color)
8239  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8240  */
8241   __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 122, __pyx_L1_error)
8242   __Pyx_GOTREF(__pyx_tuple__37);
8243   __Pyx_GIVEREF(__pyx_tuple__37);
8244   __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_pie, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 122, __pyx_L1_error)
8245 
8246   /* "pygame_sdl2/gfxdraw.pyx":126
8247  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8248  *
8249  * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
8250  *     cdef Color c = Color(color)
8251  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8252  */
8253   __pyx_tuple__39 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 126, __pyx_L1_error)
8254   __Pyx_GOTREF(__pyx_tuple__39);
8255   __Pyx_GIVEREF(__pyx_tuple__39);
8256   __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_trigon, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 126, __pyx_L1_error)
8257 
8258   /* "pygame_sdl2/gfxdraw.pyx":130
8259  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8260  *
8261  * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
8262  *     cdef Color c = Color(color)
8263  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8264  */
8265   __pyx_tuple__41 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 130, __pyx_L1_error)
8266   __Pyx_GOTREF(__pyx_tuple__41);
8267   __Pyx_GIVEREF(__pyx_tuple__41);
8268   __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aatrigon, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 130, __pyx_L1_error)
8269 
8270   /* "pygame_sdl2/gfxdraw.pyx":134
8271  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8272  *
8273  * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
8274  *     cdef Color c = Color(color)
8275  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8276  */
8277   __pyx_tuple__43 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 134, __pyx_L1_error)
8278   __Pyx_GOTREF(__pyx_tuple__43);
8279   __Pyx_GIVEREF(__pyx_tuple__43);
8280   __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_trigon, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 134, __pyx_L1_error)
8281 
8282   /* "pygame_sdl2/gfxdraw.pyx":138
8283  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8284  *
8285  * def polygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
8286  *     cdef Color c = Color(color)
8287  *     cdef Sint16 *vx
8288  */
8289   __pyx_tuple__45 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 138, __pyx_L1_error)
8290   __Pyx_GOTREF(__pyx_tuple__45);
8291   __Pyx_GIVEREF(__pyx_tuple__45);
8292   __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_polygon, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 138, __pyx_L1_error)
8293 
8294   /* "pygame_sdl2/gfxdraw.pyx":151
8295  *     free(vy)
8296  *
8297  * def aapolygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
8298  *     cdef Color c = Color(color)
8299  *     cdef Sint16 *vx
8300  */
8301   __pyx_tuple__47 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 151, __pyx_L1_error)
8302   __Pyx_GOTREF(__pyx_tuple__47);
8303   __Pyx_GIVEREF(__pyx_tuple__47);
8304   __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aapolygon, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 151, __pyx_L1_error)
8305 
8306   /* "pygame_sdl2/gfxdraw.pyx":164
8307  *     free(vy)
8308  *
8309  * def filled_polygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
8310  *     cdef Color c = Color(color)
8311  *     cdef Sint16 *vx
8312  */
8313   __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 164, __pyx_L1_error)
8314   __Pyx_GOTREF(__pyx_tuple__49);
8315   __Pyx_GIVEREF(__pyx_tuple__49);
8316   __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_polygon, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 164, __pyx_L1_error)
8317 
8318   /* "pygame_sdl2/gfxdraw.pyx":177
8319  *     free(vy)
8320  *
8321  * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty):             # <<<<<<<<<<<<<<
8322  *     cdef Sint16 *vx
8323  *     cdef Sint16 *vy
8324  */
8325   __pyx_tuple__51 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_texture, __pyx_n_s_tx, __pyx_n_s_ty, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 177, __pyx_L1_error)
8326   __Pyx_GOTREF(__pyx_tuple__51);
8327   __Pyx_GIVEREF(__pyx_tuple__51);
8328   __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_textured_polygon, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 177, __pyx_L1_error)
8329 
8330   /* "pygame_sdl2/gfxdraw.pyx":189
8331  *     free(vy)
8332  *
8333  * def bezier(Surface surface, points, steps, color):             # <<<<<<<<<<<<<<
8334  *     cdef Color c = Color(color)
8335  *     cdef Sint16 *vx
8336  */
8337   __pyx_tuple__53 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_steps, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 189, __pyx_L1_error)
8338   __Pyx_GOTREF(__pyx_tuple__53);
8339   __Pyx_GIVEREF(__pyx_tuple__53);
8340   __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_bezier, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 189, __pyx_L1_error)
8341   __Pyx_RefNannyFinishContext();
8342   return 0;
8343   __pyx_L1_error:;
8344   __Pyx_RefNannyFinishContext();
8345   return -1;
8346 }
8347 
__Pyx_InitGlobals(void)8348 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
8349   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
8350   return 0;
8351   __pyx_L1_error:;
8352   return -1;
8353 }
8354 
8355 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
8356 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
8357 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
8358 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
8359 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
8360 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
8361 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
8362 
__Pyx_modinit_global_init_code(void)8363 static int __Pyx_modinit_global_init_code(void) {
8364   __Pyx_RefNannyDeclarations
8365   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
8366   /*--- Global init code ---*/
8367   __Pyx_RefNannyFinishContext();
8368   return 0;
8369 }
8370 
__Pyx_modinit_variable_export_code(void)8371 static int __Pyx_modinit_variable_export_code(void) {
8372   __Pyx_RefNannyDeclarations
8373   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
8374   /*--- Variable export code ---*/
8375   __Pyx_RefNannyFinishContext();
8376   return 0;
8377 }
8378 
__Pyx_modinit_function_export_code(void)8379 static int __Pyx_modinit_function_export_code(void) {
8380   __Pyx_RefNannyDeclarations
8381   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
8382   /*--- Function export code ---*/
8383   __Pyx_RefNannyFinishContext();
8384   return 0;
8385 }
8386 
__Pyx_modinit_type_init_code(void)8387 static int __Pyx_modinit_type_init_code(void) {
8388   __Pyx_RefNannyDeclarations
8389   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
8390   /*--- Type init code ---*/
8391   __Pyx_RefNannyFinishContext();
8392   return 0;
8393 }
8394 
__Pyx_modinit_type_import_code(void)8395 static int __Pyx_modinit_type_import_code(void) {
8396   __Pyx_RefNannyDeclarations
8397   PyObject *__pyx_t_1 = NULL;
8398   int __pyx_lineno = 0;
8399   const char *__pyx_filename = NULL;
8400   int __pyx_clineno = 0;
8401   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
8402   /*--- Type import code ---*/
8403   __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.surface"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error)
8404   __Pyx_GOTREF(__pyx_t_1);
8405   __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType(__pyx_t_1, "pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), __Pyx_ImportType_CheckSize_Warn);
8406    if (!__pyx_ptype_11pygame_sdl2_7surface_Surface) __PYX_ERR(1, 23, __pyx_L1_error)
8407   __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
8408   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8409   __pyx_t_1 = PyImport_ImportModule("pygame_sdl2.color"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error)
8410   __Pyx_GOTREF(__pyx_t_1);
8411   __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType(__pyx_t_1, "pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), __Pyx_ImportType_CheckSize_Warn);
8412    if (!__pyx_ptype_11pygame_sdl2_5color_Color) __PYX_ERR(2, 26, __pyx_L1_error)
8413   __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
8414   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8415   __Pyx_RefNannyFinishContext();
8416   return 0;
8417   __pyx_L1_error:;
8418   __Pyx_XDECREF(__pyx_t_1);
8419   __Pyx_RefNannyFinishContext();
8420   return -1;
8421 }
8422 
__Pyx_modinit_variable_import_code(void)8423 static int __Pyx_modinit_variable_import_code(void) {
8424   __Pyx_RefNannyDeclarations
8425   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
8426   /*--- Variable import code ---*/
8427   __Pyx_RefNannyFinishContext();
8428   return 0;
8429 }
8430 
__Pyx_modinit_function_import_code(void)8431 static int __Pyx_modinit_function_import_code(void) {
8432   __Pyx_RefNannyDeclarations
8433   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
8434   /*--- Function import code ---*/
8435   __Pyx_RefNannyFinishContext();
8436   return 0;
8437 }
8438 
8439 
8440 #ifndef CYTHON_NO_PYINIT_EXPORT
8441 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
8442 #elif PY_MAJOR_VERSION < 3
8443 #ifdef __cplusplus
8444 #define __Pyx_PyMODINIT_FUNC extern "C" void
8445 #else
8446 #define __Pyx_PyMODINIT_FUNC void
8447 #endif
8448 #else
8449 #ifdef __cplusplus
8450 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
8451 #else
8452 #define __Pyx_PyMODINIT_FUNC PyObject *
8453 #endif
8454 #endif
8455 
8456 
8457 #if PY_MAJOR_VERSION < 3
8458 __Pyx_PyMODINIT_FUNC initpygame_sdl2_gfxdraw(void) CYTHON_SMALL_CODE; /*proto*/
initpygame_sdl2_gfxdraw(void)8459 __Pyx_PyMODINIT_FUNC initpygame_sdl2_gfxdraw(void)
8460 #else
8461 __Pyx_PyMODINIT_FUNC PyInit_pygame_sdl2_gfxdraw(void) CYTHON_SMALL_CODE; /*proto*/
8462 __Pyx_PyMODINIT_FUNC PyInit_pygame_sdl2_gfxdraw(void)
8463 #if CYTHON_PEP489_MULTI_PHASE_INIT
8464 {
8465   return PyModuleDef_Init(&__pyx_moduledef);
8466 }
8467 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
8468     #if PY_VERSION_HEX >= 0x030700A1
8469     static PY_INT64_T main_interpreter_id = -1;
8470     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
8471     if (main_interpreter_id == -1) {
8472         main_interpreter_id = current_id;
8473         return (unlikely(current_id == -1)) ? -1 : 0;
8474     } else if (unlikely(main_interpreter_id != current_id))
8475     #else
8476     static PyInterpreterState *main_interpreter = NULL;
8477     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
8478     if (!main_interpreter) {
8479         main_interpreter = current_interpreter;
8480     } else if (unlikely(main_interpreter != current_interpreter))
8481     #endif
8482     {
8483         PyErr_SetString(
8484             PyExc_ImportError,
8485             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
8486         return -1;
8487     }
8488     return 0;
8489 }
8490 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
8491     PyObject *value = PyObject_GetAttrString(spec, from_name);
8492     int result = 0;
8493     if (likely(value)) {
8494         if (allow_none || value != Py_None) {
8495             result = PyDict_SetItemString(moddict, to_name, value);
8496         }
8497         Py_DECREF(value);
8498     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
8499         PyErr_Clear();
8500     } else {
8501         result = -1;
8502     }
8503     return result;
8504 }
8505 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
8506     PyObject *module = NULL, *moddict, *modname;
8507     if (__Pyx_check_single_interpreter())
8508         return NULL;
8509     if (__pyx_m)
8510         return __Pyx_NewRef(__pyx_m);
8511     modname = PyObject_GetAttrString(spec, "name");
8512     if (unlikely(!modname)) goto bad;
8513     module = PyModule_NewObject(modname);
8514     Py_DECREF(modname);
8515     if (unlikely(!module)) goto bad;
8516     moddict = PyModule_GetDict(module);
8517     if (unlikely(!moddict)) goto bad;
8518     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
8519     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
8520     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
8521     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
8522     return module;
8523 bad:
8524     Py_XDECREF(module);
8525     return NULL;
8526 }
8527 
8528 
8529 static CYTHON_SMALL_CODE int __pyx_pymod_exec_gfxdraw(PyObject *__pyx_pyinit_module)
8530 #endif
8531 #endif
8532 {
8533   PyObject *__pyx_t_1 = NULL;
8534   PyObject *__pyx_t_2 = NULL;
8535   int __pyx_lineno = 0;
8536   const char *__pyx_filename = NULL;
8537   int __pyx_clineno = 0;
8538   __Pyx_RefNannyDeclarations
8539   #if CYTHON_PEP489_MULTI_PHASE_INIT
8540   if (__pyx_m) {
8541     if (__pyx_m == __pyx_pyinit_module) return 0;
8542     PyErr_SetString(PyExc_RuntimeError, "Module 'gfxdraw' has already been imported. Re-initialisation is not supported.");
8543     return -1;
8544   }
8545   #elif PY_MAJOR_VERSION >= 3
8546   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
8547   #endif
8548   #if CYTHON_REFNANNY
8549 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
8550 if (!__Pyx_RefNanny) {
8551   PyErr_Clear();
8552   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
8553   if (!__Pyx_RefNanny)
8554       Py_FatalError("failed to import 'refnanny' module");
8555 }
8556 #endif
8557   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void)", 0);
8558   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8559   #ifdef __Pxy_PyFrame_Initialize_Offsets
8560   __Pxy_PyFrame_Initialize_Offsets();
8561   #endif
8562   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
8563   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
8564   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
8565   #ifdef __Pyx_CyFunction_USED
8566   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8567   #endif
8568   #ifdef __Pyx_FusedFunction_USED
8569   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8570   #endif
8571   #ifdef __Pyx_Coroutine_USED
8572   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8573   #endif
8574   #ifdef __Pyx_Generator_USED
8575   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8576   #endif
8577   #ifdef __Pyx_AsyncGen_USED
8578   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8579   #endif
8580   #ifdef __Pyx_StopAsyncIteration_USED
8581   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8582   #endif
8583   /*--- Library function declarations ---*/
8584   /*--- Threads initialization code ---*/
8585   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
8586   #ifdef WITH_THREAD /* Python build with threading support? */
8587   PyEval_InitThreads();
8588   #endif
8589   #endif
8590   /*--- Module creation code ---*/
8591   #if CYTHON_PEP489_MULTI_PHASE_INIT
8592   __pyx_m = __pyx_pyinit_module;
8593   Py_INCREF(__pyx_m);
8594   #else
8595   #if PY_MAJOR_VERSION < 3
8596   __pyx_m = Py_InitModule4("pygame_sdl2.gfxdraw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
8597   #else
8598   __pyx_m = PyModule_Create(&__pyx_moduledef);
8599   #endif
8600   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
8601   #endif
8602   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
8603   Py_INCREF(__pyx_d);
8604   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
8605   Py_INCREF(__pyx_b);
8606   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
8607   Py_INCREF(__pyx_cython_runtime);
8608   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
8609   /*--- Initialize various global constants etc. ---*/
8610   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8611   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
8612   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8613   #endif
8614   if (__pyx_module_is_main_pygame_sdl2__gfxdraw) {
8615     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8616   }
8617   #if PY_MAJOR_VERSION >= 3
8618   {
8619     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
8620     if (!PyDict_GetItemString(modules, "pygame_sdl2.gfxdraw")) {
8621       if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.gfxdraw", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
8622     }
8623   }
8624   #endif
8625   /*--- Builtin init code ---*/
8626   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8627   /*--- Constants init code ---*/
8628   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8629   /*--- Global type/function init code ---*/
8630   (void)__Pyx_modinit_global_init_code();
8631   (void)__Pyx_modinit_variable_export_code();
8632   (void)__Pyx_modinit_function_export_code();
8633   (void)__Pyx_modinit_type_init_code();
8634   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
8635   (void)__Pyx_modinit_variable_import_code();
8636   (void)__Pyx_modinit_function_import_code();
8637   /*--- Execution code ---*/
8638   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
8639   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8640   #endif
8641 
8642   /* "pygame_sdl2/gfxdraw.pyx":25
8643  * from pygame_sdl2.color cimport Color
8644  *
8645  * from pygame_sdl2.error import error             # <<<<<<<<<<<<<<
8646  * from pygame_sdl2.rect import Rect
8647  *
8648  */
8649   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
8650   __Pyx_GOTREF(__pyx_t_1);
8651   __Pyx_INCREF(__pyx_n_s_error);
8652   __Pyx_GIVEREF(__pyx_n_s_error);
8653   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error);
8654   __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
8655   __Pyx_GOTREF(__pyx_t_2);
8656   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8657   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
8658   __Pyx_GOTREF(__pyx_t_1);
8659   if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
8660   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8661   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8662 
8663   /* "pygame_sdl2/gfxdraw.pyx":26
8664  *
8665  * from pygame_sdl2.error import error
8666  * from pygame_sdl2.rect import Rect             # <<<<<<<<<<<<<<
8667  *
8668  *
8669  */
8670   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
8671   __Pyx_GOTREF(__pyx_t_2);
8672   __Pyx_INCREF(__pyx_n_s_Rect);
8673   __Pyx_GIVEREF(__pyx_n_s_Rect);
8674   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect);
8675   __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
8676   __Pyx_GOTREF(__pyx_t_1);
8677   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8678   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
8679   __Pyx_GOTREF(__pyx_t_2);
8680   if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
8681   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8682   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8683 
8684   /* "pygame_sdl2/gfxdraw.pyx":29
8685  *
8686  *
8687  * def pixel(Surface surface, x, y, color):             # <<<<<<<<<<<<<<
8688  *     cdef Color c = Color(color)
8689  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
8690  */
8691   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
8692   __Pyx_GOTREF(__pyx_t_1);
8693   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
8694   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8695 
8696   /* "pygame_sdl2/gfxdraw.pyx":33
8697  *     pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
8698  *
8699  * def hline(Surface surface, x1, x2, y, color):             # <<<<<<<<<<<<<<
8700  *     cdef Color c = Color(color)
8701  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
8702  */
8703   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_3hline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
8704   __Pyx_GOTREF(__pyx_t_1);
8705   if (PyDict_SetItem(__pyx_d, __pyx_n_s_hline, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
8706   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8707 
8708   /* "pygame_sdl2/gfxdraw.pyx":37
8709  *     hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
8710  *
8711  * def vline(Surface surface, x, y1, y2, color):             # <<<<<<<<<<<<<<
8712  *     cdef Color c = Color(color)
8713  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
8714  */
8715   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_5vline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
8716   __Pyx_GOTREF(__pyx_t_1);
8717   if (PyDict_SetItem(__pyx_d, __pyx_n_s_vline, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
8718   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8719 
8720   /* "pygame_sdl2/gfxdraw.pyx":41
8721  *     vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
8722  *
8723  * def rectangle(Surface surface, rect, color):             # <<<<<<<<<<<<<<
8724  *     cdef Color c = Color(color)
8725  *     if not isinstance(rect, Rect):
8726  */
8727   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
8728   __Pyx_GOTREF(__pyx_t_1);
8729   if (PyDict_SetItem(__pyx_d, __pyx_n_s_rectangle, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
8730   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8731 
8732   /* "pygame_sdl2/gfxdraw.pyx":47
8733  *     rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
8734  *
8735  * def rounded_rectangle(Surface surface, rect, rad, color):             # <<<<<<<<<<<<<<
8736  *     cdef Color c = Color(color)
8737  *     if not isinstance(rect, Rect):
8738  */
8739   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
8740   __Pyx_GOTREF(__pyx_t_1);
8741   if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_rectangle, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
8742   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8743 
8744   /* "pygame_sdl2/gfxdraw.pyx":53
8745  *     roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
8746  *
8747  * def box(Surface surface, rect, color):             # <<<<<<<<<<<<<<
8748  *     cdef Color c = Color(color)
8749  *     if not isinstance(rect, Rect):
8750  */
8751   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_11box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
8752   __Pyx_GOTREF(__pyx_t_1);
8753   if (PyDict_SetItem(__pyx_d, __pyx_n_s_box, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
8754   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8755 
8756   /* "pygame_sdl2/gfxdraw.pyx":59
8757  *     boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
8758  *
8759  * def rounded_box(Surface surface, rect, rad, color):             # <<<<<<<<<<<<<<
8760  *     cdef Color c = Color(color)
8761  *     if not isinstance(rect, Rect):
8762  */
8763   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
8764   __Pyx_GOTREF(__pyx_t_1);
8765   if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_box, __pyx_t_1) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
8766   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8767 
8768   /* "pygame_sdl2/gfxdraw.pyx":65
8769  *     roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
8770  *
8771  * def line(Surface surface, x1, y1, x2, y2, color):             # <<<<<<<<<<<<<<
8772  *     cdef Color c = Color(color)
8773  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
8774  */
8775   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_15line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
8776   __Pyx_GOTREF(__pyx_t_1);
8777   if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
8778   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8779 
8780   /* "pygame_sdl2/gfxdraw.pyx":69
8781  *     lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
8782  *
8783  * def aaline(Surface surface, x1, y1, x2, y2, color):             # <<<<<<<<<<<<<<
8784  *     cdef Color c = Color(color)
8785  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
8786  */
8787   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
8788   __Pyx_GOTREF(__pyx_t_1);
8789   if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
8790   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8791 
8792   /* "pygame_sdl2/gfxdraw.pyx":73
8793  *     aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
8794  *
8795  * def thick_line(Surface surface, x1, y1, x2, y2, width, color):             # <<<<<<<<<<<<<<
8796  *     cdef Color c = Color(color)
8797  *
8798  */
8799   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
8800   __Pyx_GOTREF(__pyx_t_1);
8801   if (PyDict_SetItem(__pyx_d, __pyx_n_s_thick_line, __pyx_t_1) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
8802   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8803 
8804   /* "pygame_sdl2/gfxdraw.pyx":90
8805  *     thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a)
8806  *
8807  * def circle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
8808  *     cdef Color c = Color(color)
8809  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8810  */
8811   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_21circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
8812   __Pyx_GOTREF(__pyx_t_1);
8813   if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_1) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
8814   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8815 
8816   /* "pygame_sdl2/gfxdraw.pyx":94
8817  *     circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8818  *
8819  * def arc(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
8820  *     cdef Color c = Color(color)
8821  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8822  */
8823   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_23arc, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
8824   __Pyx_GOTREF(__pyx_t_1);
8825   if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_1) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
8826   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8827 
8828   /* "pygame_sdl2/gfxdraw.pyx":98
8829  *     arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8830  *
8831  * def aacircle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
8832  *     cdef Color c = Color(color)
8833  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8834  */
8835   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
8836   __Pyx_GOTREF(__pyx_t_1);
8837   if (PyDict_SetItem(__pyx_d, __pyx_n_s_aacircle, __pyx_t_1) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
8838   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8839 
8840   /* "pygame_sdl2/gfxdraw.pyx":102
8841  *     aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8842  *
8843  * def filled_circle(Surface surface, x, y, r, color):             # <<<<<<<<<<<<<<
8844  *     cdef Color c = Color(color)
8845  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8846  */
8847   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
8848   __Pyx_GOTREF(__pyx_t_1);
8849   if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_circle, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
8850   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8851 
8852   /* "pygame_sdl2/gfxdraw.pyx":106
8853  *     filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
8854  *
8855  * def ellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
8856  *     cdef Color c = Color(color)
8857  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8858  */
8859   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
8860   __Pyx_GOTREF(__pyx_t_1);
8861   if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_1) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
8862   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8863 
8864   /* "pygame_sdl2/gfxdraw.pyx":110
8865  *     ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8866  *
8867  * def aaellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
8868  *     cdef Color c = Color(color)
8869  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8870  */
8871   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
8872   __Pyx_GOTREF(__pyx_t_1);
8873   if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaellipse, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
8874   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8875 
8876   /* "pygame_sdl2/gfxdraw.pyx":114
8877  *     aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8878  *
8879  * def filled_ellipse(Surface surface, x, y, rx, ry, color):             # <<<<<<<<<<<<<<
8880  *     cdef Color c = Color(color)
8881  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8882  */
8883   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
8884   __Pyx_GOTREF(__pyx_t_1);
8885   if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_ellipse, __pyx_t_1) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
8886   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8887 
8888   /* "pygame_sdl2/gfxdraw.pyx":118
8889  *     filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
8890  *
8891  * def pie(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
8892  *     cdef Color c = Color(color)
8893  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8894  */
8895   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_35pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
8896   __Pyx_GOTREF(__pyx_t_1);
8897   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pie, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
8898   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8899 
8900   /* "pygame_sdl2/gfxdraw.pyx":122
8901  *     pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8902  *
8903  * def filled_pie(Surface surface, x, y, r, start, end, color):             # <<<<<<<<<<<<<<
8904  *     cdef Color c = Color(color)
8905  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8906  */
8907   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
8908   __Pyx_GOTREF(__pyx_t_1);
8909   if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_pie, __pyx_t_1) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
8910   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8911 
8912   /* "pygame_sdl2/gfxdraw.pyx":126
8913  *     filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
8914  *
8915  * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
8916  *     cdef Color c = Color(color)
8917  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8918  */
8919   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
8920   __Pyx_GOTREF(__pyx_t_1);
8921   if (PyDict_SetItem(__pyx_d, __pyx_n_s_trigon, __pyx_t_1) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
8922   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8923 
8924   /* "pygame_sdl2/gfxdraw.pyx":130
8925  *     trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8926  *
8927  * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
8928  *     cdef Color c = Color(color)
8929  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8930  */
8931   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
8932   __Pyx_GOTREF(__pyx_t_1);
8933   if (PyDict_SetItem(__pyx_d, __pyx_n_s_aatrigon, __pyx_t_1) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
8934   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8935 
8936   /* "pygame_sdl2/gfxdraw.pyx":134
8937  *     aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8938  *
8939  * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):             # <<<<<<<<<<<<<<
8940  *     cdef Color c = Color(color)
8941  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8942  */
8943   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
8944   __Pyx_GOTREF(__pyx_t_1);
8945   if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_trigon, __pyx_t_1) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
8946   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8947 
8948   /* "pygame_sdl2/gfxdraw.pyx":138
8949  *     filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
8950  *
8951  * def polygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
8952  *     cdef Color c = Color(color)
8953  *     cdef Sint16 *vx
8954  */
8955   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
8956   __Pyx_GOTREF(__pyx_t_1);
8957   if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_1) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
8958   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8959 
8960   /* "pygame_sdl2/gfxdraw.pyx":151
8961  *     free(vy)
8962  *
8963  * def aapolygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
8964  *     cdef Color c = Color(color)
8965  *     cdef Sint16 *vx
8966  */
8967   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
8968   __Pyx_GOTREF(__pyx_t_1);
8969   if (PyDict_SetItem(__pyx_d, __pyx_n_s_aapolygon, __pyx_t_1) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
8970   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8971 
8972   /* "pygame_sdl2/gfxdraw.pyx":164
8973  *     free(vy)
8974  *
8975  * def filled_polygon(Surface surface, points, color):             # <<<<<<<<<<<<<<
8976  *     cdef Color c = Color(color)
8977  *     cdef Sint16 *vx
8978  */
8979   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
8980   __Pyx_GOTREF(__pyx_t_1);
8981   if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_polygon, __pyx_t_1) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
8982   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8983 
8984   /* "pygame_sdl2/gfxdraw.pyx":177
8985  *     free(vy)
8986  *
8987  * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty):             # <<<<<<<<<<<<<<
8988  *     cdef Sint16 *vx
8989  *     cdef Sint16 *vy
8990  */
8991   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
8992   __Pyx_GOTREF(__pyx_t_1);
8993   if (PyDict_SetItem(__pyx_d, __pyx_n_s_textured_polygon, __pyx_t_1) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
8994   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8995 
8996   /* "pygame_sdl2/gfxdraw.pyx":189
8997  *     free(vy)
8998  *
8999  * def bezier(Surface surface, points, steps, color):             # <<<<<<<<<<<<<<
9000  *     cdef Color c = Color(color)
9001  *     cdef Sint16 *vx
9002  */
9003   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
9004   __Pyx_GOTREF(__pyx_t_1);
9005   if (PyDict_SetItem(__pyx_d, __pyx_n_s_bezier, __pyx_t_1) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
9006   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9007 
9008   /* "pygame_sdl2/gfxdraw.pyx":1
9009  * # Copyright 2014 Patrick Dawson <pat@dw.is>             # <<<<<<<<<<<<<<
9010  * #
9011  * # This software is provided 'as-is', without any express or implied
9012  */
9013   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
9014   __Pyx_GOTREF(__pyx_t_1);
9015   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9016   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9017 
9018   /*--- Wrapped vars code ---*/
9019 
9020   goto __pyx_L0;
9021   __pyx_L1_error:;
9022   __Pyx_XDECREF(__pyx_t_1);
9023   __Pyx_XDECREF(__pyx_t_2);
9024   if (__pyx_m) {
9025     if (__pyx_d) {
9026       __Pyx_AddTraceback("init pygame_sdl2.gfxdraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
9027     }
9028     Py_CLEAR(__pyx_m);
9029   } else if (!PyErr_Occurred()) {
9030     PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.gfxdraw");
9031   }
9032   __pyx_L0:;
9033   __Pyx_RefNannyFinishContext();
9034   #if CYTHON_PEP489_MULTI_PHASE_INIT
9035   return (__pyx_m != NULL) ? 0 : -1;
9036   #elif PY_MAJOR_VERSION >= 3
9037   return __pyx_m;
9038   #else
9039   return;
9040   #endif
9041 }
9042 
9043 /* --- Runtime support code --- */
9044 /* Refnanny */
9045 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)9046 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
9047     PyObject *m = NULL, *p = NULL;
9048     void *r = NULL;
9049     m = PyImport_ImportModule(modname);
9050     if (!m) goto end;
9051     p = PyObject_GetAttrString(m, "RefNannyAPI");
9052     if (!p) goto end;
9053     r = PyLong_AsVoidPtr(p);
9054 end:
9055     Py_XDECREF(p);
9056     Py_XDECREF(m);
9057     return (__Pyx_RefNannyAPIStruct *)r;
9058 }
9059 #endif
9060 
9061 /* PyObjectGetAttrStr */
9062 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)9063 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9064     PyTypeObject* tp = Py_TYPE(obj);
9065     if (likely(tp->tp_getattro))
9066         return tp->tp_getattro(obj, attr_name);
9067 #if PY_MAJOR_VERSION < 3
9068     if (likely(tp->tp_getattr))
9069         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
9070 #endif
9071     return PyObject_GetAttr(obj, attr_name);
9072 }
9073 #endif
9074 
9075 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)9076 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9077     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
9078     if (unlikely(!result)) {
9079         PyErr_Format(PyExc_NameError,
9080 #if PY_MAJOR_VERSION >= 3
9081             "name '%U' is not defined", name);
9082 #else
9083             "name '%.200s' is not defined", PyString_AS_STRING(name));
9084 #endif
9085     }
9086     return result;
9087 }
9088 
9089 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)9090 static void __Pyx_RaiseArgtupleInvalid(
9091     const char* func_name,
9092     int exact,
9093     Py_ssize_t num_min,
9094     Py_ssize_t num_max,
9095     Py_ssize_t num_found)
9096 {
9097     Py_ssize_t num_expected;
9098     const char *more_or_less;
9099     if (num_found < num_min) {
9100         num_expected = num_min;
9101         more_or_less = "at least";
9102     } else {
9103         num_expected = num_max;
9104         more_or_less = "at most";
9105     }
9106     if (exact) {
9107         more_or_less = "exactly";
9108     }
9109     PyErr_Format(PyExc_TypeError,
9110                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
9111                  func_name, more_or_less, num_expected,
9112                  (num_expected == 1) ? "" : "s", num_found);
9113 }
9114 
9115 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)9116 static void __Pyx_RaiseDoubleKeywordsError(
9117     const char* func_name,
9118     PyObject* kw_name)
9119 {
9120     PyErr_Format(PyExc_TypeError,
9121         #if PY_MAJOR_VERSION >= 3
9122         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
9123         #else
9124         "%s() got multiple values for keyword argument '%s'", func_name,
9125         PyString_AsString(kw_name));
9126         #endif
9127 }
9128 
9129 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)9130 static int __Pyx_ParseOptionalKeywords(
9131     PyObject *kwds,
9132     PyObject **argnames[],
9133     PyObject *kwds2,
9134     PyObject *values[],
9135     Py_ssize_t num_pos_args,
9136     const char* function_name)
9137 {
9138     PyObject *key = 0, *value = 0;
9139     Py_ssize_t pos = 0;
9140     PyObject*** name;
9141     PyObject*** first_kw_arg = argnames + num_pos_args;
9142     while (PyDict_Next(kwds, &pos, &key, &value)) {
9143         name = first_kw_arg;
9144         while (*name && (**name != key)) name++;
9145         if (*name) {
9146             values[name-argnames] = value;
9147             continue;
9148         }
9149         name = first_kw_arg;
9150         #if PY_MAJOR_VERSION < 3
9151         if (likely(PyString_Check(key))) {
9152             while (*name) {
9153                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
9154                         && _PyString_Eq(**name, key)) {
9155                     values[name-argnames] = value;
9156                     break;
9157                 }
9158                 name++;
9159             }
9160             if (*name) continue;
9161             else {
9162                 PyObject*** argname = argnames;
9163                 while (argname != first_kw_arg) {
9164                     if ((**argname == key) || (
9165                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
9166                              && _PyString_Eq(**argname, key))) {
9167                         goto arg_passed_twice;
9168                     }
9169                     argname++;
9170                 }
9171             }
9172         } else
9173         #endif
9174         if (likely(PyUnicode_Check(key))) {
9175             while (*name) {
9176                 int cmp = (**name == key) ? 0 :
9177                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9178                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
9179                 #endif
9180                     PyUnicode_Compare(**name, key);
9181                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9182                 if (cmp == 0) {
9183                     values[name-argnames] = value;
9184                     break;
9185                 }
9186                 name++;
9187             }
9188             if (*name) continue;
9189             else {
9190                 PyObject*** argname = argnames;
9191                 while (argname != first_kw_arg) {
9192                     int cmp = (**argname == key) ? 0 :
9193                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9194                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
9195                     #endif
9196                         PyUnicode_Compare(**argname, key);
9197                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9198                     if (cmp == 0) goto arg_passed_twice;
9199                     argname++;
9200                 }
9201             }
9202         } else
9203             goto invalid_keyword_type;
9204         if (kwds2) {
9205             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
9206         } else {
9207             goto invalid_keyword;
9208         }
9209     }
9210     return 0;
9211 arg_passed_twice:
9212     __Pyx_RaiseDoubleKeywordsError(function_name, key);
9213     goto bad;
9214 invalid_keyword_type:
9215     PyErr_Format(PyExc_TypeError,
9216         "%.200s() keywords must be strings", function_name);
9217     goto bad;
9218 invalid_keyword:
9219     PyErr_Format(PyExc_TypeError,
9220     #if PY_MAJOR_VERSION < 3
9221         "%.200s() got an unexpected keyword argument '%.200s'",
9222         function_name, PyString_AsString(key));
9223     #else
9224         "%s() got an unexpected keyword argument '%U'",
9225         function_name, key);
9226     #endif
9227 bad:
9228     return -1;
9229 }
9230 
9231 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)9232 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
9233 {
9234     if (unlikely(!type)) {
9235         PyErr_SetString(PyExc_SystemError, "Missing type object");
9236         return 0;
9237     }
9238     else if (exact) {
9239         #if PY_MAJOR_VERSION == 2
9240         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
9241         #endif
9242     }
9243     else {
9244         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
9245     }
9246     PyErr_Format(PyExc_TypeError,
9247         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
9248         name, type->tp_name, Py_TYPE(obj)->tp_name);
9249     return 0;
9250 }
9251 
9252 /* PyCFunctionFastCall */
9253 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)9254 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
9255     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
9256     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
9257     PyObject *self = PyCFunction_GET_SELF(func);
9258     int flags = PyCFunction_GET_FLAGS(func);
9259     assert(PyCFunction_Check(func));
9260     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
9261     assert(nargs >= 0);
9262     assert(nargs == 0 || args != NULL);
9263     /* _PyCFunction_FastCallDict() must not be called with an exception set,
9264        because it may clear it (directly or indirectly) and so the
9265        caller loses its exception */
9266     assert(!PyErr_Occurred());
9267     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
9268         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
9269     } else {
9270         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
9271     }
9272 }
9273 #endif
9274 
9275 /* PyFunctionFastCall */
9276 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)9277 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
9278                                                PyObject *globals) {
9279     PyFrameObject *f;
9280     PyThreadState *tstate = __Pyx_PyThreadState_Current;
9281     PyObject **fastlocals;
9282     Py_ssize_t i;
9283     PyObject *result;
9284     assert(globals != NULL);
9285     /* XXX Perhaps we should create a specialized
9286        PyFrame_New() that doesn't take locals, but does
9287        take builtins without sanity checking them.
9288        */
9289     assert(tstate != NULL);
9290     f = PyFrame_New(tstate, co, globals, NULL);
9291     if (f == NULL) {
9292         return NULL;
9293     }
9294     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
9295     for (i = 0; i < na; i++) {
9296         Py_INCREF(*args);
9297         fastlocals[i] = *args++;
9298     }
9299     result = PyEval_EvalFrameEx(f,0);
9300     ++tstate->recursion_depth;
9301     Py_DECREF(f);
9302     --tstate->recursion_depth;
9303     return result;
9304 }
9305 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)9306 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
9307     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
9308     PyObject *globals = PyFunction_GET_GLOBALS(func);
9309     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
9310     PyObject *closure;
9311 #if PY_MAJOR_VERSION >= 3
9312     PyObject *kwdefs;
9313 #endif
9314     PyObject *kwtuple, **k;
9315     PyObject **d;
9316     Py_ssize_t nd;
9317     Py_ssize_t nk;
9318     PyObject *result;
9319     assert(kwargs == NULL || PyDict_Check(kwargs));
9320     nk = kwargs ? PyDict_Size(kwargs) : 0;
9321     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
9322         return NULL;
9323     }
9324     if (
9325 #if PY_MAJOR_VERSION >= 3
9326             co->co_kwonlyargcount == 0 &&
9327 #endif
9328             likely(kwargs == NULL || nk == 0) &&
9329             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
9330         if (argdefs == NULL && co->co_argcount == nargs) {
9331             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
9332             goto done;
9333         }
9334         else if (nargs == 0 && argdefs != NULL
9335                  && co->co_argcount == Py_SIZE(argdefs)) {
9336             /* function called with no arguments, but all parameters have
9337                a default value: use default values as arguments .*/
9338             args = &PyTuple_GET_ITEM(argdefs, 0);
9339             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
9340             goto done;
9341         }
9342     }
9343     if (kwargs != NULL) {
9344         Py_ssize_t pos, i;
9345         kwtuple = PyTuple_New(2 * nk);
9346         if (kwtuple == NULL) {
9347             result = NULL;
9348             goto done;
9349         }
9350         k = &PyTuple_GET_ITEM(kwtuple, 0);
9351         pos = i = 0;
9352         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
9353             Py_INCREF(k[i]);
9354             Py_INCREF(k[i+1]);
9355             i += 2;
9356         }
9357         nk = i / 2;
9358     }
9359     else {
9360         kwtuple = NULL;
9361         k = NULL;
9362     }
9363     closure = PyFunction_GET_CLOSURE(func);
9364 #if PY_MAJOR_VERSION >= 3
9365     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
9366 #endif
9367     if (argdefs != NULL) {
9368         d = &PyTuple_GET_ITEM(argdefs, 0);
9369         nd = Py_SIZE(argdefs);
9370     }
9371     else {
9372         d = NULL;
9373         nd = 0;
9374     }
9375 #if PY_MAJOR_VERSION >= 3
9376     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
9377                                args, (int)nargs,
9378                                k, (int)nk,
9379                                d, (int)nd, kwdefs, closure);
9380 #else
9381     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
9382                                args, (int)nargs,
9383                                k, (int)nk,
9384                                d, (int)nd, closure);
9385 #endif
9386     Py_XDECREF(kwtuple);
9387 done:
9388     Py_LeaveRecursiveCall();
9389     return result;
9390 }
9391 #endif
9392 #endif
9393 
9394 /* PyObjectCall */
9395 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)9396 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
9397     PyObject *result;
9398     ternaryfunc call = func->ob_type->tp_call;
9399     if (unlikely(!call))
9400         return PyObject_Call(func, arg, kw);
9401     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
9402         return NULL;
9403     result = (*call)(func, arg, kw);
9404     Py_LeaveRecursiveCall();
9405     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
9406         PyErr_SetString(
9407             PyExc_SystemError,
9408             "NULL result without error in PyObject_Call");
9409     }
9410     return result;
9411 }
9412 #endif
9413 
9414 /* PyObjectCallMethO */
9415 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)9416 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
9417     PyObject *self, *result;
9418     PyCFunction cfunc;
9419     cfunc = PyCFunction_GET_FUNCTION(func);
9420     self = PyCFunction_GET_SELF(func);
9421     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
9422         return NULL;
9423     result = cfunc(self, arg);
9424     Py_LeaveRecursiveCall();
9425     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
9426         PyErr_SetString(
9427             PyExc_SystemError,
9428             "NULL result without error in PyObject_Call");
9429     }
9430     return result;
9431 }
9432 #endif
9433 
9434 /* PyObjectCallOneArg */
9435 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)9436 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9437     PyObject *result;
9438     PyObject *args = PyTuple_New(1);
9439     if (unlikely(!args)) return NULL;
9440     Py_INCREF(arg);
9441     PyTuple_SET_ITEM(args, 0, arg);
9442     result = __Pyx_PyObject_Call(func, args, NULL);
9443     Py_DECREF(args);
9444     return result;
9445 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)9446 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9447 #if CYTHON_FAST_PYCALL
9448     if (PyFunction_Check(func)) {
9449         return __Pyx_PyFunction_FastCall(func, &arg, 1);
9450     }
9451 #endif
9452     if (likely(PyCFunction_Check(func))) {
9453         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
9454             return __Pyx_PyObject_CallMethO(func, arg);
9455 #if CYTHON_FAST_PYCCALL
9456         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
9457             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
9458 #endif
9459         }
9460     }
9461     return __Pyx__PyObject_CallOneArg(func, arg);
9462 }
9463 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)9464 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9465     PyObject *result;
9466     PyObject *args = PyTuple_Pack(1, arg);
9467     if (unlikely(!args)) return NULL;
9468     result = __Pyx_PyObject_Call(func, args, NULL);
9469     Py_DECREF(args);
9470     return result;
9471 }
9472 #endif
9473 
9474 /* PyDictVersioning */
9475 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)9476 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
9477     PyObject *dict = Py_TYPE(obj)->tp_dict;
9478     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
9479 }
__Pyx_get_object_dict_version(PyObject * obj)9480 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
9481     PyObject **dictptr = NULL;
9482     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
9483     if (offset) {
9484 #if CYTHON_COMPILING_IN_CPYTHON
9485         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
9486 #else
9487         dictptr = _PyObject_GetDictPtr(obj);
9488 #endif
9489     }
9490     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
9491 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)9492 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
9493     PyObject *dict = Py_TYPE(obj)->tp_dict;
9494     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
9495         return 0;
9496     return obj_dict_version == __Pyx_get_object_dict_version(obj);
9497 }
9498 #endif
9499 
9500 /* GetModuleGlobalName */
9501 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)9502 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
9503 #else
9504 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
9505 #endif
9506 {
9507     PyObject *result;
9508 #if !CYTHON_AVOID_BORROWED_REFS
9509 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
9510     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
9511     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9512     if (likely(result)) {
9513         return __Pyx_NewRef(result);
9514     } else if (unlikely(PyErr_Occurred())) {
9515         return NULL;
9516     }
9517 #else
9518     result = PyDict_GetItem(__pyx_d, name);
9519     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9520     if (likely(result)) {
9521         return __Pyx_NewRef(result);
9522     }
9523 #endif
9524 #else
9525     result = PyObject_GetItem(__pyx_d, name);
9526     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9527     if (likely(result)) {
9528         return __Pyx_NewRef(result);
9529     }
9530     PyErr_Clear();
9531 #endif
9532     return __Pyx_GetBuiltinName(name);
9533 }
9534 
9535 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)9536 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
9537     PyObject *args, *result = NULL;
9538     #if CYTHON_FAST_PYCALL
9539     if (PyFunction_Check(function)) {
9540         PyObject *args[2] = {arg1, arg2};
9541         return __Pyx_PyFunction_FastCall(function, args, 2);
9542     }
9543     #endif
9544     #if CYTHON_FAST_PYCCALL
9545     if (__Pyx_PyFastCFunction_Check(function)) {
9546         PyObject *args[2] = {arg1, arg2};
9547         return __Pyx_PyCFunction_FastCall(function, args, 2);
9548     }
9549     #endif
9550     args = PyTuple_New(2);
9551     if (unlikely(!args)) goto done;
9552     Py_INCREF(arg1);
9553     PyTuple_SET_ITEM(args, 0, arg1);
9554     Py_INCREF(arg2);
9555     PyTuple_SET_ITEM(args, 1, arg2);
9556     Py_INCREF(function);
9557     result = __Pyx_PyObject_Call(function, args, NULL);
9558     Py_DECREF(args);
9559     Py_DECREF(function);
9560 done:
9561     return result;
9562 }
9563 
9564 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)9565 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
9566     PyErr_Format(PyExc_ValueError,
9567                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
9568 }
9569 
9570 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)9571 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
9572     PyErr_Format(PyExc_ValueError,
9573                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
9574                  index, (index == 1) ? "" : "s");
9575 }
9576 
9577 /* IterFinish */
__Pyx_IterFinish(void)9578 static CYTHON_INLINE int __Pyx_IterFinish(void) {
9579 #if CYTHON_FAST_THREAD_STATE
9580     PyThreadState *tstate = __Pyx_PyThreadState_Current;
9581     PyObject* exc_type = tstate->curexc_type;
9582     if (unlikely(exc_type)) {
9583         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
9584             PyObject *exc_value, *exc_tb;
9585             exc_value = tstate->curexc_value;
9586             exc_tb = tstate->curexc_traceback;
9587             tstate->curexc_type = 0;
9588             tstate->curexc_value = 0;
9589             tstate->curexc_traceback = 0;
9590             Py_DECREF(exc_type);
9591             Py_XDECREF(exc_value);
9592             Py_XDECREF(exc_tb);
9593             return 0;
9594         } else {
9595             return -1;
9596         }
9597     }
9598     return 0;
9599 #else
9600     if (unlikely(PyErr_Occurred())) {
9601         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
9602             PyErr_Clear();
9603             return 0;
9604         } else {
9605             return -1;
9606         }
9607     }
9608     return 0;
9609 #endif
9610 }
9611 
9612 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)9613 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
9614     if (unlikely(retval)) {
9615         Py_DECREF(retval);
9616         __Pyx_RaiseTooManyValuesError(expected);
9617         return -1;
9618     } else {
9619         return __Pyx_IterFinish();
9620     }
9621     return 0;
9622 }
9623 
9624 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)9625 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
9626     PyObject *r;
9627     if (!j) return NULL;
9628     r = PyObject_GetItem(o, j);
9629     Py_DECREF(j);
9630     return r;
9631 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)9632 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
9633                                                               CYTHON_NCP_UNUSED int wraparound,
9634                                                               CYTHON_NCP_UNUSED int boundscheck) {
9635 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9636     Py_ssize_t wrapped_i = i;
9637     if (wraparound & unlikely(i < 0)) {
9638         wrapped_i += PyList_GET_SIZE(o);
9639     }
9640     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
9641         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
9642         Py_INCREF(r);
9643         return r;
9644     }
9645     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9646 #else
9647     return PySequence_GetItem(o, i);
9648 #endif
9649 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)9650 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
9651                                                               CYTHON_NCP_UNUSED int wraparound,
9652                                                               CYTHON_NCP_UNUSED int boundscheck) {
9653 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9654     Py_ssize_t wrapped_i = i;
9655     if (wraparound & unlikely(i < 0)) {
9656         wrapped_i += PyTuple_GET_SIZE(o);
9657     }
9658     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
9659         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
9660         Py_INCREF(r);
9661         return r;
9662     }
9663     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9664 #else
9665     return PySequence_GetItem(o, i);
9666 #endif
9667 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)9668 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
9669                                                      CYTHON_NCP_UNUSED int wraparound,
9670                                                      CYTHON_NCP_UNUSED int boundscheck) {
9671 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
9672     if (is_list || PyList_CheckExact(o)) {
9673         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
9674         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
9675             PyObject *r = PyList_GET_ITEM(o, n);
9676             Py_INCREF(r);
9677             return r;
9678         }
9679     }
9680     else if (PyTuple_CheckExact(o)) {
9681         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
9682         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
9683             PyObject *r = PyTuple_GET_ITEM(o, n);
9684             Py_INCREF(r);
9685             return r;
9686         }
9687     } else {
9688         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
9689         if (likely(m && m->sq_item)) {
9690             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
9691                 Py_ssize_t l = m->sq_length(o);
9692                 if (likely(l >= 0)) {
9693                     i += l;
9694                 } else {
9695                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
9696                         return NULL;
9697                     PyErr_Clear();
9698                 }
9699             }
9700             return m->sq_item(o, i);
9701         }
9702     }
9703 #else
9704     if (is_list || PySequence_Check(o)) {
9705         return PySequence_GetItem(o, i);
9706     }
9707 #endif
9708     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9709 }
9710 
9711 /* ObjectGetItem */
9712 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)9713 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
9714     PyObject *runerr;
9715     Py_ssize_t key_value;
9716     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
9717     if (unlikely(!(m && m->sq_item))) {
9718         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
9719         return NULL;
9720     }
9721     key_value = __Pyx_PyIndex_AsSsize_t(index);
9722     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
9723         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
9724     }
9725     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
9726         PyErr_Clear();
9727         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
9728     }
9729     return NULL;
9730 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)9731 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
9732     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
9733     if (likely(m && m->mp_subscript)) {
9734         return m->mp_subscript(obj, key);
9735     }
9736     return __Pyx_PyObject_GetIndex(obj, key);
9737 }
9738 #endif
9739 
9740 /* TypeImport */
9741 #ifndef __PYX_HAVE_RT_ImportType
9742 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)9743 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
9744     size_t size, enum __Pyx_ImportType_CheckSize check_size)
9745 {
9746     PyObject *result = 0;
9747     char warning[200];
9748     Py_ssize_t basicsize;
9749 #ifdef Py_LIMITED_API
9750     PyObject *py_basicsize;
9751 #endif
9752     result = PyObject_GetAttrString(module, class_name);
9753     if (!result)
9754         goto bad;
9755     if (!PyType_Check(result)) {
9756         PyErr_Format(PyExc_TypeError,
9757             "%.200s.%.200s is not a type object",
9758             module_name, class_name);
9759         goto bad;
9760     }
9761 #ifndef Py_LIMITED_API
9762     basicsize = ((PyTypeObject *)result)->tp_basicsize;
9763 #else
9764     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
9765     if (!py_basicsize)
9766         goto bad;
9767     basicsize = PyLong_AsSsize_t(py_basicsize);
9768     Py_DECREF(py_basicsize);
9769     py_basicsize = 0;
9770     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
9771         goto bad;
9772 #endif
9773     if ((size_t)basicsize < size) {
9774         PyErr_Format(PyExc_ValueError,
9775             "%.200s.%.200s size changed, may indicate binary incompatibility. "
9776             "Expected %zd from C header, got %zd from PyObject",
9777             module_name, class_name, size, basicsize);
9778         goto bad;
9779     }
9780     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
9781         PyErr_Format(PyExc_ValueError,
9782             "%.200s.%.200s size changed, may indicate binary incompatibility. "
9783             "Expected %zd from C header, got %zd from PyObject",
9784             module_name, class_name, size, basicsize);
9785         goto bad;
9786     }
9787     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
9788         PyOS_snprintf(warning, sizeof(warning),
9789             "%s.%s size changed, may indicate binary incompatibility. "
9790             "Expected %zd from C header, got %zd from PyObject",
9791             module_name, class_name, size, basicsize);
9792         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
9793     }
9794     return (PyTypeObject *)result;
9795 bad:
9796     Py_XDECREF(result);
9797     return NULL;
9798 }
9799 #endif
9800 
9801 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)9802 static void* __Pyx_GetVtable(PyObject *dict) {
9803     void* ptr;
9804     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
9805     if (!ob)
9806         goto bad;
9807 #if PY_VERSION_HEX >= 0x02070000
9808     ptr = PyCapsule_GetPointer(ob, 0);
9809 #else
9810     ptr = PyCObject_AsVoidPtr(ob);
9811 #endif
9812     if (!ptr && !PyErr_Occurred())
9813         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
9814     Py_DECREF(ob);
9815     return ptr;
9816 bad:
9817     Py_XDECREF(ob);
9818     return NULL;
9819 }
9820 
9821 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)9822 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
9823     PyObject *empty_list = 0;
9824     PyObject *module = 0;
9825     PyObject *global_dict = 0;
9826     PyObject *empty_dict = 0;
9827     PyObject *list;
9828     #if PY_MAJOR_VERSION < 3
9829     PyObject *py_import;
9830     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
9831     if (!py_import)
9832         goto bad;
9833     #endif
9834     if (from_list)
9835         list = from_list;
9836     else {
9837         empty_list = PyList_New(0);
9838         if (!empty_list)
9839             goto bad;
9840         list = empty_list;
9841     }
9842     global_dict = PyModule_GetDict(__pyx_m);
9843     if (!global_dict)
9844         goto bad;
9845     empty_dict = PyDict_New();
9846     if (!empty_dict)
9847         goto bad;
9848     {
9849         #if PY_MAJOR_VERSION >= 3
9850         if (level == -1) {
9851             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
9852                 module = PyImport_ImportModuleLevelObject(
9853                     name, global_dict, empty_dict, list, 1);
9854                 if (!module) {
9855                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
9856                         goto bad;
9857                     PyErr_Clear();
9858                 }
9859             }
9860             level = 0;
9861         }
9862         #endif
9863         if (!module) {
9864             #if PY_MAJOR_VERSION < 3
9865             PyObject *py_level = PyInt_FromLong(level);
9866             if (!py_level)
9867                 goto bad;
9868             module = PyObject_CallFunctionObjArgs(py_import,
9869                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
9870             Py_DECREF(py_level);
9871             #else
9872             module = PyImport_ImportModuleLevelObject(
9873                 name, global_dict, empty_dict, list, level);
9874             #endif
9875         }
9876     }
9877 bad:
9878     #if PY_MAJOR_VERSION < 3
9879     Py_XDECREF(py_import);
9880     #endif
9881     Py_XDECREF(empty_list);
9882     Py_XDECREF(empty_dict);
9883     return module;
9884 }
9885 
9886 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)9887 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
9888     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
9889     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
9890         PyErr_Format(PyExc_ImportError,
9891         #if PY_MAJOR_VERSION < 3
9892             "cannot import name %.230s", PyString_AS_STRING(name));
9893         #else
9894             "cannot import name %S", name);
9895         #endif
9896     }
9897     return value;
9898 }
9899 
9900 /* PyErrFetchRestore */
9901 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)9902 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9903     PyObject *tmp_type, *tmp_value, *tmp_tb;
9904     tmp_type = tstate->curexc_type;
9905     tmp_value = tstate->curexc_value;
9906     tmp_tb = tstate->curexc_traceback;
9907     tstate->curexc_type = type;
9908     tstate->curexc_value = value;
9909     tstate->curexc_traceback = tb;
9910     Py_XDECREF(tmp_type);
9911     Py_XDECREF(tmp_value);
9912     Py_XDECREF(tmp_tb);
9913 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)9914 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9915     *type = tstate->curexc_type;
9916     *value = tstate->curexc_value;
9917     *tb = tstate->curexc_traceback;
9918     tstate->curexc_type = 0;
9919     tstate->curexc_value = 0;
9920     tstate->curexc_traceback = 0;
9921 }
9922 #endif
9923 
9924 /* CLineInTraceback */
9925 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)9926 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
9927     PyObject *use_cline;
9928     PyObject *ptype, *pvalue, *ptraceback;
9929 #if CYTHON_COMPILING_IN_CPYTHON
9930     PyObject **cython_runtime_dict;
9931 #endif
9932     if (unlikely(!__pyx_cython_runtime)) {
9933         return c_line;
9934     }
9935     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
9936 #if CYTHON_COMPILING_IN_CPYTHON
9937     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
9938     if (likely(cython_runtime_dict)) {
9939         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
9940             use_cline, *cython_runtime_dict,
9941             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
9942     } else
9943 #endif
9944     {
9945       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
9946       if (use_cline_obj) {
9947         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
9948         Py_DECREF(use_cline_obj);
9949       } else {
9950         PyErr_Clear();
9951         use_cline = NULL;
9952       }
9953     }
9954     if (!use_cline) {
9955         c_line = 0;
9956         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
9957     }
9958     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
9959         c_line = 0;
9960     }
9961     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
9962     return c_line;
9963 }
9964 #endif
9965 
9966 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)9967 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
9968     int start = 0, mid = 0, end = count - 1;
9969     if (end >= 0 && code_line > entries[end].code_line) {
9970         return count;
9971     }
9972     while (start < end) {
9973         mid = start + (end - start) / 2;
9974         if (code_line < entries[mid].code_line) {
9975             end = mid;
9976         } else if (code_line > entries[mid].code_line) {
9977              start = mid + 1;
9978         } else {
9979             return mid;
9980         }
9981     }
9982     if (code_line <= entries[mid].code_line) {
9983         return mid;
9984     } else {
9985         return mid + 1;
9986     }
9987 }
__pyx_find_code_object(int code_line)9988 static PyCodeObject *__pyx_find_code_object(int code_line) {
9989     PyCodeObject* code_object;
9990     int pos;
9991     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
9992         return NULL;
9993     }
9994     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
9995     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
9996         return NULL;
9997     }
9998     code_object = __pyx_code_cache.entries[pos].code_object;
9999     Py_INCREF(code_object);
10000     return code_object;
10001 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)10002 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
10003     int pos, i;
10004     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
10005     if (unlikely(!code_line)) {
10006         return;
10007     }
10008     if (unlikely(!entries)) {
10009         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
10010         if (likely(entries)) {
10011             __pyx_code_cache.entries = entries;
10012             __pyx_code_cache.max_count = 64;
10013             __pyx_code_cache.count = 1;
10014             entries[0].code_line = code_line;
10015             entries[0].code_object = code_object;
10016             Py_INCREF(code_object);
10017         }
10018         return;
10019     }
10020     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10021     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
10022         PyCodeObject* tmp = entries[pos].code_object;
10023         entries[pos].code_object = code_object;
10024         Py_DECREF(tmp);
10025         return;
10026     }
10027     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
10028         int new_max = __pyx_code_cache.max_count + 64;
10029         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
10030             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
10031         if (unlikely(!entries)) {
10032             return;
10033         }
10034         __pyx_code_cache.entries = entries;
10035         __pyx_code_cache.max_count = new_max;
10036     }
10037     for (i=__pyx_code_cache.count; i>pos; i--) {
10038         entries[i] = entries[i-1];
10039     }
10040     entries[pos].code_line = code_line;
10041     entries[pos].code_object = code_object;
10042     __pyx_code_cache.count++;
10043     Py_INCREF(code_object);
10044 }
10045 
10046 /* AddTraceback */
10047 #include "compile.h"
10048 #include "frameobject.h"
10049 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)10050 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
10051             const char *funcname, int c_line,
10052             int py_line, const char *filename) {
10053     PyCodeObject *py_code = 0;
10054     PyObject *py_srcfile = 0;
10055     PyObject *py_funcname = 0;
10056     #if PY_MAJOR_VERSION < 3
10057     py_srcfile = PyString_FromString(filename);
10058     #else
10059     py_srcfile = PyUnicode_FromString(filename);
10060     #endif
10061     if (!py_srcfile) goto bad;
10062     if (c_line) {
10063         #if PY_MAJOR_VERSION < 3
10064         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10065         #else
10066         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10067         #endif
10068     }
10069     else {
10070         #if PY_MAJOR_VERSION < 3
10071         py_funcname = PyString_FromString(funcname);
10072         #else
10073         py_funcname = PyUnicode_FromString(funcname);
10074         #endif
10075     }
10076     if (!py_funcname) goto bad;
10077     py_code = __Pyx_PyCode_New(
10078         0,
10079         0,
10080         0,
10081         0,
10082         0,
10083         __pyx_empty_bytes, /*PyObject *code,*/
10084         __pyx_empty_tuple, /*PyObject *consts,*/
10085         __pyx_empty_tuple, /*PyObject *names,*/
10086         __pyx_empty_tuple, /*PyObject *varnames,*/
10087         __pyx_empty_tuple, /*PyObject *freevars,*/
10088         __pyx_empty_tuple, /*PyObject *cellvars,*/
10089         py_srcfile,   /*PyObject *filename,*/
10090         py_funcname,  /*PyObject *name,*/
10091         py_line,
10092         __pyx_empty_bytes  /*PyObject *lnotab*/
10093     );
10094     Py_DECREF(py_srcfile);
10095     Py_DECREF(py_funcname);
10096     return py_code;
10097 bad:
10098     Py_XDECREF(py_srcfile);
10099     Py_XDECREF(py_funcname);
10100     return NULL;
10101 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)10102 static void __Pyx_AddTraceback(const char *funcname, int c_line,
10103                                int py_line, const char *filename) {
10104     PyCodeObject *py_code = 0;
10105     PyFrameObject *py_frame = 0;
10106     PyThreadState *tstate = __Pyx_PyThreadState_Current;
10107     if (c_line) {
10108         c_line = __Pyx_CLineForTraceback(tstate, c_line);
10109     }
10110     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
10111     if (!py_code) {
10112         py_code = __Pyx_CreateCodeObjectForTraceback(
10113             funcname, c_line, py_line, filename);
10114         if (!py_code) goto bad;
10115         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
10116     }
10117     py_frame = PyFrame_New(
10118         tstate,            /*PyThreadState *tstate,*/
10119         py_code,           /*PyCodeObject *code,*/
10120         __pyx_d,    /*PyObject *globals,*/
10121         0                  /*PyObject *locals*/
10122     );
10123     if (!py_frame) goto bad;
10124     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
10125     PyTraceBack_Here(py_frame);
10126 bad:
10127     Py_XDECREF(py_code);
10128     Py_XDECREF(py_frame);
10129 }
10130 
10131 /* CIntFromPyVerify */
10132 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
10133     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
10134 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
10135     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
10136 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
10137     {\
10138         func_type value = func_value;\
10139         if (sizeof(target_type) < sizeof(func_type)) {\
10140             if (unlikely(value != (func_type) (target_type) value)) {\
10141                 func_type zero = 0;\
10142                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
10143                     return (target_type) -1;\
10144                 if (is_unsigned && unlikely(value < zero))\
10145                     goto raise_neg_overflow;\
10146                 else\
10147                     goto raise_overflow;\
10148             }\
10149         }\
10150         return (target_type) value;\
10151     }
10152 
10153 /* CIntFromPy */
__Pyx_PyInt_As_int16_t(PyObject * x)10154 static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) {
10155     const int16_t neg_one = (int16_t) ((int16_t) 0 - (int16_t) 1), const_zero = (int16_t) 0;
10156     const int is_unsigned = neg_one > const_zero;
10157 #if PY_MAJOR_VERSION < 3
10158     if (likely(PyInt_Check(x))) {
10159         if (sizeof(int16_t) < sizeof(long)) {
10160             __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x))
10161         } else {
10162             long val = PyInt_AS_LONG(x);
10163             if (is_unsigned && unlikely(val < 0)) {
10164                 goto raise_neg_overflow;
10165             }
10166             return (int16_t) val;
10167         }
10168     } else
10169 #endif
10170     if (likely(PyLong_Check(x))) {
10171         if (is_unsigned) {
10172 #if CYTHON_USE_PYLONG_INTERNALS
10173             const digit* digits = ((PyLongObject*)x)->ob_digit;
10174             switch (Py_SIZE(x)) {
10175                 case  0: return (int16_t) 0;
10176                 case  1: __PYX_VERIFY_RETURN_INT(int16_t, digit, digits[0])
10177                 case 2:
10178                     if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) {
10179                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10180                             __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10181                         } else if (8 * sizeof(int16_t) >= 2 * PyLong_SHIFT) {
10182                             return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
10183                         }
10184                     }
10185                     break;
10186                 case 3:
10187                     if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) {
10188                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10189                             __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10190                         } else if (8 * sizeof(int16_t) >= 3 * PyLong_SHIFT) {
10191                             return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
10192                         }
10193                     }
10194                     break;
10195                 case 4:
10196                     if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) {
10197                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10198                             __PYX_VERIFY_RETURN_INT(int16_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])))
10199                         } else if (8 * sizeof(int16_t) >= 4 * PyLong_SHIFT) {
10200                             return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
10201                         }
10202                     }
10203                     break;
10204             }
10205 #endif
10206 #if CYTHON_COMPILING_IN_CPYTHON
10207             if (unlikely(Py_SIZE(x) < 0)) {
10208                 goto raise_neg_overflow;
10209             }
10210 #else
10211             {
10212                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10213                 if (unlikely(result < 0))
10214                     return (int16_t) -1;
10215                 if (unlikely(result == 1))
10216                     goto raise_neg_overflow;
10217             }
10218 #endif
10219             if (sizeof(int16_t) <= sizeof(unsigned long)) {
10220                 __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x))
10221 #ifdef HAVE_LONG_LONG
10222             } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) {
10223                 __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10224 #endif
10225             }
10226         } else {
10227 #if CYTHON_USE_PYLONG_INTERNALS
10228             const digit* digits = ((PyLongObject*)x)->ob_digit;
10229             switch (Py_SIZE(x)) {
10230                 case  0: return (int16_t) 0;
10231                 case -1: __PYX_VERIFY_RETURN_INT(int16_t, sdigit, (sdigit) (-(sdigit)digits[0]))
10232                 case  1: __PYX_VERIFY_RETURN_INT(int16_t,  digit, +digits[0])
10233                 case -2:
10234                     if (8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT) {
10235                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10236                             __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10237                         } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
10238                             return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
10239                         }
10240                     }
10241                     break;
10242                 case 2:
10243                     if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) {
10244                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10245                             __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10246                         } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
10247                             return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
10248                         }
10249                     }
10250                     break;
10251                 case -3:
10252                     if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
10253                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10254                             __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10255                         } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
10256                             return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
10257                         }
10258                     }
10259                     break;
10260                 case 3:
10261                     if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) {
10262                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10263                             __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10264                         } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
10265                             return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
10266                         }
10267                     }
10268                     break;
10269                 case -4:
10270                     if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
10271                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10272                             __PYX_VERIFY_RETURN_INT(int16_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])))
10273                         } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) {
10274                             return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
10275                         }
10276                     }
10277                     break;
10278                 case 4:
10279                     if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) {
10280                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10281                             __PYX_VERIFY_RETURN_INT(int16_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])))
10282                         } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) {
10283                             return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
10284                         }
10285                     }
10286                     break;
10287             }
10288 #endif
10289             if (sizeof(int16_t) <= sizeof(long)) {
10290                 __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x))
10291 #ifdef HAVE_LONG_LONG
10292             } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) {
10293                 __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x))
10294 #endif
10295             }
10296         }
10297         {
10298 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10299             PyErr_SetString(PyExc_RuntimeError,
10300                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10301 #else
10302             int16_t val;
10303             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10304  #if PY_MAJOR_VERSION < 3
10305             if (likely(v) && !PyLong_Check(v)) {
10306                 PyObject *tmp = v;
10307                 v = PyNumber_Long(tmp);
10308                 Py_DECREF(tmp);
10309             }
10310  #endif
10311             if (likely(v)) {
10312                 int one = 1; int is_little = (int)*(unsigned char *)&one;
10313                 unsigned char *bytes = (unsigned char *)&val;
10314                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10315                                               bytes, sizeof(val),
10316                                               is_little, !is_unsigned);
10317                 Py_DECREF(v);
10318                 if (likely(!ret))
10319                     return val;
10320             }
10321 #endif
10322             return (int16_t) -1;
10323         }
10324     } else {
10325         int16_t val;
10326         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10327         if (!tmp) return (int16_t) -1;
10328         val = __Pyx_PyInt_As_int16_t(tmp);
10329         Py_DECREF(tmp);
10330         return val;
10331     }
10332 raise_overflow:
10333     PyErr_SetString(PyExc_OverflowError,
10334         "value too large to convert to int16_t");
10335     return (int16_t) -1;
10336 raise_neg_overflow:
10337     PyErr_SetString(PyExc_OverflowError,
10338         "can't convert negative value to int16_t");
10339     return (int16_t) -1;
10340 }
10341 
10342 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)10343 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
10344     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
10345     const int is_unsigned = neg_one > const_zero;
10346 #if PY_MAJOR_VERSION < 3
10347     if (likely(PyInt_Check(x))) {
10348         if (sizeof(int) < sizeof(long)) {
10349             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
10350         } else {
10351             long val = PyInt_AS_LONG(x);
10352             if (is_unsigned && unlikely(val < 0)) {
10353                 goto raise_neg_overflow;
10354             }
10355             return (int) val;
10356         }
10357     } else
10358 #endif
10359     if (likely(PyLong_Check(x))) {
10360         if (is_unsigned) {
10361 #if CYTHON_USE_PYLONG_INTERNALS
10362             const digit* digits = ((PyLongObject*)x)->ob_digit;
10363             switch (Py_SIZE(x)) {
10364                 case  0: return (int) 0;
10365                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
10366                 case 2:
10367                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
10368                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10369                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10370                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
10371                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10372                         }
10373                     }
10374                     break;
10375                 case 3:
10376                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
10377                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10378                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10379                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
10380                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10381                         }
10382                     }
10383                     break;
10384                 case 4:
10385                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
10386                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10387                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10388                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
10389                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10390                         }
10391                     }
10392                     break;
10393             }
10394 #endif
10395 #if CYTHON_COMPILING_IN_CPYTHON
10396             if (unlikely(Py_SIZE(x) < 0)) {
10397                 goto raise_neg_overflow;
10398             }
10399 #else
10400             {
10401                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10402                 if (unlikely(result < 0))
10403                     return (int) -1;
10404                 if (unlikely(result == 1))
10405                     goto raise_neg_overflow;
10406             }
10407 #endif
10408             if (sizeof(int) <= sizeof(unsigned long)) {
10409                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
10410 #ifdef HAVE_LONG_LONG
10411             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
10412                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10413 #endif
10414             }
10415         } else {
10416 #if CYTHON_USE_PYLONG_INTERNALS
10417             const digit* digits = ((PyLongObject*)x)->ob_digit;
10418             switch (Py_SIZE(x)) {
10419                 case  0: return (int) 0;
10420                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
10421                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
10422                 case -2:
10423                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
10424                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10425                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10426                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10427                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10428                         }
10429                     }
10430                     break;
10431                 case 2:
10432                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
10433                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10434                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10435                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10436                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10437                         }
10438                     }
10439                     break;
10440                 case -3:
10441                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10442                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10443                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10444                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10445                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10446                         }
10447                     }
10448                     break;
10449                 case 3:
10450                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
10451                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10452                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10453                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10454                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10455                         }
10456                     }
10457                     break;
10458                 case -4:
10459                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10460                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10461                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10462                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
10463                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10464                         }
10465                     }
10466                     break;
10467                 case 4:
10468                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
10469                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10470                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10471                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
10472                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10473                         }
10474                     }
10475                     break;
10476             }
10477 #endif
10478             if (sizeof(int) <= sizeof(long)) {
10479                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
10480 #ifdef HAVE_LONG_LONG
10481             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
10482                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
10483 #endif
10484             }
10485         }
10486         {
10487 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10488             PyErr_SetString(PyExc_RuntimeError,
10489                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10490 #else
10491             int val;
10492             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10493  #if PY_MAJOR_VERSION < 3
10494             if (likely(v) && !PyLong_Check(v)) {
10495                 PyObject *tmp = v;
10496                 v = PyNumber_Long(tmp);
10497                 Py_DECREF(tmp);
10498             }
10499  #endif
10500             if (likely(v)) {
10501                 int one = 1; int is_little = (int)*(unsigned char *)&one;
10502                 unsigned char *bytes = (unsigned char *)&val;
10503                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10504                                               bytes, sizeof(val),
10505                                               is_little, !is_unsigned);
10506                 Py_DECREF(v);
10507                 if (likely(!ret))
10508                     return val;
10509             }
10510 #endif
10511             return (int) -1;
10512         }
10513     } else {
10514         int val;
10515         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10516         if (!tmp) return (int) -1;
10517         val = __Pyx_PyInt_As_int(tmp);
10518         Py_DECREF(tmp);
10519         return val;
10520     }
10521 raise_overflow:
10522     PyErr_SetString(PyExc_OverflowError,
10523         "value too large to convert to int");
10524     return (int) -1;
10525 raise_neg_overflow:
10526     PyErr_SetString(PyExc_OverflowError,
10527         "can't convert negative value to int");
10528     return (int) -1;
10529 }
10530 
10531 /* CIntFromPy */
__Pyx_PyInt_As_uint8_t(PyObject * x)10532 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
10533     const uint8_t neg_one = (uint8_t) ((uint8_t) 0 - (uint8_t) 1), const_zero = (uint8_t) 0;
10534     const int is_unsigned = neg_one > const_zero;
10535 #if PY_MAJOR_VERSION < 3
10536     if (likely(PyInt_Check(x))) {
10537         if (sizeof(uint8_t) < sizeof(long)) {
10538             __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x))
10539         } else {
10540             long val = PyInt_AS_LONG(x);
10541             if (is_unsigned && unlikely(val < 0)) {
10542                 goto raise_neg_overflow;
10543             }
10544             return (uint8_t) val;
10545         }
10546     } else
10547 #endif
10548     if (likely(PyLong_Check(x))) {
10549         if (is_unsigned) {
10550 #if CYTHON_USE_PYLONG_INTERNALS
10551             const digit* digits = ((PyLongObject*)x)->ob_digit;
10552             switch (Py_SIZE(x)) {
10553                 case  0: return (uint8_t) 0;
10554                 case  1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0])
10555                 case 2:
10556                     if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) {
10557                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10558                             __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10559                         } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) {
10560                             return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
10561                         }
10562                     }
10563                     break;
10564                 case 3:
10565                     if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) {
10566                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10567                             __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10568                         } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) {
10569                             return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
10570                         }
10571                     }
10572                     break;
10573                 case 4:
10574                     if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) {
10575                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10576                             __PYX_VERIFY_RETURN_INT(uint8_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])))
10577                         } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) {
10578                             return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
10579                         }
10580                     }
10581                     break;
10582             }
10583 #endif
10584 #if CYTHON_COMPILING_IN_CPYTHON
10585             if (unlikely(Py_SIZE(x) < 0)) {
10586                 goto raise_neg_overflow;
10587             }
10588 #else
10589             {
10590                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10591                 if (unlikely(result < 0))
10592                     return (uint8_t) -1;
10593                 if (unlikely(result == 1))
10594                     goto raise_neg_overflow;
10595             }
10596 #endif
10597             if (sizeof(uint8_t) <= sizeof(unsigned long)) {
10598                 __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x))
10599 #ifdef HAVE_LONG_LONG
10600             } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
10601                 __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10602 #endif
10603             }
10604         } else {
10605 #if CYTHON_USE_PYLONG_INTERNALS
10606             const digit* digits = ((PyLongObject*)x)->ob_digit;
10607             switch (Py_SIZE(x)) {
10608                 case  0: return (uint8_t) 0;
10609                 case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0]))
10610                 case  1: __PYX_VERIFY_RETURN_INT(uint8_t,  digit, +digits[0])
10611                 case -2:
10612                     if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) {
10613                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10614                             __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10615                         } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
10616                             return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
10617                         }
10618                     }
10619                     break;
10620                 case 2:
10621                     if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) {
10622                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10623                             __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10624                         } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
10625                             return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
10626                         }
10627                     }
10628                     break;
10629                 case -3:
10630                     if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
10631                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10632                             __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10633                         } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
10634                             return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
10635                         }
10636                     }
10637                     break;
10638                 case 3:
10639                     if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) {
10640                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10641                             __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10642                         } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
10643                             return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
10644                         }
10645                     }
10646                     break;
10647                 case -4:
10648                     if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
10649                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10650                             __PYX_VERIFY_RETURN_INT(uint8_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])))
10651                         } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) {
10652                             return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
10653                         }
10654                     }
10655                     break;
10656                 case 4:
10657                     if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) {
10658                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10659                             __PYX_VERIFY_RETURN_INT(uint8_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])))
10660                         } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) {
10661                             return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
10662                         }
10663                     }
10664                     break;
10665             }
10666 #endif
10667             if (sizeof(uint8_t) <= sizeof(long)) {
10668                 __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x))
10669 #ifdef HAVE_LONG_LONG
10670             } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
10671                 __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x))
10672 #endif
10673             }
10674         }
10675         {
10676 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10677             PyErr_SetString(PyExc_RuntimeError,
10678                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10679 #else
10680             uint8_t val;
10681             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10682  #if PY_MAJOR_VERSION < 3
10683             if (likely(v) && !PyLong_Check(v)) {
10684                 PyObject *tmp = v;
10685                 v = PyNumber_Long(tmp);
10686                 Py_DECREF(tmp);
10687             }
10688  #endif
10689             if (likely(v)) {
10690                 int one = 1; int is_little = (int)*(unsigned char *)&one;
10691                 unsigned char *bytes = (unsigned char *)&val;
10692                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10693                                               bytes, sizeof(val),
10694                                               is_little, !is_unsigned);
10695                 Py_DECREF(v);
10696                 if (likely(!ret))
10697                     return val;
10698             }
10699 #endif
10700             return (uint8_t) -1;
10701         }
10702     } else {
10703         uint8_t val;
10704         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10705         if (!tmp) return (uint8_t) -1;
10706         val = __Pyx_PyInt_As_uint8_t(tmp);
10707         Py_DECREF(tmp);
10708         return val;
10709     }
10710 raise_overflow:
10711     PyErr_SetString(PyExc_OverflowError,
10712         "value too large to convert to uint8_t");
10713     return (uint8_t) -1;
10714 raise_neg_overflow:
10715     PyErr_SetString(PyExc_OverflowError,
10716         "can't convert negative value to uint8_t");
10717     return (uint8_t) -1;
10718 }
10719 
10720 /* CIntToPy */
__Pyx_PyInt_From_long(long value)10721 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
10722     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
10723     const int is_unsigned = neg_one > const_zero;
10724     if (is_unsigned) {
10725         if (sizeof(long) < sizeof(long)) {
10726             return PyInt_FromLong((long) value);
10727         } else if (sizeof(long) <= sizeof(unsigned long)) {
10728             return PyLong_FromUnsignedLong((unsigned long) value);
10729 #ifdef HAVE_LONG_LONG
10730         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
10731             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10732 #endif
10733         }
10734     } else {
10735         if (sizeof(long) <= sizeof(long)) {
10736             return PyInt_FromLong((long) value);
10737 #ifdef HAVE_LONG_LONG
10738         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
10739             return PyLong_FromLongLong((PY_LONG_LONG) value);
10740 #endif
10741         }
10742     }
10743     {
10744         int one = 1; int little = (int)*(unsigned char *)&one;
10745         unsigned char *bytes = (unsigned char *)&value;
10746         return _PyLong_FromByteArray(bytes, sizeof(long),
10747                                      little, !is_unsigned);
10748     }
10749 }
10750 
10751 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)10752 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
10753     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
10754     const int is_unsigned = neg_one > const_zero;
10755 #if PY_MAJOR_VERSION < 3
10756     if (likely(PyInt_Check(x))) {
10757         if (sizeof(long) < sizeof(long)) {
10758             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
10759         } else {
10760             long val = PyInt_AS_LONG(x);
10761             if (is_unsigned && unlikely(val < 0)) {
10762                 goto raise_neg_overflow;
10763             }
10764             return (long) val;
10765         }
10766     } else
10767 #endif
10768     if (likely(PyLong_Check(x))) {
10769         if (is_unsigned) {
10770 #if CYTHON_USE_PYLONG_INTERNALS
10771             const digit* digits = ((PyLongObject*)x)->ob_digit;
10772             switch (Py_SIZE(x)) {
10773                 case  0: return (long) 0;
10774                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
10775                 case 2:
10776                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
10777                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10778                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10779                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
10780                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10781                         }
10782                     }
10783                     break;
10784                 case 3:
10785                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
10786                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10787                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10788                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
10789                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10790                         }
10791                     }
10792                     break;
10793                 case 4:
10794                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
10795                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10796                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10797                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
10798                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10799                         }
10800                     }
10801                     break;
10802             }
10803 #endif
10804 #if CYTHON_COMPILING_IN_CPYTHON
10805             if (unlikely(Py_SIZE(x) < 0)) {
10806                 goto raise_neg_overflow;
10807             }
10808 #else
10809             {
10810                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10811                 if (unlikely(result < 0))
10812                     return (long) -1;
10813                 if (unlikely(result == 1))
10814                     goto raise_neg_overflow;
10815             }
10816 #endif
10817             if (sizeof(long) <= sizeof(unsigned long)) {
10818                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
10819 #ifdef HAVE_LONG_LONG
10820             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
10821                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10822 #endif
10823             }
10824         } else {
10825 #if CYTHON_USE_PYLONG_INTERNALS
10826             const digit* digits = ((PyLongObject*)x)->ob_digit;
10827             switch (Py_SIZE(x)) {
10828                 case  0: return (long) 0;
10829                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
10830                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
10831                 case -2:
10832                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
10833                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10834                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10835                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10836                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10837                         }
10838                     }
10839                     break;
10840                 case 2:
10841                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
10842                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10843                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10844                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10845                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10846                         }
10847                     }
10848                     break;
10849                 case -3:
10850                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10851                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10852                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10853                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10854                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10855                         }
10856                     }
10857                     break;
10858                 case 3:
10859                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
10860                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10861                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10862                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10863                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10864                         }
10865                     }
10866                     break;
10867                 case -4:
10868                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10869                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10870                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10871                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10872                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10873                         }
10874                     }
10875                     break;
10876                 case 4:
10877                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
10878                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10879                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10880                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10881                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10882                         }
10883                     }
10884                     break;
10885             }
10886 #endif
10887             if (sizeof(long) <= sizeof(long)) {
10888                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
10889 #ifdef HAVE_LONG_LONG
10890             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
10891                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
10892 #endif
10893             }
10894         }
10895         {
10896 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10897             PyErr_SetString(PyExc_RuntimeError,
10898                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10899 #else
10900             long val;
10901             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10902  #if PY_MAJOR_VERSION < 3
10903             if (likely(v) && !PyLong_Check(v)) {
10904                 PyObject *tmp = v;
10905                 v = PyNumber_Long(tmp);
10906                 Py_DECREF(tmp);
10907             }
10908  #endif
10909             if (likely(v)) {
10910                 int one = 1; int is_little = (int)*(unsigned char *)&one;
10911                 unsigned char *bytes = (unsigned char *)&val;
10912                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10913                                               bytes, sizeof(val),
10914                                               is_little, !is_unsigned);
10915                 Py_DECREF(v);
10916                 if (likely(!ret))
10917                     return val;
10918             }
10919 #endif
10920             return (long) -1;
10921         }
10922     } else {
10923         long val;
10924         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10925         if (!tmp) return (long) -1;
10926         val = __Pyx_PyInt_As_long(tmp);
10927         Py_DECREF(tmp);
10928         return val;
10929     }
10930 raise_overflow:
10931     PyErr_SetString(PyExc_OverflowError,
10932         "value too large to convert to long");
10933     return (long) -1;
10934 raise_neg_overflow:
10935     PyErr_SetString(PyExc_OverflowError,
10936         "can't convert negative value to long");
10937     return (long) -1;
10938 }
10939 
10940 /* FastTypeChecks */
10941 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)10942 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
10943     while (a) {
10944         a = a->tp_base;
10945         if (a == b)
10946             return 1;
10947     }
10948     return b == &PyBaseObject_Type;
10949 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)10950 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
10951     PyObject *mro;
10952     if (a == b) return 1;
10953     mro = a->tp_mro;
10954     if (likely(mro)) {
10955         Py_ssize_t i, n;
10956         n = PyTuple_GET_SIZE(mro);
10957         for (i = 0; i < n; i++) {
10958             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
10959                 return 1;
10960         }
10961         return 0;
10962     }
10963     return __Pyx_InBases(a, b);
10964 }
10965 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)10966 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
10967     PyObject *exception, *value, *tb;
10968     int res;
10969     __Pyx_PyThreadState_declare
10970     __Pyx_PyThreadState_assign
10971     __Pyx_ErrFetch(&exception, &value, &tb);
10972     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
10973     if (unlikely(res == -1)) {
10974         PyErr_WriteUnraisable(err);
10975         res = 0;
10976     }
10977     if (!res) {
10978         res = PyObject_IsSubclass(err, exc_type2);
10979         if (unlikely(res == -1)) {
10980             PyErr_WriteUnraisable(err);
10981             res = 0;
10982         }
10983     }
10984     __Pyx_ErrRestore(exception, value, tb);
10985     return res;
10986 }
10987 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)10988 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
10989     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
10990     if (!res) {
10991         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
10992     }
10993     return res;
10994 }
10995 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)10996 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10997     Py_ssize_t i, n;
10998     assert(PyExceptionClass_Check(exc_type));
10999     n = PyTuple_GET_SIZE(tuple);
11000 #if PY_MAJOR_VERSION >= 3
11001     for (i=0; i<n; i++) {
11002         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11003     }
11004 #endif
11005     for (i=0; i<n; i++) {
11006         PyObject *t = PyTuple_GET_ITEM(tuple, i);
11007         #if PY_MAJOR_VERSION < 3
11008         if (likely(exc_type == t)) return 1;
11009         #endif
11010         if (likely(PyExceptionClass_Check(t))) {
11011             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
11012         } else {
11013         }
11014     }
11015     return 0;
11016 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)11017 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
11018     if (likely(err == exc_type)) return 1;
11019     if (likely(PyExceptionClass_Check(err))) {
11020         if (likely(PyExceptionClass_Check(exc_type))) {
11021             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
11022         } else if (likely(PyTuple_Check(exc_type))) {
11023             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
11024         } else {
11025         }
11026     }
11027     return PyErr_GivenExceptionMatches(err, exc_type);
11028 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)11029 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
11030     assert(PyExceptionClass_Check(exc_type1));
11031     assert(PyExceptionClass_Check(exc_type2));
11032     if (likely(err == exc_type1 || err == exc_type2)) return 1;
11033     if (likely(PyExceptionClass_Check(err))) {
11034         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
11035     }
11036     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
11037 }
11038 #endif
11039 
11040 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)11041 static int __Pyx_check_binary_version(void) {
11042     char ctversion[4], rtversion[4];
11043     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
11044     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
11045     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
11046         char message[200];
11047         PyOS_snprintf(message, sizeof(message),
11048                       "compiletime version %s of module '%.100s' "
11049                       "does not match runtime version %s",
11050                       ctversion, __Pyx_MODULE_NAME, rtversion);
11051         return PyErr_WarnEx(NULL, message, 1);
11052     }
11053     return 0;
11054 }
11055 
11056 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)11057 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
11058     while (t->p) {
11059         #if PY_MAJOR_VERSION < 3
11060         if (t->is_unicode) {
11061             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
11062         } else if (t->intern) {
11063             *t->p = PyString_InternFromString(t->s);
11064         } else {
11065             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
11066         }
11067         #else
11068         if (t->is_unicode | t->is_str) {
11069             if (t->intern) {
11070                 *t->p = PyUnicode_InternFromString(t->s);
11071             } else if (t->encoding) {
11072                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
11073             } else {
11074                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
11075             }
11076         } else {
11077             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
11078         }
11079         #endif
11080         if (!*t->p)
11081             return -1;
11082         if (PyObject_Hash(*t->p) == -1)
11083             return -1;
11084         ++t;
11085     }
11086     return 0;
11087 }
11088 
__Pyx_PyUnicode_FromString(const char * c_str)11089 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
11090     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
11091 }
__Pyx_PyObject_AsString(PyObject * o)11092 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
11093     Py_ssize_t ignore;
11094     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
11095 }
11096 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
11097 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)11098 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
11099     char* defenc_c;
11100     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
11101     if (!defenc) return NULL;
11102     defenc_c = PyBytes_AS_STRING(defenc);
11103 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
11104     {
11105         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
11106         char* c;
11107         for (c = defenc_c; c < end; c++) {
11108             if ((unsigned char) (*c) >= 128) {
11109                 PyUnicode_AsASCIIString(o);
11110                 return NULL;
11111             }
11112         }
11113     }
11114 #endif
11115     *length = PyBytes_GET_SIZE(defenc);
11116     return defenc_c;
11117 }
11118 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)11119 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
11120     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
11121 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
11122     if (likely(PyUnicode_IS_ASCII(o))) {
11123         *length = PyUnicode_GET_LENGTH(o);
11124         return PyUnicode_AsUTF8(o);
11125     } else {
11126         PyUnicode_AsASCIIString(o);
11127         return NULL;
11128     }
11129 #else
11130     return PyUnicode_AsUTF8AndSize(o, length);
11131 #endif
11132 }
11133 #endif
11134 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)11135 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
11136 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
11137     if (
11138 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
11139             __Pyx_sys_getdefaultencoding_not_ascii &&
11140 #endif
11141             PyUnicode_Check(o)) {
11142         return __Pyx_PyUnicode_AsStringAndSize(o, length);
11143     } else
11144 #endif
11145 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
11146     if (PyByteArray_Check(o)) {
11147         *length = PyByteArray_GET_SIZE(o);
11148         return PyByteArray_AS_STRING(o);
11149     } else
11150 #endif
11151     {
11152         char* result;
11153         int r = PyBytes_AsStringAndSize(o, &result, length);
11154         if (unlikely(r < 0)) {
11155             return NULL;
11156         } else {
11157             return result;
11158         }
11159     }
11160 }
__Pyx_PyObject_IsTrue(PyObject * x)11161 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
11162    int is_true = x == Py_True;
11163    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
11164    else return PyObject_IsTrue(x);
11165 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)11166 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
11167     int retval;
11168     if (unlikely(!x)) return -1;
11169     retval = __Pyx_PyObject_IsTrue(x);
11170     Py_DECREF(x);
11171     return retval;
11172 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)11173 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
11174 #if PY_MAJOR_VERSION >= 3
11175     if (PyLong_Check(result)) {
11176         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
11177                 "__int__ returned non-int (type %.200s).  "
11178                 "The ability to return an instance of a strict subclass of int "
11179                 "is deprecated, and may be removed in a future version of Python.",
11180                 Py_TYPE(result)->tp_name)) {
11181             Py_DECREF(result);
11182             return NULL;
11183         }
11184         return result;
11185     }
11186 #endif
11187     PyErr_Format(PyExc_TypeError,
11188                  "__%.4s__ returned non-%.4s (type %.200s)",
11189                  type_name, type_name, Py_TYPE(result)->tp_name);
11190     Py_DECREF(result);
11191     return NULL;
11192 }
__Pyx_PyNumber_IntOrLong(PyObject * x)11193 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
11194 #if CYTHON_USE_TYPE_SLOTS
11195   PyNumberMethods *m;
11196 #endif
11197   const char *name = NULL;
11198   PyObject *res = NULL;
11199 #if PY_MAJOR_VERSION < 3
11200   if (likely(PyInt_Check(x) || PyLong_Check(x)))
11201 #else
11202   if (likely(PyLong_Check(x)))
11203 #endif
11204     return __Pyx_NewRef(x);
11205 #if CYTHON_USE_TYPE_SLOTS
11206   m = Py_TYPE(x)->tp_as_number;
11207   #if PY_MAJOR_VERSION < 3
11208   if (m && m->nb_int) {
11209     name = "int";
11210     res = m->nb_int(x);
11211   }
11212   else if (m && m->nb_long) {
11213     name = "long";
11214     res = m->nb_long(x);
11215   }
11216   #else
11217   if (likely(m && m->nb_int)) {
11218     name = "int";
11219     res = m->nb_int(x);
11220   }
11221   #endif
11222 #else
11223   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
11224     res = PyNumber_Int(x);
11225   }
11226 #endif
11227   if (likely(res)) {
11228 #if PY_MAJOR_VERSION < 3
11229     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
11230 #else
11231     if (unlikely(!PyLong_CheckExact(res))) {
11232 #endif
11233         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
11234     }
11235   }
11236   else if (!PyErr_Occurred()) {
11237     PyErr_SetString(PyExc_TypeError,
11238                     "an integer is required");
11239   }
11240   return res;
11241 }
11242 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
11243   Py_ssize_t ival;
11244   PyObject *x;
11245 #if PY_MAJOR_VERSION < 3
11246   if (likely(PyInt_CheckExact(b))) {
11247     if (sizeof(Py_ssize_t) >= sizeof(long))
11248         return PyInt_AS_LONG(b);
11249     else
11250         return PyInt_AsSsize_t(b);
11251   }
11252 #endif
11253   if (likely(PyLong_CheckExact(b))) {
11254     #if CYTHON_USE_PYLONG_INTERNALS
11255     const digit* digits = ((PyLongObject*)b)->ob_digit;
11256     const Py_ssize_t size = Py_SIZE(b);
11257     if (likely(__Pyx_sst_abs(size) <= 1)) {
11258         ival = likely(size) ? digits[0] : 0;
11259         if (size == -1) ival = -ival;
11260         return ival;
11261     } else {
11262       switch (size) {
11263          case 2:
11264            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
11265              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11266            }
11267            break;
11268          case -2:
11269            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
11270              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11271            }
11272            break;
11273          case 3:
11274            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
11275              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11276            }
11277            break;
11278          case -3:
11279            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
11280              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11281            }
11282            break;
11283          case 4:
11284            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
11285              return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11286            }
11287            break;
11288          case -4:
11289            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
11290              return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11291            }
11292            break;
11293       }
11294     }
11295     #endif
11296     return PyLong_AsSsize_t(b);
11297   }
11298   x = PyNumber_Index(b);
11299   if (!x) return -1;
11300   ival = PyInt_AsSsize_t(x);
11301   Py_DECREF(x);
11302   return ival;
11303 }
11304 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
11305   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
11306 }
11307 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
11308     return PyInt_FromSize_t(ival);
11309 }
11310 
11311 
11312 #endif /* Py_PYTHON_H */
11313 
11314 
11315 static struct _inittab pygame_sdl2_gfxdraw_inittab[] = {
11316 #if PY_MAJOR_VERSION < 3
11317     { "pygame_sdl2.gfxdraw", initpygame_sdl2_gfxdraw },
11318 #else
11319     { "pygame_sdl2.gfxdraw", PyInit_pygame_sdl2_gfxdraw },
11320 #endif
11321     { NULL, NULL },
11322 };
11323 
11324 static void pygame_sdl2_gfxdraw_constructor(void) __attribute__((constructor));
11325 
11326 static void pygame_sdl2_gfxdraw_constructor(void) {
11327     PyImport_ExtendInittab(pygame_sdl2_gfxdraw_inittab);
11328 }
11329