Made SDL_ReadSurfacePixel a public function

Fixes https://github.com/libsdl-org/SDL/issues/8320
This commit is contained in:
Sam Lantinga 2024-01-18 04:36:37 -08:00
parent f7ba340999
commit f8dfee01bb
9 changed files with 93 additions and 118 deletions

View file

@ -44,27 +44,6 @@
extern "C" {
#endif
/**
* Retrieves a single pixel from a surface.
*
* This function prioritizes correctness over speed: it is suitable for
* unit tests, but is not intended for use in a game engine.
*
* Like SDL_GetRGBA, this uses the entire 0..255 range when converting
* color components from pixel formats with less than 8 bits per RGB
* component.
*
* \param surface The surface
* \param x Horizontal coordinate, 0 <= x < width
* \param y Vertical coordinate, 0 <= y < height
* \param r Pointer to location to store red channel, 0-255
* \param g Pointer to location to store green channel, 0-255
* \param b Pointer to location to store blue channel, 0-255
* \param a Pointer to location to store alpha channel, 0-255
* \returns 0 if the surface is valid and the coordinates are in-bounds
*/
int SDLTest_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
/**
* Compares a surface and with reference image data for equality
*