summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m15
1 files changed, 0 insertions, 15 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m
deleted file mode 100755
index 497297e..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m
+++ /dev/null
@@ -1,15 +0,0 @@
1% [RES] = shift(MTX, OFFSET)
2%
3% Circular shift 2D matrix samples by OFFSET (a [Y,X] 2-vector),
4% such that RES(POS) = MTX(POS-OFFSET).
5
6function res = shift(mtx, offset)
7
8dims = size(mtx);
9
10offset = mod(-offset,dims);
11
12res = [ mtx(offset(1)+1:dims(1), offset(2)+1:dims(2)), ...
13 mtx(offset(1)+1:dims(1), 1:offset(2)); ...
14 mtx(1:offset(1), offset(2)+1:dims(2)), ...
15 mtx(1:offset(1), 1:offset(2)) ];