|
|
|
@ -5,6 +5,32 @@ |
|
|
|
|
|
|
|
|
|
#include "funcs.h" |
|
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */ |
|
|
|
|
int x_upscaler(unsigned char *src, int w, int h, FloatImg *d) |
|
|
|
|
{ |
|
|
|
|
int x, y, xx, yy; |
|
|
|
|
float *rp, *gp, *bp; |
|
|
|
|
float r, g, b; |
|
|
|
|
static unsigned short modz; |
|
|
|
|
|
|
|
|
|
rp = d->R, gp = d->G, bp = d->B; |
|
|
|
|
|
|
|
|
|
for (y=0; y<h; y++) { |
|
|
|
|
yy = (y*2) + ! (modz & 1); |
|
|
|
|
for (x=0; x<w; x++) { |
|
|
|
|
xx = (x*2) + ! (modz & 2); |
|
|
|
|
r = (float)*src++; |
|
|
|
|
g = (float)*src++; |
|
|
|
|
b = (float)*src++; |
|
|
|
|
fimg_plot_rgb(d, xx, yy, r, g, b); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
modz++; |
|
|
|
|
|
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
/* --------------------------------------------------------------------- */ |
|
|
|
|
int x_rgb2fimg(unsigned char *src, int w, int h, FloatImg *d) |
|
|
|
|
{ |
|
|
|
|