Browse Source

first external contrib

master
tTh 7 months ago
parent
commit
ccd324749e
  1. 3
      .gitignore
  2. 4
      README.md
  3. 7
      contrib/Makefile
  4. 4
      contrib/README.md
  5. 82
      contrib/fimg2povhf.c
  6. 2
      floatimg.h
  7. 1
      v4l2/funcs.c

3
.gitignore vendored

@ -9,6 +9,8 @@ lib/*.gif @@ -9,6 +9,8 @@ lib/*.gif
*.a
gmon.out
*.swp
*.pnm
*.fimg
essai
@ -88,4 +90,5 @@ experiment/muxplanes @@ -88,4 +90,5 @@ experiment/muxplanes
experiment/movepixels
experiment/tcache
contrib/fimg2povhf

4
README.md

@ -38,6 +38,10 @@ apt install libv4l2-dev @@ -38,6 +38,10 @@ apt install libv4l2-dev
apt install libcfitsio-dev
apt install libnetpbm-dev
```
Il est probable que j'en oublient. Ensuite, j'ai dans l'idée de construire
um met-packet à la sauce Debian pour installer facilement tout ce
qui sert à faire fonctionner ce kluge. Ensuite, j'irais voir du
coté de pkg-config.
Certains outils externes sont aussi utiles :

7
contrib/Makefile

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
DBGL = '-DDEBUG_LEVEL=1'
fimg2povhf: fimg2povhf.c Makefile
gcc -Wall $(DBGL) $< -limage -lfloatimg -lm -o $@

4
contrib/README.md

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
# Contributions
Need some external garbage, sorry.

82
contrib/fimg2povhf.c

@ -0,0 +1,82 @@ @@ -0,0 +1,82 @@
/*
* convertir une image flottante en champ d'altitude
*
* nouveau 64 ernest renan - 20220108
*/
#include <stdio.h>
#include <math.h>
#include "tthimage.h"
#include "floatimg.h"
int verbosity;
/* ------------------------------------------------------------------ */
int This_is_the_real_conversion(FloatImg *fimg, Image_Desc *hf, int k)
{
FloatImg mixed;
int foo;
float minmax[6];
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, fimg, hf, k);
#endif
foo = fimg_get_minmax_rgb(fimg, minmax);
fimg_print_minmax(minmax, "source");
return FULL_NUCKED;
}
/* ------------------------------------------------------------------ */
int Convertir_Fimg_to_Povhf(char *fimgname, char *hfname, int k)
{
FloatImg fimg;
Image_Desc *hf;
int wid, hei;
int foo;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %s %s %d )\n", __func__, fimgname, hfname, k);
#endif
foo = fimg_create_from_dump(fimgname, &fimg);
fprintf(stderr, "load of %s --> %d\n", fimgname, foo);
if (foo) {
return foo;
}
wid = fimg.width; hei = fimg.height; // nice alias
fprintf(stderr, "picture size %dx%d\n", wid, hei);
hf = Image_alloc(wid, hei, IMAGE_RGB);
fprintf(stderr, "hf alloc -> %p\n", hf);
if (NULL == hf) {
return NULL_POINTER;
}
foo = This_is_the_real_conversion(&fimg, hf, k);
fprintf(stderr, "real conversion -> %d\n", foo);
return FULL_NUCKED;
}
/* ------------------------------------------------------------------ */
int main(int argc, char *argv[])
{
int foo;
verbosity = 1;
Image_print_version(3);
fimg_print_version(3);
foo = Convertir_Fimg_to_Povhf("foo.fimg", "out.tga", 0);
fprintf(stderr, "retour conversion was %d\n", foo);
return 0;
}
/* ------------------------------------------------------------------ */

2
floatimg.h

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
* http://la.buvette.org/photos/cumul
*/
#define FIMG_VERSION 164
#define FIMG_VERSION 166
/*
* in memory descriptor

1
v4l2/funcs.c

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <fcntl.h> /* low-level i/o */
#include <unistd.h>

Loading…
Cancel
Save