Compare commits
4 Commits
3f7abf4ea0
...
4597598b02
Author | SHA1 | Date | |
---|---|---|---|
|
4597598b02 | ||
|
db7b740b2c | ||
|
6aa802fde2 | ||
|
879e25463b |
@ -26,7 +26,7 @@ extern int verbosity;
|
||||
static A_Fifo g_fifo;
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
static int big_adder(FloatImg *from, FloatImg *to)
|
||||
static inline int big_adder(FloatImg *from, FloatImg *to)
|
||||
{
|
||||
int size, idx;
|
||||
|
||||
@ -90,7 +90,7 @@ int export_fifo(char *fname, int notused)
|
||||
int foo, type;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, fname, step);
|
||||
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, fname, notused);
|
||||
#endif
|
||||
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
value = idx_values[idx].value;
|
||||
value = idx_values[idx].value; /* WTF ? */
|
||||
|
||||
/* here was the input filter */
|
||||
foo = filterstack_run(0, &B, 0);
|
||||
|
@ -86,6 +86,9 @@ for (idx=20; idx < size; idx+=42) {
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
/*
|
||||
* LR mean left/right
|
||||
*/
|
||||
int get_float_metric_LR(FloatImg *pimg, float *where)
|
||||
{
|
||||
int coords[4], foo;
|
||||
@ -97,8 +100,16 @@ coords[2] = pimg->width / 2; // W
|
||||
coords[3] = pimg->height; // H
|
||||
|
||||
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;
|
||||
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];
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
static int nextpng, counter;
|
||||
static char *destination;
|
||||
static int chainfilter;
|
||||
static int outtype;
|
||||
// static int outtype;
|
||||
|
||||
/* and the classic global var */
|
||||
extern int verbosity;
|
||||
|
12
README.md
12
README.md
@ -38,8 +38,16 @@ 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
|
||||
Il est probable que j'en oublie.
|
||||
Et ya Debian qui change des trucs, alors, ça marche plus
|
||||
|
||||
```
|
||||
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
|
||||
coté de pkg-config.
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* http://la.buvette.org/photos/cumul
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION 166
|
||||
#define FIMG_VERSION 167
|
||||
|
||||
/*
|
||||
* in memory descriptor
|
||||
|
@ -36,7 +36,7 @@ return 42.0;
|
||||
int fimg_decomp_rgbz_color(FloatImg *psrc, FloatImg *pdst, int k)
|
||||
{
|
||||
int x, y, x2, y2;
|
||||
int w2, h2, idx;
|
||||
int w2, h2;
|
||||
float cumul, vgray;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
|
@ -40,6 +40,10 @@ if (fimg_images_not_compatible(psrc, pdst)) {
|
||||
}
|
||||
|
||||
foo = fimg_get_minmax_rgb(psrc, minmax);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s : err %d on get minmax\n", __func__, foo);
|
||||
return foo;
|
||||
}
|
||||
if (verbosity) {
|
||||
fimg_print_minmax(minmax, (char *)__func__);
|
||||
}
|
||||
|
@ -54,9 +54,11 @@ switch(filetype) {
|
||||
case FILE_TYPE_BMP:
|
||||
fprintf(stderr, "%s: file type BMP not implemented\n", __func__);
|
||||
foo = -666;
|
||||
break;
|
||||
case FILE_TYPE_EXR:
|
||||
fprintf(stderr, "%s: file type EXR experimental\n", __func__);
|
||||
foo = fimg_save_as_exr(pic, fname, 0);
|
||||
break;
|
||||
default:
|
||||
foo = -1789;
|
||||
break;
|
||||
|
@ -87,7 +87,7 @@ if (PNG_NO_ERROR != foo) {
|
||||
}
|
||||
|
||||
ptr = datas;
|
||||
for (idx=0; idx<png.width * png.height; idx++) {
|
||||
for (idx=0; idx<(int)(png.width*png.height); idx++) {
|
||||
fimg->R[idx] = (float)*ptr++;
|
||||
fimg->G[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 */
|
||||
if ((fimg->width != png.width) || (fimg->height != png.height)) {
|
||||
if ((fimg->width != (int)png.width) || (fimg->height != (int)png.height)) {
|
||||
fprintf(stderr, "%s : fatal error on images sizes\n", __func__);
|
||||
exit(1);
|
||||
}
|
||||
@ -151,7 +151,7 @@ if (PNG_NO_ERROR != foo) {
|
||||
}
|
||||
|
||||
ptr = datas;
|
||||
for (idx=0; idx<png.width * png.height; idx++) {
|
||||
for (idx=0; idx<(int)(png.width*png.height); idx++) {
|
||||
fimg->R[idx] = (float)*ptr++;
|
||||
fimg->G[idx] = (float)*ptr++;
|
||||
fimg->B[idx] = (float)*ptr++;
|
||||
@ -174,6 +174,10 @@ double maximum, fk;
|
||||
fprintf(stderr, ">>> %-25s ( %p '%s' 0x%x )\n", __func__, src, outname, flags);
|
||||
#endif
|
||||
|
||||
if (flags) {
|
||||
fprintf(stderr, "*** in %s, flags are %08x\n", __func__, flags);
|
||||
}
|
||||
|
||||
/* convert ou floating datas to a byte/rgb array */
|
||||
/* first, alloc a buffer */
|
||||
sz = src->width * src->height;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
int fimg_killrgb_v(FloatImg *src, FloatImg *dst, int k)
|
||||
{
|
||||
int foo, line, col;
|
||||
int line, col;
|
||||
int ir;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
|
@ -47,7 +47,7 @@ return 0;
|
||||
int fimg_split_level(FloatImg *src, FloatImg *dst, int notused)
|
||||
{
|
||||
float means[4];
|
||||
float in[3], out[3];
|
||||
float in[3];
|
||||
int foo, idx, surface;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
|
@ -106,6 +106,8 @@ while (pcmd->name) {
|
||||
}
|
||||
fprintf(stderr, "\ncompiled on "__DATE__" at "__TIME__"\n");
|
||||
|
||||
if (k) fimg_print_version(k);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
@ -39,10 +39,12 @@ switch (head->type) {
|
||||
if (head->G[foo] > maxval) maxval = head->G[foo];
|
||||
if (head->B[foo] > maxval) maxval = head->B[foo];
|
||||
}
|
||||
break;
|
||||
case FIMG_TYPE_GRAY:
|
||||
for (foo=0; foo<surface; foo++) {
|
||||
if (head->R[foo] > maxval) maxval = head->R[foo];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
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_classtrial, Fx_mirror, Fx_shift0, Fx_trimul,
|
||||
Fx_xper, Fx_binarize, Fx_trinarize, Fx_hilight_R,
|
||||
Fx_absolute, Fx_clamp };
|
||||
Fx_absolute, Fx_clamp, Fx_shiftZ };
|
||||
|
||||
Fx fx_list[] = {
|
||||
{ "cos01", Fx_cos01, 0, 1 },
|
||||
@ -52,6 +52,7 @@ Fx fx_list[] = {
|
||||
{ "hilightr", Fx_hilight_R, 0, 1 },
|
||||
{ "abs", Fx_absolute, 0, 1 },
|
||||
{ "clamp", Fx_clamp, 0, 1 },
|
||||
{ "shiftzero", Fx_shiftZ, 0, 1 },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
|
||||
@ -131,7 +132,8 @@ for (fx=fx_list; fx->name; fx++) {
|
||||
}
|
||||
}
|
||||
puts("\n");
|
||||
fimg_print_version(1);
|
||||
if (lvl) fimg_print_version(1);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
@ -162,7 +164,7 @@ if (fx_list[fxidx].flags & 1) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "%s: ???\n", __func__); /* XXX */
|
||||
fprintf(stderr, "%s: flags & 1 ???\n", __func__); /* XXX */
|
||||
memset(&dest, 0, sizeof(dest));
|
||||
return -888;
|
||||
}
|
||||
@ -245,6 +247,14 @@ switch (action) {
|
||||
negative pixels killed */
|
||||
if (foo > 0) foo = 0;
|
||||
break;
|
||||
|
||||
case Fx_shiftZ:
|
||||
foo = fimg_auto_shift_to_zero(&src, &dest);
|
||||
if (foo) {
|
||||
fprintf(stderr, "*** shiftzero -> %d\n", foo);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "%s %s : %d is bad action\n",
|
||||
__FILE__, __func__, action);
|
||||
@ -277,12 +287,13 @@ char *operator;
|
||||
char *srcname = "";
|
||||
char *dstname = "out.fimg";
|
||||
|
||||
while ((opt = getopt(argc, argv, "hk:lv")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "hk:lvx")) != -1) {
|
||||
switch(opt) {
|
||||
case 'h': help(0); 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 'x': break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user