Horde3D

Next-Generation Graphics Engine
It is currently 28.04.2024, 08:26

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 13.03.2010, 17:21 
Offline

Joined: 28.02.2010, 16:07
Posts: 4
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


Attachments:
File comment: Programme output (converted to PNG and scaled up so you can actually find it)
test.png
test.png [ 291 Bytes | Viewed 5250 times ]
Top
 Profile  
Reply with quote  
PostPosted: 19.03.2010, 02:47 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Thanks for the hint.

I guess we should fix the documentation as all other texture and image related functions assume the origin to be the lower left corner.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group