libtthimage/Lib/testtga.c

123 lines
2.5 KiB
C
Raw Normal View History

2022-06-26 11:06:35 +02:00
/*
* TESTTGA.C
*
* see also: essais.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <math.h>
2022-06-26 22:55:56 +02:00
#include "../tthimage.h"
2022-06-26 11:06:35 +02:00
#include "essais.h"
/*::------------------------------------------------------------------::*/
2023-01-31 00:21:05 +01:00
int test_du_jpeg_reader(char *filename)
{
Image_Desc destimg;
int foo;
fprintf(stderr, ">>> %s ( '%s' ) \n", __func__, filename);
2024-08-10 17:48:52 +02:00
#if 0
2023-01-31 00:21:05 +01:00
foo = try_to_read_a_jpeg_file(filename, &destimg);
2024-08-10 17:48:52 +02:00
#endif
2023-01-31 00:21:05 +01:00
return FULL_NUCKED;
}
2022-06-26 11:06:35 +02:00
/*::------------------------------------------------------------------::*/
int main(int argc, char *argv[])
{
char *fichier;
2024-08-10 17:48:52 +02:00
int foo, idx;
2022-06-26 11:06:35 +02:00
printf("\n========== TestTga %s %s ==========\n", __DATE__, __TIME__);
Image_print_version(2);
2023-01-31 00:21:05 +01:00
#if DEBUG_LEVEL
Image_print_sizeof_structs("tth was here");
#endif
2022-06-26 11:06:35 +02:00
2024-08-10 17:48:52 +02:00
if (argc != 2) {
2022-06-26 11:06:35 +02:00
printf("no args, using the testfile\n");
fichier = "wou.tga";
}
else
{
srand(getpid());
fichier = argv[1];
}
Image_start_chrono("Essai", 0);
2024-08-10 17:48:52 +02:00
for (idx=0; idx<5; idx++) {
foo = Test_Egalisations(fichier, 0);
fprintf(stderr, " essai egalisation -> %d\n", foo);
foo = Essai_Televisions(fichier, 10);
fprintf(stderr, " essai televisions -> %d\n", foo);
}
#if 0
2023-01-31 00:21:05 +01:00
foo = test_du_jpeg_reader("in.jpeg");
fprintf(stderr, " essai lecture jpeg -> %d\n", foo);
2022-06-26 11:06:35 +02:00
foo = Test_Dithering(fichier, 17);
fprintf(stderr, "essai dithering -> %d\n", foo);
Test_des_patterns("/tmp/pattt", 0, 0);
foo = Essai_des_jauges(fichier, 17);
foo = Essai_Extractbits(fichier, 17);
Essai_des_Glitches(fichier, 900);
Essai_Television(fichier, 10);
Essai_des_drawings(fichier, 17);
foo = Test_Effects_A(fichier, 17);
Test_des_warpings(fichier, 17);
foo = Essai_des_Combines(fichier, 17);
fprintf(stderr, "essai combine -> %d\n", foo);
2024-08-10 17:48:52 +02:00
2022-06-26 11:06:35 +02:00
foo = Test_Dithering(fichier, 17);
Essai_des_Contrastes(fichier, 0);
Essai_anamorphoses(fichier, 0.666, 42);
Test_copie_de_rectangles(fichier);
Essai_des_7_segments(fichier, 0x0F);
/* Essai_color_2_map(fichier, 0); */
Essais_plot_Map(5);
foo = Essai_des_bitplanes("Grgrgr !", 1600, 1200);
printf("retour essai bitplane -> %d\n", foo);
Test_hf15_synth_fromPtl(fichier, "aaaa.tga");
Test_classif(fichier, 0);
Test_new_scale(fichier, 0);
Essai_des_cadres(fichier, 0);
Essai_luminance(fichier, 0);
Essayer_les_alphas(fichier, 0);
foo = Essai_de_la_Recursion(fichier, 0);
#endif
Image_stop_chrono("Essai", 0);
/*
* Warning: this function was a GNU/Linuxism !
*/
#if DEBUG_LEVEL > 1
malloc_stats();
#endif
return 0;
}
/*::------------------------------------------------------------------::*/