Origin of coordinate system, TGA file in C

69 views Asked by At

In my program I am writing geometrical shapes at different positions. This is what the header looks like:

    TGAHeader header = {
        .id_length = 0,
        .color_map_type = 0,
        .image_type = 2,
        .color_map = 0,
        .x_origin = 0,
        .y_origin = 0,
        .width = w, 
        .height = h, 
        .depth = 32,
        .descriptor = 0,
    };

The problem is that the origin of coordinate system is in the bottom left corner and I need it to be in the top left. I've tried multiple things to change the origin but none of it works.

I've tried changing the values to

.x_origin = 0,
.y_origin = 1

or

.x_origin = 0,
.y_origin = {0,1}

I don't really know how it works. I was hoping that the picture would be drawn from top to bottom. Do you have any idea what might be the problem? Thanks for any help.

0

There are 0 answers