comparison src/dmlinefunc.h @ 971:f654435df15e

Rename DMRGBA32 struct to DMColor and remove the original redundant DMColor struct definition.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Feb 2015 06:10:16 +0200
parents 1e5cf1144f36
children
comparison
equal deleted inserted replaced
970:6c33c92de066 971:f654435df15e
21 #include "dmdrawline.h" 21 #include "dmdrawline.h"
22 22
23 23
24 #define DM_DRAWLINE_NAME dmDrawLine32Transparent 24 #define DM_DRAWLINE_NAME dmDrawLine32Transparent
25 #define DM_DRAWLINE_DST_BYTES 4 25 #define DM_DRAWLINE_DST_BYTES 4
26 #define DM_DRAWLINE_DST_TYPE DMRGBA32 26 #define DM_DRAWLINE_DST_TYPE DMColor
27 #define DM_DRAWLINE_INIT const DMRGBA32 *c = (DMRGBA32*) &col; 27 #define DM_DRAWLINE_INIT const DMColor *c = (DMColor*) &col;
28 #define DM_DRAWLINE_INNER \ 28 #define DM_DRAWLINE_INNER \
29 const DMRGBA32 q = pix[y0 + x0]; \ 29 const DMColor q = pix[y0 + x0]; \
30 const int qr = (q.r + c->r) >> 1, qg = (q.g + c->g) >> 1, qb = (q.b + c->b) >> 1; \ 30 const int qr = (q.r + c->r) >> 1, qg = (q.g + c->g) >> 1, qb = (q.b + c->b) >> 1; \
31 pix[y0 + x0].r = qr; \ 31 pix[y0 + x0].r = qr; \
32 pix[y0 + x0].g = qg; \ 32 pix[y0 + x0].g = qg; \
33 pix[y0 + x0].b = qb; 33 pix[y0 + x0].b = qb;
34 #include "dmdrawline.h" 34 #include "dmdrawline.h"
45 #include "dmdrawline.h" 45 #include "dmdrawline.h"
46 46
47 47
48 #define DM_DRAWLINE_NAME dmDrawLine32Saturate 48 #define DM_DRAWLINE_NAME dmDrawLine32Saturate
49 #define DM_DRAWLINE_DST_BYTES 4 49 #define DM_DRAWLINE_DST_BYTES 4
50 #define DM_DRAWLINE_DST_TYPE DMRGBA32 50 #define DM_DRAWLINE_DST_TYPE DMColor
51 #define DM_DRAWLINE_INIT const DMRGBA32 *c = (DMRGBA32*) &col; 51 #define DM_DRAWLINE_INIT const DMColor *c = (DMColor*) &col;
52 #define DM_DRAWLINE_INNER \ 52 #define DM_DRAWLINE_INNER \
53 const DMRGBA32 q = pix[y0 + x0]; \ 53 const DMColor q = pix[y0 + x0]; \
54 const int qr = q.r + c->r, qg = q.g + c->g, qb = q.b + c->b; \ 54 const int qr = q.r + c->r, qg = q.g + c->g, qb = q.b + c->b; \
55 pix[y0 + x0].r = qr < 255 ? qr : 255; \ 55 pix[y0 + x0].r = qr < 255 ? qr : 255; \
56 pix[y0 + x0].g = qg < 255 ? qg : 255; \ 56 pix[y0 + x0].g = qg < 255 ? qg : 255; \
57 pix[y0 + x0].b = qb < 255 ? qb : 255; 57 pix[y0 + x0].b = qb < 255 ? qb : 255;
58 #include "dmdrawline.h" 58 #include "dmdrawline.h"