Title: Change {FigureCanvasAgg,RendererAgg}.buffer_rgba to return a memoryview. by anntzer · Pull Request #11735 · matplotlib/matplotlib · GitHub
Open Graph Title: Change {FigureCanvasAgg,RendererAgg}.buffer_rgba to return a memoryview. by anntzer · Pull Request #11735 · matplotlib/matplotlib
X Title: Change {FigureCanvasAgg,RendererAgg}.buffer_rgba to return a memoryview. by anntzer · Pull Request #11735 · matplotlib/matplotlib
Description: The buffer_rgba method now allows direct access to the renderer's underlying buffer (as a (m, n, 4)-shape memoryview) rather than copying the data to a new bytestring. This is consistent with the behavior on Py2, where a buffer object was returned. While this is technically a backwards-incompatible change, memoryviews are in fact quite compatible with bytes for most uses, and I'd argue that the bigger compatibility break was the change from no-copy in Py2 to copy in Py3 (after all that's the main point of the method...). See also discussion in #11726. Added second commit: reimplement tostring_rgba, tostring_rgb using numpy to access the buffer. Note that this was one of the suggestions of the original removal of PyCXX (#3646) :-) PR Summary PR Checklist Has Pytest style unit tests Code is PEP 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: The buffer_rgba method now allows direct access to the renderer's underlying buffer (as a (m, n, 4)-shape memoryview) rather than copying the data to a new bytestring. This is consistent with ...
X Description: The buffer_rgba method now allows direct access to the renderer's underlying buffer (as a (m, n, 4)-shape memoryview) rather than copying the data to a new bytestring. This is consistent w...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/11735
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3b5253ef-39a5-ed29-be8e-004e0f2b4d13 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BDEA:B33E1:B7EC60:FCEF7F:6A572534 |
| html-safe-nonce | f0f44e4e5b692fbd1649602edab6c2f2c53e26221278d53e630c82f0e1fd5de2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREVBOkIzM0UxOkI3RUM2MDpGQ0VGN0Y6NkE1NzI1MzQiLCJ2aXNpdG9yX2lkIjoiODc4NTQ4MjcyODE5NDEyMzA2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cea8dbae36f6851457b48e19385e0583a1b784ead94290846983665f38959afb |
| hovercard-subject-tag | pull_request:203057410 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/11735/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | The buffer_rgba method now allows direct access to the renderer's underlying buffer (as a (m, n, 4)-shape memoryview) rather than copying the data to a new bytestring. This is consistent with ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width