Compare commits
No commits in common. "a38f4a8c72db6b1acdd5cf5c5e54592dd12188aa" and "75f36c0f6a25a5bc22400957513cf7e39eb94f07" have entirely different histories.
a38f4a8c72
...
75f36c0f6a
@ -3,7 +3,7 @@
|
||||
* ugly code from tTh
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION 118
|
||||
#define FIMG_VERSION 117
|
||||
|
||||
/*
|
||||
* in memory descriptor
|
||||
@ -40,7 +40,6 @@ typedef struct {
|
||||
#define FILE_TYPE_TGA 4
|
||||
#define FILE_TYPE_TIFF 5
|
||||
#define FILE_TYPE_FITS 6
|
||||
#define FILE_TYPE_BMP 7
|
||||
|
||||
/* lib/contrast.c */
|
||||
#define CONTRAST_NONE 0
|
||||
@ -131,7 +130,7 @@ int fimg_mix_rgb_gray(FloatImg *img, float mix);
|
||||
int fimg_shift_to_zero(FloatImg *s, FloatImg *d, float coefs[6]);
|
||||
|
||||
/* --> funcs/plasmas.c */
|
||||
int fimg_prototype_plasma(FloatImg *img, double time, int type);
|
||||
int fimg_prototype_plasma(FloatImg *img, char *txt, int type);
|
||||
|
||||
/* * * * experimental ! */
|
||||
int fimg_classif_trial(FloatImg *src, FloatImg*dst, float fval, int notused);
|
||||
@ -183,8 +182,6 @@ int fimg_load_from_png(char *filename, FloatImg *fimg);
|
||||
int fimg_create_from_png(char *filename, FloatImg *fimg);
|
||||
int fimg_save_as_png(FloatImg *src, char *outname, int flags);
|
||||
|
||||
int fimg_save_as_bmp(FloatImg *src, char *outname, int flags);
|
||||
|
||||
int fimg_test_pattern(FloatImg *fimg, int type, double dval);
|
||||
int fimg_draw_something(FloatImg *fimg);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#---------------------------------------------------------------
|
||||
|
||||
COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=0
|
||||
COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=1
|
||||
DEPS = ../floatimg.h Makefile
|
||||
|
||||
OBJS = fimg-png.o fimg-tiff.o misc-plots.o filtrage.o utils.o \
|
||||
@ -29,15 +29,12 @@ tests.o: tests.c tests.h $(DEPS)
|
||||
../libfloatimg.a: $(OBJS)
|
||||
$(AR) r $@ $?
|
||||
|
||||
displacement.o: displacement.c $(DEPS)
|
||||
displacement.o: displacement.c
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
fimg-png.o: fimg-png.c $(DEPS)
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
fimg-bmp.o: fimg-bmp.c $(DEPS)
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
fimg-tiff.o: fimg-tiff.c $(DEPS)
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
|
@ -57,10 +57,6 @@ switch(filetype) {
|
||||
foo = fimg_save_R_as_fits(pic, fname, 0);
|
||||
break;
|
||||
|
||||
case FILE_TYPE_BMP:
|
||||
fprintf(stderr, "%s: file type BMP not implemented\n", __func__);
|
||||
foo = -666;
|
||||
|
||||
default:
|
||||
foo = -1789;
|
||||
break;
|
||||
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Lecture/ecriture des images BMP
|
||||
* -------------------------------
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../floatimg.h"
|
||||
|
||||
extern int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
int fimg_save_as_bmp(FloatImg *src, char *outname, int flags)
|
||||
{
|
||||
|
||||
|
||||
return -2;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
@ -170,7 +170,7 @@ unsigned char *bytes, *bptr;
|
||||
double maximum, fk;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %-25s ( %p '%s' 0x%x )\n", __func__, src, outname, flags);
|
||||
fprintf(stderr, ">>> %-25s ( %p '%s' %x )\n", __func__, src, outname, flags);
|
||||
#endif
|
||||
|
||||
/* convert ou floating datas to a byte/rgb array */
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
PLASMAS
|
||||
|
||||
Inspiration Reep : https://blog.314r.net/2021/01/10/plasma/
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "../floatimg.h"
|
||||
|
||||
extern int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
int fimg_prototype_plasma(FloatImg *img, double time, int type)
|
||||
{
|
||||
int x, y;
|
||||
float rgb[3];
|
||||
double dx, dy;
|
||||
|
||||
fprintf(stderr, ">>> %s ( %p %.3f %d )\n", __func__,
|
||||
img, time, type);
|
||||
|
||||
for (y=0; y<img->height; y++) {
|
||||
dy = ((double)y/(double)img->height) - 0.5000;
|
||||
|
||||
for (x=0; x<img->width; x++) {
|
||||
dx = ((double)x/(double)img->width) - 0.5000;
|
||||
|
||||
rgb[0] = sin(dx*10 + time) + 1.0;
|
||||
rgb[1] = sin(dx*12 + time) + 1.0;
|
||||
rgb[2] = sin(dx*14 + time) + 1.0;
|
||||
fimg_put_rgb(img, x, y, rgb);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
@ -171,7 +171,7 @@ switch(opt) {
|
||||
foo = essai_lecture_png(filename, outfile, 0);
|
||||
break;
|
||||
case Plasmas:
|
||||
foo = essai_plasma(filename, outfile, 1, global_fvalue);
|
||||
foo = essai_plasma(filename, outfile, 1, 13.37);
|
||||
fprintf(stderr, "we are all plasmafields\n");
|
||||
break;
|
||||
default:
|
||||
|
@ -17,8 +17,6 @@
|
||||
extern int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
/*
|
||||
*/
|
||||
int essai_plasma(char *infile, char *outfile, int ikoef, float fkoef)
|
||||
{
|
||||
FloatImg src, dst;
|
||||
@ -29,24 +27,15 @@ fprintf(stderr, ">>> %s ( '%s' '%s' %d %g )\n", __func__,
|
||||
|
||||
/* if infile is loadable, use it for background */
|
||||
foo = fimg_create_from_dump(infile, &src);
|
||||
if (0 == foo) {
|
||||
fprintf(stderr, "%s: image '%s' loaded\n", __func__, infile);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: error loading '%s'\n", __func__, infile);
|
||||
return foo;
|
||||
}
|
||||
else {
|
||||
/* make a fancy synthetic picture */
|
||||
foo = fimg_create(&src, 800, 600, FIMG_TYPE_RGB);
|
||||
}
|
||||
|
||||
fprintf(stderr, "'%s' loaded\n", infile);
|
||||
fimg_printhead(&src);
|
||||
|
||||
fimg_clone(&src, &dst, 1);
|
||||
|
||||
foo = fimg_prototype_plasma(&dst, fkoef, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: err %d on plasma proto\n", __func__, foo);
|
||||
return -88;
|
||||
}
|
||||
|
||||
fimg_mul_3(&src, &dst, &dst);
|
||||
|
||||
foo = fimg_export_picture(&dst, outfile, 0);
|
||||
if (foo) {
|
||||
|
@ -7,7 +7,7 @@ device=/dev/video2
|
||||
maxi=59
|
||||
W="320"
|
||||
H="240"
|
||||
grabopt=" -s ${W}x${H} -vv -u -d $device -p 0 -n 30
|
||||
grabopt=" -s ${W}x${H}w -vv -d $device -p 0 -n 30
|
||||
0 -c none "
|
||||
|
||||
mkdir /tmp/V
|
||||
@ -22,10 +22,10 @@ do
|
||||
|
||||
grabvidseq -$grabopt -o $src
|
||||
|
||||
fval=$(echo "$foo / $maxi * 13.56636" | bc -l)
|
||||
echo ; echo $foo ' => ' $fval
|
||||
fval=$(echo "$foo / $maxi" | bc -l)
|
||||
echo $foo ' => ' $fval
|
||||
|
||||
./t -vv -k $fval -o $out plasma $src
|
||||
./t -vv -k $fval -o $out classif $src
|
||||
|
||||
# fimgstats $out
|
||||
|
||||
@ -33,7 +33,7 @@ do
|
||||
echo $dst
|
||||
montage $src $out -tile 1x2 -geometry $G $dst
|
||||
|
||||
sleep 55
|
||||
sleep 2
|
||||
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user