Compare commits
	
		
			No commits in common. "30cb44864223e8ccabc1196c04cc46d8f448e623" and "dbff8129b72bc946da93e6753b4f2ffbde09866a" have entirely different histories.
		
	
	
		
			30cb448642
			...
			dbff8129b7
		
	
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -85,5 +85,4 @@ experiment/*.fimg
 | 
				
			|||||||
experiment/*.pnm
 | 
					experiment/*.pnm
 | 
				
			||||||
experiment/*.o
 | 
					experiment/*.o
 | 
				
			||||||
experiment/muxplanes
 | 
					experiment/muxplanes
 | 
				
			||||||
experiment/movepixels
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -15,7 +15,7 @@ pour les codeurs.
 | 
				
			|||||||
Le service après-vente est (plus ou moins bien) assuré sur
 | 
					Le service après-vente est (plus ou moins bien) assuré sur
 | 
				
			||||||
la [mailing list](https://lists.tetalab.org/mailman/listinfo/tetalab) et/ou
 | 
					la [mailing list](https://lists.tetalab.org/mailman/listinfo/tetalab) et/ou
 | 
				
			||||||
le canal IRC #tetalab sur le réseau de 
 | 
					le canal IRC #tetalab sur le réseau de 
 | 
				
			||||||
[Libera.Chat](https://libera.chat/)...
 | 
					[Freenode](https://webchat.freenode.net/)...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Par ailleurs, d'autres expérimentations sont
 | 
					Par ailleurs, d'autres expérimentations sont
 | 
				
			||||||
[en cours](http://la.buvette.org/photos/cumul/fonderie/vidz.html#interpolator)
 | 
					[en cours](http://la.buvette.org/photos/cumul/fonderie/vidz.html#interpolator)
 | 
				
			||||||
 | 
				
			|||||||
@ -1,14 +1,7 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#	this script generate some picz for the PDF documentation
 | 
					 | 
				
			||||||
#	and was called by mkdoc.sh
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
PI=" 3.141592654 "
 | 
					PI=" 3.141592654 "
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#	---------------------------------------------------
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
OUT="cos01.tex"
 | 
					OUT="cos01.tex"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gnuplot << __EOF__
 | 
					gnuplot << __EOF__
 | 
				
			||||||
@ -31,8 +24,6 @@ __EOF__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
wc $OUT
 | 
					wc $OUT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#	---------------------------------------------------
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
OUT="cos010.tex"
 | 
					OUT="cos010.tex"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gnuplot << __EOF__
 | 
					gnuplot << __EOF__
 | 
				
			||||||
@ -54,5 +45,3 @@ plot					\
 | 
				
			|||||||
__EOF__
 | 
					__EOF__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wc $OUT
 | 
					wc $OUT
 | 
				
			||||||
 | 
					 | 
				
			||||||
#	---------------------------------------------------
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -74,7 +74,7 @@ et sa fiablité (surtout sur certains aspects mathématiques)
 | 
				
			|||||||
reste à démontrer\index{valgrind}.
 | 
					reste à démontrer\index{valgrind}.
 | 
				
			||||||
Mais le service après-vente est assez réactif. Du moins
 | 
					Mais le service après-vente est assez réactif. Du moins
 | 
				
			||||||
pour ceux qui suivent le canal \texttt{\#tetalab} sur le réseau
 | 
					pour ceux qui suivent le canal \texttt{\#tetalab} sur le réseau
 | 
				
			||||||
IRC de \textsl{libera.chat}.
 | 
					IRC de Freenode.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\textbf{Attention !} ce document commence par une bonne rafale
 | 
					\textbf{Attention !} ce document commence par une bonne rafale
 | 
				
			||||||
de technique parfois \textsl{hardue}, avec des pointeurs dedans.
 | 
					de technique parfois \textsl{hardue}, avec des pointeurs dedans.
 | 
				
			||||||
 | 
				
			|||||||
@ -1,13 +1,12 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#
 | 
					#  experiments
 | 
				
			||||||
#  some ugly experiments, do not use in production
 | 
					
 | 
				
			||||||
#
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPT = -Wall -fpic -g -DDEBUG_LEVEL=1 -lm
 | 
					COPT = -Wall -fpic -g -DDEBUG_LEVEL=1 -lm
 | 
				
			||||||
DEPS = ../floatimg.h  ../libfloatimg.a Makefile
 | 
					DEPS = ../floatimg.h  ../libfloatimg.a Makefile
 | 
				
			||||||
LIBS = -ltiff -lpnglite -lcfitsio
 | 
					LIBS = -ltiff -lpnglite -lcfitsio
 | 
				
			||||||
 | 
					
 | 
				
			||||||
all:	assemblage extracteur muxplanes movepixels
 | 
					all:	assemblage extracteur muxplanes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
assemblage:	assemblage.c ${DEPS} 
 | 
					assemblage:	assemblage.c ${DEPS} 
 | 
				
			||||||
	gcc $(COPT) $< ../libfloatimg.a ${LIBS} -o $@
 | 
						gcc $(COPT) $< ../libfloatimg.a ${LIBS} -o $@
 | 
				
			||||||
@ -17,6 +16,3 @@ extracteur:	extracteur.c ${DEPS}
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
muxplanes:	muxplanes.c ${DEPS}
 | 
					muxplanes:	muxplanes.c ${DEPS}
 | 
				
			||||||
	gcc $(COPT) $<  ../libfloatimg.a ${LIBS} -o $@
 | 
						gcc $(COPT) $<  ../libfloatimg.a ${LIBS} -o $@
 | 
				
			||||||
 | 
					 | 
				
			||||||
movepixels:	movepixels.c ${DEPS}
 | 
					 | 
				
			||||||
	gcc $(COPT) $<  ../libfloatimg.a ${LIBS} -o $@
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -1,12 +1,6 @@
 | 
				
			|||||||
# EXPÉRIMENTATIONS ÀLC
 | 
					# EXPÉRIMENTATION ÀLC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Attention, tout ce qui se trouve dans ce répertoire ne sont que des
 | 
					## ASSEMBLAGE
 | 
				
			||||||
essais. Certains aboutissent, et sont migrés vers `funcs/` ou
 | 
					 | 
				
			||||||
`tools/`, d'autre échouent et restent trainer dans le coin en attente
 | 
					 | 
				
			||||||
du retour de l'inspiration.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Le contenu de ce répertoire doit donc être considéré comme
 | 
					 | 
				
			||||||
**volatile**. Si vous y trouvez votre bonheur, il serait sage
 | 
					 | 
				
			||||||
d'en faire une copie personnelle...
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## EXTRACTEUR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,154 +0,0 @@
 | 
				
			|||||||
/*
 | 
					 | 
				
			||||||
 *		MOVEPIXELS
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 *	This is experimental, do not use in production !
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include   <stdio.h>
 | 
					 | 
				
			||||||
#include   <stdlib.h>
 | 
					 | 
				
			||||||
#include   <stdint.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include   <floatimg.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int		verbosity;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* ------------------------------------------------------------------- */
 | 
					 | 
				
			||||||
