diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-01-14 04:59:20 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-01-14 04:59:20 +0100 |
| commit | 37980568fc614968f1c1f55f3ef4e0dd17f968eb (patch) | |
| tree | 0dac9830758d5c5a38c2a18a3ee3b2df4808df07 | |
| parent | Fix errors, blind-{to,from}-{video,image} works (diff) | |
| download | blind-37980568fc614968f1c1f55f3ef4e0dd17f968eb.tar.gz blind-37980568fc614968f1c1f55f3ef4e0dd17f968eb.tar.bz2 blind-37980568fc614968f1c1f55f3ef4e0dd17f968eb.tar.xz | |
Fix blind-transpose
Signed-off-by: Mattias Andrée <maandree@kth.se>
| -rw-r--r-- | TODO | 34 | ||||
| -rw-r--r-- | src/blind-transpose.c | 19 |
2 files changed, 40 insertions, 13 deletions
@@ -1,9 +1,31 @@ -vu-transform transformation by matrix multiplication, -t for tiling, -s for improve quality +blind-transform transformation by matrix multiplication, -t for tiling, -s for improve quality on downscaling (pixels' neighbours must not change) -vu-chroma-key replace a chroma with transparency -vu-primary-key replace a primary with transparency, -g for greyscaled images -vu-primaries given three selectable primaries split the video into three side-by-side which +blind-chroma-key replace a chroma with transparency +blind-primary-key replace a primary with transparency, -g for greyscaled images +blind-primaries given three selectable primaries split the video into three side-by-side which only one primary active -vu-apply-map remap pixels (distortion) using the X and Y values, -t for tiling, -s for +blind-apply-map remap pixels (distortion) using the X and Y values, -t for tiling, -s for improve quality on downscaling (pixels' neighbours must not change) -vu-apply-kernel apply a convolution matrix +blind-apply-kernel apply a convolution matrix + +UNTESTED: + blind-arithm + blind-colour-srgb + blind-concat + blind-crop + blind-cut + blind-dissolve + blind-extend + blind-from-text + blind-gauss-blur + blind-invert-luma + blind-repeat + blind-reverse + blind-rewrite-head + blind-set-alpha + blind-set-luma + blind-set-saturation + blind-single-colour + blind-split + blind-stack + blind-to-text diff --git a/src/blind-transpose.c b/src/blind-transpose.c index 0c32d81..7bc124d 100644 --- a/src/blind-transpose.c +++ b/src/blind-transpose.c @@ -14,28 +14,33 @@ main(int argc, char *argv[]) { struct stream stream; char *buf, *image; - size_t n, imgw, imgh, x, y, i, b; + size_t n, imgw, srcw, srch, ps, x, y, i, b, dx; ENOFLAGS(argc); stream.file = "<stdin>"; stream.fd = STDIN_FILENO; einit_stream(&stream); + imgw = srch = stream.height; + stream.height = srcw = stream.width; + stream.width = imgw; fprint_stream_head(stdout, &stream); efflush(stdout, "<stdout>"); echeck_frame_size(stream.width, stream.height, stream.pixel_size, 0, "<stdin>"); - n = stream.width * stream.height * stream.pixel_size; + n = stream.width * stream.height * (ps = stream.pixel_size); buf = emalloc(n); image = emalloc(n); - imgw = stream.width * (imgh = stream.height * stream.pixel_size); + srch *= ps; + srcw *= dx = imgw * ps; + imgw *= ps; memcpy(buf, stream.buf, stream.ptr); while (eread_frame(&stream, buf, n)) { - for (b = y = 0; y < imgh; y += stream.pixel_size) - for (x = 0; x < imgw; x += imgh) - for (i = 0; i < stream.pixel_size; i++) - image[x + y + i] = buf[b++]; + for (b = y = 0; y < srch; y += ps) + for (x = 0; x < srcw; x += dx) + for (i = 0; i < ps; i++, b++) + image[y + x + i] = buf[b]; ewriteall(STDOUT_FILENO, image, n, "<stdout>"); } |
