summaryrefslogtreecommitdiffstats
path: root/plugins/dexela/software-roi.c
blob: 74baa96e1a1c4b9f7adc00f7ed3157b736285c51 (plain)
1
2
3
4
5
6
7
8
9
10
11
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);
    }
}