Compare commits

..

No commits in common. "6258bd08edc7dba1e816c44c71055768f8f5a39d" and "282fe9f14338cc4e2c4377dc1fdfdf77b38f2200" have entirely different histories.

4 changed files with 9 additions and 30 deletions

View File

@ -3,20 +3,22 @@
# a look to the 'build.sh' script ! #
####################################################
COPT = -Wall -fpic -g -pg -no-pie -DDEBUG_LEVEL=0
COPT = -Wall -fpic -g -pg -DDEBUG_LEVEL=0
LDOPT = libfloatimg.a -pg -lm
all: essai
#---------------------------------------------------------------
exemple: exemple.c libfloatimg.a floatimg.h Makefile
gcc $(COPT) $< $(LDOPT) -o $@
essai: essai.c libfloatimg.a floatimg.h Makefile
gcc $(COPT) $< $(LDOPT) -lpnglite -o $@
#---------------------------------------------------------------
TOTAR = *.[ch] Makefile *.sh *.txt \
doc/*.tex doc/mkdoc.sh \
TOTAR = *.[ch] Makefile *.sh *.txt doc/*.tex \
funcs/*.[ch] funcs/Makefile \
tools/*.[ch] tools/Makefile \
v4l2/*.[ch] v4l2/Makefile \

View File

@ -136,8 +136,7 @@ if (foo) {
return foo;
}
foo = fread(head->R, sizeof(float),
filehead.w*filehead.h*filehead.t, fp);
foo = fread(head->R, sizeof(float), filehead.w*filehead.h*3, fp);
fclose(fp);

View File

@ -7,8 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "string.h"
#include "../floatimg.h"
@ -20,12 +19,6 @@ float fimg_get_maxvalue(FloatImg *head)
float maxval;
int foo;
if (head->type != FIMG_TYPE_RGB) {
fprintf(stderr, "%s : type %d invalide\n",
__func__, head->type);
return nanf("wtf ?");
}
maxval = 0.0; /* no negative values allowed */
for (foo=0; foo<(head->width*head->height); foo++) {
@ -64,12 +57,6 @@ int fimg_to_gray(FloatImg *head)
float add;
int foo;
if (head->type != FIMG_TYPE_RGB) {
fprintf(stderr, "%s : type %d invalide\n",
__func__, head->type);
return -3;
}
for (foo=0; foo<(head->width*head->height); foo++) {
add = head->R[foo];
add += head->G[foo];
@ -83,12 +70,6 @@ void fimg_add_cste(FloatImg *fi, float value)
{
int nbre, idx;
if (fi->type != FIMG_TYPE_RGB) {
fprintf(stderr, "%s : type %d invalide\n",
__func__, fi->type);
return;
}
nbre = fi->width * fi->height * fi->type;
#if DEBUG_LEVEL
fprintf(stderr, "%s, nbre is %d\n", __func__, nbre);

View File

@ -13,7 +13,7 @@ int main(int argc, char *argv[])
int foo;
FloatImg fimg;
int datas[3];
char *fname = "foo.fimg";
verbosity = 1;
fimg_print_version(0);
@ -25,12 +25,9 @@ fimg_printhead(&fimg);
fimg_describe(&fimg, "vroum");
// fimg_save_as_pnm(&fimg, "foo.pnm", 0);
foo = fimg_dump_to_file(&fimg, fname, 0);
foo = fimg_dump_to_file(&fimg, "foo.fimg", 0);
foo = fimg_fileinfos("foo.fimg", datas);
printf("%s : largeur %d hauteur %d type %d\n",
fname, datas[0], datas[1], datas[2]);
return 0;
}