premiere version de l'upscaling qui fonctionne
This commit is contained in:
@@ -5,15 +5,17 @@
|
||||
|
||||
#include "funcs.h"
|
||||
|
||||
extern int verbosity;
|
||||
|
||||
/*
|
||||
* Be careful, these functions are not yet fireproof,
|
||||
* and calling conventions are fluctuating.
|
||||
*/
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
int x_upscaler(unsigned char *src, int w, int h, FloatImg *d)
|
||||
int x_upscaler_0(unsigned char *src, int w, int h, FloatImg *d)
|
||||
{
|
||||
int x, y, xx, yy;
|
||||
int x, y, xx, yy, ox, oy;
|
||||
// float *rp, *gp, *bp;
|
||||
float r, g, b;
|
||||
static unsigned short modz;
|
||||
@@ -26,12 +28,16 @@ if ( d->width != w*2 || d->height != h*2 ) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
// rp = d->R, gp = d->G, bp = d->B;
|
||||
ox = ! (modz & 2);
|
||||
oy = ! (modz & 1);
|
||||
|
||||
if (verbosity>2) fprintf(stderr, "%s %5d %d %d\n", __func__,
|
||||
modz, ox, oy);
|
||||
|
||||
for (y=0; y<h; y++) {
|
||||
yy = (y*2) + ! (modz & 1);
|
||||
yy = (y*2) + oy;
|
||||
for (x=0; x<w; x++) {
|
||||
xx = (x*2) + ! (modz & 2);
|
||||
xx = (x*2) + ox;
|
||||
r = (float)*src++;
|
||||
g = (float)*src++;
|
||||
b = (float)*src++;
|
||||
|
||||
Reference in New Issue
Block a user