1 #ifndef __NR_GRADIENT_H__
2 #define __NR_GRADIENT_H__
4 /*
5 * Pixel buffer rendering library
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * This code is in public domain
11 */
13 #include <libnr/nr-matrix.h>
14 #include <libnr/nr-render.h>
16 #define NR_GRADIENT_VECTOR_LENGTH 1024
18 enum {
19 NR_GRADIENT_SPREAD_PAD,
20 NR_GRADIENT_SPREAD_REFLECT,
21 NR_GRADIENT_SPREAD_REPEAT
22 };
24 /* Radial */
26 struct NRRGradientRenderer {
27 NRRenderer renderer;
28 const unsigned char *vector;
29 unsigned int spread;
30 NRMatrix px2gs;
31 float cx, cy;
32 float fx, fy;
33 float r;
34 float C;
35 };
37 NRRenderer *nr_rgradient_renderer_setup (NRRGradientRenderer *rgr,
38 const unsigned char *cv,
39 unsigned int spread,
40 const NRMatrix *gs2px,
41 float cx, float cy,
42 float fx, float fy,
43 float r);
47 #endif