summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m47
1 files changed, 0 insertions, 47 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m
deleted file mode 100755
index dd37164..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m
+++ /dev/null
@@ -1,47 +0,0 @@
1% IM = mkRamp(SIZE, DIRECTION, SLOPE, INTERCEPT, ORIGIN)
2%
3% Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar)
4% containing samples of a ramp function, with given gradient DIRECTION
5% (radians, CW from X-axis, default = 0), SLOPE (per pixel, default =
6% 1), and a value of INTERCEPT (default = 0) at the ORIGIN (default =
7% (size+1)/2, [1 1] = upper left). All but the first argument are
8% optional.
9
10% Eero Simoncelli, 6/96. 2/97: adjusted coordinate system.
11
12function [res] = mkRamp(sz, dir, slope, intercept, origin)
13
14sz = sz(:);
15if (size(sz,1) == 1)
16 sz = [sz,sz];
17end
18
19% -----------------------------------------------------------------
20% OPTIONAL args:
21
22if (exist('dir') ~= 1)
23 dir = 0;
24end
25
26if (exist('slope') ~= 1)
27 slope = 1;
28end
29
30if (exist('intercept') ~= 1)
31 intercept = 0;
32end
33
34if (exist('origin') ~= 1)
35 origin = (sz+1)/2;
36end
37
38% -----------------------------------------------------------------
39
40xinc = slope*cos(dir);
41yinc = slope*sin(dir);
42
43[xramp,yramp] = meshgrid( xinc*([1:sz(2)]-origin(2)), ...
44 yinc*([1:sz(1)]-origin(1)) );
45
46res = intercept + xramp + yramp;
47