#include #include #include #include uint32_t swap_endian(uint32_t val) { val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF); return (val << 16) | (val >> 16); } // Renvoie une image sous forme d'un int** int** read_image(unsigned int width, unsigned int height, FILE* ptr) { unsigned char buffer[width*height]; int** image = (int**)malloc(sizeof(int*)*height); size_t ligne_size = sizeof(int) * width; fread(buffer, sizeof(buffer), 1, ptr); for (int i=0; i