Mercurial > hg > dmlib
changeset 487:b89598501cec
Move dmCompareColor() to libgfx.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 12 Nov 2012 17:21:33 +0200 |
parents | cb61c44f7846 |
children | 49f0ce2cc347 |
files | gfxconv.c libgfx.c libgfx.h |
diffstat | 3 files changed, 13 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/gfxconv.c Sun Nov 11 14:36:17 2012 +0200 +++ b/gfxconv.c Mon Nov 12 17:21:33 2012 +0200 @@ -753,16 +753,6 @@ } #endif -BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha) -{ - if (c1->r == c2->r && - c1->g == c2->g && - c1->b == c2->b) - return alpha ? (c1->a == c2->a) : TRUE; - else - return FALSE; -} - int dmRemapImageColors(DMImage *image) {
--- a/libgfx.c Sun Nov 11 14:36:17 2012 +0200 +++ b/libgfx.c Mon Nov 12 17:21:33 2012 +0200 @@ -15,6 +15,17 @@ #endif +BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha) +{ + if (c1->r == c2->r && + c1->g == c2->g && + c1->b == c2->b) + return alpha ? (c1->a == c2->a) : TRUE; + else + return FALSE; +} + + DMImage * dmImageAlloc(int width, int height) { DMImage *img = dmCalloc(1, sizeof(DMImage));
--- a/libgfx.h Sun Nov 11 14:36:17 2012 +0200 +++ b/libgfx.h Mon Nov 12 17:21:33 2012 +0200 @@ -90,6 +90,8 @@ int dmImageGetBytesPerPixel(int format); int dmImageProbeGeneric(const Uint8 *buf, const size_t len, DMImageFormat **fmt, int *index); +BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha); + int dmWriteImageData(DMImage *img, void *cbdata, BOOL (*writeRowCB)(void *, Uint8 *, size_t), const DMImageSpec *spec);