Select Git revision
ligne_commande.md
Forked from
programmation_sequentielle / cours
Source project has a limited visibility.
main.c 882 B
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include "pgm_io.h"
#include "quadtree.h"
#include "Matrix.h"
int main()
{
pgm* p = malloc(1 * sizeof(pgm));
pgm_read_from_file(p,"buzz.pgm");
uint32_t val = quadtree_get_depth_from_image_size(p->pixels.col);
printf("Depth : %u\n",val);
node* tree = quadtree_tree_create(val);
quadtree_matrix2tree(&p->pixels,tree);
pgm* pp = malloc(1 * sizeof(pgm));
pp->max = p->max;
matrix_alloc(&pp->pixels,p->pixels.lin,p->pixels.col);
quadtree_moyenne(tree);
quadtree_compress(tree,2000);
// quadtree_print(tree,1,"|");
quadtree_tree2matrix(tree,&pp->pixels);
pgm_write_from_file(pp,"Test.pgm");
matrix_destroy(&p->pixels);
matrix_destroy(&pp->pixels);
quadtree_tree_destroy(&tree);
free(p);
free(pp);
return 0;
}