Compare commits

..

No commits in common. "5845ab796290b0f3d14b95ab36576cfefaec26bd" and "6c92cca12c90704de83246cdba1dc871899d51da" have entirely different histories.

12 changed files with 14 additions and 168 deletions

2
.gitignore vendored
View File

@ -86,6 +86,4 @@ experiment/*.pnm
experiment/*.o
experiment/muxplanes
experiment/movepixels
experiment/tcache

View File

@ -92,7 +92,6 @@ FimgFilter3x3 lowpass = {
};
FimgFilter3x3 hipass = {
/* there was a bug with this filter */
{
-1.0, -1.0, -1.0,
-1.0, 9.0, -1.0,
@ -102,7 +101,6 @@ FimgFilter3x3 hipass = {
};
FimgFilter3x3 diagonal = {
/* there was a bug with this filter */
{
4.0, 1.0, 0.0,
1.0, 0.0, -1.0,
@ -356,9 +354,8 @@ switch (idFx) {
retval = des_bords_sombres_a(image, 160);
break;
case CR_bsombrb: /* experiment ! */
retval = des_bords_sombres_b(image, 100);
retval = des_bords_sombres_b(image, 160);
break;
case CR_vsglitch:
/* please make this function more tweakable */
retval = vertical_singlitch(image, 290+rand()%45,

View File

@ -54,11 +54,9 @@ static int pixel_trinitron(FloatImg *pimg, int pos[4], float *fvals)
{
int x, y, pline, off;
fimg_clear_rectangle(pimg, pos);
for (y=pos[1]; y<pos[1]+pos[3]; y++) {
pline = y*pimg->width;
for (x=pos[0]+2; x<(pos[0]+pos[2]-2); x++) {
for (x=pos[0]+2; x<pos[0]+pos[2]-2; x++) {
off = pline + x;
/* wtf i'm doing here ? */
pimg->R[off] = fvals[0];
@ -322,39 +320,21 @@ return 0;
/* -------------------------------------------------------------- */
/* nouveau Mon 10 May 2021 08:46:02 PM CEST
* chez Eric 1KA */
int des_bords_sombres_b(FloatImg *pimg, int nbre)
int des_bords_sombres_b(FloatImg *pimg, int offset)
{
int idx, x, foo;
float coef, *fptr;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pimg, offset);
#endif
for (idx=0; idx<nbre; idx++) {
coef = (float)idx / (float)nbre;
fptr = pimg->R + (idx*pimg->width);
for (x=0; x<pimg->width; x++) *fptr++ *= coef;
fptr = pimg->G + (idx*pimg->width);
for (x=0; x<pimg->width; x++) *fptr++ *= coef;
fptr = pimg->B + (idx*pimg->width);
for (x=0; x<pimg->width; x++) *fptr++ *= coef;
foo = (pimg->height-idx) - 1;
fptr = pimg->R + (foo*pimg->width);
// fprintf(stderr, "%5d %9.3f %p\n", foo, coef, fptr);
for (x=0; x<pimg->width; x++) *fptr++ *= coef;
fptr = pimg->G + (foo*pimg->width);
for (x=0; x<pimg->width; x++) *fptr++ *= coef;
fptr = pimg->B + (foo*pimg->width);
for (x=0; x<pimg->width; x++) *fptr++ *= coef;
if (offset<0 || offset>=pimg->width) {
fprintf(stderr, "%s: offset %d is bad\n", __func__, offset);
return -66;
}
// fprintf(stderr, "WARNING: %s badly implemented\n", __func__);
fprintf(stderr, "ERROR: %s not implemented\n", __func__);
return 0;
return -1;
}
/* -------------------------------------------------------------- */
/*

View File

@ -5,12 +5,10 @@
COPT = -Wall -fpic -g -DDEBUG_LEVEL=1 -lm
DEPS = ../floatimg.h ../libfloatimg.a Makefile
LIBS = ../libfloatimg.a -ltiff -lpnglite -lcfitsio
LIBS = -ltiff -lpnglite -lcfitsio
all: assemblage extracteur muxplanes movepixels
# ---------------------------------------------------------
assemblage: assemblage.c ${DEPS}
gcc $(COPT) $< ../libfloatimg.a ${LIBS} -o $@
@ -18,20 +16,7 @@ extracteur: extracteur.c ${DEPS}
gcc $(COPT) $< ../libfloatimg.a ${LIBS} -o $@
muxplanes: muxplanes.c ${DEPS}
gcc $(COPT) $< ${LIBS} -o $@
gcc $(COPT) $< ../libfloatimg.a ${LIBS} -o $@
movepixels: movepixels.c ${DEPS}
gcc $(COPT) $< ../libfloatimg.a ${LIBS} -o $@
# ---------------------------------------------------------
# CACHE ENGINE
cachengn.o: cachengn.c cachengn.h Makefile
gcc $(COPT) -c $<
tcache.o: tcache.c cachengn.h Makefile
gcc $(COPT) -c $<
tcache: tcache.o cachengn.o Makefile
gcc $(COPT) tcache.o cachengn.o $(LIBS) -o $@

View File

@ -1,18 +0,0 @@
/*
* the chache engine - code
*/
#include <stdio.h>
#include "cachengn.h"
/* ------------------------------------------------------------ */
void cachengn_print_version(int k)
{
printf("this is the version ZERO !!!\n");
}
/* ------------------------------------------------------------ */

View File

@ -1,5 +0,0 @@
/*
* the chache engine - header
*/
void cachengn_print_version(int k);

View File

@ -1,18 +0,0 @@
/*
* tests du systeme de cache
*/
#include <stdio.h>
#include "cachengn.h"
/* ------------------------------------------------------------ */
int main(int argc, char *argv[])
{
fprintf(stderr, "Test of the cache engin - %s %s\n", __DATE__, __TIME__);
return 0;
}
/* ------------------------------------------------------------ */

View File

@ -4,7 +4,7 @@
* http://la.buvette.org/photos/cumul
*/
#define FIMG_VERSION 160
#define FIMG_VERSION 157
/*
* in memory descriptor
@ -108,7 +108,6 @@ typedef struct {
int fimg_killborders(FloatImg *img);
int fimg_lissage_2x2(FloatImg *img);
int fimg_show_filter(char *title, FimgFilter3x3 *filtr);
int fimg_filter_3x3(FloatImg *s, FloatImg *d, FimgFilter3x3 *filtr);
@ -249,7 +248,6 @@ int parse_rectangle(char *str, FimgArea51 *r, int notused);
int format_from_extension(char *fname);
char * extension_from_format(int fmt);
int fimg_clear_rectangle(FloatImg *pimg, int rect[4]);

View File

@ -7,7 +7,7 @@ COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=0
DEPS = ../floatimg.h Makefile
OBJS = fimg-png.o fimg-tiff.o misc-plots.o filtrage.o utils.o \
fimg-libpnm.o rampes.o rectangle.o \
fimg-libpnm.o rampes.o \
sfx0.o sfx1.o sfx2.o sfx3.o sfx4.o \
geometry.o rotate.o fimg-openexr.o \
equalize.o fimg-fits.o saturation.o histogram.o \
@ -37,9 +37,6 @@ tests.o: tests.c tests.h $(DEPS)
# ###
rectangle.o: rectangle.c $(DEPS)
gcc $(COPT) -c $<
decomprgb.o: decomprgb.c $(DEPS)
gcc $(COPT) -c $<

View File

@ -1,38 +0,0 @@
/*
* R E C T A N G L E
* This is an eternal WIP, sorry...
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include "../floatimg.h"
/* --------------------------------------------------------------------- */
int fimg_clear_rectangle(FloatImg *pi, int coo[4])
{
int line, off;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p )\n", __func__, pi, coo);
#endif
/* please add boudary checks */
for (line=0; line<coo[3]; line++) {
off = (line+coo[1])*pi->width + coo[0];
// fprintf(stderr, "line %3d off %8d\n", line, off);
/* Kaboum ! */
memset(pi->R + off, 0, coo[2]*sizeof(float));
memset(pi->G + off, 0, coo[2]*sizeof(float));
memset(pi->B + off, 0, coo[2]*sizeof(float));
}
return -1;
}
/* --------------------------------------------------------------------- */

View File

@ -24,7 +24,7 @@ enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff,
Histo, Hsv, Classif, Ctr2x2, Qsortrgb,
Displace, ReadPNG, Plasmas, Hilight, OpenEXR,
Geometrie, FileType, Mirror, KillRGB,
Pixelize,SplitLevel,DecompRgbz, Rectangle };
Pixelize,SplitLevel,DecompRgbz };
typedef struct {
char *name;
int Cmd;
@ -56,7 +56,6 @@ Command commands[] = {
{ "pixelize", Pixelize },
{ "spltlvl", SplitLevel },
{ "decomprgbz", DecompRgbz },
{ "rectangle", Rectangle },
{ NULL, 0 }
} ;
@ -234,10 +233,6 @@ switch(opt) {
case DecompRgbz:
foo = essai_decomprgb(filename, outfile);
break;
case Rectangle:
essai_rectangle(outfile, 0);
break;
default:
fprintf(stderr, "'%s' is a bad command\n", command);
exit(1);

View File

@ -17,31 +17,6 @@
extern int verbosity;
/* --------------------------------------------------------------------- */
int essai_rectangle(char *outf, int k)
{
FloatImg img;
int foo;
int rect[4];
foo = fimg_create(&img, 320, 240, FIMG_TYPE_RGB);
fimg_drand48(&img, 1.0);
rect[0] = 100; rect[1] = 100;
rect[2] = 32; rect[3] = 16;
foo = fimg_clear_rectangle(&img, rect);
foo = fimg_export_picture(&img, outf, 0);
if (foo) {
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
return foo;
}
fimg_destroy(&img);
return 0;
}
/* --------------------------------------------------------------------- */
int essai_killrgb(char *inf, char *outf)
{