forked from tTh/FloatImg
NEW RELEASE for other systems
This commit is contained in:
parent
6c92cca12c
commit
1b5186f4b3
@ -92,6 +92,7 @@ FimgFilter3x3 lowpass = {
|
||||
};
|
||||
|
||||
FimgFilter3x3 hipass = {
|
||||
/* there was a bug with this filter */
|
||||
{
|
||||
-1.0, -1.0, -1.0,
|
||||
-1.0, 9.0, -1.0,
|
||||
@ -101,6 +102,7 @@ FimgFilter3x3 hipass = {
|
||||
};
|
||||
|
||||
FimgFilter3x3 diagonal = {
|
||||
/* there was a bug with this filter */
|
||||
{
|
||||
4.0, 1.0, 0.0,
|
||||
1.0, 0.0, -1.0,
|
||||
@ -354,8 +356,9 @@ switch (idFx) {
|
||||
retval = des_bords_sombres_a(image, 160);
|
||||
break;
|
||||
case CR_bsombrb: /* experiment ! */
|
||||
retval = des_bords_sombres_b(image, 160);
|
||||
retval = des_bords_sombres_b(image, 100);
|
||||
break;
|
||||
|
||||
case CR_vsglitch:
|
||||
/* please make this function more tweakable */
|
||||
retval = vertical_singlitch(image, 290+rand()%45,
|
||||
|
@ -56,7 +56,13 @@ int x, y, pline, off;
|
||||
|
||||
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++) {
|
||||
#if 0
|
||||
for (x=0; x<(pos[0]+pos[2]); x++) {
|
||||
off = pline + x;
|
||||
pimg->R[off]=pimg->G[off]=pimg->B[off]=0.0;
|
||||
}
|
||||
#endif
|
||||
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];
|
||||
@ -320,21 +326,39 @@ return 0;
|
||||
/* -------------------------------------------------------------- */
|
||||
/* nouveau Mon 10 May 2021 08:46:02 PM CEST
|
||||
* chez Eric 1KA */
|
||||
int des_bords_sombres_b(FloatImg *pimg, int offset)
|
||||
int des_bords_sombres_b(FloatImg *pimg, int nbre)
|
||||
{
|
||||
|
||||
int idx, x, foo;
|
||||
float coef, *fptr;
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pimg, offset);
|
||||
#endif
|
||||
|
||||
if (offset<0 || offset>=pimg->width) {
|
||||
fprintf(stderr, "%s: offset %d is bad\n", __func__, offset);
|
||||
return -66;
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
fprintf(stderr, "ERROR: %s not implemented\n", __func__);
|
||||
// fprintf(stderr, "WARNING: %s badly implemented\n", __func__);
|
||||
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
/*
|
||||
|
@ -4,7 +4,7 @@
|
||||
* http://la.buvette.org/photos/cumul
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION 157
|
||||
#define FIMG_VERSION 158
|
||||
|
||||
/*
|
||||
* in memory descriptor
|
||||
|
@ -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 \
|
||||
fimg-libpnm.o rampes.o rectangle.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,6 +37,9 @@ tests.o: tests.c tests.h $(DEPS)
|
||||
|
||||
# ###
|
||||
|
||||
rectangle.o: rectangle.c $(DEPS)
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
decomprgb.o: decomprgb.c $(DEPS)
|
||||
gcc $(COPT) -c $<
|
||||
|
||||
|
32
funcs/rectangle.c
Normal file
32
funcs/rectangle.c
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 <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 %d off %d\n", line, off);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user