aboutsummaryrefslogtreecommitdiffstats
path: root/src/blind-affine-colour.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-07-23 20:48:18 +0200
committerMattias Andrée <maandree@kth.se>2017-07-23 20:48:18 +0200
commitccd26e2affb0fb4a10b7261a85cb85b2525e5d9e (patch)
tree0f83f5850f4a175b437ff271c5cac1dd65781213 /src/blind-affine-colour.c
parentAdd blind-colour-matrix, and blind-invert-matrix: fix -e and add -axyz (diff)
downloadblind-ccd26e2affb0fb4a10b7261a85cb85b2525e5d9e.tar.gz
blind-ccd26e2affb0fb4a10b7261a85cb85b2525e5d9e.tar.bz2
blind-ccd26e2affb0fb4a10b7261a85cb85b2525e5d9e.tar.xz
Fix some errors, add manual for blind-colour-matrix and add blind-primary-key
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-affine-colour.c')
-rw-r--r--src/blind-affine-colour.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/blind-affine-colour.c b/src/blind-affine-colour.c
index 7be9ab6..654345f 100644
--- a/src/blind-affine-colour.c
+++ b/src/blind-affine-colour.c
@@ -88,14 +88,23 @@ PROCESS(struct stream *colour, struct stream *matrix)
if (!x) {
if (!y && !eread_segment(matrix, mbuf, dim * matrix->row_size))
break;
- if (!per_pixel)
+ if (!per_pixel) {
+ if (!y) {
+ mat = (TYPE *)mbuf;
+ for (i = 0; i < dim; i++, mat += w)
+ for (j = 0; j < dim; j++)
+ M[i][j] = mat[j * matrix->n_chan + 1]
+ * mat[(j + 1) * matrix->n_chan - 1];
+ }
y = (y + 1) % colour->height;
+ }
}
if (per_pixel) {
mat = (TYPE *)(mbuf + x * dim * matrix->pixel_size);
for (i = 0; i < dim; i++, mat += w)
for (j = 0; j < dim; j++)
- M[i][j] = mat[j * matrix->n_chan + 1] * mat[(j + 1) * matrix->n_chan - 1];
+ M[i][j] = mat[j * matrix->n_chan + 1]
+ * mat[(j + 1) * matrix->n_chan - 1];
}
pixel = (TYPE *)(colour->buf + ptr);
for (i = 0; i < dim; i++) {