Add fetch_pixel(s) method to window for unit testing.
We currently don't have a concrete way to do pixel testing for unit tests. get_image doesn't play nice with the spoof window. It would hopefully be performant, but it doesn't need to be as aggressively optimized as an official screenshot interface.
I started on this a while ago ..
I have the following questions:
- [ ] What does "spoof window" mean here? @DragonMoffon
- [ ] Are our windows always assumed to be RGBA buffers?
- [ ] Will all render targets be assumed to be RGBA buffers as well?
- [ ] @einarf When you said "I started on this", did you mean the files below?
The arcade.screenshot functions
This file has commits from einarf in June and August of 2024, and two functions:
https://github.com/pythonarcade/arcade/blob/8a41838a9dd89c8f35e89b22111936effbdd43d8/arcade/screenshot.py#L15
https://github.com/pythonarcade/arcade/blob/8a41838a9dd89c8f35e89b22111936effbdd43d8/arcade/screenshot.py#L38
Offscreen in the top-level conftest.py
- is exposed as a top-level test fixture available in all tests via
offscreen - was created in August of 2024 by einarf before further work by Eruvanos
It has the following methods of interest
https://github.com/pythonarcade/arcade/blob/8a41838a9dd89c8f35e89b22111936effbdd43d8/tests/conftest.py#L400
https://github.com/pythonarcade/arcade/blob/8a41838a9dd89c8f35e89b22111936effbdd43d8/tests/conftest.py#L405
https://github.com/pythonarcade/arcade/blob/8a41838a9dd89c8f35e89b22111936effbdd43d8/tests/conftest.py#L415
https://github.com/pythonarcade/arcade/blob/8a41838a9dd89c8f35e89b22111936effbdd43d8/tests/conftest.py#L430
https://github.com/pythonarcade/arcade/blob/8a41838a9dd89c8f35e89b22111936effbdd43d8/tests/conftest.py#L437