summaryrefslogtreecommitdiffstats
path: root/plugins/dexela/software-roi.c
diff options
context:
space:
mode:
authorMihael Koep <koep@schneide.com>2014-09-09 13:57:32 +0200
committerMihael Koep <koep@schneide.com>2014-09-17 09:45:13 +0200
commitf39be2686446c41a5fbf93eba7fb40ca99efcc3a (patch)
treee0c2a7d67a6677013fb176b2d374b468c7dcd470 /plugins/dexela/software-roi.c
parent05523b118bf396f33528b7aa59db5ad1b7378d54 (diff)
downloaduca-f39be2686446c41a5fbf93eba7fb40ca99efcc3a.tar.gz
uca-f39be2686446c41a5fbf93eba7fb40ca99efcc3a.tar.bz2
uca-f39be2686446c41a5fbf93eba7fb40ca99efcc3a.tar.xz
uca-f39be2686446c41a5fbf93eba7fb40ca99efcc3a.zip
Add software roi feature to dexela plugin
Diffstat (limited to 'plugins/dexela/software-roi.c')
-rw-r--r--plugins/dexela/software-roi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/dexela/software-roi.c b/plugins/dexela/software-roi.c
new file mode 100644
index 0000000..74baa96
--- /dev/null
+++ b/plugins/dexela/software-roi.c
@@ -0,0 +1,12 @@
+#include "software-roi.h"
+#include <string.h>
+
+void apply_software_roi(const guchar* src, guint srcWidth, guchar* dest, guint x, guint y, guint roiWidth, guint roiHeight)
+{
+ for (guint row = 0; row < roiHeight; row++) {
+ guint rowOffset = srcWidth * (y + row);
+ guint offset = rowOffset + x;
+ memcpy(dest + row * roiWidth, src + offset, roiWidth);
+ }
+}
+