src/Foundation/Media/Gimela.Media.Imaging/Filters/BaseUsingCopyPartialFilter.cs
/// <summary>
/// Apply filter to an image in unmanaged memory.
/// </summary>
/// 
/// <param name="sourceImage">Source image in unmanaged memory to apply filter to.</param>
/// <param name="destinationImage">Destination image in unmanaged memory to put result into.</param>
/// 
/// <remarks><para>The method keeps the source image unchanged and puts result of image processing
/// into destination image.</para>
/// 
/// <para><note>The destination image must have the same width and height as source image. Also
/// destination image must have pixel format, which is expected by particular filter (see
/// <see cref="FormatTranslations"/> property for information about pixel format conversions).</note></para>
/// </remarks>
/// 
/// <exception cref="UnsupportedImageFormatException">Unsupported pixel format of the source image.</exception>
/// <exception cref="InvalidImagePropertiesException">Incorrect destination pixel format.</exception>
/// <exception cref="InvalidImagePropertiesException">Destination image has wrong width and/or height.</exception>
///
Apply filter to an image in unmanaged memory.
Apply filter to an image in unmanaged memory .
public void Apply(UnmanagedImage sourceImage, UnmanagedImage destinationImage)
    {
      CheckSourceFormat(sourceImage.PixelFormat);
      if (destinationImage.PixelFormat != FormatTranslations[sourceImage.PixelFormat])
      {
        throw new InvalidImagePropertiesException("Destination pixel format is specified incorrectly.");
      }
      if ((destinationImage.Width != sourceImage.Width) || (destinationImage.Height != sourceImage.Height))
      {
        throw new InvalidImagePropertiesException("Destination image must have the same width and height as source image.");
      }
      ProcessFilter(sourceImage, destinationImage, new Rectangle(0, 0, sourceImage.Width, sourceImage.Height));
    }
public void Apply ( UnmanagedImage sourceImage , UnmanagedImage destinationImage ) { CheckSourceFormat ( sourceImage . PixelFormat ) ; if ( destinationImage . PixelFormat != FormatTranslations [ sourceImage . PixelFormat ] ) { throw new InvalidImagePropertiesException ( " " ) ; } if ( ( destinationImage . Width != sourceImage . Width ) || ( destinationImage . Height != sourceImage . Height ) ) { throw new InvalidImagePropertiesException ( " " ) ; } ProcessFilter ( sourceImage , destinationImage , new Rectangle ( 0 , 0 , sourceImage . Width , sourceImage . Height ) ) ; }
Apply filter to an image in unmanaged memory.
Apply filter to an image in unmanaged memory .
// check pixel format of the source and destination images // ensure destination image has correct format // ensure destination image has correct size // process the filter
Unsupported pixel format of the source image.
Unsupported pixel format of the source image .
Incorrect destination pixel format.
Incorrect destination pixel format .
Destination image has wrong width and/or height.
Destination image has wrong width and / or height .
sourceImage
UnmanagedImage
Source image in unmanaged memory to apply filter to.
Source image in unmanaged memory to apply filter to .
destinationImage
UnmanagedImage
Destination image in unmanaged memory to put result into.
Destination image in unmanaged memory to put result into .
remarks
The method keeps the source image unchanged and puts result of image processing
into destination image.The destination image must have the same width and height as source image. Also
destination image must have pixel format, which is expected by particular filter (see
property for information about pixel format conversions).
The method keeps the source image unchanged and puts result of image processing into destination image . The destination image must have the same width and height as source image . Also destination image must have pixel format which is expected by particular filter ( see property for information about pixel format conversions ) .