Move x_VAL() macros to common.h
This commit is contained in:
parent
46dc96436a
commit
2dd4c665d0
|
@ -3,22 +3,6 @@
|
|||
|
||||
#include "colormod.h"
|
||||
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
|
||||
#define A_VAL(p) ((DATA8 *)(p))[3]
|
||||
#define R_VAL(p) ((DATA8 *)(p))[2]
|
||||
#define G_VAL(p) ((DATA8 *)(p))[1]
|
||||
#define B_VAL(p) ((DATA8 *)(p))[0]
|
||||
|
||||
#else
|
||||
|
||||
#define A_VAL(p) ((DATA8 *)(p))[0]
|
||||
#define R_VAL(p) ((DATA8 *)(p))[1]
|
||||
#define G_VAL(p) ((DATA8 *)(p))[2]
|
||||
#define B_VAL(p) ((DATA8 *)(p))[3]
|
||||
|
||||
#endif
|
||||
|
||||
#define INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
|
||||
((x < (xx + ww)) && \
|
||||
(y < (yy + hh)) && \
|
||||
|
|
|
@ -48,6 +48,18 @@
|
|||
#define PIXEL_G(argb) (((argb) >> 8) & 0xff)
|
||||
#define PIXEL_B(argb) (((argb) ) & 0xff)
|
||||
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
#define A_VAL(p) ((DATA8 *)(p))[3]
|
||||
#define R_VAL(p) ((DATA8 *)(p))[2]
|
||||
#define G_VAL(p) ((DATA8 *)(p))[1]
|
||||
#define B_VAL(p) ((DATA8 *)(p))[0]
|
||||
#else
|
||||
#define A_VAL(p) ((DATA8 *)(p))[0]
|
||||
#define R_VAL(p) ((DATA8 *)(p))[1]
|
||||
#define G_VAL(p) ((DATA8 *)(p))[2]
|
||||
#define B_VAL(p) ((DATA8 *)(p))[3]
|
||||
#endif
|
||||
|
||||
#define CLIP(x, y, w, h, xx, yy, ww, hh) \
|
||||
if (x < (xx)) { w += (x - (xx)); x = (xx); } \
|
||||
if (y < (yy)) { h += (y - (yy)); y = (yy); } \
|
||||
|
|
Loading…
Reference in New Issue