libmypaint  1.6.0
Data Structures | Typedefs
mypaint-surface.h File Reference
#include "mypaint-config.h"
#include "mypaint-rectangle.h"

Go to the source code of this file.

Data Structures

struct  MyPaintSurface
 Abstract surface type for the MyPaint brush engine. More...
 
struct  MyPaintSurface2
 Extends MyPaintSurface with support for spectral ops and multiple bounding boxes. More...
 

Typedefs

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. More...
 

Typedef Documentation

◆ 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
selfThe surface to fetch the pixels from
x,yThe center of the dab that determine which pixels to include, and their respective impact on the result.
radiusThe radius of the dab.
[out]color_r,color_g,color_b,color_aThe destination of the resulting colors, range: [0.0, 1.0]