Compare commits

..

No commits in common. "154844c94dc01bb44b18bba07d75682bcbeb6f25" and "70694cf59243e968ea4b4c1c493ccedae73e2389" have entirely different histories.

7 changed files with 6 additions and 106 deletions

View File

@ -222,21 +222,7 @@ FloatImg tmp;
int ret;
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = graylevel2popcolors(img, &tmp, k);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
return ret;
}
/* -------------------------------------------------------------- */
/* new Sun Feb 12 11:30:02 CET 2023 */
static int run_rndfluffy(FloatImg *img, int k)
{
FloatImg tmp;
int ret;
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = fimg_make_rndfluffy_lines(img, &tmp, k);
ret = graylevel2popcolors(img, &tmp, k);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
@ -455,12 +441,8 @@ switch (idFx) {
break;
case CR_gr2popcol:
retval = run_gr2popcol(image, -1);
break;
case CR_fluffy:
// fprintf(stderr, "******* TO BE DONE ********\n");
retval = run_rndfluffy(image, 75);
retval = run_gr2popcol(image, -1);
break;
default :
@ -499,7 +481,7 @@ int idx;
#define OUT stdout
if (NULL!=texte && verbosity) fprintf(OUT, "___ %s ___\n", texte);
if (NULL!=texte && verbosity) fprintf(OUT, "___ %s\n ___", texte);
for (idx=0; CrapL[idx].id!=-1; idx++) {
if (verbosity) {
fprintf(OUT, " %-12s | %4d | %5d | %8.3f\n",

View File

@ -42,6 +42,5 @@
50 decrgbzc 1 99
51 decrgbzg 1 99
60 gr2popcol 1 99
61 fluffy 1 0.12
99 message 1 1.0
-1 end 1 1.0

View File

@ -20,7 +20,7 @@
* https://git.tetalab.org/tTh/FloatImg
*/
#define FIMG_VERSION (219)
#define FIMG_VERSION (212)
#define RELEASE_NAME ("noname")
/* XXX add a test for stdint.h / uint32_t XXX */
@ -174,7 +174,6 @@ int fimg_binarize(FloatImg *pimg, int notused);
int fimg_trinarize(FloatImg *pimg, int notused);
/* module sfx3.c */
int fimg_make_rndfluffy_lines(FloatImg *src, FloatImg *dst, int rndt);
int fimg_crump_hard(FloatImg *src, FloatImg *dst, float kval, int notused);
/* module sfx4.c */

View File

@ -9,7 +9,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/time.h>
@ -17,45 +16,6 @@
extern int verbosity;
/* -------------------------------------------------------------- */
/* new Sun 29 Jan 2023 10:01:39 PM CET
*/
int fimg_make_rndfluffy_lines(FloatImg *src, FloatImg *dst, int rndt)
{
int x, y, ol;
float accu;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%p' '%p' %d )\n", __func__,
src, dst, rndt);
#endif
if (fimg_images_not_compatible(src, dst)) {
/* be hard for the lamers */
fprintf(stderr, "compatibility OUPS in %s\n", __func__);
abort();
}
for (y=0; y<src->height; y++) {
ol = y * src->width;
if (rndt < (rand() % 100)) {
accu = 0.0;
for (x=0; x<src->width; x++) accu += src->R[ol + x];
accu /= (float)src->width;
for (x=0; x<src->width; x++) dst->R[ol + x] = accu;
}
else {
for (x=0; x<src->width; x++) {
dst->R[ol+x] = src->R[ol+x];
dst->G[ol+x] = src->G[ol+x];
dst->B[ol+x] = src->B[ol+x];
}
}
}
return 0;
}
/* -------------------------------------------------------------- */
int fimg_crump_hard(FloatImg *src, FloatImg *dst, float kval, int notused)
{

View File

@ -26,7 +26,7 @@ enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff,
Geometrie, FileType, Mirror, KillRGB,
Pixelize,SplitLevel, DecompRgbz, DecompRgbg,
Rectangle, Dicom, Fakolor0, Fakolor3,
Fmorpho0, Fluffy };
Fmorpho0 };
typedef struct {
char *name;
int Cmd;
@ -64,7 +64,6 @@ Command commands[] = {
{ "fakolor0", Fakolor0 },
{ "fakolor3", Fakolor3 },
{ "fmorpho0", Fmorpho0 },
{ "fluffy", Fluffy },
{ NULL, 0 }
} ;
@ -263,9 +262,6 @@ switch(opt) {
case Fmorpho0:
foo = essai_fmorpho_0(filename, "/tmp/fmorpho", 0);
break;
case Fluffy:
foo = essai_rndfluffy(filename, outfile, 0);
break;
default:
fprintf(stderr, "'%s' is a bad command\n", command);
exit(1);

View File

@ -27,6 +27,7 @@ extern int verbosity;
/*
* nouveau 30 octobre 2022 --> fmorpho.c
*/
int essai_fmorpho_0(char *infile, char *basefname, int k)
{
FloatImg src, dst;
@ -317,42 +318,6 @@ if (foo) {
return 0;
}
/* --------------------------------------------------------------------- */
/* new Sun Feb 12 10:34:06 CET 2023
*/
int essai_rndfluffy(char *infile, char *outfile, int k)
{
int foo;
FloatImg src, dst;
fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__,
infile, outfile, k);
foo = fimg_create_from_dump(infile, &src);
if (0 != foo) {
fprintf(stderr, "%s: err %d loading image '%s'\n", __func__,
foo, infile);
return foo;
}
fprintf(stderr, " %s loaded.\n", infile);
fimg_clone(&src, &dst, 0);
fprintf(stderr, " %p cloned.\n", &src);
foo = fimg_make_rndfluffy_lines(&src, &dst, 80);
if (foo) {
fprintf(stderr, "err %d while making fluffy\n", foo);
return foo;
}
foo = fimg_export_picture(&dst, outfile, 0);
if (foo) {
fprintf(stderr, "%s: err %d exporting %s\n", __func__, foo, outfile);
return foo;
}
fimg_destroy(&src); fimg_destroy(&dst);
return 0;
}
/* --------------------------------------------------------------------- */
int essai_split_level(char *inf, char *outf, int flags)
{

View File

@ -8,7 +8,6 @@ int essai_miroir(char *inf, char *outf, int flags);
int essai_killrgb(char *inf, char *outf);
int essai_decomprgb_color(char *inf, char *outf);
int essai_decomprgb_gray(char *inf, char *outf);
int essai_rndfluffy(char *infile, char *outfile, int k); /* sfx3.c */
int essai_split_level(char *inf, char *outf, int flags);
int essai_displacement(char *infile, char *outfile);