davidhorman
17th May 2007, 20:27
Hello,
I've written myself a library full of useful and esoteric C functions for manipulating images. Unfortunately my little laptop is getting a bit slow for this sort of thing (1GHz), but although I'm looking at a new laptop, I'd also like to improve my library (last time I put my mind to it, I got a 4x speed increase out of it - mainly by replacing a=floor(x) with int a=x-(x<0)).
At the moment, I'm storing images like this:
struct image {
int w,h;
struct bitmap **pixel;
}
struct pixel {
unsigned char r,g,b;
}
and, for example, examining a pixel like this:
image->bitmap[x][y].r
And I was wondering if there was a more efficient/standard way. Can anyone point me in a faster direction?
Thanks,
David
I've written myself a library full of useful and esoteric C functions for manipulating images. Unfortunately my little laptop is getting a bit slow for this sort of thing (1GHz), but although I'm looking at a new laptop, I'd also like to improve my library (last time I put my mind to it, I got a 4x speed increase out of it - mainly by replacing a=floor(x) with int a=x-(x<0)).
At the moment, I'm storing images like this:
struct image {
int w,h;
struct bitmap **pixel;
}
struct pixel {
unsigned char r,g,b;
}
and, for example, examining a pixel like this:
image->bitmap[x][y].r
And I was wondering if there was a more efficient/standard way. Can anyone point me in a faster direction?
Thanks,
David