better support of gray level
This commit is contained in:
@@ -13,7 +13,7 @@ extern int verbosity; /* must be declared around main() */
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
/*
|
||||
* floating img MUST be allocated.
|
||||
* floating imgs MUST be allocated before calling this func.
|
||||
*/
|
||||
int fimg_mk_gray_from(FloatImg *src, FloatImg*dst, int k)
|
||||
{
|
||||
@@ -40,14 +40,13 @@ if (FIMG_TYPE_GRAY != dst->type) {
|
||||
nbb = src->width * src->height;
|
||||
|
||||
for (foo=0; foo<nbb; foo++) {
|
||||
|
||||
dst->R[foo] = ( (src->R[foo] * kr) +
|
||||
(src->G[foo] * kg) +
|
||||
(src->B[foo] * kb) ) /
|
||||
kdiv;
|
||||
}
|
||||
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user