@@ -44,18 +44,6 @@ static void PyBufferRegion_dealloc(PyBufferRegion *self)
4444 Py_TYPE (self)->tp_free ((PyObject *)self);
4545}
4646
47- static PyObject *PyBufferRegion_to_string (PyBufferRegion *self, PyObject *args)
48- {
49- char const * msg =
50- " BufferRegion.to_string is deprecated since Matplotlib 3.7 and will "
51- " be removed two minor releases later; use np.asarray(region) instead." ;
52- if (PyErr_WarnEx (PyExc_DeprecationWarning, msg, 1 )) {
53- return NULL ;
54- }
55- return PyBytes_FromStringAndSize ((const char *)self->x ->get_data (),
56- (Py_ssize_t) self->x ->get_height () * self->x ->get_stride ());
57- }
58-
5947/* TODO: This doesn't seem to be used internally. Remove? */
6048
6149static PyObject *PyBufferRegion_set_x (PyBufferRegion *self, PyObject *args)
@@ -87,28 +75,6 @@ static PyObject *PyBufferRegion_get_extents(PyBufferRegion *self, PyObject *args
8775 return Py_BuildValue (" IIII" , rect.x1 , rect.y1 , rect.x2 , rect.y2 );
8876}
8977
90- static PyObject *PyBufferRegion_to_string_argb (PyBufferRegion *self, PyObject *args)
91- {
92- char const * msg =
93- " BufferRegion.to_string_argb is deprecated since Matplotlib 3.7 and "
94- " will be removed two minor releases later; use "
95- " np.take(region, [2, 1, 0, 3], axis=2) instead." ;
96- if (PyErr_WarnEx (PyExc_DeprecationWarning, msg, 1 )) {
97- return NULL ;
98- }
99- PyObject *bufobj;
100- uint8_t *buf;
101- Py_ssize_t height, stride;
102- height = self->x ->get_height ();
103- stride = self->x ->get_stride ();
104- bufobj = PyBytes_FromStringAndSize (NULL , height * stride);
105- buf = (uint8_t *)PyBytes_AS_STRING (bufobj);
106-
107- CALL_CPP_CLEANUP (" to_string_argb" , (self->x ->to_string_argb (buf)), Py_DECREF (bufobj));
108-
109- return bufobj;
110- }
111-
11278int PyBufferRegion_get_buffer (PyBufferRegion *self, Py_buffer *buf, int flags)
11379{
11480 Py_INCREF (self);
@@ -136,8 +102,6 @@ int PyBufferRegion_get_buffer(PyBufferRegion *self, Py_buffer *buf, int flags)
136102static PyTypeObject *PyBufferRegion_init_type ()
137103{
138104 static PyMethodDef methods[] = {
139- { " to_string" , (PyCFunction)PyBufferRegion_to_string, METH_NOARGS, NULL },
140- { " to_string_argb" , (PyCFunction)PyBufferRegion_to_string_argb, METH_NOARGS, NULL },
141105 { " set_x" , (PyCFunction)PyBufferRegion_set_x, METH_VARARGS, NULL },
142106 { " set_y" , (PyCFunction)PyBufferRegion_set_y, METH_VARARGS, NULL },
143107 { " get_extents" , (PyCFunction)PyBufferRegion_get_extents, METH_NOARGS, NULL },
0 commit comments