int displace(FloatImg *psrc, FloatImg *pshift, FloatImg *pdst, float k)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
int		xd, yd, xs, ys;
 | 
					 | 
				
			||||||
float		rgb[3], disp[3], maxv;
 | 
					 | 
				
			||||||
float		minmax[6];
 | 
					 | 
				
			||||||
int		foo, inside, outside;
 | 
					 | 
				
			||||||
float		dltr, dltg, dltb;	/* delta des minmax */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#if DEBUG_LEVEL
 | 
					 | 
				
			||||||
fprintf(stderr, ">>> %s ( %p %p %p %g )\n", __func__,
 | 
					 | 
				
			||||||
			psrc, pshift, pdst, k);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if (FIMG_TYPE_RGB != psrc->type) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "%s: bad src type %d\n", __func__, psrc->type);
 | 
					 | 
				
			||||||
	return -7;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
if (fimg_images_not_compatible(psrc, pshift)) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "%s: bad shift image %d\n", __func__, pshift->type);
 | 
					 | 
				
			||||||
	return -8;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
if (fimg_images_not_compatible(psrc, pdst)) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "%s: bad dst image %d\n", __func__, pdst->type);
 | 
					 | 
				
			||||||
	return -8;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foo = fimg_get_minmax_rgb(pshift, minmax);
 | 
					 | 
				
			||||||
