Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <assert.h>
- #include "bmp.h"
- int main(int argc, char** argv){
- colour** data = NULL;
- colour** crop_data = NULL;
- colour** rotate_data = NULL;
- unsigned char* header = (unsigned char*)malloc(54);
- FILE* in = fopen(argv[2], "r");
- int w1, h1;
- data = load_bmp(in, header, &w1, &h1);
- fclose(in);
- FILE* out = fopen(argv[3], "w");
- int x = h1 - 1 - atoi(argv[4]);
- int y = w1 - 1 - atoi(argv[5]);
- int w = atoi(argv[6]);
- int h = atoi(argv[7]);
- crop_data = crop(data, x, y, w, h);
- rotate_data = rotate(crop_data, w, h);
- save_bmp(out, header, w, h, rotate_data);
- fclose(out);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement