killed a mega bug in the upscaling

This commit is contained in:
tonton Th 2019-09-03 19:35:45 +02:00
parent b67d023f0c
commit 5758f1c932
3 changed files with 10 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* floatimg.h * floatimg.h
*/ */
#define FIMG_VERSION 67 #define FIMG_VERSION 71
/* /*
* in memory descriptor * in memory descriptor

View File

@ -197,6 +197,14 @@ return 0;
int fimg_add_rgb(FloatImg *head, int x, int y, float r, float g, float b) int fimg_add_rgb(FloatImg *head, int x, int y, float r, float g, float b)
{ {
int offset; int offset;
if (head->type != FIMG_TYPE_RGB) {
#if DEBUG_LEVEL > 1
fprintf(stderr, "%s : type %d is bad.\n", __func__, head->type);
#endif
return -1;
}
offset = x + (y * head->width); offset = x + (y * head->width);
head->R[offset] += r; head->R[offset] += r;
head->G[offset] += g; head->G[offset] += g;

View File

@ -41,9 +41,8 @@ for (y=0; y<h; y++) {
r = (float)*src++; r = (float)*src++;
g = (float)*src++; g = (float)*src++;
b = (float)*src++; b = (float)*src++;
fimg_plot_rgb(d, xx, yy, r, g, b); fimg_add_rgb(d, xx, yy, r, g, b);
} }
} }
modz++; modz++;