importing the exporter :)

This commit is contained in:
tth
2022-06-28 21:28:22 +02:00
parent c87f70c5f2
commit 81611a3491
7 changed files with 223 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ all: foo testtga
basic_io.o: basic_io.c $(DEPS)
bitblt.o: bitblt.c $(DEPS)
bmp.o: bmp.c $(DEPS) bmp.h
cadres.o: cadres.c $(DEPS)
cadres2.o: cadres2.c $(DEPS)
@@ -89,6 +90,7 @@ pht.o: pht.c $(DEPS)
pixeliz.o: pixeliz.c $(DEPS)
pixels.o: pixels.c $(DEPS)
plotteur.o: plotteur.c $(DEPS)
pnm.o: pnm.c $(DEPS)
pov_hf15a.o: pov_hf15a.c $(DEPS)
pov_hf15b.o: pov_hf15b.c $(DEPS)
pov_hf15c.o: pov_hf15c.c $(DEPS)
@@ -126,7 +128,7 @@ zoom.o: zoom.c $(DEPS)
#-----------------------------------------------------------------
OBJECTS = 7seg.o \
basic_io.o bitblt.o \
basic_io.o bitblt.o bmp.o \
cadres2.o cadres3.o cadres4.o cadres84.o cadresbox.o \
cadres.o \
calculs.o classif.o \
@@ -149,6 +151,7 @@ OBJECTS = 7seg.o \
palettes.o \
patterns.o patterns2.o patterns3.o patterns4.o \
photomaton.o pht.o pixeliz.o pixels.o plotteur.o \
pnm.o \
pov_hf15a.o pov_hf15b.o pov_hf15c.o pov_hf15d.o \
pov_hf15e.o pov_hf15e.o pov_hf15f.o pov_synth.o \
ptlist.o \
@@ -168,10 +171,14 @@ OBJECTS = 7seg.o \
#-----------------------------------------------------------------
foo: foo.c $(DEPS) ../libtthimage.a
gcc $(CFLAGS) $< ../libimage.a -o $@
gcc $(CFLAGS) $< ../libtthimage.a -o $@
t_t16x24: t_t16x24.c $(DEPS) ../libtthimage.a
gcc $(CFLAGS) $< ../libimage.a-o $@
gcc $(CFLAGS) $< ../libtthimage.a -o $@
testbmp: testbmp.c $(DEPS) ../libtthimage.a
gcc $(CFLAGS) $< ../libtthimage.a -lm -o $@
#-----------------------------------------------------------------

View File

@@ -14,7 +14,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "tthimage.h"
#include "../tthimage.h"
#include "bmp.h" /* maybe I can hardcoded bmp.h here ? */

30
Lib/bmp.h Normal file
View File

@@ -0,0 +1,30 @@
/*
* header file for BMP functions
* -----------------------------
* 'tthimage.h' must be included before this file.
*
*/
#pragma pack(1) /* est-ce encore utile ? */
typedef struct
{
char id[2];
long filesize;
uint16_t reserved[2];
long headerSize;
long infoSize;
long width;
long height;
short planes;
short bits;
long compression;
long SizeImage;
long xpixpermeter;
long ypixpermeter;
long clrused;
long clrimportant;
} BMPHEAD;
#pragma pack()

56
Lib/testbmp.c Normal file
View File

@@ -0,0 +1,56 @@
/*
* essais sur le format BMP
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../tthimage.h"
/*::------------------------------------------------------------------::*/
/*
* Ther was a nasty bug in the 'save' function, staying here from the
* previous century. Try to fix it in October 2009
*/
int essai_largeur(int k)
{
int w;
Image_Desc *img;
char filename[100], chaine[110];
Image_load_fnt8x8("libimage.fonte", NULL, 0);
for (w=160; w<180; w++)
{
sprintf(filename, "tmp/aaaa-%03d-%d.bmp", w, w&3);
fprintf(stderr, "---- building '%s'\n", filename);
img = Image_alloc(w, 100, 3);
if (NULL==img)
{ exit(1); }
Image_pattern_001(img, 100);
Image_marque_0(img, 0);
sprintf(chaine, " w = %3d %d ", w, w&3);
Image_trace_chaine_1(img, chaine, 14, 14, NULL, NULL, NULL);
Image_BMP_save_24(filename, img, 0);
snprintf(chaine, 100, "display %s", filename);
fprintf(stderr, "running [%s]\n", chaine);
system(chaine);
Image_DeAllocate(img); free(img);
}
return 0;
}
/*::------------------------------------------------------------------::*/
int main(int argc, char *argv[])
{
int foo;
Image_print_version(1);
foo = essai_largeur(20);
return 0;
}
/*::------------------------------------------------------------------::*/