not ready for prime time

This commit is contained in:
le vieux 2020-11-16 11:12:29 +01:00
parent fdc2544ad1
commit 7c1ad9633a
3 changed files with 21 additions and 12 deletions

View File

@ -9,6 +9,7 @@
#include "fonctions.h" #include "fonctions.h"
#include "crapulator.h" #include "crapulator.h"
#include "glitches.h"
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */
static int effect_3(FloatImg *image) static int effect_3(FloatImg *image)
@ -118,7 +119,7 @@ switch (idFx) {
break; break;
/* --- WTF -- */ /* --- WTF -- */
case 25: case 25:
retval = vertical_singlitch(image, 250, fval, 18, 0); retval = vertical_singlitch(image, 250+rand()%15 , fval, 18, 0);
break; break;
default : default :
fprintf(stderr, "%s : effect #%d invalid\n", fprintf(stderr, "%s : effect #%d invalid\n",

View File

@ -16,6 +16,7 @@
#include "../floatimg.h" #include "../floatimg.h"
#include "fonctions.h"
#include "glitches.h" #include "glitches.h"
#include "crapulator.h" #include "crapulator.h"
#include "metriques.h" #include "metriques.h"
@ -83,11 +84,13 @@ if (method) {
qsort(idxvalues, nombre, sizeof(IdxValue), cmp_idxvalues); qsort(idxvalues, nombre, sizeof(IdxValue), cmp_idxvalues);
} }
if (verbosity) {
for (idx=0; idx<nombre; idx++) { for (idx=0; idx<nombre; idx++) {
printf("%5d %9.6f %5d\n", idx, printf("%5d %9.6f %5d\n", idx,
idxvalues[idx].value, idxvalues[idx].idx); idxvalues[idx].value, idxvalues[idx].idx);
fflush(stdout); fflush(stdout);
} }
}
return 0; return 0;
} }
@ -115,7 +118,6 @@ memset(&globbuf, 0, sizeof(glob_t));
foo = glob(pattern, 0, NULL, &globbuf); foo = glob(pattern, 0, NULL, &globbuf);
fprintf(stderr, "globbing '%s' -> %d, %ld files found\n", fprintf(stderr, "globbing '%s' -> %d, %ld files found\n",
pattern, foo, globbuf.gl_pathc); pattern, foo, globbuf.gl_pathc);
if (0 == globbuf.gl_pathc) { if (0 == globbuf.gl_pathc) {
fprintf(stderr, "%s : no file found, aborting\n", __func__); fprintf(stderr, "%s : no file found, aborting\n", __func__);
return -1; return -1;
@ -135,8 +137,11 @@ w = iarray[0], h = iarray[1];
fprintf(stderr, "first image size : %dx%d\n", w, h); fprintf(stderr, "first image size : %dx%d\n", w, h);
fimg_create(&A, w, h, 3); pFirst = &A; fimg_create(&A, w, h, 3); pFirst = &A;
// brotche_rand48_a(&A, 0.10, 250.555);
fimg_create(&B, w, h, 3); pSecond = &B; fimg_create(&B, w, h, 3); pSecond = &B;
// brotche_rand48_a(&B, 0.10, 250.555);
fimg_create(&Out, w, h, 3); fimg_create(&Out, w, h, 3);
// brotche_rand48_a(&Out, 0.10, 250.555);
ipng = 0; ipng = 0;
for (idx=0; idx<globbuf.gl_pathc; idx++) { for (idx=0; idx<globbuf.gl_pathc; idx++) {

View File

@ -4,6 +4,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include "../floatimg.h" #include "../floatimg.h"
#include "glitches.h" #include "glitches.h"
@ -13,8 +14,8 @@
int verbosity; int verbosity;
#define PNG "out.png" #define PNG "out.png"
#define W 512 #define W 800
#define H 256 #define H 600
#define LMAX 233.333 #define LMAX 233.333
#define TIMER 1 #define TIMER 1
@ -34,15 +35,17 @@ if (foo) {
fprintf(stderr, "err %d create image\n", foo); fprintf(stderr, "err %d create image\n", foo);
exit(1); exit(1);
} }
fimg_vdeg_a(&image, LMAX);
srand(getpid());
debut = fimg_timer_set(TIMER); debut = fimg_timer_set(TIMER);
for (iter=0; iter<64; iter++) { for (iter=0; iter<72; iter++) {
for (bloub=0; bloub<5; bloub++) { fimg_vdeg_a(&image, LMAX);
for (bloub=0; bloub<7; bloub++) {
xloc = rand() % W; xloc = rand() % W;
omega = (float)(0.1 + drand48()*0.8) * 0.5; omega = (float)(0.1 + drand48()*0.6) * 0.4;
foo = vertical_singlitch(&image, xloc, LMAX, foo = vertical_singlitch(&image, xloc, LMAX,
omega, (float)iter); omega, (float)iter);
if (foo) abort(); if (foo) abort();