Code:
#include <cstdio>
#include <Horde3DUtils.h>
int main() {
unsigned char pixels[] = { 255, 255, 255, 128, 128, 128, 0, 0, 0,
0, 0, 255, 0, 255, 0, 255, 0, 0,
100, 100, 0, 0, 100, 0, 0, 100, 100
};
char *out_data;
int out_size;
h3dutCreateTGAImage(pixels, 3, 3, 24, &out_data, &out_size);
FILE *f = fopen("test.tga", "wb");
fwrite(out_data, 1, out_size, f);
fclose(f);
return 0;
}
According to the documentation, that pixel data should produce a 3x3 image where the upper left pixel is white (the origin) etc. However, see the attachment for the actual output; it seems as if the code actually took the lower left corner as the origin. No idea if the code or the documentation is right, but I'd say one of them needs to be fixed.
Regards,
Felix