libtthimage/Lib/imprime.c

70 lines
1.7 KiB
C
Raw Normal View History

2022-06-26 20:06:35 +11:00
/*
imprime.c
---------
*/
#include <stdio.h>
2022-06-27 07:55:56 +11:00
#include "../tthimage.h"
2022-06-26 20:06:35 +11:00
/*::------------------------------------------------------------------::*/
2022-07-07 21:52:00 +11:00
int Image_print_histo_0(long *histo, char *fname, char *texte)
2022-06-26 20:06:35 +11:00
{
int foo;
2022-07-07 21:52:00 +11:00
printf("** %s / %s **\n", texte, fname);
2022-06-26 20:06:35 +11:00
2022-07-07 21:52:00 +11:00
for (foo=0; foo<256; foo++) {
2022-06-26 20:06:35 +11:00
printf("%7ld ", histo[foo]);
if ((foo % 8)==0)
printf("\n");
}
printf("\n");
return FULL_NUCKED;
}
/*
* je sais m<EFBFBD>me plus pourquoi j'ai commenc<EFBFBD> cette fonction :)
*/
/*::------------------------------------------------------------------::*/
void Image_print_sizeof_structs(char *texte)
{
unsigned short petit;
unsigned long grand;
unsigned char *ucptr;
int foo;
2022-07-07 21:52:00 +11:00
if (NULL != texte) {
2022-06-26 20:06:35 +11:00
printf("============= %s ============\n", texte);
}
/* examen du boutisme (ah ah ah) */
petit = 0x1234; printf("petit = %8x -> ", petit);
ucptr = (unsigned char *)&petit;
for (foo=0; foo<(int)sizeof(petit); foo++)
printf(" %02x", ucptr[foo]);
printf("\n");
/* trop kikoolol, le boutisme */
grand = 0x12345678;
printf("grand = %lx -> ", grand);
ucptr = (unsigned char *)&grand;
for (foo=0; foo<sizeof(grand); foo++)
printf(" %02x", ucptr[foo]);
printf("\n");
/* examen des types de base */
2022-07-07 21:52:00 +11:00
printf("basic types : short=%ld int=%ld long=%ld ptr=%ld\n",
2022-06-26 20:06:35 +11:00
sizeof(short), sizeof(int), sizeof(long), sizeof(void *));
2022-06-27 07:55:56 +11:00
/* examen des tructures de la libtthimage */
2022-07-07 21:52:00 +11:00
printf("Image_Desc : %5ld\n", sizeof(Image_Desc));
printf("Image_Rect : %5ld\n", sizeof(Image_Rect));
printf("RGBA : %5ld\n", sizeof(RGBA));
printf("A_BitPlane : %5ld\n", sizeof(A_BitPlane));
printf("RGB_map : %5ld\n", sizeof(RGB_map));
printf("Image_Point : %5ld\n", sizeof(Image_Point));
2022-06-26 20:06:35 +11:00
}
/*::------------------------------------------------------------------::*/