if (verbosity) {
 | 
					 | 
				
			||||||
	fimg_print_minmax(minmax, (char *)__func__);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
dltr = minmax[1] - minmax[0];
 | 
					 | 
				
			||||||
dltg = minmax[3] - minmax[2];
 | 
					 | 
				
			||||||
dltb = minmax[5] - minmax[4];
 | 
					 | 
				
			||||||
if (verbosity) fprintf(stderr, "delta shift  %f %f %f\n", dltr, dltg, dltb);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
maxv = fimg_get_maxvalue(psrc);
 | 
					 | 
				
			||||||
inside = outside = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* hardcoded parameters. this is very dirty :) */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define  MULT  (140.0)
 | 
					 | 
				
			||||||
#define  OFFS  (70.0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* loop over all the pixels of the DESTINATION picture */
 | 
					 | 
				
			||||||
for (yd=0; yd<pdst->height; yd++) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for (xd=0; xd<pdst->width; xd++) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		fimg_get_rgb(pshift, xd, yd, disp);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		xs = xd + ((disp[0]/dltr*MULT) - OFFS);
 | 
					 | 
				
			||||||
		ys = yd + ((disp[2]/dltb*MULT) - OFFS);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if ( xs<0 || xs>psrc->width 	||
 | 
					 | 
				
			||||||
		     ys<0 || ys>psrc->height ) {
 | 
					 | 
				
			||||||
			rgb[0] = maxv;			/* fucking bug XXX */
 | 
					 | 
				
			||||||
			rgb[1] = rgb[2] = 0.0;
 | 
					 | 
				
			||||||
			outside++;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		else {
 | 
					 | 
				
			||||||
			fimg_get_rgb(psrc, xs, ys, rgb);
 | 
					 | 
				
			||||||
			inside++;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		fimg_put_rgb(pdst, xd, yd, rgb);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// fprintf(stderr, "%s: inside %d outside %d\n", __func__, inside, outside);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
/* ------------------------------------------------------------------- */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int move_the_pixels(char *infile, char *statfile, char *outfile, int k)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
int		foo;
 | 
					 | 
				
			||||||
FloatImg	src, shift, dst;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#if DEBUG_LEVEL
 | 
					 | 
				
			||||||
fprintf(stderr, ">>> %s ( %s %s 0x%04x )\n", __func__,
 | 
					 | 
				
			||||||
				infile, outfile, k);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* 'infile' contains the shifting values */
 | 
					 | 
				
			||||||
foo = fimg_create_from_dump(infile, &shift);
 | 
					 | 
				
			||||||
if (foo) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "%s: error loading '%s'\n", __func__, infile);
 | 
					 | 
				
			||||||
	return foo;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
fimg_clone(&shift, &dst, 0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foo = fimg_create_from_dump(statfile, &src);
 | 
					 | 
				
			||||||
if (foo) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "%s: error loading 'cumul.fimg'\n", __func__);
 | 
					 | 
				
			||||||
	return foo;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foo = displace(&src, &shift, &dst, 42.42);
 | 
					 | 
				
			||||||
if (foo) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "%s: err %d in disp map 0\n", __func__, foo);
 | 
					 | 
				
			||||||
	return foo;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foo = fimg_export_picture(&dst, outfile, 0);
 | 
					 | 
				
			||||||
if (foo) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "%s: err %d saving result\n", __func__, foo);
 | 
					 | 
				
			||||||
	return foo;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
/* ------------------------------------------------------------------- */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int main(int argc, char *argv[])
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
int		foo;
 | 
					 | 
				
			||||||
char		*srcfile, *dstfile;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if (3 != argc) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "usage:\n\t%s src.fimg dst.fimg\n", argv[0]);
 | 
					 | 
				
			||||||
	exit(1);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
srcfile = argv[1];
 | 
					 | 
				
			||||||
dstfile = argv[2];
 | 
					 | 
				
			||||||
verbosity = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foo = move_the_pixels(srcfile, "cumul.fimg", dstfile, 3);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// fprintf(stderr, "move pixels %s -> %s = %d\n", srcfile, dstfile, foo);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
/* ------------------------------------------------------------------- */
 | 
					 | 
				
			||||||
@ -5,7 +5,7 @@
 | 
				
			|||||||
#include  <stdlib.h>
 | 
					#include  <stdlib.h>
 | 
				
			||||||
#include  <unistd.h>
 | 
					#include  <unistd.h>
 | 
				
			||||||
#include  <stdint.h>
 | 
					#include  <stdint.h>
 | 
				
			||||||
#include  <string.h>
 | 
					#include  <strings.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include  "../floatimg.h"
 | 
					#include  "../floatimg.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user