I'll get Mad with the stupid people manageing this blogger.com
Why cant they use a simple and working scaling function like this fast and
ugly one i'll wrote in all haste wrote for simple desktop picture resizeing.
And why the Hell do they think that all pictures are smaller
or equal to 1600x1200 ??? Maybe i will go back to my old wiki-wiki again.
typedef struct bilin {
int i0, i1, d0, d1;
} abilin;
/* bilinear.c - Per Andersson 050321 */
#define IR 0
#define IG 1
#define IB 2
#define OR 2
#define OG 1
#define OB 0
#define PARTS 256
/***/ bilinear(in, insiz, inx, iny, out, outsiz, outx, outy)
unsigned char *in, *out;
int insiz, inx, iny, outsiz, outx, outy;
{
abilin *xp, *yp;
int r, g, b, x, y, *o;
long t;
for (x = 0 ; x < t =" (long)" i0 =" t" i0 =" 0;" i1 =" (t">= inx) bilxx[x].i1 = inx - 1;
bilxx[x].i0 *= color;
bilxx[x].i1 *= color;
bilxx[x].d1 = t & (PARTS - 1);
bilxx[x].d0 = PARTS - bilxx[x].d1;
}
for (y = 0 ; y < t =" (long)" i0 =" t" i0 =" 0;" i1 =" (t">= iny) bilyy[y].i1 = iny - 1;
bilyy[y].i0 *= insiz * color;
bilyy[y].i1 *= insiz * color;
bilyy[y].d1 = t & (PARTS - 1);
bilyy[y].d0 = PARTS - bilyy[y].d1;
}
o = (int *) out;
if (color == 1) {
for (yp = bilyy; yp < xp =" bilxx;" r =" (PARTS">d0 * yp->d0 * in[xp->i0 + yp->i0];
r += xp->d1 * yp->d0 * in[xp->i1 + yp->i0];
r += xp->d0 * yp->d1 * in[xp->i0 + yp->i1];
r += xp->d1 * yp->d1 * in[xp->i1 + yp->i1];
*o++ = (r >> 16) * 0x010101; /* only if PARTS == 256 */
}
}
}
else {
for (yp = bilyy; yp < xp =" bilxx;" r =" g" b =" (PARTS">d0 * yp->d0 * in[xp->i0 + yp->i0 + IR];
g += xp->d0 * yp->d0 * in[xp->i0 + yp->i0 + IG];
b += xp->d0 * yp->d0 * in[xp->i0 + yp->i0 + IB];
r += xp->d1 * yp->d0 * in[xp->i1 + yp->i0 + IR];
g += xp->d1 * yp->d0 * in[xp->i1 + yp->i0 + IG];
b += xp->d1 * yp->d0 * in[xp->i1 + yp->i0 + IB];
r += xp->d0 * yp->d1 * in[xp->i0 + yp->i1 + IR];
g += xp->d0 * yp->d1 * in[xp->i0 + yp->i1 + IG];
b += xp->d0 * yp->d1 * in[xp->i0 + yp->i1 + IB];
r += xp->d1 * yp->d1 * in[xp->i1 + yp->i1 + IR];
g += xp->d1 * yp->d1 * in[xp->i1 + yp->i1 + IG];
b += xp->d1 * yp->d1 * in[xp->i1 + yp->i1 + IB];
*o++ = (r & 0xff0000) | ((g & 0xff0000) >> 8) | (b >> 16); /* only if PARTS == 256 */
}
o += outsiz - outx;
}
}
Here is an old Hasselbladare for resizing.
Can You guess who put up these three object in my local Church (wich also happens to be the main church here in Sweden) ?
I do not remember the name of the photographer, but you must know the name of the artist. She has appeared before in this very blog.
Prenumerera på:
Kommentarer till inlägget (Atom)
Bloggarkiv
-
▼
2009
(46)
-
▼
juni
(19)
- Uppsala är Aproligt! (at Nowrouz in North)
- An angry Note of the Bloody Blogger-Blogspot-Blog
- Heiss wie im Hölle hier im Norten
- A Note from my old Emperiador Guitar
- Abbey Road Revival
- Mobile Thelephone Revulotion in Teheran
- Midsommer in Sweden (on a rainy day)
- Samhällets Stöttepelare
- Kommendörkapten Andersson
- Yester-Easters Tulips-Eating
- Simona Melona
- A missed uppertunerty
- I was hunted beim Käter last eavening
- EU election
- A Protest Note
- Season for Frankfurters & Hamburgers
- A Hard Days Night
- An rather old video
- En Ny Fylla
-
▼
juni
(19)
Så.
SvaraRaderaSSS
SvaraRadera