public void Apply( UnmanagedImage sourceImage, UnmanagedImage destinationImage )
{
// check pixel format of the source and destination images
CheckSourceFormat( sourceImage.PixelFormat );
// ensure destination image has correct format
if ( destinationImage.PixelFormat != FormatTranslations[sourceImage.PixelFormat] )
{
throw new InvalidImagePropertiesException( "Destination pixel format is specified incorrectly." );
}
// ensure destination image has correct size
if ( ( destinationImage.Width != sourceImage.Width ) || ( destinationImage.Height != sourceImage.Height ) )
{
throw new InvalidImagePropertiesException( "Destination image must have the same width and height as source image." );
}
// process the filter
ProcessFilter( sourceImage, destinationImage );
}