Compare commits
No commits in common. "954de623ab1b4203c6b66c2fa3583ad54bbe3686" and "e7c726320a73afe72c0422d1d60fdf4affdd9842" have entirely different histories.
954de623ab
...
e7c726320a
@ -33,7 +33,7 @@ sfx.o: sfx.c ${DEPS} Makefile
|
|||||||
metriques.o: metriques.[hc] Makefile
|
metriques.o: metriques.[hc] Makefile
|
||||||
gcc ${COPT} -c $<
|
gcc ${COPT} -c $<
|
||||||
|
|
||||||
glitches.o: glitches.c glitches.h Makefile
|
glitches.o: glitches.[hc] Makefile
|
||||||
gcc ${COPT} -c $<
|
gcc ${COPT} -c $<
|
||||||
|
|
||||||
interpolator: interpolator.c ${OBJS} Makefile
|
interpolator: interpolator.c ${OBJS} Makefile
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
extern int verbosity;
|
extern int verbosity;
|
||||||
|
|
||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
int kill_a_random_line(FloatImg *pvictime, float fval, int bits)
|
int kill_a_random_line(FloatImg *pvictime, float fval, int notused)
|
||||||
{
|
{
|
||||||
int line, xpos, offset;
|
int line, xpos, offset;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pvictime, bits);
|
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pvictime, notused);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
line = rand() % pvictime->height;
|
line = rand() % pvictime->height;
|
||||||
@ -26,13 +26,10 @@ if (verbosity > 1) {
|
|||||||
|
|
||||||
offset = pvictime->width * line;
|
offset = pvictime->width * line;
|
||||||
|
|
||||||
for (xpos=0; xpos<pvictime->width; xpos++) {
|
for (xpos=offset; xpos<pvictime->width; xpos++) {
|
||||||
if (bits & 1) pvictime->R[offset+xpos] = fval;
|
pvictime->R[offset] = fval;
|
||||||
else pvictime->R[offset+xpos] = 0.0;
|
pvictime->G[offset] = 0.0;
|
||||||
if (bits & 2) pvictime->G[offset+xpos] = fval;
|
pvictime->B[offset] = fval;
|
||||||
else pvictime->G[offset+xpos] = 0.0;
|
|
||||||
if (bits & 4) pvictime->B[offset+xpos] = fval;
|
|
||||||
else pvictime->B[offset+xpos] = 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -44,7 +41,7 @@ int idx, foo;
|
|||||||
|
|
||||||
/* Frag the pixels */
|
/* Frag the pixels */
|
||||||
for (idx=0; idx<number; idx++) {
|
for (idx=0; idx<number; idx++) {
|
||||||
foo = kill_a_random_line(who, fval, rand() & 0x0f);
|
foo = kill_a_random_line(who, fval, 0);
|
||||||
if (foo) abort();
|
if (foo) abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
* glitches.h
|
* glitches.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int kill_a_random_line(FloatImg *pvictime, float level, int bits);
|
int kill_a_random_line(FloatImg *pvictime, float level, int notused);
|
||||||
int kill_a_few_lines(FloatImg *who, float fval, int number);
|
int kill_a_few_lines(FloatImg *who, float fval, int number);
|
||||||
|
|
||||||
|
|
||||||
/* this is a wtf file */
|
/* this is a wtf file */
|
||||||
|
@ -45,13 +45,8 @@ if (0 == globbuf.gl_pathc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foo = fimg_fileinfos(globbuf.gl_pathv[0], iarray);
|
foo = fimg_fileinfos(globbuf.gl_pathv[0], iarray);
|
||||||
if (FIMG_TYPE_RGB != iarray[2]) {
|
|
||||||
fprintf(stderr, "can work only on RGB fimg picture, was %d\n",
|
|
||||||
iarray[2]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
w = iarray[0], h = iarray[1];
|
w = iarray[0], h = iarray[1];
|
||||||
fprintf(stderr, "first image size : %dx%d\n", w, h);
|
fprintf(stderr, "\tfirst image size : %dx%d\n", w, h);
|
||||||
|
|
||||||
fimg_create(&A, w, h, 3); pFirst = &A;
|
fimg_create(&A, w, h, 3); pFirst = &A;
|
||||||
fimg_create(&B, w, h, 3); pSecond = &B;
|
fimg_create(&B, w, h, 3); pSecond = &B;
|
||||||
@ -83,7 +78,7 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
|
|||||||
fimg_interpolate(pSecond, pFirst, &Out, coef);
|
fimg_interpolate(pSecond, pFirst, &Out, coef);
|
||||||
|
|
||||||
/* here we can insert the output filter */
|
/* here we can insert the output filter */
|
||||||
kill_a_few_lines(&Out, 150.5, 5+(rand()%20));
|
kill_a_few_lines(&Out, 3.14159, 500);
|
||||||
|
|
||||||
sprintf(line, "%s/%05d.png", outdir, ipng);
|
sprintf(line, "%s/%05d.png", outdir, ipng);
|
||||||
foo = fimg_save_as_png(&Out, line, 0);
|
foo = fimg_save_as_png(&Out, line, 0);
|
||||||
@ -132,9 +127,8 @@ fprintf(stderr, "*** %s : compiled by tTh, %s %s\n", __FILE__,
|
|||||||
__DATE__, __TIME__);
|
__DATE__, __TIME__);
|
||||||
fimg_print_version(2);
|
fimg_print_version(2);
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "hv")) != -1) {
|
while ((opt = getopt(argc, argv, "v")) != -1) {
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'h': help(); break;
|
|
||||||
case 'v': verbosity++; break;
|
case 'v': verbosity++; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user