Made image_setPixel() static inline; added image_setMaskPixel()
This commit is contained in:
20
src/image.h
20
src/image.h
@@ -12,12 +12,6 @@
|
|||||||
#include "luaobj.h"
|
#include "luaobj.h"
|
||||||
|
|
||||||
|
|
||||||
#define image_setPixel(self, x, y, color)\
|
|
||||||
if ((x) > 0 && (x) < (self)->width && (y) > 0 && (y) < (self)->height) {\
|
|
||||||
(self)->data[(x) + (y) * (self)->width] = (color);\
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
IMAGE_NORMAL,
|
IMAGE_NORMAL,
|
||||||
IMAGE_FAST,
|
IMAGE_FAST,
|
||||||
@@ -34,6 +28,20 @@ typedef struct {
|
|||||||
} image_t;
|
} image_t;
|
||||||
|
|
||||||
|
|
||||||
|
static inline
|
||||||
|
void image_setPixel(image_t* self, int x, int y, pixel_t val) {
|
||||||
|
if (x > 0 && x < self->width && y > 0 && y < self->height) {
|
||||||
|
self->data[x + y * self->width] = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline
|
||||||
|
void image_setMaskPixel(image_t* self, int x, int y, pixel_t val) {
|
||||||
|
if (x > 0 && x < self->width && y > 0 && y < self->height) {
|
||||||
|
self->mask[x + y * self->width] = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void image_setColor(pixel_t color);
|
void image_setColor(pixel_t color);
|
||||||
void image_setBlendMode(int mode);
|
void image_setBlendMode(int mode);
|
||||||
void image_setFlip(int mode);
|
void image_setFlip(int mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user