Go to the source code of this file.
◆ MyPaintSurfaceGetColorFunction
typedef void(* MyPaintSurfaceGetColorFunction) (MyPaintSurface *self, float x, float y, float radius, float *color_r, float *color_g, float *color_b, float *color_a) |
Function used to retrieve the average color/alpha from a region of a surface.
This kind of function calculates the average color/alpha from the pixels of the given surface, selected and weighted respectively by the area and opacity of a uniform dab with a given center and radius.
- Parameters
-
| self | The surface to fetch the pixels from |
| x,y | The center of the dab that determine which pixels to include, and their respective impact on the result. |
| radius | The radius of the dab. |
[out] | color_r,color_g,color_b,color_a | The destination of the resulting colors, range: [0.0, 1.0] |