summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/c/iDeepCopyRange.c
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/common/c/iDeepCopyRange.c')
-rw-r--r--SD-VBS/common/c/iDeepCopyRange.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/SD-VBS/common/c/iDeepCopyRange.c b/SD-VBS/common/c/iDeepCopyRange.c
new file mode 100644
index 0000000..f3fa6e3
--- /dev/null
+++ b/SD-VBS/common/c/iDeepCopyRange.c
@@ -0,0 +1,23 @@
1/********************************
2Author: Sravanthi Kota Venkata
3********************************/
4
5#include "sdvbs_common.h"
6
7I2D* iDeepCopyRange(I2D* in, int startRow, int numberRows, int startCol, int numberCols)
8{
9 int i, j, k;
10 I2D *out;
11 int rows, cols;
12
13 rows = numberRows + startRow;
14 cols = numberCols + startCol;
15 out = iMallocHandle(numberRows, numberCols);
16
17 k = 0;
18 for(i=startRow; i<rows; i++)
19 for(j=startCol; j<cols; j++)
20 asubsref(out,k++) = subsref(in,i,j);
21
22 return out;
23}