Mercurial > hg > dmlib
comparison tools/libgfx.c @ 2467:a11ef670bd99
Move dmCompareColor() from libgfx to gfxconv as it is used only there,
rename to dmExactCompareColor().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 16 Apr 2020 15:00:18 +0300 |
parents | 16426e9dc238 |
children | c6ee41fd98dd |
comparison
equal
deleted
inserted
replaced
2466:213ce6d400dc | 2467:a11ef670bd99 |
---|---|
103 else | 103 else |
104 n--; | 104 n--; |
105 } | 105 } |
106 | 106 |
107 return -2; | 107 return -2; |
108 } | |
109 | |
110 | |
111 BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, const BOOL alpha) | |
112 { | |
113 if (c1->r == c2->r && | |
114 c1->g == c2->g && | |
115 c1->b == c2->b) | |
116 return alpha ? (c1->a == c2->a) : TRUE; | |
117 else | |
118 return FALSE; | |
119 } | 108 } |
120 | 109 |
121 | 110 |
122 int dmImageGetBytesPerPixel(const int format) | 111 int dmImageGetBytesPerPixel(const int format) |
123 { | 112 { |