forked from tTh/FloatImg
j'adore quand un plan se deroule sans accroc
This commit is contained in:
parent
c7d7c8b2dd
commit
1008a778c9
|
@ -61,7 +61,7 @@ fseek(fp, 1L, SEEK_CUR); /* black magic */
|
||||||
Rptr = head->R; Gptr = head->G; Bptr = head->B;
|
Rptr = head->R; Gptr = head->G; Bptr = head->B;
|
||||||
for (line=0; line<height; line++) {
|
for (line=0; line<height; line++) {
|
||||||
foo = fread(buffline, 3, width, fp);
|
foo = fread(buffline, 3, width, fp);
|
||||||
fprintf(stderr, "line %d read %d\n", line, width);
|
// fprintf(stderr, "line %d read %d\n", line, width);
|
||||||
idxrd = buffline;
|
idxrd = buffline;
|
||||||
for (column=0; column<width; column++)
|
for (column=0; column<width; column++)
|
||||||
{
|
{
|
||||||
|
@ -130,7 +130,6 @@ for (idx=0; idx<sz; idx++) {
|
||||||
}
|
}
|
||||||
fputs("\n", fp);
|
fputs("\n", fp);
|
||||||
|
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -27,7 +27,7 @@ addtga2fimg: addtga2fimg.c $(DEPS)
|
||||||
gcc -g $< ../libfloatimg.a -limageSO -lm -o $@
|
gcc -g $< ../libfloatimg.a -limageSO -lm -o $@
|
||||||
|
|
||||||
addpnm2fimg: addpnm2fimg.c $(DEPS)
|
addpnm2fimg: addpnm2fimg.c $(DEPS)
|
||||||
gcc -g $< ../libfloatimg.a -limageSO -lm -o $@
|
gcc -g $< ../libfloatimg.a -lm -o $@
|
||||||
|
|
||||||
|
|
||||||
# if "undefined reference to crc32" then "use -lz"
|
# if "undefined reference to crc32" then "use -lz"
|
||||||
|
|
|
@ -32,12 +32,15 @@ if (foo) fprintf(stderr, "create src fimg from '%s' -> %d\n", dstname, foo);
|
||||||
fimg_describe(&qrc, "created fimg from PNM");
|
fimg_describe(&qrc, "created fimg from PNM");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// fprintf(stderr, "src is %dx%d\n", src.width, src.height);
|
||||||
|
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for (y=0; y<src.height; y++) {
|
for (y=0; y<src.height; y++) {
|
||||||
for (x=0; x<src.width; x++) {
|
for (x=0; x<src.width; x++) {
|
||||||
dst.R[idx] += src.R[idx];
|
dst.R[idx] += src.R[idx];
|
||||||
dst.G[idx] += src.G[idx];
|
dst.G[idx] += src.G[idx];
|
||||||
dst.B[idx] += src.B[idx];
|
dst.B[idx] += src.B[idx];
|
||||||
|
idx++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,8 +62,10 @@ if (3 != argc) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verbosity = 0;
|
||||||
|
|
||||||
if ( 0==access(argv[2], R_OK|W_OK) ) { /* fimg is readable */
|
if ( 0==access(argv[2], R_OK|W_OK) ) { /* fimg is readable */
|
||||||
fprintf(stderr, "%s exist\n", argv[2]);
|
// fprintf(stderr, "%s exist\n", argv[2]);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue