Compare commits
No commits in common. "6258bd08edc7dba1e816c44c71055768f8f5a39d" and "282fe9f14338cc4e2c4377dc1fdfdf77b38f2200" have entirely different histories.
6258bd08ed
...
282fe9f143
8
Makefile
8
Makefile
@ -3,20 +3,22 @@
|
|||||||
# a look to the 'build.sh' script ! #
|
# 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
|
LDOPT = libfloatimg.a -pg -lm
|
||||||
|
|
||||||
all: essai
|
all: essai
|
||||||
|
|
||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
|
|
||||||
|
exemple: exemple.c libfloatimg.a floatimg.h Makefile
|
||||||
|
gcc $(COPT) $< $(LDOPT) -o $@
|
||||||
|
|
||||||
essai: essai.c libfloatimg.a floatimg.h Makefile
|
essai: essai.c libfloatimg.a floatimg.h Makefile
|
||||||
gcc $(COPT) $< $(LDOPT) -lpnglite -o $@
|
gcc $(COPT) $< $(LDOPT) -lpnglite -o $@
|
||||||
|
|
||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
|
|
||||||
TOTAR = *.[ch] Makefile *.sh *.txt \
|
TOTAR = *.[ch] Makefile *.sh *.txt doc/*.tex \
|
||||||
doc/*.tex doc/mkdoc.sh \
|
|
||||||
funcs/*.[ch] funcs/Makefile \
|
funcs/*.[ch] funcs/Makefile \
|
||||||
tools/*.[ch] tools/Makefile \
|
tools/*.[ch] tools/Makefile \
|
||||||
v4l2/*.[ch] v4l2/Makefile \
|
v4l2/*.[ch] v4l2/Makefile \
|
||||||
|
@ -136,8 +136,7 @@ if (foo) {
|
|||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
foo = fread(head->R, sizeof(float),
|
foo = fread(head->R, sizeof(float), filehead.w*filehead.h*3, fp);
|
||||||
filehead.w*filehead.h*filehead.t, fp);
|
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
@ -7,8 +7,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include "string.h"
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "../floatimg.h"
|
#include "../floatimg.h"
|
||||||
|
|
||||||
@ -20,12 +19,6 @@ float fimg_get_maxvalue(FloatImg *head)
|
|||||||
float maxval;
|
float maxval;
|
||||||
int foo;
|
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 */
|
maxval = 0.0; /* no negative values allowed */
|
||||||
|
|
||||||
for (foo=0; foo<(head->width*head->height); foo++) {
|
for (foo=0; foo<(head->width*head->height); foo++) {
|
||||||
@ -64,12 +57,6 @@ int fimg_to_gray(FloatImg *head)
|
|||||||
float add;
|
float add;
|
||||||
int foo;
|
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++) {
|
for (foo=0; foo<(head->width*head->height); foo++) {
|
||||||
add = head->R[foo];
|
add = head->R[foo];
|
||||||
add += head->G[foo];
|
add += head->G[foo];
|
||||||
@ -83,12 +70,6 @@ void fimg_add_cste(FloatImg *fi, float value)
|
|||||||
{
|
{
|
||||||
int nbre, idx;
|
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;
|
nbre = fi->width * fi->height * fi->type;
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, "%s, nbre is %d\n", __func__, nbre);
|
fprintf(stderr, "%s, nbre is %d\n", __func__, nbre);
|
||||||
|
7
lib/t.c
7
lib/t.c
@ -13,7 +13,7 @@ int main(int argc, char *argv[])
|
|||||||
int foo;
|
int foo;
|
||||||
FloatImg fimg;
|
FloatImg fimg;
|
||||||
int datas[3];
|
int datas[3];
|
||||||
char *fname = "foo.fimg";
|
|
||||||
verbosity = 1;
|
verbosity = 1;
|
||||||
|
|
||||||
fimg_print_version(0);
|
fimg_print_version(0);
|
||||||
@ -25,12 +25,9 @@ fimg_printhead(&fimg);
|
|||||||
fimg_describe(&fimg, "vroum");
|
fimg_describe(&fimg, "vroum");
|
||||||
|
|
||||||
// fimg_save_as_pnm(&fimg, "foo.pnm", 0);
|
// 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);
|
foo = fimg_fileinfos("foo.fimg", datas);
|
||||||
|
|
||||||
printf("%s : largeur %d hauteur %d type %d\n",
|
|
||||||
fname, datas[0], datas[1], datas[2]);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user