00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef _mitk_Video_Source_h_ 00019 #define _mitk_Video_Source_h_ 00020 00021 #include "mitkCommon.h" 00022 #include "MitkExtExports.h" 00023 #include <itkObject.h> 00024 #include <itkObjectFactory.h> 00025 #include <mitkMessage.h> 00026 00027 namespace mitk 00028 { 00032 class MitkExt_EXPORT VideoSource : public itk::Object 00033 { 00034 public: 00035 mitkClassMacro( VideoSource, itk::Object ); 00036 itkNewMacro( Self ); 00037 00042 typedef mitk::Message<void> StartedStoppedEvent; 00043 00044 StartedStoppedEvent Started; 00045 StartedStoppedEvent Stopped; 00046 00049 virtual void FetchFrame(); 00052 virtual unsigned char * GetVideoTexture(); 00055 virtual void StartCapturing(); 00058 virtual void StopCapturing(); 00059 00062 bool IsCapturingEnabled() const; 00063 00064 int GetImageWidth(){return m_CaptureWidth;} 00065 int GetImageHeight(){return m_CaptureHeight;} 00066 00067 void EnableRotation(bool enable= true) 00068 {m_RotationEnabled = enable;}; 00069 00070 void SetRotationAngle(double rotationAngle) 00071 {m_RotationAngle = rotationAngle;}; 00072 00073 double GetRotationAngle() 00074 {return m_RotationAngle;}; 00075 00076 itkGetConstMacro( FrameCount, unsigned long ); 00077 00078 protected: 00079 VideoSource(); 00080 virtual ~VideoSource(); 00081 00082 unsigned char * m_CurrentVideoTexture; 00083 int m_CaptureWidth, m_CaptureHeight; 00084 bool m_CapturingInProcess; 00085 00089 double m_RotationAngle; 00090 00094 bool m_RotationEnabled; 00095 00099 unsigned long m_FrameCount; 00100 00101 }; 00102 } 00103 #endif // Header 00104 00105