summaryrefslogtreecommitdiffstats
path: root/src/livarot
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-19 15:11:19 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2018-06-20 09:51:42 +0000
commitaf7e9ecd1fdd9a3499da7fc2721c4e4a74d8542f (patch)
tree1cd0e24fa031a9231b800b0b41102a5d95e7082c /src/livarot
parentReplace functions with methods in SPColor. (diff)
downloadinkscape-af7e9ecd1fdd9a3499da7fc2721c4e4a74d8542f.tar.gz
inkscape-af7e9ecd1fdd9a3499da7fc2721c4e4a74d8542f.zip
Replace typedef struct with struct in POD type declarations.
Diffstat (limited to 'src/livarot')
-rw-r--r--src/livarot/AlphaLigne.h4
-rw-r--r--src/livarot/LivarotDefs.h34
2 files changed, 16 insertions, 22 deletions
diff --git a/src/livarot/AlphaLigne.h b/src/livarot/AlphaLigne.h
index fe3dc69b0..e0eef308a 100644
--- a/src/livarot/AlphaLigne.h
+++ b/src/livarot/AlphaLigne.h
@@ -19,10 +19,10 @@
*/
// a step
-typedef struct alpha_step {
+struct alpha_step {
int x; // position
float delta; // increase or decrease in pixel coverage with respect to the coverage of the previous pixel
-} alpha_step;
+};
class AlphaLigne {
diff --git a/src/livarot/LivarotDefs.h b/src/livarot/LivarotDefs.h
index aa1919cf1..48a1fa80b 100644
--- a/src/livarot/LivarotDefs.h
+++ b/src/livarot/LivarotDefs.h
@@ -68,33 +68,30 @@ enum fill_typ
typedef enum fill_typ FillRule;
// stupid version of dashes: in dash x is plain, dash x+1 must be empty, so the gap field is extremely redundant
-typedef struct one_dash
+struct one_dash
{
bool gap;
double length;
-}
-one_dash;
+};
// color definition structures for the rasterizations primitives (not present here)
-typedef struct std_color
+struct std_color
{
uint32_t uCol;
uint16_t iColA, iColR, iColG, iColB;
double fColA, fColR, fColG, fColB;
uint32_t iColATab[256];
-}
-std_color;
+};
-typedef struct grad_stop
+struct grad_stop
{
double at;
double ca, cr, cg, cb;
double iSize;
-}
-grad_stop;
+};
// linear gradient for filling polygons
-typedef struct lin_grad
+struct lin_grad
{
int type; // 0= gradient appears once
// 1= repeats itself start-end/start-end/start-end...
@@ -104,11 +101,10 @@ typedef struct lin_grad
// double cba,cbr,cbg,cbb; // color at gradient position 1
int nbStop;
grad_stop stops[2];
-}
-lin_grad;
+};
// radial gradient (color is funciton of r^2, need to be corrected with a sqrt() to be r)
-typedef struct rad_grad
+struct rad_grad
{
int type; // 0= gradient appears once
// 1= repeats itself start-end/start-end/start-end...
@@ -117,8 +113,7 @@ typedef struct rad_grad
double rxx, rxy, ryx, ryy; // 1/radius
int nbStop;
grad_stop stops[2];
-}
-rad_grad;
+};
// functions types for an arbitrary filling shader
typedef void (*InitColorFunc) (int ph, int pv, void *); // init for position ph,pv; the last parameter is a pointer
@@ -131,7 +126,7 @@ typedef void (*GotoLigneColorFunc) (int pv, void *); // move to v-coordinate pv
// in the InitColorFunc)
// an arbitrary shader
-typedef struct gen_color
+struct gen_color
{
double colA, colR, colG, colB;
InitColorFunc iFunc;
@@ -139,15 +134,14 @@ typedef struct gen_color
NextLigneColorFunc nlFunc;
GotoPixelColorFunc gpFunc;
GotoLigneColorFunc glFunc;
-}
-gen_color;
+};
// info for a run of pixel to fill
-typedef struct raster_info {
+struct raster_info {
int startPix,endPix; // start and end pixel from the polygon POV
int sth,stv; // coordinates for the first pixel in the run, in (possibly another) POV
uint32_t* buffer; // pointer to the first pixel in the run
-} raster_info;
+};
typedef void (*RasterInRunFunc) (raster_info &dest,void *data,int nst,float vst,int nen,float ven); // init for position ph,pv; the last parameter is a pointer