forked from tTh/FloatImg
time to optimize for velocity
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# building the base library
|
||||
#
|
||||
|
||||
COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=0
|
||||
COPT = -Wall -fpic -g -no-pie -pg -DDEBUG_LEVEL=0
|
||||
OBJS = fimg-core.o fimg-pnm.o fimg-file.o fimg-math.o \
|
||||
fimg-timers.o operators.o fimg-2gray.o
|
||||
DEPS = Makefile ../floatimg.h
|
||||
|
||||
@@ -117,9 +117,16 @@ int nbre, idx;
|
||||
fprintf(stderr, ">>> %s ( %p %g )\n", __func__, fi, kmul);
|
||||
#endif
|
||||
|
||||
nbre = fi->width * fi->height * fi->type;
|
||||
if (fi->type != FIMG_TYPE_RGB) {
|
||||
fprintf(stderr, "%s : type %d invalide\n",
|
||||
__func__, fi->type);
|
||||
return;
|
||||
}
|
||||
nbre = fi->width * fi->height;
|
||||
for (idx=0; idx<nbre; idx++) {
|
||||
fi->R[idx] = drand48() * kmul;
|
||||
fi->G[idx] = drand48() * kmul;
|
||||
fi->B[idx] = drand48() * kmul;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user