protected override void ProcessFilter(UnmanagedImage sourceData, UnmanagedImage destinationData)
{
// get width and height
int width = sourceData.Width;
int height = sourceData.Height;
if (((width & 1) == 1) || ((height & 1) == 1) ||
(width < 2) || (height < 2))
{
throw new InvalidImagePropertiesException("Source image must have even width and height. Width and height can not be smaller than 2.");
}
switch (bayerPattern)
{
case BayerPattern.GRBG:
ApplyGRBG(sourceData, destinationData);
break;
case BayerPattern.BGGR:
ApplyBGGR(sourceData, destinationData);
break;
}
}