surfaces-unies/src/compress.h

30 lines
1.0 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* \file compress.h
* \brief Déclaration pour la (dé)compression dimages
*/
#ifndef SRC_COMPRESS_H_
#define SRC_COMPRESS_H_
#include "ppm.h"
#define DEFAULT_COMPRESSED_NAME "output.su"
/// Teste léligibilité dun pixel à une zone
int32_t sameColor(Pixel *t_pixel, Zone *t_zone);
/// Ajoute un pixel et ses pixels connexes à une zone
void addPixelToSelectedZone(Image *t_img, int64_t t_idx, Zone *t_zone);
/// Sélectionne la zone correspondant à la couleur d'un pixel
void chooseZoneForPixel(Image *t_img, int64_t t_idx, darray *zones);
/// Créé les zones d'une image
darray *imgToZones(Image *t_img);
/// Écrit tous les \ref Segment dune zone dans le fichier de sortie
void write_segments(FILE *t_output, darray *t_segments);
/// Écrit les données compressées dans le fichier de sortie
void write_compressed_file(Image *t_img, FILE *t_output, darray *t_zones);
/// Compresse l'image d'entrée
void compress(const char *t_input_file, const char *t_output_file,
int32_t tolerance);
#endif /* SRC_COMPRESS_H_ */