You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.3 KiB

13 years ago
13 years ago
13 years ago
13 years ago
  1. //----------------------------------------------------------------------------
  2. // Copyright (C) 2004-2015 by EMGU Corporation. All rights reserved.
  3. //----------------------------------------------------------------------------
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. using System.Text;
  8. using Emgu.CV;
  9. using Emgu.CV.Structure;
  10. using Emgu.Util;
  11. namespace Emgu.CV.VideoStab
  12. {
  13. /// <summary>
  14. /// Use the Capture class as a FrameSource
  15. /// </summary>
  16. public class CaptureFrameSource : FrameSource
  17. {
  18. /// <summary>
  19. /// Create a Capture frame source
  20. /// </summary>
  21. /// <param name="capture">The capture object that will be converted to a FrameSource</param>
  22. public CaptureFrameSource(Capture capture)
  23. {
  24. _ptr = VideoStabInvoke.VideostabCaptureFrameSourceCreate(capture, ref FrameSourcePtr);
  25. CaptureSource = capture.CaptureSource;
  26. }
  27. /// <summary>
  28. /// Release the unmanaged memory associated with this CaptureFrameSource
  29. /// </summary>
  30. protected override void DisposeObject()
  31. {
  32. VideoStabInvoke.VideostabCaptureFrameSourceRelease(ref _ptr);
  33. FrameSourcePtr = IntPtr.Zero;
  34. base.DisposeObject();
  35. }
  36. }
  37. }