forked from tTh/FloatImg
killed a mega bug in the upscaling
This commit is contained in:
parent
b67d023f0c
commit
5758f1c932
|
@ -2,7 +2,7 @@
|
|||
* floatimg.h
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION 67
|
||||
#define FIMG_VERSION 71
|
||||
|
||||
/*
|
||||
* in memory descriptor
|
||||
|
|
|
@ -197,6 +197,14 @@ return 0;
|
|||
int fimg_add_rgb(FloatImg *head, int x, int y, float r, float g, float b)
|
||||
{
|
||||
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);
|
||||
head->R[offset] += r;
|
||||
head->G[offset] += g;
|
||||
|
|
|
@ -41,9 +41,8 @@ for (y=0; y<h; y++) {
|
|||
r = (float)*src++;
|
||||
g = (float)*src++;
|
||||
b = (float)*src++;
|
||||
fimg_plot_rgb(d, xx, yy, r, g, b);
|
||||
fimg_add_rgb(d, xx, yy, r, g, b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
modz++;
|
||||
|
|
Loading…
Reference in New Issue