diff options
Diffstat (limited to '')
| -rw-r--r-- | src/blind-kernel.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/blind-kernel.c b/src/blind-kernel.c index f670886..8d0382e 100644 --- a/src/blind-kernel.c +++ b/src/blind-kernel.c @@ -290,23 +290,23 @@ usage: int main(int argc, char *argv[]) { - int null_x = 1, null_y = 1, null_z = 1, null_a = 1; + int id_x = 1, id_y = 1, id_z = 1, id_a = 1; size_t rows, cols, y, x, n; const double *kernel, *kern; - double *buffer, *buf, *free_this; + double *buffer, *buf, *free_this, id_val; ARGBEGIN { case 'x': - null_x = 0; + id_x = 0; break; case 'y': - null_y = 0; + id_y = 0; break; case 'z': - null_z = 0; + id_z = 0; break; case 'a': - null_a = 0; + id_a = 0; break; default: usage(); @@ -315,8 +315,8 @@ main(int argc, char *argv[]) if (!argc) usage(); - if (null_x && null_y && null_z && null_a) - null_x = null_y = null_z = null_a = 0; + if (id_x && id_y && id_z && id_a) + id_x = id_y = id_z = id_a = 0; if (0); #define X(FUNC, NAME)\ @@ -337,10 +337,11 @@ main(int argc, char *argv[]) for (y = 0; y < rows; y++) { buf = buffer; for (x = 0; x < cols; x++) { - buf[0] = null_x ? 0.0 : *kern; - buf[1] = null_y ? 0.0 : *kern; - buf[2] = null_z ? 0.0 : *kern; - buf[3] = null_a ? 0.0 : *kern; + id_val = (x == cols / 2 && y == rows / 2) ? 1. : 0.; + buf[0] = id_x ? id_val : *kern; + buf[1] = id_y ? id_val : *kern; + buf[2] = id_z ? id_val : *kern; + buf[3] = id_a ? id_val : *kern; buf += 4; kern++; } |
