summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/c/iHorzcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/common/c/iHorzcat.c')
-rw-r--r--SD-VBS/common/c/iHorzcat.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/SD-VBS/common/c/iHorzcat.c b/SD-VBS/common/c/iHorzcat.c
new file mode 100644
index 0000000..ac1c4ea
--- /dev/null
+++ b/SD-VBS/common/c/iHorzcat.c
@@ -0,0 +1,41 @@
1/********************************
2Author: Sravanthi Kota Venkata
3********************************/
4
5#include "sdvbs_common.h"
6
7I2D* iHorzcat(I2D* a, I2D* b)
8{
9 I2D *out, *c;
10 int rows=0, cols=0, i, j, k, c_1, c_2, r_3, c_3;
11 int r_1;
12
13 r_1 = a->height;
14 c_1 = a->width;
15 cols += c_1;
16
17 c_2 = b->width;
18 cols += c_2;
19 rows = r_1;
20
21 out = iMallocHandle(rows, cols);
22
23 for(i=0; i<rows; i++)
24 {
25 k = 0;
26 for(j=0; j<c_1; j++)
27 {
28 subsref(out,i,k) = subsref(a,i,j);
29 k++;
30 }
31 for(j=0; j<c_2; j++)
32 {
33 subsref(out,i,k) = subsref(b,i,j);
34 k++;
35 }
36 }
37
38 return out;
39}
40
41