Compare commits
No commits in common. "4597598b0293c6e719f187110bca4666333bda47" and "3f7abf4ea0b3f6a01683025a066e1837ca6864b4" have entirely different histories.
4597598b02
...
3f7abf4ea0
@ -26,7 +26,7 @@ extern int verbosity;
|
|||||||
static A_Fifo g_fifo;
|
static A_Fifo g_fifo;
|
||||||
|
|
||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
static inline int big_adder(FloatImg *from, FloatImg *to)
|
static int big_adder(FloatImg *from, FloatImg *to)
|
||||||
{
|
{
|
||||||
int size, idx;
|
int size, idx;
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ int export_fifo(char *fname, int notused)
|
|||||||
int foo, type;
|
int foo, type;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, fname, notused);
|
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, fname, step);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
foo = faire_la_somme(&g_fifo, NULL, 1);
|
foo = faire_la_somme(&g_fifo, NULL, 1);
|
||||||
|
@ -175,7 +175,7 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
|
|||||||
fprintf(stderr, "load %s from dump -> %d\n", cptr, foo);
|
fprintf(stderr, "load %s from dump -> %d\n", cptr, foo);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
value = idx_values[idx].value; /* WTF ? */
|
value = idx_values[idx].value;
|
||||||
|
|
||||||
/* here was the input filter */
|
/* here was the input filter */
|
||||||
foo = filterstack_run(0, &B, 0);
|
foo = filterstack_run(0, &B, 0);
|
||||||
|
@ -86,9 +86,6 @@ for (idx=20; idx < size; idx+=42) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
/*
|
|
||||||
* LR mean left/right
|
|
||||||
*/
|
|
||||||
int get_float_metric_LR(FloatImg *pimg, float *where)
|
int get_float_metric_LR(FloatImg *pimg, float *where)
|
||||||
{
|
{
|
||||||
int coords[4], foo;
|
int coords[4], foo;
|
||||||
@ -100,16 +97,8 @@ coords[2] = pimg->width / 2; // W
|
|||||||
coords[3] = pimg->height; // H
|
coords[3] = pimg->height; // H
|
||||||
|
|
||||||
foo = stat_zone(pimg, coords, valL);
|
foo = stat_zone(pimg, coords, valL);
|
||||||
if (foo) {
|
|
||||||
fprintf(stderr, "err %d stat zone in %s\n", foo, __func__);
|
|
||||||
return foo;
|
|
||||||
}
|
|
||||||
coords[1] = pimg->width / 2;
|
coords[1] = pimg->width / 2;
|
||||||
foo = stat_zone(pimg, coords, valR);
|
foo = stat_zone(pimg, coords, valR);
|
||||||
if (foo) {
|
|
||||||
fprintf(stderr, "err %d stat zone in %s\n", foo, __func__);
|
|
||||||
return foo;
|
|
||||||
}
|
|
||||||
|
|
||||||
*where = valL[1] - valR[1];
|
*where = valL[1] - valR[1];
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
static int nextpng, counter;
|
static int nextpng, counter;
|
||||||
static char *destination;
|
static char *destination;
|
||||||
static int chainfilter;
|
static int chainfilter;
|
||||||
// static int outtype;
|
static int outtype;
|
||||||
|
|
||||||
/* and the classic global var */
|
/* and the classic global var */
|
||||||
extern int verbosity;
|
extern int verbosity;
|
||||||
|
12
README.md
12
README.md
@ -38,16 +38,8 @@ apt install libv4l2-dev
|
|||||||
apt install libcfitsio-dev
|
apt install libcfitsio-dev
|
||||||
apt install libnetpbm-dev
|
apt install libnetpbm-dev
|
||||||
```
|
```
|
||||||
Il est probable que j'en oublie.
|
Il est probable que j'en oublient. Ensuite, j'ai dans l'idée de construire
|
||||||
Et ya Debian qui change des trucs, alors, ça marche plus
|
um met-packet à la sauce Debian pour installer facilement tout ce
|
||||||
|
|
||||||
```
|
|
||||||
E: Unable to locate package libv4l2-dev
|
|
||||||
E: Unable to locate package libnetpbm-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Ensuite, j'ai dans l'idée de construire
|
|
||||||
um meta-packet à la sauce Debian pour installer facilement tout ce
|
|
||||||
qui sert à faire fonctionner ce kluge. Ensuite, j'irais voir du
|
qui sert à faire fonctionner ce kluge. Ensuite, j'irais voir du
|
||||||
coté de pkg-config.
|
coté de pkg-config.
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* http://la.buvette.org/photos/cumul
|
* http://la.buvette.org/photos/cumul
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define FIMG_VERSION 167
|
#define FIMG_VERSION 166
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* in memory descriptor
|
* in memory descriptor
|
||||||
|
@ -36,7 +36,7 @@ return 42.0;
|
|||||||
int fimg_decomp_rgbz_color(FloatImg *psrc, FloatImg *pdst, int k)
|
int fimg_decomp_rgbz_color(FloatImg *psrc, FloatImg *pdst, int k)
|
||||||
{
|
{
|
||||||
int x, y, x2, y2;
|
int x, y, x2, y2;
|
||||||
int w2, h2;
|
int w2, h2, idx;
|
||||||
float cumul, vgray;
|
float cumul, vgray;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
|
@ -40,10 +40,6 @@ if (fimg_images_not_compatible(psrc, pdst)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foo = fimg_get_minmax_rgb(psrc, minmax);
|
foo = fimg_get_minmax_rgb(psrc, minmax);
|
||||||
if (foo) {
|
|
||||||
fprintf(stderr, "%s : err %d on get minmax\n", __func__, foo);
|
|
||||||
return foo;
|
|
||||||
}
|
|
||||||
if (verbosity) {
|
if (verbosity) {
|
||||||
fimg_print_minmax(minmax, (char *)__func__);
|
fimg_print_minmax(minmax, (char *)__func__);
|
||||||
}
|
}
|
||||||
|
@ -54,11 +54,9 @@ switch(filetype) {
|
|||||||
case FILE_TYPE_BMP:
|
case FILE_TYPE_BMP:
|
||||||
fprintf(stderr, "%s: file type BMP not implemented\n", __func__);
|
fprintf(stderr, "%s: file type BMP not implemented\n", __func__);
|
||||||
foo = -666;
|
foo = -666;
|
||||||
break;
|
|
||||||
case FILE_TYPE_EXR:
|
case FILE_TYPE_EXR:
|
||||||
fprintf(stderr, "%s: file type EXR experimental\n", __func__);
|
fprintf(stderr, "%s: file type EXR experimental\n", __func__);
|
||||||
foo = fimg_save_as_exr(pic, fname, 0);
|
foo = fimg_save_as_exr(pic, fname, 0);
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
foo = -1789;
|
foo = -1789;
|
||||||
break;
|
break;
|
||||||
|
@ -87,7 +87,7 @@ if (PNG_NO_ERROR != foo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ptr = datas;
|
ptr = datas;
|
||||||
for (idx=0; idx<(int)(png.width*png.height); idx++) {
|
for (idx=0; idx<png.width * png.height; idx++) {
|
||||||
fimg->R[idx] = (float)*ptr++;
|
fimg->R[idx] = (float)*ptr++;
|
||||||
fimg->G[idx] = (float)*ptr++;
|
fimg->G[idx] = (float)*ptr++;
|
||||||
fimg->B[idx] = (float)*ptr++;
|
fimg->B[idx] = (float)*ptr++;
|
||||||
@ -132,7 +132,7 @@ if ( 3 != png.bpp ) { /* TO BE PATCHED */
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check if floatimg and PNG have the same size */
|
/* check if floatimg and PNG have the same size */
|
||||||
if ((fimg->width != (int)png.width) || (fimg->height != (int)png.height)) {
|
if ((fimg->width != png.width) || (fimg->height != png.height)) {
|
||||||
fprintf(stderr, "%s : fatal error on images sizes\n", __func__);
|
fprintf(stderr, "%s : fatal error on images sizes\n", __func__);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ if (PNG_NO_ERROR != foo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ptr = datas;
|
ptr = datas;
|
||||||
for (idx=0; idx<(int)(png.width*png.height); idx++) {
|
for (idx=0; idx<png.width * png.height; idx++) {
|
||||||
fimg->R[idx] = (float)*ptr++;
|
fimg->R[idx] = (float)*ptr++;
|
||||||
fimg->G[idx] = (float)*ptr++;
|
fimg->G[idx] = (float)*ptr++;
|
||||||
fimg->B[idx] = (float)*ptr++;
|
fimg->B[idx] = (float)*ptr++;
|
||||||
@ -174,10 +174,6 @@ double maximum, fk;
|
|||||||
fprintf(stderr, ">>> %-25s ( %p '%s' 0x%x )\n", __func__, src, outname, flags);
|
fprintf(stderr, ">>> %-25s ( %p '%s' 0x%x )\n", __func__, src, outname, flags);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (flags) {
|
|
||||||
fprintf(stderr, "*** in %s, flags are %08x\n", __func__, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* convert ou floating datas to a byte/rgb array */
|
/* convert ou floating datas to a byte/rgb array */
|
||||||
/* first, alloc a buffer */
|
/* first, alloc a buffer */
|
||||||
sz = src->width * src->height;
|
sz = src->width * src->height;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
int fimg_killrgb_v(FloatImg *src, FloatImg *dst, int k)
|
int fimg_killrgb_v(FloatImg *src, FloatImg *dst, int k)
|
||||||
{
|
{
|
||||||
int line, col;
|
int foo, line, col;
|
||||||
int ir;
|
int ir;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
|
@ -47,7 +47,7 @@ return 0;
|
|||||||
int fimg_split_level(FloatImg *src, FloatImg *dst, int notused)
|
int fimg_split_level(FloatImg *src, FloatImg *dst, int notused)
|
||||||
{
|
{
|
||||||
float means[4];
|
float means[4];
|
||||||
float in[3];
|
float in[3], out[3];
|
||||||
int foo, idx, surface;
|
int foo, idx, surface;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
|
@ -106,8 +106,6 @@ while (pcmd->name) {
|
|||||||
}
|
}
|
||||||
fprintf(stderr, "\ncompiled on "__DATE__" at "__TIME__"\n");
|
fprintf(stderr, "\ncompiled on "__DATE__" at "__TIME__"\n");
|
||||||
|
|
||||||
if (k) fimg_print_version(k);
|
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
@ -39,12 +39,10 @@ switch (head->type) {
|
|||||||
if (head->G[foo] > maxval) maxval = head->G[foo];
|
if (head->G[foo] > maxval) maxval = head->G[foo];
|
||||||
if (head->B[foo] > maxval) maxval = head->B[foo];
|
if (head->B[foo] > maxval) maxval = head->B[foo];
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case FIMG_TYPE_GRAY:
|
case FIMG_TYPE_GRAY:
|
||||||
for (foo=0; foo<surface; foo++) {
|
for (foo=0; foo<surface; foo++) {
|
||||||
if (head->R[foo] > maxval) maxval = head->R[foo];
|
if (head->R[foo] > maxval) maxval = head->R[foo];
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return maxval;
|
return maxval;
|
||||||
|
@ -28,7 +28,7 @@ enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0,
|
|||||||
Fx_rot90, Fx_cmixa, Fx_desat, Fx_ctr2x2, Fx_norm,
|
Fx_rot90, Fx_cmixa, Fx_desat, Fx_ctr2x2, Fx_norm,
|
||||||
Fx_classtrial, Fx_mirror, Fx_shift0, Fx_trimul,
|
Fx_classtrial, Fx_mirror, Fx_shift0, Fx_trimul,
|
||||||
Fx_xper, Fx_binarize, Fx_trinarize, Fx_hilight_R,
|
Fx_xper, Fx_binarize, Fx_trinarize, Fx_hilight_R,
|
||||||
Fx_absolute, Fx_clamp, Fx_shiftZ };
|
Fx_absolute, Fx_clamp };
|
||||||
|
|
||||||
Fx fx_list[] = {
|
Fx fx_list[] = {
|
||||||
{ "cos01", Fx_cos01, 0, 1 },
|
{ "cos01", Fx_cos01, 0, 1 },
|
||||||
@ -52,7 +52,6 @@ Fx fx_list[] = {
|
|||||||
{ "hilightr", Fx_hilight_R, 0, 1 },
|
{ "hilightr", Fx_hilight_R, 0, 1 },
|
||||||
{ "abs", Fx_absolute, 0, 1 },
|
{ "abs", Fx_absolute, 0, 1 },
|
||||||
{ "clamp", Fx_clamp, 0, 1 },
|
{ "clamp", Fx_clamp, 0, 1 },
|
||||||
{ "shiftzero", Fx_shiftZ, 0, 1 },
|
|
||||||
{ NULL, 0, 0, 0 }
|
{ NULL, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -132,8 +131,7 @@ for (fx=fx_list; fx->name; fx++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
puts("\n");
|
puts("\n");
|
||||||
if (lvl) fimg_print_version(1);
|
fimg_print_version(1);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
@ -164,7 +162,7 @@ if (fx_list[fxidx].flags & 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "%s: flags & 1 ???\n", __func__); /* XXX */
|
fprintf(stderr, "%s: ???\n", __func__); /* XXX */
|
||||||
memset(&dest, 0, sizeof(dest));
|
memset(&dest, 0, sizeof(dest));
|
||||||
return -888;
|
return -888;
|
||||||
}
|
}
|
||||||
@ -247,14 +245,6 @@ switch (action) {
|
|||||||
negative pixels killed */
|
negative pixels killed */
|
||||||
if (foo > 0) foo = 0;
|
if (foo > 0) foo = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Fx_shiftZ:
|
|
||||||
foo = fimg_auto_shift_to_zero(&src, &dest);
|
|
||||||
if (foo) {
|
|
||||||
fprintf(stderr, "*** shiftzero -> %d\n", foo);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "%s %s : %d is bad action\n",
|
fprintf(stderr, "%s %s : %d is bad action\n",
|
||||||
__FILE__, __func__, action);
|
__FILE__, __func__, action);
|
||||||
@ -287,13 +277,12 @@ char *operator;
|
|||||||
char *srcname = "";
|
char *srcname = "";
|
||||||
char *dstname = "out.fimg";
|
char *dstname = "out.fimg";
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "hk:lvx")) != -1) {
|
while ((opt = getopt(argc, argv, "hk:lv")) != -1) {
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'h': help(0); break;
|
case 'h': help(0); break;
|
||||||
case 'k': global_fvalue = atof(optarg); break;
|
case 'k': global_fvalue = atof(optarg); break;
|
||||||
case 'l': list_of_effects(); exit(0);
|
case 'l': list_of_effects(); exit(0);
|
||||||
case 'v': verbosity++; break;
|
case 'v': verbosity++; break;
|
||||||
case 'x': break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user