├── SingleCameraControlRobotArm ├── Camera.h ├── main.cpp ├── Camera.cpp ├── GetImage.cpp ├── GetImage.h ├── kinematics.h ├── output.bmp ├── Calibration.h ├── EyeToHand.cpp ├── kinematics.cpp ├── Calibration.cpp ├── EyeToHand.h ├── packages.config ├── HL.xml ├── lastSelectedDeviceState1.xml ├── lastSelectedDeviceState2.xml ├── HR.xml ├── IC Imaging Control │ └── classlib │ │ └── include │ │ ├── libbasedefs.h │ │ ├── int_interface_pre.h │ │ ├── VCDPropertyDef.h │ │ ├── tisudshl.h │ │ ├── UDSHL_defs.h │ │ ├── filterdll.h │ │ ├── DeBayerTransform.h │ │ ├── AviSink.h │ │ ├── GrabberSinkType.h │ │ ├── GrabberListener.h │ │ ├── filterfactory.h │ │ ├── VideoFormatDesc.h │ │ ├── filterloader.h │ │ ├── VCDPropertyID.h │ │ ├── VideoNormItem.h │ │ ├── libutil_string.h │ │ ├── UDSHL_lnk.h │ │ ├── AnalogChannelItem.h │ │ ├── FrameGrabberSink.h │ │ ├── Error.h │ │ ├── smart_ptr.h │ │ ├── dstring.h │ │ ├── dvector.h │ │ ├── smart_com.h │ │ ├── Codec.h │ │ ├── MediaStreamContainer.h │ │ ├── IVCDPropertyInterfaces.h │ │ ├── VideoFormatItem.h │ │ ├── iframe_def.h │ │ ├── OverlayBitmap.h │ │ ├── IVCDPropertyInterfaces_inl.h │ │ ├── MemBufferCollection.h │ │ ├── FilterInfoObject.h │ │ ├── dshow_header.h │ │ ├── MemBuffer.h │ │ ├── VideoCaptureDeviceItem.h │ │ ├── simplectypes.h │ │ └── VCDPropertyIDTis.h ├── SingleCameraControlRobotArm.vcxproj.filters └── SingleCameraControlRobotArm.vcxproj ├── SingleCameraControlRobotArm.sln └── .gitignore /SingleCameraControlRobotArm/Camera.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/Camera.h -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/main.cpp -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/Camera.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/Camera.cpp -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/GetImage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/GetImage.cpp -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/GetImage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/GetImage.h -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/kinematics.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/kinematics.h -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/output.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/output.bmp -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/Calibration.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/Calibration.h -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/EyeToHand.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/EyeToHand.cpp -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/kinematics.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/kinematics.cpp -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/Calibration.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huipengly/SingleCameraControlRobotArm/HEAD/SingleCameraControlRobotArm/Calibration.cpp -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/EyeToHand.h: -------------------------------------------------------------------------------- 1 | #ifndef _EYE_TO_HAND_H 2 | #define _EYE_TO_HAND_H 3 | 4 | #include 5 | #include 6 | 7 | using cv::Mat; 8 | 9 | void EyeToHand(Mat &Eye, Mat &Hand); 10 | 11 | #endif -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/HL.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 3 5 | 4 6 |
d
7 | 1.369787e+03 -4.791212e-02 6.203269e+02 0 0 1.369371e+03 4.394241e+02 0 0 0 1 0 8 |
9 |
-------------------------------------------------------------------------------- /SingleCameraControlRobotArm/lastSelectedDeviceState1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | RGB32 (2592x1944) 4 | 5.9870022181843216558 5 | 6 | 7 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/lastSelectedDeviceState2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | RGB32 (2592x1944) 4 | 5.9870022181843216558 5 | 6 | 7 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/HR.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 3 5 | 4 6 |
d
7 | 1.215623e+03 -9.589885e+00 8.879250e+02 -1.627887e+05 -8.649396e+01 1.362036e+03 4.505679e+02 4.689369e+03 -1.969243e-01 -8.892149e-03 9.803784e-01 1.085955e+01 8 | 9 |
-------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/libbasedefs.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBBASEDEFS_H_INC 2 | #define LIBBASEDEFS_H_INC 3 | 4 | #define _DSHOWLIB_NAMESPACE DShowLib 5 | namespace DShowLib 6 | { 7 | }; 8 | 9 | namespace _DSHOWLIB_NAMESPACE // define for certain code completion tools 10 | { 11 | }; 12 | 13 | #define UDSHL_NAME_BASE "TIS_UDSHL11" 14 | 15 | #endif // LIBBASEDEFS_H_INC -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/int_interface_pre.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef INT_INTERFACE_PRE_H_INC_ 3 | #define INT_INTERFACE_PRE_H_INC_ 4 | 5 | #include "udshl_defs.h" 6 | 7 | namespace icbase 8 | { 9 | class IDShowFilter; 10 | class IDShowFactoryObjectInfo; 11 | class IDShowError; 12 | }; 13 | 14 | namespace win32_utils 15 | { 16 | class CVideoFormat; 17 | class CVideoFormatDesc; 18 | }; 19 | 20 | #endif // INT_INTERFACE_PRE_H_INC_ -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/VCDPropertyDef.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef VCDPROPERTYDEF_H_INC_ 3 | #define VCDPROPERTYDEF_H_INC_ 4 | 5 | #pragma once 6 | 7 | #include "IVCDPropertyInterfaces.h" 8 | 9 | namespace _DSHOWLIB_NAMESPACE 10 | { 11 | static const GUID VCDInterface_Range = IID_IVCDRangeProperty; 12 | static const GUID VCDInterface_Switch = IID_IVCDSwitchProperty; 13 | static const GUID VCDInterface_Button = IID_IVCDButtonProperty; 14 | static const GUID VCDInterface_MapStrings = IID_IVCDMapStringsProperty; 15 | static const GUID VCDInterface_AbsoluteValue = IID_IVCDAbsoluteValueProperty; 16 | }; 17 | 18 | #endif // VCDPROPERTYDEF_H_INC_ 19 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SingleCameraControlRobotArm", "SingleCameraControlRobotArm\SingleCameraControlRobotArm.vcxproj", "{7145AD21-96E5-4DE7-B3A3-AA7663728595}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {7145AD21-96E5-4DE7-B3A3-AA7663728595}.Debug|x64.ActiveCfg = Debug|x64 17 | {7145AD21-96E5-4DE7-B3A3-AA7663728595}.Debug|x64.Build.0 = Debug|x64 18 | {7145AD21-96E5-4DE7-B3A3-AA7663728595}.Debug|x86.ActiveCfg = Debug|Win32 19 | {7145AD21-96E5-4DE7-B3A3-AA7663728595}.Debug|x86.Build.0 = Debug|Win32 20 | {7145AD21-96E5-4DE7-B3A3-AA7663728595}.Release|x64.ActiveCfg = Release|x64 21 | {7145AD21-96E5-4DE7-B3A3-AA7663728595}.Release|x64.Build.0 = Release|x64 22 | {7145AD21-96E5-4DE7-B3A3-AA7663728595}.Release|x86.ActiveCfg = Release|Win32 23 | {7145AD21-96E5-4DE7-B3A3-AA7663728595}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/tisudshl.h: -------------------------------------------------------------------------------- 1 | #ifndef TISUDSHL_H 2 | #define TISUDSHL_H 3 | 4 | #pragma warning( push ) 5 | #pragma warning( disable : 4996 ) // deprecated warnings 6 | #pragma warning( disable : 4100 ) // warning C4100: unreferenced formal parameter 7 | #pragma warning( disable : 4786 ) // warning: identifier was truncated (VC6) 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // DLL public interface 15 | #include "libbasedefs.h" // namespace definition 16 | #include "udshl_defs.h" 17 | 18 | #include "dshow_header.h" 19 | 20 | // linker helper, to bind to the UDSHL 21 | #include "udshl_lnk.h" 22 | 23 | #include "smart_ptr.h" 24 | #include "smart_com.h" 25 | 26 | #include "simplectypes.h" 27 | 28 | #include "int_interface_pre.h" 29 | 30 | #include "VideoFormatItem.h" 31 | #include "VideoFormatDesc.h" 32 | #include "VideoNormItem.h" 33 | #include "VideoCaptureDeviceItem.h" 34 | #include "AnalogChannelItem.h" 35 | 36 | #include "Error.h" 37 | #include "Grabber.h" 38 | #include "MemBufferCollection.h" 39 | #include "MemBuffer.h" 40 | #include "Framegrabbersink.h" 41 | #include "AviSink.h" 42 | #include "OverlayBitmap.h" 43 | #include "GrabberListener.h" 44 | 45 | #include "FrameHandlerSink.h" 46 | #include "MediaStreamSink.h" 47 | 48 | #include "IVCDProperty.h" 49 | #include "IVCDPropertyInterfaces.h" 50 | #include "VCDPropertyDef.h" 51 | 52 | #include "VCDPropertyID.h" 53 | #include "VCDPropertyIDTIS.h" 54 | 55 | #include "FilterLoader.h" 56 | #include "FrameFilter.h" 57 | #include "FrameFilterImpl.h" 58 | 59 | #pragma warning( pop ) 60 | 61 | #endif /* TISUDSHL_H */ 62 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/UDSHL_defs.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UDSHL_DEFS_H_INC 3 | #define UDSHL_DEFS_H_INC 4 | 5 | #include "libbasedefs.h" 6 | 7 | #if defined _MSC_VER && _MSC_VER < 1600 8 | 9 | // introduce the C99/C++11 defines for basic width types 10 | typedef signed char int8_t; 11 | typedef short int16_t; 12 | typedef int int32_t; 13 | typedef long long int64_t; 14 | typedef unsigned char uint8_t; 15 | typedef unsigned short uint16_t; 16 | typedef unsigned int uint32_t; 17 | typedef unsigned long long uint64_t; 18 | 19 | #else 20 | #include 21 | #endif 22 | 23 | #ifdef UDSHL_GENERATE_DLL_EXPORTS 24 | #define _UDSHL_EXP_API __declspec(dllexport) 25 | #define UDSHL_EXP_API_ __declspec(dllexport) 26 | #else 27 | #define _UDSHL_EXP_API __declspec(dllimport) 28 | #define UDSHL_EXP_API_ __declspec(dllimport) 29 | #endif 30 | 31 | #define UDSHL_LIB_VERSION_MAJOR 3 32 | #define UDSHL_LIB_VERSION_MINOR 4 33 | 34 | #if !defined UDSHL_DISABLE_DEPRECATE_MESSAGES_ && defined UDSHL_GENERATE_DLL_EXPORTS 35 | #define UDSHL_DISABLE_DEPRECATE_MESSAGES_ 36 | #endif 37 | 38 | // use UDSHL_DEPRECATE_FUNCION_DISABLE_ to disable deprecation 39 | #if _MSC_VER > 1500 && !defined UDSHL_DISABLE_DEPRECATE_MESSAGES_ 40 | #define UDSHL_DEPRECATE_FUNCTION_ __declspec(deprecated) 41 | #define UDSHL_DEPRECATE_FUNCTION_TEXT_(text) __declspec(deprecated(text)) 42 | // Text generated is: "was declared deprecated. Instead, use the ." 43 | #define UDSHL_DEPRECATE_FUNCTION_T_(replacement) __declspec(deprecated("was declared deprecated. Instead, use the " replacement ".")) 44 | #else 45 | #define UDSHL_DEPRECATE_FUNCTION_ 46 | #define UDSHL_DEPRECATE_FUNCTION_TEXT_(text) 47 | #define UDSHL_DEPRECATE_FUNCTION_T_(replacement) 48 | #endif 49 | 50 | #endif // UDSHL_DEFS_H_INC -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/filterdll.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FILTERDLL_H_INC_ 3 | #define _FILTERDLL_H_INC_ 4 | 5 | #include "libbasedefs.h" 6 | 7 | /** The factory interface and the according helper functions are defined here. 8 | * 9 | * To export filters from your dll, use the macros defined below: 10 | * 11 | * FILTERDLL_BEGIN_EXPORT() 12 | * FILTERDLL_REGISTER_FILTER(CMyFilter1) 13 | * FILTERDLL_REGISTER_FILTER(CMyFilter2) 14 | * FILTERDLL_REGISTER_FILTER(CMyFilter2) 15 | * FILTERDLL_END_EXPORT() 16 | * 17 | * This registration has to be in any of the cpp files of your dll project. 18 | * The classes have to be visible for the compiler at this point. 19 | */ 20 | 21 | #define FILTER_INTERFACE_VERSION 1 22 | 23 | namespace _DSHOWLIB_NAMESPACE 24 | { 25 | class IFrameFilter; 26 | struct FilterInfo; 27 | 28 | /** 29 | * Abstract base class for a filter factory. An implementation of this 30 | * interface has to be created by getFilterFactory. 31 | * 32 | * IFilterFactory has methods for enumeration, creation and removal of 33 | * Frame-/Update-Transform-filters 34 | */ 35 | class IFilterFactory 36 | { 37 | public: 38 | virtual bool enumFilters( unsigned int index, FilterInfo* pFilterInfo ) = 0; 39 | 40 | virtual IFrameFilter* createFilter( const wchar_t* name ) = 0; 41 | 42 | virtual int getVersion() = 0; 43 | }; 44 | } 45 | 46 | #define FILTERDLL_BEGIN_EXPORT() \ 47 | extern "C" __declspec(dllexport) _DSHOWLIB_NAMESPACE::IFilterFactory* getFilterFactory() \ 48 | { \ 49 | static bool init = false; \ 50 | static _DSHOWLIB_NAMESPACE::CFilterFactory fac; \ 51 | if( !init ) \ 52 | { 53 | 54 | #define FILTERDLL_REGISTER_FILTER(CFilter) \ 55 | fac.registerFilter( (CFilter*) 0 ); 56 | 57 | #define FILTERDLL_END_EXPORT() \ 58 | init = true; \ 59 | } \ 60 | return &fac; \ 61 | } 62 | 63 | #endif -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/DeBayerTransform.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef DEBAYERTRANSFORM_H_INC_ 3 | #define DEBAYERTRANSFORM_H_INC_ 4 | 5 | #pragma once 6 | 7 | #include "udshl_defs.h" 8 | 9 | namespace _DSHOWLIB_NAMESPACE 10 | { 11 | class IDispEventDispatcher; 12 | struct DeBayerTransformImpl; 13 | class GrabberPImpl; 14 | 15 | /** The DeBayerTransform class allows you to control the automatic debayering process of IC Imaging Control. 16 | */ 17 | class DeBayerTransform 18 | { 19 | friend GrabberPImpl; 20 | public: 21 | _UDSHL_EXP_API ~DeBayerTransform(); 22 | 23 | /** Checks whether the image data is currently debayered by IC Imaging Control. */ 24 | _UDSHL_EXP_API 25 | bool isActive() const; 26 | 27 | enum tStartPattern 28 | { 29 | eBG = 0, 30 | eGB, 31 | eGR, 32 | eRG, 33 | }; 34 | 35 | /** Sets the pattern which determines how the algorithm interprets the pixels of the raw image data. 36 | * It has to match the pattern of the first two pixels of the first line. 37 | */ 38 | _UDSHL_EXP_API 39 | void setStartPattern( tStartPattern pat ); 40 | /** Returns the currently selected start pattern. */ 41 | _UDSHL_EXP_API 42 | tStartPattern getStartPattern() const; 43 | 44 | enum tDeBayerMode 45 | { 46 | eNearestColor, ///< Simplest and fastest algorithm, but lesser output image quality. 47 | eBilinear, ///< Algorithm with both acceptable speed and image quality. 48 | eEdgeSensing, ///< This algorithm creates the best image quality, but is rather slow. 49 | }; 50 | 51 | /** Selects the algorithm for the debayering of the image data. */ 52 | _UDSHL_EXP_API 53 | void setDeBayerMode( tDeBayerMode mode ); 54 | /** Returns the currently active debayering algorithm. */ 55 | _UDSHL_EXP_API 56 | tDeBayerMode getDeBayerMode() const; 57 | private: 58 | DeBayerTransform( IDispEventDispatcher& disp ); 59 | 60 | DeBayerTransformImpl* m_pImpl; 61 | }; 62 | 63 | }; 64 | 65 | #endif // DEBAYERTRANSFORM_H_INC_ 66 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/SingleCameraControlRobotArm.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 源文件 26 | 27 | 28 | 源文件 29 | 30 | 31 | 源文件 32 | 33 | 34 | 源文件 35 | 36 | 37 | 38 | 39 | 头文件 40 | 41 | 42 | 头文件 43 | 44 | 45 | 头文件 46 | 47 | 48 | 头文件 49 | 50 | 51 | 头文件 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/AviSink.h: -------------------------------------------------------------------------------- 1 | // AviSink.h: interface for the AviSink class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_AVISINK_H__75215A63_EB7B_46E2_AAFA_174B8EF4D77D__INCLUDED_) 6 | #define AFX_AVISINK_H__75215A63_EB7B_46E2_AAFA_174B8EF4D77D__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "udshl_defs.h" 12 | 13 | #include "smart_ptr.h" 14 | #include "FilterInfoObject.h" 15 | #include "MediaStreamSink.h" 16 | #include "dstring.h" 17 | 18 | namespace _DSHOWLIB_NAMESPACE 19 | { 20 | /** Using this Sink in a new Application is deprecated. 21 | * 22 | * The AviSink writes the image stream that comes from the currently active video capture device, to an avi file. 23 | * If a codec is specified in the constructor, the image stream is compressed using this codec. 24 | */ 25 | class AviSink : public MediaStreamSink 26 | { 27 | public: 28 | /** Create sink from filename and GUID. 29 | * @param codec_type possible GUIDs are codec types or MEDIASUBTYPEs. 30 | * This may be GUID_NULL when the VideoFormat from the source should be used as avi stream type. 31 | */ 32 | _UDSHL_EXP_API AviSink( const dstringa& filename, const GUID& codec_type, tSinkModes AutoStart = eRUN ); 33 | _UDSHL_EXP_API AviSink( const dstringw& filename, const GUID& codec_type, tSinkModes AutoStart = eRUN ); 34 | /** create sink from filter object and optional a codec_type 35 | * @param finfo the codec filter you want to use 36 | */ 37 | _UDSHL_EXP_API AviSink( const dstringa& filename, const FilterInfoObject& finfo, tSinkModes AutoStart = eRUN ); 38 | _UDSHL_EXP_API AviSink( const dstringw& filename, const FilterInfoObject& finfo, tSinkModes AutoStart = eRUN ); 39 | 40 | /** dtor */ 41 | _UDSHL_EXP_API ~AviSink(); 42 | 43 | /** Returns eAviSink 44 | * @return eAviSink 45 | */ 46 | _UDSHL_EXP_API tSinkType getSinkType() const; 47 | 48 | /** Returns the codec type as specified in the ctor. */ 49 | _UDSHL_EXP_API GUID getCodecType() const; 50 | /** The codec as specified in the ctor, may be 0. 51 | * @return maybe 0 52 | */ 53 | _UDSHL_EXP_API smart_ptr getFilterInfo() const; 54 | protected: 55 | smart_ptr m_pFilterInfoBuffer; 56 | }; 57 | 58 | }; 59 | 60 | #endif // !defined(AFX_AVISINK_H__75215A63_EB7B_46E2_AAFA_174B8EF4D77D__INCLUDED_) 61 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/GrabberSinkType.h: -------------------------------------------------------------------------------- 1 | // GrabberSinkType.h: interface for the GrabberSinkType class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_GRABBERSINKTYPE_H__7341AF44_4BE7_42A9_8825_DAE0A0724BA1__INCLUDED_) 6 | #define AFX_GRABBERSINKTYPE_H__7341AF44_4BE7_42A9_8825_DAE0A0724BA1__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include "udshl_defs.h" 11 | #include "smart_com.h" 12 | 13 | #include "simplectypes.h" 14 | 15 | #include "int_interface_pre.h" 16 | 17 | namespace _DSHOWLIB_NAMESPACE 18 | { 19 | class GrabberPImpl; 20 | class Grabber; 21 | 22 | /** Pure virtual base class for all sinks. The currently available sink objects are 23 | * MediaStreamSink and FrameHandlerSink (and the deprecated FrameGrabberSink and AviSink). 24 | */ 25 | class GrabberSinkType 26 | { 27 | friend Grabber; 28 | friend GrabberPImpl; 29 | public: 30 | /** dtor */ 31 | _UDSHL_EXP_API virtual ~GrabberSinkType(); 32 | 33 | /** must return the sink id*/ 34 | _UDSHL_EXP_API virtual tSinkType getSinkType() const = 0; 35 | 36 | ///< represents the mode in which the sink currently is/ is set 37 | enum tSinkModes 38 | { 39 | eRUN = 0x1, 40 | ePAUSE = 0x2, 41 | /// you cannot set this mode, this is only for the case that no graph is built 42 | eUNCONNECTED = -1, 43 | }; 44 | /** sets the mode of the sink. 45 | * So by calling this function you can pause and restart the sink. 46 | * @return the mode in which the sink is set after the command. 47 | */ 48 | _UDSHL_EXP_API virtual tSinkModes setSinkMode( tSinkModes mode ); 49 | /** returns the current sink mode */ 50 | _UDSHL_EXP_API virtual tSinkModes getSinkMode() const; 51 | /** Returns if the sink is currently attached to a Grabber */ 52 | _UDSHL_EXP_API bool isAttached() const; 53 | 54 | static void* operator new( size_t size ) 55 | { 56 | return CoTaskMemAlloc( size ); 57 | } 58 | static void operator delete( void* p ) 59 | { 60 | CoTaskMemFree( p ); 61 | } 62 | protected: 63 | GrabberSinkType(); 64 | 65 | virtual bool attach( GrabberPImpl* ); 66 | virtual void detach(); 67 | 68 | virtual smart_com getBaseSinkFilter() const = 0; 69 | 70 | GrabberPImpl* m_pAttachedParent; 71 | }; 72 | }; 73 | 74 | #endif // !defined(AFX_GRABBERSINKTYPE_H__7341AF44_4BE7_42A9_8825_DAE0A0724BA1__INCLUDED_) 75 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/GrabberListener.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef GRABBERLISTENER_H_INC 3 | #define GRABBERLISTENER_H_INC 4 | 5 | #include "udshl_defs.h" 6 | #include "smart_ptr.h" 7 | 8 | #include "simplectypes.h" 9 | #include "OverlayBitmap.h" 10 | #include "MemBuffer.h" 11 | 12 | namespace _DSHOWLIB_NAMESPACE 13 | { 14 | class Grabber; 15 | class MemBuffer; 16 | class OverlayBitmap; 17 | class VideoCaptureDeviceItem; 18 | class DeviceListChangeData; 19 | 20 | ///< base class for listener which can be registered to receive events from the grabber object. 21 | class GrabberListener 22 | { 23 | public: 24 | ///< the type of the Callbacks the listener receives 25 | enum tListenerType 26 | { 27 | eDEVICELOST = 0x1, 28 | eFRAMEREADY = 0x2, 29 | eOVERLAYCALLBACK = 0x4, 30 | eDEVICELISTCHANGED = 0x8, 31 | 32 | eALL = eDEVICELOST | eFRAMEREADY | eOVERLAYCALLBACK | eDEVICELISTCHANGED, 33 | }; 34 | public: 35 | ///< dtor 36 | virtual ~GrabberListener() {} 37 | 38 | /** called when the current device gets lost (e.g. is unplugged). 39 | * @param caller reference to the calling object. 40 | */ 41 | virtual void deviceLost( Grabber& caller ) {} 42 | /** called when after the frame in pBuffer is copied. 43 | * @param caller reference to the calling object. 44 | * @param pBuffer reference to the buffer in which the frame was copied, for which the callback is called. 45 | * @param FrameNumber 46 | */ 47 | virtual void frameReady( Grabber& caller, smart_ptr pBuffer, DWORD FrameNumber ){} 48 | /** called when before the overlay gets updated. 49 | * @param caller reference to the calling object. 50 | * @param pBitmap reference to the OverlayBitmap object which you can use to directly draw onto the overlay. 51 | * @param desc reference to a data structure which contains the sample times and a description of the sample. 52 | * You should not use the contents of the structure after the CB returned 53 | * (the pointer of desc.pData is either invalid or may point to some other sample). 54 | */ 55 | virtual void overlayCallback( Grabber& caller, smart_ptr pBitmap, const tsMediaSampleDesc& desc ) {} 56 | 57 | /** called when the device list changed due to device arrival or removal. 58 | * Note that this event is delivered in an arbitrary thread context. You should post this message 59 | * to your own thread context and execute a response there. 60 | * @param caller reference to the calling object. 61 | */ 62 | virtual void deviceListChanged( Grabber& caller, const DeviceListChangeData& ) {} 63 | }; 64 | }; 65 | 66 | #endif // GRABBERLISTENER_H_INC -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/filterfactory.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FILTERFACTORY_H_INC_ 3 | #define _FILTERFACTORY_H_INC_ 4 | 5 | #include "libbasedefs.h" 6 | #include "smart_ptr.h" 7 | 8 | #include "FilterDll.h" 9 | #include "FrameFilterImpl.h" 10 | 11 | namespace _DSHOWLIB_NAMESPACE 12 | { 13 | 14 | /** 15 | * Default implementation of IFilterFactory. 16 | * You should _almost_ never have to write your own. 17 | * 18 | * You should return a pointer to an instance of this class from getFilterFactory 19 | * inside your filter's DLL. 20 | * 21 | * To register a filter class at this factory, call registerFilter. 22 | * 23 | */ 24 | class CFilterFactory 25 | : public IFilterFactory 26 | { 27 | private: 28 | template 29 | void call_getfilterinfo( FilterInfo& fi ) 30 | { 31 | FilterInfo temp = T::getStaticFilterInfo(); 32 | fi = temp; 33 | } 34 | public: 35 | /** 36 | * Registers a frame filter class in this factory. 37 | * Usage: 38 | * factory.registerFilter( (FilterClass*)0 ); 39 | * 40 | */ 41 | template 42 | void registerFilter( T* pFilter ) 43 | { 44 | // Forward call to clean function trying to avoid x64 2010 optimization bug 45 | FilterInfo fi; 46 | call_getfilterinfo( fi ); 47 | 48 | m_registeredFilters[fi.name] = new FilterItem; 49 | } 50 | protected: 51 | virtual bool enumFilters( unsigned int index, FilterInfo* pFilterInfo ) 52 | { 53 | assert( pFilterInfo ); 54 | if( index < 0 || index >= (int) m_registeredFilters.size() ) 55 | return false; 56 | 57 | tFilterMap::const_iterator it = m_registeredFilters.begin(); 58 | std::advance( it, index ); 59 | 60 | it->second->getFilterInfo( *pFilterInfo ); 61 | 62 | return true; 63 | } 64 | 65 | virtual IFrameFilter* createFilter( const wchar_t* name ) 66 | { 67 | tFilterMap::iterator it = m_registeredFilters.find( name ); 68 | if( it != m_registeredFilters.end() ) 69 | { 70 | return it->second->create(); 71 | } 72 | else 73 | { 74 | return 0; 75 | } 76 | } 77 | 78 | virtual int getVersion() 79 | { 80 | return FILTER_INTERFACE_VERSION; 81 | } 82 | private: 83 | struct FilterItemBase 84 | { 85 | virtual IFrameFilter* create() const = 0; 86 | virtual void getFilterInfo( FilterInfo& info ) const = 0; 87 | }; 88 | 89 | typedef std::map > tFilterMap; 90 | 91 | template 92 | struct FilterItem : FilterItemBase 93 | { 94 | virtual IFrameFilter* create() const 95 | { 96 | return new T; 97 | } 98 | virtual void getFilterInfo( FilterInfo& info ) const 99 | { 100 | info = T::getStaticFilterInfo(); 101 | } 102 | }; 103 | 104 | tFilterMap m_registeredFilters; 105 | }; 106 | } 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/VideoFormatDesc.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _VIDEOFORMATDESC_H_ 3 | #define _VIDEOFORMATDESC_H_ 4 | 5 | #include "dstring.h" 6 | 7 | #include "VideoFormatItem.h" 8 | 9 | #include "int_interface_pre.h" 10 | 11 | namespace dshowlib_dll 12 | { 13 | struct sTISScanningModeInfo; 14 | } 15 | 16 | namespace _DSHOWLIB_NAMESPACE 17 | { 18 | class Grabber; 19 | class CSourceFilterType; 20 | 21 | class VideoFormatDesc 22 | { 23 | friend class Grabber; 24 | friend class CSourceFilterType; 25 | public: 26 | _UDSHL_EXP_API ~VideoFormatDesc(); 27 | public: 28 | _UDSHL_EXP_API VideoFormatItem createVideoFormat( SIZE size ) const; 29 | _UDSHL_EXP_API VideoFormatItem createVideoFormat( int width, int height ) const; 30 | public: 31 | _UDSHL_EXP_API GUID getSubtype() const; 32 | _UDSHL_EXP_API SIZE getMinSize() const; 33 | _UDSHL_EXP_API SIZE getMaxSize() const; 34 | _UDSHL_EXP_API SIZE getStepSize() const; 35 | 36 | UDSHL_DEPRECATE_FUNCTION_T_( "VideoFormatDesc::getBinningFactorHorizontal() and VideoFormatDesc::getBinningFactorVertical() methods" ) 37 | _UDSHL_EXP_API int getBinningFactor() const; 38 | 39 | // Internal use only 40 | _UDSHL_EXP_API int getBinningModeId() const; 41 | 42 | _UDSHL_EXP_API int getBinningFactorHorizontal() const; 43 | _UDSHL_EXP_API int getBinningFactorVertical() const; 44 | _UDSHL_EXP_API int getSkippingFactorHorizontal() const; 45 | _UDSHL_EXP_API int getSkippingFactorVertical() const; 46 | 47 | _UDSHL_EXP_API bool isROIFormat() const; 48 | 49 | _UDSHL_EXP_API bool isValidSize( const SIZE& sz ) const; 50 | 51 | /** get string representing this format desc 52 | **/ 53 | std::string toString() const 54 | { 55 | return wstoas( toString_() ); 56 | } 57 | std::wstring toStringW() const 58 | { 59 | return toString_(); 60 | } 61 | 62 | /** get string representing the color format of this format 63 | * @return string representing the color format of this format 64 | **/ 65 | std::string getColorformatString() const 66 | { 67 | return wstoas( getColorformatString_() ); 68 | } 69 | std::wstring getColorformatStringW() const 70 | { 71 | return getColorformatString_(); 72 | } 73 | 74 | private: 75 | _UDSHL_EXP_API dstringw toString_() const; 76 | _UDSHL_EXP_API dstringw getColorformatString_() const; 77 | 78 | VideoFormatDesc( const VideoFormatDesc& op2 ); 79 | //VideoFormatDesc& operator=( const VideoFormatDesc& op2 ); 80 | 81 | VideoFormatDesc( const win32_utils::CVideoFormatDesc& desc, const dshowlib_dll::sTISScanningModeInfo& smi, bool isROIFormat ); 82 | 83 | smart_ptr m_pDesc; 84 | 85 | int m_binningModeId; 86 | int m_binningHorizontal; 87 | int m_binningVertical; 88 | int m_skippingHorizontal; 89 | int m_skippingVertical; 90 | bool m_isROIFormat; 91 | bool m_dontAllowROI; 92 | }; 93 | 94 | } 95 | 96 | #endif // _VIDEOFORMATDESC_H_ 97 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/filterloader.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FILTERLOADER_H_INC_ 3 | #define _FILTERLOADER_H_INC_ 4 | 5 | #include "FrameFilter.h" 6 | #include "dstring.h" 7 | #include "dvector.h" 8 | 9 | namespace _DSHOWLIB_NAMESPACE 10 | { 11 | class IFrameFilter_param; 12 | 13 | /** 14 | * The FilterLoader methods allows you to load frame filters from external DLLs. 15 | * 16 | * The FilterLoader loads the frame filters from the ".ftf" filter DLLs in the following directories : 17 | 1) The path where this DLL resides. (tis_udshl_*.dll) 18 | 2) The Application Path or if you called FilterLoader::setLoadPath in the specified 19 | path. 20 | * 21 | * The loaded frame filter factories can be queried by calling getAvailableFrameFilters. 22 | * You can then create a specific filter by calling createFilter with a FilterInfo or 23 | * by specifying the according name. 24 | * 25 | * As all methods of this class are static, you can not create instances of this class. 26 | */ 27 | class FilterLoader 28 | { 29 | public: 30 | /** 31 | * Internal use only. 32 | */ 33 | _UDSHL_EXP_API static void setLoadPath( const dstringw& path ); 34 | 35 | _UDSHL_EXP_API static void loadDirectory( const dstringw& path ); 36 | _UDSHL_EXP_API static void loadDirectory( const dstringw& path, const dstringw& search_pattern ); 37 | 38 | /** 39 | * Retrieves a list with the names of the available frame filters. 40 | * To instantiate a filter from this list, call 41 | * createFilter. 42 | * @return A list with FilterInfo objects which describe the available filters. 43 | */ 44 | static std::vector getAvailableFrameFilters( tFilterClass filterClass = eFC_ALL ) 45 | { 46 | dvector tmp = getAvailableFrameFilters_( filterClass ); 47 | return std::vector( tmp.begin(), tmp.end() ); 48 | } 49 | 50 | /** Creates an instance of a specified frame filter. 51 | * @return 0 when no according filter could be created, otherwise a reference to the newly created filter. 52 | */ 53 | _UDSHL_EXP_API 54 | static smart_com createFilter( const FilterInfo& fi ); 55 | /** Creates an instance of a specified frame filter. 56 | * When module == std::string(), then the loader creates the first filter with the specified name 57 | * ignoring the module. 58 | * The look up of the filter name is case-sensitive. 59 | * @return 0 when no according filter could be created, otherwise a reference to the newly created filter. 60 | */ 61 | _UDSHL_EXP_API 62 | static smart_com createFilter( const dstringa& filter_name, const dstringa& module = dstringa() ); 63 | _UDSHL_EXP_API 64 | static smart_com createFilter( const dstringw& filter_name, const dstringw& module = dstringw() ); 65 | private: 66 | _UDSHL_EXP_API 67 | static dvector getAvailableFrameFilters_( tFilterClass filterClass = eFC_ALL ); 68 | 69 | /** 70 | * Do not create any instances of this class. 71 | */ 72 | FilterLoader() {} 73 | }; 74 | } 75 | 76 | #endif -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/VCDPropertyID.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef VCDPROPERTYID_H_INC_ 3 | #define VCDPROPERTYID_H_INC_ 4 | 5 | namespace _DSHOWLIB_NAMESPACE 6 | { 7 | static const GUID VCDElement_Value = { 0xB57D3000, 0x0AC6, 0x4819, { 0xA6, 0x09, 0x27, 0x2A, 0x33, 0x14, 0x0A, 0xCA } }; 8 | static const GUID VCDElement_Auto = { 0xB57D3001, 0x0AC6, 0x4819, { 0xA6, 0x09, 0x27, 0x2A, 0x33, 0x14, 0x0A, 0xCA } }; 9 | static const GUID VCDElement_OnePush = { 0xB57D3002, 0x0AC6, 0x4819, { 0xA6, 0x09, 0x27, 0x2A, 0x33, 0x14, 0x0A, 0xCA } }; 10 | 11 | static const GUID VCDID_Brightness = { 0x284C0E06, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 12 | static const GUID VCDID_Contrast = { 0x284C0E07, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 13 | static const GUID VCDID_Hue = { 0x284C0E08, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 14 | static const GUID VCDID_Saturation = { 0x284C0E09, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 15 | static const GUID VCDID_Sharpness = { 0x284C0E0A, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 16 | static const GUID VCDID_Gamma = { 0x284C0E0B, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 17 | static const GUID VCDID_ColorEnable = { 0x284C0E0C, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 18 | static const GUID VCDID_WhiteBalance = { 0x284C0E0D, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 19 | static const GUID VCDID_BacklightCompensation = { 0x284C0E0E, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 20 | static const GUID VCDID_Gain = { 0x284C0E0F, 0x010B, 0x45BF, { 0x82, 0x91, 0x09, 0xD9, 0x0A, 0x45, 0x9B, 0x28 } }; 21 | 22 | static const GUID VCDID_Pan = { 0x90D5702A, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 23 | static const GUID VCDID_Tilt = { 0x90D5702B, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 24 | static const GUID VCDID_Roll = { 0x90D5702C, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 25 | static const GUID VCDID_Zoom = { 0x90D5702D, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 26 | static const GUID VCDID_Exposure = { 0x90D5702E, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 27 | static const GUID VCDID_Iris = { 0x90D5702F, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 28 | static const GUID VCDID_Focus = { 0x90D57030, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 29 | 30 | static const GUID VCDID_Trigger = { 0x90D57031, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 31 | static const GUID VCDID_TriggerMode = VCDID_Trigger; 32 | 33 | static const GUID VCDID_VCRCompatibilityMode = { 0x90D57032, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 34 | 35 | static const GUID VCDID_SignalDetected = { 0x90D57033, 0xE43B, 0x4366, { 0xAA, 0xEB, 0x7A, 0x7A, 0x10, 0xB4, 0x48, 0xB4 } }; 36 | 37 | }; 38 | 39 | #endif // VCDPROPERTYID_H_INC_ -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/VideoNormItem.h: -------------------------------------------------------------------------------- 1 | // VideoNormItem.h: interface for the VideoNormItem class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_VIDEONORMITEM_H__978E5F24_E299_4CA7_BFD2_F5700DC0444D__INCLUDED_) 6 | #define AFX_VIDEONORMITEM_H__978E5F24_E299_4CA7_BFD2_F5700DC0444D__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "udshl_defs.h" 12 | #include "dstring.h" 13 | 14 | namespace _DSHOWLIB_NAMESPACE 15 | { 16 | class Grabber; 17 | 18 | /** Class representing a video norm. 19 | * All members will deliver valid values when isValid() returns true 20 | **/ 21 | class VideoNormItem 22 | { 23 | friend Grabber; 24 | private: 25 | VideoNormItem( AnalogVideoStandard t ); 26 | public: 27 | /// constructs an invalid VideoNormItem(); 28 | _UDSHL_EXP_API VideoNormItem(); 29 | /// copies an VideoNormItem(); 30 | _UDSHL_EXP_API VideoNormItem( const VideoNormItem& op ); 31 | _UDSHL_EXP_API ~VideoNormItem(); 32 | 33 | /** get the saved video norm 34 | * @return saved video norm 35 | **/ 36 | _UDSHL_EXP_API AnalogVideoStandard getVideoNorm() const { return m_VideoNorm; } 37 | 38 | 39 | /** get a string representation of the saved video norm 40 | * @return a pointer to the string representation of the saved video norm 41 | **/ 42 | _UDSHL_EXP_API const char* c_str() const; 43 | 44 | /** Creates a textual representation for this VideoNormItem 45 | * @return The textual representation. 46 | */ 47 | std::string toString() const 48 | { 49 | return c_str(); 50 | } 51 | std::wstring toStringW() const 52 | { 53 | return astows( toString() ); 54 | } 55 | 56 | /** assignment operator 57 | * @return *this 58 | */ 59 | _UDSHL_EXP_API VideoNormItem& operator=( const VideoNormItem& op2 ); 60 | 61 | /** returns the result of a lexicographical compare of the names 62 | * @return true, if this is before op 63 | * @param op the VideoNormItem to compare with 64 | **/ 65 | _UDSHL_EXP_API bool operator < (const VideoNormItem& op) const; 66 | 67 | /** test if this is valid 68 | * @return true if this is valid 69 | **/ 70 | _UDSHL_EXP_API bool isValid() const; 71 | 72 | /** test if two norms are equal 73 | * @param op norm to compare to this 74 | * @return true if this and op are equal, else false 75 | **/ 76 | _UDSHL_EXP_API bool operator==( const VideoNormItem& op ) const; 77 | 78 | /** test if two norms are not equal 79 | * @param op norm to compare to this 80 | * @return false if this and op are equal, else true 81 | **/ 82 | _UDSHL_EXP_API bool operator!=( const VideoNormItem& op ) const; 83 | 84 | /** test if two items are equal 85 | * @param op item to compare to this 86 | * @return true if this and op are equal, else false 87 | **/ 88 | _UDSHL_EXP_API bool operator==( const dstringa& op ) const; 89 | _UDSHL_EXP_API bool operator==( const dstringw& op ) const; 90 | 91 | /** generates an invalid item 92 | * @return an invalid item 93 | * @see isValid() 94 | **/ 95 | _UDSHL_EXP_API static VideoNormItem createInvalid(); 96 | private: 97 | AnalogVideoStandard m_VideoNorm; 98 | }; 99 | }; 100 | 101 | #endif // !defined(AFX_VIDEONORMITEM_H__978E5F24_E299_4CA7_BFD2_F5700DC0444D__INCLUDED_) 102 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/libutil_string.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_STRING_H_INC_ 2 | #define LIBUTIL_STRING_H_INC_ 3 | 4 | #pragma once 5 | 6 | #include 7 | #include "libbasedefs.h" 8 | 9 | namespace _DSHOWLIB_NAMESPACE 10 | { 11 | /** wide string to ascii string 12 | * \param op the wide input string 13 | * \param rval temporary ascii string 14 | * \return the resulting ascii string 15 | */ 16 | std::string& wstoas( const std::wstring& op, std::string& rval ); 17 | std::string wstoas( const std::wstring& op ); 18 | 19 | /** ascii string to wide string 20 | * \param op the ascii input string 21 | * \param rval temporary wide string 22 | * \return the resulting wide string 23 | */ 24 | std::wstring& astows( const std::string& op, std::wstring& rval ); 25 | std::wstring astows( const std::string& op ); 26 | 27 | /** GUID <-> String conversion functions 28 | */ 29 | GUID StringToGUID( const wchar_t* pString ); 30 | std::wstring GUIDToWString( const GUID& id ); 31 | wchar_t* GUIDToCOMString( const GUID& id ); 32 | BSTR GUIDToBSTR( const GUID& id ); 33 | 34 | inline std::string convert( const std::wstring& ws ) 35 | { 36 | size_t reqLength = ::WideCharToMultiByte( CP_UTF8, 0, ws.c_str(), int(ws.length()), 0, 0, 0, 0 ); 37 | if( reqLength == 0 ) return std::string(); 38 | 39 | std::string ret( reqLength, '\0' ); 40 | ::WideCharToMultiByte( CP_UTF8, 0, ws.c_str(), int(ws.length()), &ret[0], int(ret.length()), 0, 0 ); 41 | 42 | return ret; 43 | } 44 | 45 | inline std::wstring convert( const std::string& as ) 46 | { 47 | size_t reqLength = ::MultiByteToWideChar( CP_UTF8, 0, as.c_str(), int(as.length()), 0, 0 ); 48 | if( reqLength == 0 ) return std::wstring(); 49 | 50 | std::wstring ret( reqLength, L'\0' ); 51 | ::MultiByteToWideChar( CP_UTF8, 0, as.c_str(), int(as.length()), &ret[0], int(ret.length()) ); 52 | 53 | return ret; 54 | } 55 | 56 | /// wide string to ascii string 57 | inline std::string& wstoas( const std::wstring& op, std::string& rval ) 58 | { 59 | return rval = convert( op ); 60 | } 61 | 62 | /// multibyte string to wide string 63 | inline std::wstring& astows( const std::string& op, std::wstring& rval ) 64 | { 65 | return rval = convert( op ); 66 | } 67 | 68 | inline std::string wstoas( const std::wstring& op ) 69 | { 70 | std::string temp; 71 | return wstoas( op, temp ); 72 | } 73 | 74 | inline std::wstring astows( const std::string& op ) 75 | { 76 | std::wstring temp; 77 | return astows( op, temp ); 78 | } 79 | 80 | 81 | inline GUID StringToGUID( const wchar_t* pString ) 82 | { 83 | GUID id = GUID_NULL; 84 | CLSIDFromString( const_cast( pString ), &id ); 85 | return id; 86 | } 87 | 88 | inline std::wstring GUIDToWString( const GUID& id ) 89 | { 90 | wchar_t* pStr = 0; 91 | std::wstring rval; 92 | StringFromCLSID( id, &pStr ); 93 | if( pStr != 0 ) 94 | { 95 | rval = pStr; 96 | CoTaskMemFree( pStr ); 97 | } 98 | return rval; 99 | } 100 | 101 | 102 | inline wchar_t* GUIDToCOMString( const GUID& id ) 103 | { 104 | wchar_t* pRval = 0; 105 | StringFromCLSID( id, &pRval ); 106 | return pRval; 107 | } 108 | 109 | inline BSTR GUIDToBSTR( const GUID& id ) 110 | { 111 | BSTR pRval = 0; 112 | wchar_t* pStr = GUIDToCOMString( id ); 113 | if( pStr != 0 ) 114 | { 115 | pRval = ::SysAllocString( pStr ); 116 | CoTaskMemFree( pStr ); 117 | } 118 | return pRval; 119 | } 120 | }; 121 | 122 | #endif // LIBUTIL_STRING_H_INC_ 123 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/UDSHL_lnk.h: -------------------------------------------------------------------------------- 1 | 2 | /** This file checks the compiler version and binds to the udshl library and other libraries needed. 3 | * To use the link feature you must define the UDSHL_LIB_BASEDIR macro. 4 | * UDSHL_LIB_BASEDIR must contain the relative path to the lib base directory of imaging control. 5 | * 6 | * For example this define is used by the samples : 7 | #define UDSHL_LIB_BASEDIR "..\..\..\ClassLib\" 8 | * This is automatically expanded to point to the right file for the build. 9 | * 10 | * You can prevent linking with anything by specifying UDSHL_LIB_NO_LINK. 11 | * 12 | * This file checks the following defines : 13 | _MSC_VER // compiler version, defined by the compiler 14 | * 15 | * You may pass UDSHL_LIB_NO_COMPILER_CHECK to prevent the compiler checks. 16 | * 17 | */ 18 | 19 | #ifndef UDSHL_LNK_H_INC_ 20 | #define UDSHL_LNK_H_INC_ 21 | 22 | #pragma once 23 | 24 | #if !defined UDSHL_LIB_DIR 25 | #if defined UDSHL_LIB_BASEDIR 26 | #ifdef _DEBUG 27 | #define UDSHL_LIB_DIR UDSHL_LIB_BASEDIR "debug/" 28 | #else 29 | #define UDSHL_LIB_DIR UDSHL_LIB_BASEDIR "release/" 30 | #endif 31 | #else 32 | #define UDSHL_LIB_DIR "" 33 | #endif 34 | #endif 35 | 36 | #ifndef UDSHL_LIB_NO_COMPILER_CHECK 37 | 38 | #if !defined _MSC_VER 39 | #error Wrong Compiler. This library does only run with Visual C++ 6.0, 7.1, 8.0, 9.0 and 10.0 40 | #else 41 | #if _MSC_VER < 1200 42 | #error Wrong Compiler. This library does not run with Visual C++ prior to version 6.0 43 | #elif _MSC_VER == 1200 44 | // VC 6.0 45 | #elif _MSC_VER == 1300 46 | // VC7.0 not supported 47 | #error Wrong Compiler. This library does not run with Visual C++ version 7.0. Use 7.1 instead. 48 | #elif _MSC_VER == 1310 49 | // VC71 50 | #elif _MSC_VER == 1400 51 | // VC80 52 | #elif _MSC_VER == 1500 53 | // VC90 54 | #elif _MSC_VER == 1600 55 | // VC100 56 | #elif _MSC_VER == 1700 57 | // VC110 58 | #elif _MSC_VER == 1800 59 | // vc120 60 | #elif _MSC_VER == 1900 61 | // vc14 / VS2015 62 | #elif _MSC_VER > 1900 63 | #error This compiler was not tested with this library. 64 | #else 65 | #error Wrong Compiler. This library does only run with Visual C++ 7.1, 8.0, 9.0, 10.0, 11, 12, 14. 66 | // other maybe newer compiler ... 67 | #endif 68 | #endif 69 | 70 | #if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0500) 71 | # error "This library requires _WIN32_WINNT to be at least 0x0500 (Windows 2000)" 72 | #endif 73 | #endif 74 | 75 | // #define UDSHL_BASE_NAME is in libbasedefs.h 76 | #define __UDSHL_LPREFIX(txt) L##txt 77 | #define _UDSHL_LPREFIX(txt) __UDSHL_LPREFIX(txt) 78 | 79 | #if defined _DEBUG 80 | # define UDSHL_SUFFIX_CONFIGURATION "d" 81 | #else 82 | # define UDSHL_SUFFIX_CONFIGURATION "" 83 | #endif 84 | 85 | #if defined _M_AMD64 86 | # define UDSHL_SUFFIX_PLATFORM "_x64" 87 | #else 88 | # define UDSHL_SUFFIX_PLATFORM "" 89 | #endif 90 | 91 | #define UDSHL_NAME UDSHL_NAME_BASE UDSHL_SUFFIX_CONFIGURATION UDSHL_SUFFIX_PLATFORM 92 | #define UDSHL_NAME_W _UDSHL_LPREFIX(UDSHL_NAME_BASE) _UDSHL_LPREFIX(UDSHL_SUFFIX_CONFIGURATION) _UDSHL_LPREFIX(UDSHL_SUFFIX_PLATFORM) 93 | 94 | #define UDSHL_DLL_NAME UDSHL_NAME ".dll" 95 | #define UDSHL_LIB_NAME UDSHL_NAME ".lib" 96 | #define UDSHL_DLL_NAME_W UDSHL_NAME_W L".dll" 97 | #define UDSHL_LIB_NAME_W UDSHL_NAME_W L".lib" 98 | 99 | #if !defined UDSHL_LIB_NO_LINK 100 | // other libraries sometimes needed by applications using this library 101 | #include // commsupp.lib 102 | 103 | #pragma comment ( lib, UDSHL_LIB_DIR UDSHL_LIB_NAME ) 104 | #endif 105 | 106 | // remove previous defined macro 107 | #undef UDSHL_LIB_DIR 108 | 109 | #endif // UDSHL_LNK_H_INC_ 110 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/AnalogChannelItem.h: -------------------------------------------------------------------------------- 1 | // AnalogChannelItem.h: interface for the AnalogChannelItem class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_ANALOGCHANNELITEM_H__31CEA1C4_246E_411C_800F_CF94EE0DBE8D__INCLUDED_) 6 | #define AFX_ANALOGCHANNELITEM_H__31CEA1C4_246E_411C_800F_CF94EE0DBE8D__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "udshl_defs.h" 12 | 13 | #include "simplectypes.h" 14 | #include "dstring.h" 15 | 16 | namespace _DSHOWLIB_NAMESPACE 17 | { 18 | class Grabber; 19 | 20 | /** Represents an input of a video capture device. **/ 21 | class AnalogChannelItem 22 | { 23 | friend Grabber; 24 | public: 25 | ///< constructs an invalid AnalogChannelItem() 26 | _UDSHL_EXP_API AnalogChannelItem(); 27 | /** copies an analog channel item. 28 | * @param op item to copy 29 | **/ 30 | _UDSHL_EXP_API AnalogChannelItem( const AnalogChannelItem& op ); 31 | 32 | /** dtor */ 33 | _UDSHL_EXP_API ~AnalogChannelItem(); 34 | 35 | /** assignment operator 36 | * @param op2 37 | * @return this 38 | */ 39 | _UDSHL_EXP_API AnalogChannelItem& operator=( const AnalogChannelItem& op2 ); 40 | 41 | /** return internal PhysicalConnectorType 42 | * @return internal PhysicalConnectorType, which is valid only if isValid() returns true 43 | **/ 44 | _UDSHL_EXP_API PhysicalConnectorType getPhysicalConnectorType() const { return m_PhysicalConnectorType; }; 45 | 46 | /** return index of input 47 | * @return index of input or -1, which is valid only if isValid() returns true 48 | **/ 49 | _UDSHL_EXP_API int getIndex() const { return m_Index; }; 50 | 51 | /** test if the input is valid 52 | * @return true, if the input is valid, else false 53 | **/ 54 | _UDSHL_EXP_API bool isValid() const; 55 | 56 | /** get a string representation of the input 57 | * @return a pointer to the string representation of the input 58 | **/ 59 | UDSHL_DEPRECATE_FUNCTION_T_( "AnalogChannelItem::toString() method" ) 60 | _UDSHL_EXP_API const char* c_str() const; 61 | 62 | /** returns the result of a lexicographical compare of the index 63 | * @return true, if this is before op 64 | * @param op the VideoNormItem to compare with 65 | **/ 66 | _UDSHL_EXP_API bool operator<(const AnalogChannelItem& op) const; 67 | 68 | /** test if two channels are equal 69 | * @param op channel to compare to this 70 | * @return true if this and op are equal, else false 71 | **/ 72 | _UDSHL_EXP_API bool operator==( const AnalogChannelItem& op ) const; 73 | 74 | /** test if two channels are not equal 75 | * @param op channel to compare to this 76 | * @return false if this and op are equal, else true 77 | **/ 78 | _UDSHL_EXP_API bool operator!=( const AnalogChannelItem& op ) const; 79 | 80 | /** test if two items are equal 81 | * @param op item to compare to this 82 | * @return true if this and op are equal, else false 83 | **/ 84 | _UDSHL_EXP_API bool operator==( const dstringa& op ) const; 85 | _UDSHL_EXP_API bool operator==( const dstringw& op ) const; 86 | 87 | /** generates an invalid item 88 | * @return an invalid item 89 | * @see isValid() 90 | **/ 91 | static AnalogChannelItem createInvalid(); 92 | 93 | /** Creates a textual representation for this AnalogChannelItem 94 | * @return The textual representation. 95 | */ 96 | std::string toString() const 97 | { 98 | return wstoas( toString_() ); 99 | } 100 | std::wstring toStringW() const 101 | { 102 | return toString_(); 103 | } 104 | private: 105 | _UDSHL_EXP_API dstringw toString_() const; 106 | 107 | /** constructs an AnalogChannelItem */ 108 | AnalogChannelItem( int index, PhysicalConnectorType type ); 109 | 110 | /** the PhysicalConnectorType of the wrapped type */ 111 | PhysicalConnectorType m_PhysicalConnectorType; 112 | /** the index of this Channel */ 113 | int m_Index; 114 | 115 | // this is only needed because we handout a string buffer in c_str() 116 | dstringa m_String; 117 | }; 118 | 119 | }; 120 | #endif // !defined(AFX_ANALOGCHANNELITEM_H__31CEA1C4_246E_411C_800F_CF94EE0DBE8D__INCLUDED_) 121 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/FrameGrabberSink.h: -------------------------------------------------------------------------------- 1 | // FrameGrabberSink.h: interface for the FrameGrabberSink class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_FRAMEGRABBERSINK_H__DE7BC1B6_25F9_4F33_919B_710A99EA015A__INCLUDED_) 6 | #define AFX_FRAMEGRABBERSINK_H__DE7BC1B6_25F9_4F33_919B_710A99EA015A__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include "GrabberSinkType.h" 11 | #include "MemBufferCollection.h" 12 | 13 | class ISampleTransformHandler; 14 | 15 | namespace _DSHOWLIB_NAMESPACE 16 | { 17 | class Grabber; 18 | class GrabberPImpl; 19 | 20 | class CFGSinkType; 21 | 22 | /** This class is deprecated. Use the FrameHandlerSink object. 23 | * 24 | * Sink type for a frame grabber 25 | */ 26 | class FrameGrabberSink : public GrabberSinkType 27 | { 28 | friend Grabber; 29 | friend GrabberPImpl; 30 | public: 31 | enum tFrameGrabberMode 32 | { 33 | eSNAP, ///< mode where you have to call snapImage to get a frame copied into the ring buffer 34 | eGRAB, ///< continuous grabbing mode, where every frame is copied into the ring buffer 35 | }; 36 | 37 | typedef smart_ptr tMemBufferCollectionPtr; 38 | public: 39 | /** ctor 40 | * @param grabber if true then a continuous grab operation is started with startLive(), 41 | * if false, then you are able to snap particular frames into the ring buffer 42 | * @param type is the type of the sink 43 | */ 44 | UDSHL_DEPRECATE_FUNCTION_T_( "FrameHandlerSink class" ) 45 | _UDSHL_EXP_API FrameGrabberSink( tFrameGrabberMode mode, tColorformatEnum type = eRGB24, tSinkModes AutoStart = eRUN ); 46 | 47 | /** copy ctor*/ 48 | UDSHL_DEPRECATE_FUNCTION_T_( "FrameHandlerSink class" ) 49 | _UDSHL_EXP_API FrameGrabberSink( const FrameGrabberSink& op2 ); 50 | /** dtor */ 51 | _UDSHL_EXP_API ~FrameGrabberSink(); 52 | 53 | /** assignment operator */ 54 | _UDSHL_EXP_API FrameGrabberSink& operator=( const FrameGrabberSink& op2 ); 55 | 56 | /** return the type of the sink. pure virtual function from the base 57 | * @return always eFrameGrabberSink 58 | */ 59 | UDSHL_DEPRECATE_FUNCTION_T_( "FrameHandlerSink class" ) 60 | _UDSHL_EXP_API tSinkType getSinkType() const; 61 | 62 | /** returns the set Colorformat */ 63 | UDSHL_DEPRECATE_FUNCTION_T_( "FrameHandlerSink class" ) 64 | _UDSHL_EXP_API tColorformatEnum getColorformat() const; 65 | /** returns the set mode */ 66 | UDSHL_DEPRECATE_FUNCTION_T_( "FrameHandlerSink class" ) 67 | _UDSHL_EXP_API tFrameGrabberMode getMode() const; 68 | protected: 69 | /** Creates a new MemBufferCollection which fits for this sink. 70 | * @param buffer_count The count of buffers in the collection. 71 | * @return 0 on error 72 | * Otherwise a valid collection as needed. 73 | */ 74 | tMemBufferCollectionPtr newMemBufferCollection( DWORD buffer_count ) const; 75 | /** Creates a new MemBufferCollection which fits for this sink. 76 | * @param buffersize The size of an individual Buffer you passed. 77 | * @param buffers An array of pointer which contains buffer_count pointer to buffers, to which 78 | * the Grabber will write. (If one entry is 0, then 0 is returned). 79 | * @param buffer_count The count of buffers in the collection. 80 | * @return 0 on error 81 | * Otherwise a valid collection as needed. 82 | */ 83 | tMemBufferCollectionPtr newMemBufferCollection( DWORD buffersize, BYTE* buffers[], DWORD buffer_count ) const; 84 | 85 | protected: 86 | smart_com getBaseSinkFilter() const; 87 | 88 | Error setMemBufferCollection( const tMemBufferCollectionPtr& pCol ); 89 | smart_ptr getMemBufferCollection() const; 90 | 91 | smart_ptr getActiveMemBuffer() const; 92 | DWORD getFrameCount() const; 93 | 94 | Error snapImages( DWORD count, DWORD timeout ); 95 | void setSinkDim( const SIZE& r ); 96 | 97 | bool isValid() const; 98 | 99 | unsigned long getFrameDataSize(); 100 | 101 | smart_ptr m_pFGFilter; 102 | }; 103 | }; 104 | 105 | #endif // !defined(AFX_FRAMEGRABBERSINK_H__DE7BC1B6_25F9_4F33_919B_710A99EA015A__INCLUDED_) 106 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/Error.h: -------------------------------------------------------------------------------- 1 | // Error.h: interface for the Error class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_ERROR_H__6EB4029E_C2A2_4353_8938_FF398FE42826__INCLUDED_) 6 | #define AFX_ERROR_H__6EB4029E_C2A2_4353_8938_FF398FE42826__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "udshl_defs.h" 12 | #include "simplectypes.h" 13 | 14 | #include "int_interface_pre.h" 15 | #include "dstring.h" 16 | 17 | namespace _DSHOWLIB_NAMESPACE 18 | { 19 | /** The Error class gives information about an error occurred during a call to the class library. 20 | * 21 | * Example usage : 22 | *
23 | Grabber g; 24 | // ... 25 | if( !g.startLive() ) 26 | { 27 | Error e = g.getLastError(); 28 | if( e.getVal() == eDEVICE_INVALID ) 29 | { 30 | MessageBox( "Device has become invalid.", ... ); 31 | // reopen device 32 | } 33 | else 34 | { 35 | MessageBox( e.toString(), ... ); 36 | exit( -1 ); 37 | } 38 | } 39 | 40 | **/ 41 | class Error 42 | { 43 | public: 44 | /** Constructs an unknown Error **/ 45 | _UDSHL_EXP_API Error(); 46 | 47 | /** Constructs an unknown error with given message 48 | * @param errordesc description of the error 49 | **/ 50 | _UDSHL_EXP_API Error( const dstringa& errordesc ); 51 | _UDSHL_EXP_API Error( const dstringw& errordesc ); 52 | 53 | /** constructs an error with given error code and uses the string from the resources 54 | * @param e error code 55 | **/ 56 | _UDSHL_EXP_API Error( tErrorEnum e ); 57 | 58 | /** constructs an error with given exception from DShowLib 59 | * @param e DShowLibException to handle 60 | **/ 61 | _UDSHL_EXP_API Error( const icbase::IDShowError& e ); 62 | 63 | /** constructs an error as a copy of the given one 64 | * @param e Error to copy 65 | **/ 66 | _UDSHL_EXP_API Error( const Error& e ); 67 | 68 | /** dtor */ 69 | _UDSHL_EXP_API ~Error(); 70 | 71 | /** return a string representation for the error 72 | * @return a string representation for the error 73 | **/ 74 | std::string getString() const 75 | { 76 | return toString(); 77 | } 78 | std::wstring getStringW() const 79 | { 80 | return toStringW(); 81 | } 82 | 83 | std::string toString() const 84 | { 85 | return m_String; 86 | } 87 | std::wstring toStringW() const 88 | { 89 | return astows( m_String ); 90 | } 91 | 92 | /** return a const char* to a string representing the error 93 | * @return a const char* to a string representation of the error 94 | **/ 95 | UDSHL_DEPRECATE_FUNCTION_T_( "Error::toString() method" ) 96 | const char* c_str() const 97 | { 98 | return m_String.c_str(); 99 | } 100 | 101 | /** return the error code of the error 102 | * @return the error code of the error 103 | **/ 104 | tErrorEnum getVal() const 105 | { 106 | return m_Enum; 107 | } 108 | 109 | /** return a string representation for the error 110 | * @return a string representation for the error 111 | **/ 112 | UDSHL_DEPRECATE_FUNCTION_T_( "Error::toString() method" ) 113 | operator std::string () const 114 | { 115 | return m_String; 116 | } 117 | 118 | /** return a const char* to a string representing the error 119 | * @return a const char* to a string representation of the error 120 | **/ 121 | UDSHL_DEPRECATE_FUNCTION_T_( "Error::toString() method" ) 122 | operator const char* () const 123 | { 124 | return m_String.c_str(); 125 | } 126 | 127 | /** return the error code of the error 128 | * @return the error code of the error 129 | **/ 130 | UDSHL_DEPRECATE_FUNCTION_T_( "Error::getVal() method" ) 131 | operator tErrorEnum () const 132 | { 133 | return m_Enum; 134 | } 135 | 136 | /** return true, if the internal error value equals not eNOERROR 137 | * @return true, if the internal error value equals not eNOERROR 138 | **/ 139 | bool isError() const 140 | { 141 | return eNOERROR != m_Enum; 142 | } 143 | private: // members 144 | tErrorEnum m_Enum; 145 | dstringa m_String; 146 | }; 147 | } 148 | 149 | #endif // !defined(AFX_ERROR_H__6EB4029E_C2A2_4353_8938_FF398FE42826__INCLUDED_) 150 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/smart_ptr.h: -------------------------------------------------------------------------------- 1 | #ifndef _SMARTPTR_H_INC_ 2 | #define _SMARTPTR_H_INC_ 3 | 4 | #include 5 | 6 | 7 | // forward declarations 8 | template class smart_ptr; 9 | 10 | class refcount_ptr_base 11 | { 12 | public: 13 | virtual ~refcount_ptr_base() {}; 14 | 15 | virtual void AddRef() = 0; 16 | virtual void Release() = 0; 17 | 18 | virtual void* GetPtr() = 0; 19 | }; 20 | 21 | template 22 | class refcount_ptr : public refcount_ptr_base 23 | { 24 | public: 25 | refcount_ptr( T* p ) 26 | : ref_count_( 1 ), data_( p ) 27 | { 28 | } 29 | 30 | ~refcount_ptr() 31 | { 32 | delete data_; 33 | } 34 | 35 | void AddRef() 36 | { 37 | InterlockedIncrement( &ref_count_ ); 38 | } 39 | void Release() 40 | { 41 | if( ::InterlockedDecrement( &ref_count_ ) == 0 ) 42 | { 43 | delete this; 44 | } 45 | } 46 | virtual void* GetPtr() 47 | { 48 | return data_; 49 | } 50 | private: 51 | LONG ref_count_; 52 | T* data_; 53 | }; 54 | 55 | template 56 | class refcount_ptr_wrapper : public refcount_ptr_base 57 | { 58 | public: 59 | refcount_ptr_wrapper( refcount_ptr_base* target ) 60 | : ref_count_( 1 ), target_( target ) 61 | { 62 | target_->AddRef(); 63 | } 64 | 65 | ~refcount_ptr_wrapper() 66 | { 67 | target_->Release(); 68 | } 69 | 70 | void AddRef() 71 | { 72 | InterlockedIncrement( &ref_count_ ); 73 | } 74 | void Release() 75 | { 76 | if( ::InterlockedDecrement( &ref_count_ ) == 0 ) 77 | { 78 | delete this; 79 | } 80 | } 81 | virtual void* GetPtr() 82 | { 83 | return static_cast( static_cast(target_->GetPtr()) ); 84 | } 85 | private: 86 | refcount_ptr_base* target_; 87 | LONG ref_count_; 88 | }; 89 | 90 | template 91 | class smart_ptr 92 | { 93 | public: 94 | typedef TType value_type; 95 | typedef TType* pointer; 96 | typedef const TType* const_pointer; 97 | typedef TType& reference; 98 | typedef const TType& const_reference; 99 | 100 | typedef smart_ptr object_type; 101 | 102 | typedef void (* deleter_type)( void* ); 103 | public: 104 | /** ctor */ 105 | smart_ptr( pointer p = 0 ) 106 | : ptr_( new refcount_ptr( p ) ) 107 | { 108 | 109 | } 110 | 111 | template 112 | smart_ptr( const smart_ptr& op2 ) 113 | { 114 | const_pointer p = static_cast(op2.get()); // compile time test .. 115 | UNREFERENCED_PARAMETER( p ); 116 | 117 | ptr_ = new refcount_ptr_wrapper( op2.get_refcount_ptr() ); 118 | } 119 | 120 | /** copy constructor */ 121 | smart_ptr( const object_type& op2 ) 122 | { 123 | ptr_ = op2.ptr_; 124 | ptr_->AddRef(); 125 | } 126 | /** dtor */ 127 | ~smart_ptr() 128 | { 129 | ptr_->Release(); 130 | } 131 | 132 | /** assignment operator*/ 133 | smart_ptr& operator=( const smart_ptr& op2 ) 134 | { 135 | smart_ptr tmp( op2 ); 136 | tmp.swap( *this ); 137 | return *this; 138 | } 139 | 140 | /** member selection operator 141 | * may fail when the pointer is empty 142 | */ 143 | reference operator*() { return *get(); } 144 | /** member selection operator 145 | * may fail when the pointer is empty 146 | */ 147 | const_reference operator*() const { return *get(); } 148 | /** member selection operator 149 | * may fail when the pointer is empty 150 | */ 151 | pointer operator->() { return get(); } 152 | /** member selection operator 153 | * may fail when the pointer is empty 154 | */ 155 | const_pointer operator->() const { return get(); } 156 | 157 | /** compare operator== */ 158 | bool operator==( const smart_ptr& op2 ) const 159 | { 160 | return get() == op2.get(); 161 | } 162 | /** compare operator!= */ 163 | bool operator!=( const smart_ptr& op2 ) const 164 | { 165 | return get() != op2.get(); 166 | } 167 | 168 | /** compare operator==. 169 | * implemented cause of performance reasons 170 | */ 171 | bool operator==( const pointer p ) const 172 | { 173 | return get() == p; 174 | } 175 | /** compare operator!=. 176 | * implemented cause of performance reasons 177 | */ 178 | bool operator!=( const pointer p ) const 179 | { 180 | return get() != p; 181 | } 182 | 183 | /** lets you get the internal pointer representation 184 | * do not delete the internal rep, use destroy 185 | */ 186 | pointer get() 187 | { 188 | return static_cast( ptr_->GetPtr() ); 189 | } 190 | 191 | /** lets you get the internal pointer representation 192 | * do not delete the internal rep, use destroy 193 | */ 194 | const_pointer get() const 195 | { 196 | return static_cast( ptr_->GetPtr() ); 197 | } 198 | 199 | /** destroys the internal reference and sets this to zero */ 200 | void destroy() 201 | { 202 | smart_ptr tmp; 203 | tmp.swap( *this ); 204 | } 205 | 206 | /** swaps this with op2 */ 207 | void swap( smart_ptr& op2 ) 208 | { 209 | std::swap( ptr_, op2.ptr_ ); 210 | } 211 | 212 | refcount_ptr_base* get_refcount_ptr() const { return ptr_; } 213 | 214 | private: 215 | mutable refcount_ptr_base* ptr_; 216 | }; 217 | 218 | 219 | template 220 | inline bool operator==( const void* p, const smart_ptr& op2 ) 221 | { 222 | return op2.get() == p; 223 | } 224 | 225 | template 226 | inline bool operator!=( const void* p, const smart_ptr& op2 ) 227 | { 228 | return op2.get() != p; 229 | } 230 | 231 | template 232 | inline void swap( smart_ptr& op1, smart_ptr& op2 ) { op1.swap( op2 ); } 233 | 234 | #endif -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/dstring.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef DSTRING_H_INC_ 3 | #define DSTRING_H_INC_ 4 | 5 | #include 6 | #include 7 | 8 | #if _MSC_VER >= 1300 && _MSC_VER < 1400 9 | // Required for StringCchPrintf 10 | #include 11 | #endif 12 | 13 | #include "udshl_defs.h" 14 | 15 | #include "libutil_string.h" 16 | 17 | namespace _DSHOWLIB_NAMESPACE 18 | { 19 | class dstringa 20 | { 21 | public: 22 | dstringa() 23 | : buf_( 0 ) 24 | { 25 | char str = 0; 26 | buf_ = init( &str, 1 ); 27 | } 28 | 29 | dstringa( const char* str, size_t len ) 30 | : buf_( 0 ) 31 | { 32 | buf_ = init( str, len ); 33 | } 34 | 35 | dstringa( const char* str ) 36 | : buf_( 0 ) 37 | { 38 | assert( str ); 39 | buf_ = init( str, calc_len( str ) ); 40 | } 41 | dstringa( const std::basic_string& str ) 42 | : buf_( 0 ) 43 | { 44 | buf_ = init( str.c_str(), str.size() ); 45 | } 46 | 47 | dstringa( const dstringa& str ) 48 | : buf_( 0 ) 49 | { 50 | buf_ = init( str.buf_, calc_len( str.buf_ ) ); 51 | } 52 | #if _MSC_VER >= 1600 53 | dstringa( dstringa&& str ) 54 | : buf_( 0 ) 55 | { 56 | swap( str ); 57 | } 58 | #endif 59 | ~dstringa() 60 | { 61 | free(); 62 | } 63 | 64 | dstringa& operator=( const dstringa& str ) 65 | { 66 | dstringa temp( str ); 67 | swap( temp ); 68 | return *this; 69 | } 70 | dstringa& operator=( const char* str ) 71 | { 72 | dstringa temp( str ); 73 | swap( temp ); 74 | return *this; 75 | } 76 | void swap( dstringa& str ) 77 | { 78 | std::swap( buf_, str.buf_ ); 79 | } 80 | 81 | operator std::basic_string() const { return std::basic_string( buf_ ); } 82 | 83 | const char* c_str() const { return buf_; } 84 | 85 | bool empty() const { return buf_[0] == 0; } 86 | 87 | std::basic_string to_string() const { return std::basic_string( buf_ ); } 88 | 89 | 90 | bool operator==( const std::basic_string& rhs ) const 91 | { 92 | return to_string() == rhs; 93 | } 94 | bool operator!=( const std::basic_string& rhs ) const 95 | { 96 | return to_string() != rhs; 97 | } 98 | private: 99 | static size_t calc_len( const char* str ) 100 | { 101 | return strlen( str ); 102 | } 103 | static char* init( const char* str, size_t str_len ) 104 | { 105 | char* buf = static_cast( CoTaskMemAlloc( (str_len + 1) * sizeof( str[0] ) ) ); 106 | #if _MSC_VER >= 1400 107 | strcpy_s( buf, str_len + 1, str ); 108 | #elif _MSC_VER >= 1300 109 | StringCchPrintfA( buf, str_len + 1, str ); 110 | #else 111 | strcpy( buf, str ); 112 | #endif 113 | buf[str_len] = 0; 114 | return buf; 115 | } 116 | void free() 117 | { 118 | CoTaskMemFree( buf_ ); 119 | } 120 | char* buf_; 121 | }; 122 | 123 | inline bool operator<( const dstringa& lhs, const dstringa& rhs ) 124 | { 125 | return lhs.to_string() < rhs.to_string(); 126 | } 127 | 128 | class dstringw 129 | { 130 | public: 131 | dstringw() 132 | : buf_( 0 ) 133 | { 134 | wchar_t str = 0; 135 | buf_ = init( &str, 1 ); 136 | } 137 | 138 | dstringw( const wchar_t* str, size_t len ) 139 | : buf_( 0 ) 140 | { 141 | buf_ = init( str, len ); 142 | } 143 | 144 | dstringw( const wchar_t* str ) 145 | : buf_( 0 ) 146 | { 147 | assert( str ); 148 | buf_ = init( str, calc_len( str ) ); 149 | } 150 | dstringw( const std::basic_string& str ) 151 | : buf_( 0 ) 152 | { 153 | buf_ = init( str.c_str(), str.size() ); 154 | } 155 | 156 | dstringw( const dstringw& str ) 157 | : buf_( 0 ) 158 | { 159 | buf_ = init( str.buf_, calc_len( str.buf_ ) ); 160 | } 161 | #if _MSC_VER >= 1600 162 | dstringw( dstringw&& str ) 163 | : buf_( 0 ) 164 | { 165 | swap( str ); 166 | } 167 | #endif 168 | ~dstringw() 169 | { 170 | free(); 171 | } 172 | 173 | dstringw& operator=( const dstringw& str ) 174 | { 175 | dstringw temp( str ); 176 | swap( temp ); 177 | return *this; 178 | } 179 | dstringw& operator=( const wchar_t* str ) 180 | { 181 | dstringw temp( str ); 182 | swap( temp ); 183 | return *this; 184 | } 185 | void swap( dstringw& str ) 186 | { 187 | std::swap( buf_, str.buf_ ); 188 | } 189 | 190 | operator std::basic_string() const { return std::basic_string( buf_ ); } 191 | 192 | const wchar_t* c_str() const { return buf_; } 193 | 194 | bool empty() const { return buf_[0] == 0; } 195 | 196 | std::basic_string to_string() const { return std::basic_string( buf_ ); } 197 | 198 | 199 | bool operator==( const std::basic_string& rhs ) const 200 | { 201 | return std::basic_string( *this ) == rhs; 202 | } 203 | bool operator!=( const std::basic_string& rhs ) const 204 | { 205 | return std::basic_string( *this ) != rhs; 206 | } 207 | 208 | private: 209 | static size_t calc_len( const wchar_t* str ) 210 | { 211 | return wcslen( str ); 212 | } 213 | static wchar_t* init( const wchar_t* str, size_t str_len ) 214 | { 215 | wchar_t* buf = static_cast( CoTaskMemAlloc( (str_len + 1) * sizeof( wchar_t ) ) ); 216 | #if _MSC_VER >= 1400 217 | wcscpy_s( buf, str_len + 1, str ); 218 | #elif _MSC_VER >= 1300 219 | StringCchPrintfW( buf, str_len + 1, str ); 220 | #else 221 | wcscpy( buf, str ); 222 | #endif 223 | buf[str_len] = 0; 224 | return buf; 225 | } 226 | void free() 227 | { 228 | CoTaskMemFree( buf_ ); 229 | } 230 | wchar_t* buf_; 231 | }; 232 | 233 | inline bool operator<( const dstringw& lhs, const dstringw& rhs ) 234 | { 235 | return lhs.to_string() < rhs.to_string(); 236 | } 237 | }; 238 | 239 | #endif // DSTRING_H_INC_ 240 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/dvector.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef DVECTOR_H_INC_ 3 | #define DVECTOR_H_INC_ 4 | 5 | #include "udshl_defs.h" 6 | 7 | namespace _DSHOWLIB_NAMESPACE 8 | { 9 | template 10 | class dvector 11 | { 12 | public: 13 | typedef TObj* pointer; 14 | typedef TObj value_type; 15 | typedef TObj& reference; 16 | typedef const TObj& const_reference; 17 | 18 | typedef pointer iterator; 19 | public: 20 | dvector() 21 | : _pData( 0 ), _size( 0 ), _reserved( 0 ) 22 | { 23 | } 24 | explicit dvector( size_t size, size_t reserved_size = 0 ) 25 | : _pData( 0 ), _size( 0 ), _reserved( 0 ) 26 | { 27 | if( size > reserved_size ) 28 | reserved_size = size; 29 | uninitialized_alloc( reserved_size ); 30 | uninitialized_construct( _pData, size, TObj() ); 31 | } 32 | template 33 | dvector( TIter assign_beg, TIter assign_end ) 34 | : _pData( 0 ), _size( 0 ), _reserved( 0 ) 35 | { 36 | size_t diff = assign_end - assign_beg; 37 | uninitialized_alloc( diff ); 38 | uninitialized_assign( assign_beg, diff ); 39 | } 40 | dvector( pointer assign_beg, pointer assign_end ) 41 | : _pData( 0 ), _size( 0 ), _reserved( 0 ) 42 | { 43 | size_t diff = assign_end - assign_beg; 44 | uninitialized_alloc( diff ); 45 | uninitialized_assign( assign_beg, diff ); 46 | } 47 | dvector( size_t size, pointer assign_beg, pointer assign_end ) 48 | : _pData( 0 ), _size( 0 ), _reserved( 0 ) 49 | { 50 | uninitialized_alloc( size ); 51 | 52 | size_t diff = min_( size_t(assign_end - assign_beg), size ); 53 | uninitialized_assign( assign_beg, diff ); 54 | if( diff < size ) 55 | { 56 | uninitialized_construct( _pData + diff, size - diff, TObj() ); 57 | } 58 | } 59 | dvector( const dvector& op2 ) 60 | : _pData( 0 ), _size( 0 ), _reserved( 0 ) 61 | { 62 | assign( op2.begin(), op2.end() ); 63 | } 64 | 65 | ~dvector() 66 | { 67 | pointer pDataEnd = _pData + _size; 68 | pointer pData = _pData; 69 | while( pData < pDataEnd ) 70 | { 71 | destroy( pData++ ); 72 | } 73 | deallocate( _pData, _size ); 74 | } 75 | 76 | template 77 | void assign( TIter beg, TIter end ) 78 | { 79 | dvector vTmp( beg, end ); 80 | swap( vTmp ); 81 | } 82 | 83 | 84 | void resize( size_t newSize ) 85 | { 86 | dvector vTmp( newSize, _pData, _pData + _size ); 87 | 88 | swap( vTmp ); 89 | } 90 | 91 | void reserve( size_t newSize ) 92 | { 93 | if( _reserved >= newSize ) return; 94 | newSize = (newSize & (~0x1)) + 2; 95 | 96 | dvector reserve_vec( 0, newSize ); 97 | if( _size > 0 ) 98 | reserve_vec.uninitialized_assign( _pData, _size ); 99 | swap( reserve_vec ); 100 | } 101 | 102 | void push_back( const_reference obj ) 103 | { 104 | reserve( _size + 1 ); 105 | if( capacity() > _size ) 106 | { 107 | construct( _pData + _size, obj ); 108 | _size += 1; 109 | } 110 | } 111 | 112 | void clear() 113 | { 114 | pointer pDataEnd = _pData + _size; 115 | pointer pData = _pData; 116 | while( pData < pDataEnd ) 117 | { 118 | destroy( pData++ ); 119 | } 120 | deallocate( _pData, _size ); 121 | 122 | _pData = 0; 123 | _size = 0; 124 | _reserved = 0; 125 | } 126 | 127 | iterator begin() const { return _pData + 0; } 128 | iterator end() const { return _pData + _size; } 129 | 130 | reference operator[]( size_t i ) { return _pData[i]; } 131 | const_reference operator[]( size_t i ) const { return _pData[i]; } 132 | 133 | reference front() { return _pData[0]; } 134 | const_reference front() const { return _pData[0]; } 135 | 136 | reference back() { return _pData[_size-1]; } 137 | const_reference back() const { return _pData[_size-1]; } 138 | 139 | size_t size() const { return _size; } 140 | bool empty() const { return _size == 0; } 141 | size_t capacity() const { return _reserved; } 142 | 143 | pointer data() { return _pData; } 144 | const pointer data() const { return _pData; } 145 | 146 | void swap( dvector& op2 ) 147 | { 148 | std::swap( _pData, op2._pData ); 149 | std::swap( _size, op2._size ); 150 | std::swap( _reserved, op2._reserved ); 151 | } 152 | 153 | dvector& operator=( const dvector& op2 ) 154 | { 155 | dvector vTmp( op2 ); 156 | swap( vTmp ); 157 | return *this; 158 | } 159 | 160 | bool operator==( const dvector& op2 ) const 161 | { 162 | if( size() == op2.size() ) 163 | { 164 | iterator j = op2.begin(); 165 | for( iterator i = begin(); i != end(); ++i ) 166 | { 167 | if( !(*i == *j) ) 168 | return false; 169 | } 170 | return true; 171 | } 172 | return false; 173 | } 174 | bool operator!=( const dvector& op2 ) const 175 | { 176 | return !( *this == op2); 177 | } 178 | private: 179 | size_t min_( size_t a, size_t b ) 180 | { 181 | return (a < b) ? a : b; 182 | } 183 | void uninitialized_alloc( size_t s ) 184 | { 185 | _size = 0; 186 | _reserved = 0; 187 | if( s == 0 ) 188 | { 189 | _pData = 0; 190 | } 191 | else 192 | { 193 | _pData = static_cast(CoTaskMemAlloc( s * sizeof( value_type ) )); 194 | if( _pData != 0 ) 195 | _reserved = s; 196 | } 197 | } 198 | template 199 | void uninitialized_assign( TIter iter, size_t cnt ) 200 | { 201 | while( _size < cnt ) 202 | { 203 | construct( _pData + _size, *iter ); 204 | ++iter; 205 | ++_size; 206 | } 207 | } 208 | void uninitialized_construct( pointer beg, size_t cnt, const TObj& ctor ) 209 | { 210 | while( _size < cnt ) 211 | construct( beg + _size++, ctor ); 212 | } 213 | static void construct( pointer p, const value_type& value ) 214 | { 215 | new((void*)p)value_type(value); 216 | } 217 | static void destroy( pointer p ) 218 | { 219 | p->~TObj(); 220 | } 221 | void deallocate( pointer p, size_t /* num */ ) 222 | { 223 | if( p != 0 ) 224 | CoTaskMemFree( p ); 225 | } 226 | 227 | pointer _pData; 228 | size_t _size; 229 | size_t _reserved; 230 | }; 231 | }; 232 | 233 | #endif // DVECTOR_H_INC_ -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/smart_com.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef SMART_COM_H_INC_ 3 | #define SMART_COM_H_INC_ 4 | 5 | /** smart_com is a reference counting auto_ptr implementation on top of a COM object 6 | * it release its reference to the IUnknown interface, when it is destroyed 7 | * 8 | * - when smart_com objects are copied the reference count is increased 9 | * e.g. 10 | * { 11 | * smart_com a( p ); // refcount == 1 12 | * smart_com b( a ); // refcount == 2 13 | * ... 14 | * b = 0; // refcount == 1 15 | * } // refcount == 0 16 | * 17 | * - this implementation does increase the reference of passed in pointers 18 | * e.g. 19 | * { 20 | * IUnknown* p = ...; 21 | * p->AddRef(); // refcount == 1 22 | * smart_com s( p ); // refcount == 2 23 | * ... 24 | * } // refcount == 1 25 | * 26 | * - get() doesn't increment the reference counter 27 | * => so you can fill smart_com by a function which takes a pointer on pointer 28 | * e.g. 29 | * { 30 | * smart_com p; // refcount == 0 31 | * CoCreateInstance( ..., &(p.get()) ); // refcount == 1 32 | * ... 33 | * } // refcount == 0 34 | */ 35 | template 36 | class smart_com 37 | { 38 | public: 39 | typedef TComObj value_type; 40 | typedef TComObj* pointer; 41 | typedef const TComObj* const_pointer; 42 | typedef TComObj& reference; 43 | typedef const TComObj& const_reference; 44 | public: 45 | /** ctor to empty object */ 46 | /** assign pointer and increment reference */ 47 | smart_com( TComObj* p = 0 ) : m_pComPtr(p) { if( m_pComPtr ) m_pComPtr->AddRef(); } 48 | // if bAttach == true then the pointer is attached to this object but not addref'ed in the ctor 49 | explicit smart_com( TComObj* p, bool bAttach ) 50 | : m_pComPtr( p ) { if( !bAttach && m_pComPtr ) m_pComPtr->AddRef(); } 51 | /** copy constructor */ 52 | template 53 | /*explicit*/ smart_com( const smart_com& op2 ) : m_pComPtr( op2.get() ) { if( m_pComPtr ) m_pComPtr->AddRef(); } 54 | 55 | smart_com( const smart_com& op2 ) : m_pComPtr( op2.m_pComPtr ) { if( m_pComPtr ) m_pComPtr->AddRef(); } 56 | /** dtor */ 57 | ~smart_com() { destroy(); } 58 | 59 | smart_com& operator=( smart_com op2 ) 60 | { 61 | std::swap( m_pComPtr, op2.m_pComPtr ); 62 | return *this; 63 | } 64 | smart_com& operator=( pointer op2 ) 65 | { 66 | if ( op2 != m_pComPtr ) 67 | { 68 | destroy(); 69 | m_pComPtr = op2; 70 | if( m_pComPtr ) 71 | m_pComPtr->AddRef(); 72 | } 73 | return *this; 74 | } 75 | 76 | void attach( pointer p ) { destroy(); m_pComPtr = p; } 77 | pointer detach() { pointer p = 0; std::swap( m_pComPtr, p ); return p; } 78 | 79 | bool operator<( const smart_com& op2 ) const { return m_pComPtr < op2.m_pComPtr; } 80 | bool operator==( const smart_com& op2 ) const { return m_pComPtr == op2.m_pComPtr; } 81 | bool operator!=( const smart_com& op2 ) const { return m_pComPtr != op2.m_pComPtr; } 82 | bool operator==( void* p ) const { return get() == p; } 83 | bool operator!=( void* p ) const { return get() != p; } 84 | friend bool operator==( void* p, const smart_com& op2 ); 85 | friend bool operator!=( void* p, const smart_com& op2 ); 86 | 87 | reference operator*() { return *m_pComPtr; } 88 | const_reference operator*() const { return *m_pComPtr; } 89 | pointer operator->() { return m_pComPtr; } 90 | const_pointer operator->() const { return m_pComPtr; } 91 | 92 | static GUID getIID() { return __uuidof( value_type ); } 93 | 94 | // this operator provides a shortcut for QueryInterface 95 | //operator void**() { return reinterpret_cast( &m_pComPtr ); } 96 | 97 | 98 | pointer& get() { return m_pComPtr; } 99 | /** needed for CreateInstance, QueryInterface, ... */ 100 | pointer& getImpl() { return m_pComPtr; } 101 | /** return just a copy of the pointer */ 102 | pointer get() const { return m_pComPtr; } 103 | 104 | /** return an addref'ed interface pointer. Needed when you want to pass an AddRef'ed pointer by value. */ 105 | pointer getReference() const { if( get() != 0 ) { get()->AddRef(); } return get(); } 106 | 107 | /** release the current reference, set this to 0, return the pointer to the interface */ 108 | pointer release() { TComObj* p = m_pComPtr; destroy(); return p; } 109 | 110 | /** release reference and set this to 0 */ 111 | void destroy() { if ( m_pComPtr ) { m_pComPtr->Release(); m_pComPtr = 0; } } 112 | 113 | public: 114 | template 115 | smart_com QueryInterface() 116 | { 117 | return smart_com::QueryInterface(*this); 118 | } 119 | 120 | template 121 | static smart_com QueryInterface( smart_com& pObj ) 122 | { 123 | smart_com rval; 124 | if( pObj != 0 ) 125 | pObj->QueryInterface( rval.getIID(), (void**)&rval.get() ); 126 | return rval; 127 | } 128 | 129 | private: 130 | /** internal pointer to the COM interface */ 131 | pointer m_pComPtr; 132 | }; 133 | 134 | template 135 | const smart_com& smart_comAddRef( const smart_com& p ) 136 | { 137 | smart_com tmp( p ); 138 | tmp->AddRef(); 139 | return p; 140 | } 141 | 142 | /** attaches the interface to a smart_com object. 143 | * this is useful for things like : 144 | * { 145 | * TItf* p = pSth; // pSth has a ref-count of 1 146 | * smart_com pObj( p ); // adds 1 to the reference count 147 | * } // this would leave an reference count of 1 148 | * better use : 149 | * { 150 | * TItf* p = pSth; // pSth has a ref-count of 1 151 | * smart_com pObj( attach_to_smart_com( p ) ); // this does not add a reference count 152 | * } // here the reference count would be 0 153 | */ 154 | template 155 | smart_com attach_to_smart_com( TItf* pObj ) 156 | { 157 | return smart_com( pObj, true ); 158 | } 159 | 160 | template 161 | inline bool operator==( void* p, const smart_com& op2 ) 162 | { 163 | return op2.get() == p; 164 | } 165 | 166 | template 167 | inline bool operator!=( void* p, const smart_com& op2 ) 168 | { 169 | return op2.get() != p; 170 | } 171 | 172 | #endif //SMART_COM_H_INC_ -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/Codec.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef CODEC_H_INC_ 3 | #define CODEC_H_INC_ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include "udshl_defs.h" 10 | 11 | #include "smart_ptr.h" 12 | #include "smart_com.h" 13 | 14 | #include "int_interface_pre.h" 15 | #include "dvector.h" 16 | #include "dstring.h" 17 | 18 | namespace _DSHOWLIB_NAMESPACE 19 | { 20 | class AviSink; 21 | class MediaStreamSink; 22 | 23 | class Codec; 24 | 25 | typedef smart_ptr tCodecPtr; 26 | typedef std::vector tCodecList; 27 | typedef smart_ptr tCodecListPtr; 28 | 29 | /** Represents a Codec filter, which can be used in conjunction with the MediaStreamSink. */ 30 | class Codec 31 | { 32 | friend AviSink; 33 | friend MediaStreamSink; 34 | public: 35 | /** Returns a tCodecListPtr containing the video compressors that were found on your system. 36 | */ 37 | static tCodecListPtr getAvailableCodecs() 38 | { 39 | dvector > tmp = getAvailableCodecs_(); 40 | if( tmp.empty() ) 41 | return 0; 42 | return tCodecListPtr( new tCodecList( tmp.begin(), tmp.end() ) ); 43 | } 44 | 45 | ///< dtor 46 | _UDSHL_EXP_API ~Codec(); 47 | 48 | /** Returns a reference to an internal interface. 49 | * With this function you can fetch an custom interface from the codec. 50 | * To use this function your compiler must support the __uuidof operator and the interface must 51 | * be assigned an iid with the __declspec( uuid( "iid" ) ) compiler option. When this option is 52 | * not available then you should use the other function. 53 | * \param pItf 54 | * \return A reference to the interface requested or 0 if the interface is not supported. 55 | */ 56 | template 57 | smart_com getInternalInterface( smart_com& pItf ) const 58 | { 59 | return getInternalInterface( __uuidof( TItf ), pItf ); 60 | } 61 | 62 | /** Returns a reference to an internal interface. 63 | * With this function you can fetch an custom interface from the codec. 64 | * \par usage 65 | * 66 | * smart_com pItf; 67 | * if( pCodec->getInternalInterface( pItf ) == 0 ) 68 | * { 69 | * ... // interface is not supported, so error handling 70 | * } 71 | * else 72 | * { 73 | * ... // use the interface 74 | * } 75 | * 76 | * \param pItf A smart_com to a interface reference. 77 | * \param riid An interface ID. 78 | * \return A reference to the interface requested or 0 if the interface is not supported. 79 | */ 80 | template 81 | smart_com getInternalInterface( REFIID riid, smart_com& pItf ) const 82 | { 83 | pItf = 0; 84 | getInternalInterface_( riid, (void**) &pItf.get() ); 85 | return pItf; 86 | } 87 | 88 | /** Returns the readable name of this Filter */ 89 | std::string getName() const 90 | { 91 | return wstoas( toString_() ); 92 | } 93 | 94 | /** Creates a textual representation for this Codec 95 | * @return The textual representation. 96 | */ 97 | std::string toString() const 98 | { 99 | return wstoas( toString_() ); 100 | } 101 | std::wstring toStringW() const 102 | { 103 | return toString_(); 104 | } 105 | 106 | /** test if two formats are equal 107 | * @param op format to compare to this 108 | * @return true if this and op are equal, else false 109 | **/ 110 | _UDSHL_EXP_API bool operator==( const Codec& op ) const; 111 | 112 | /** test if two formats are not equal 113 | * @param op format to compare to this 114 | * @return false if this and op are equal, else true 115 | **/ 116 | _UDSHL_EXP_API bool operator!=( const Codec& op ) const; 117 | 118 | /** test if this is equal to the string passed in op 119 | * @param op item to compare to this 120 | * @return true if this and op are equal, else false 121 | **/ 122 | _UDSHL_EXP_API bool operator==( const dstringa& op ) const; 123 | _UDSHL_EXP_API bool operator==( const dstringw& op ) const; 124 | 125 | /** returns true if this CODEC has an Dialog. */ 126 | _UDSHL_EXP_API bool hasDialog() const; 127 | 128 | /** calls the Dialog and saves the Data retrieved after the operation in the local buffer.*/ 129 | _UDSHL_EXP_API bool callDialog( HWND hParent = 0 ); 130 | 131 | /** returns true if the codec contained is an Video for Windows CODEC */ 132 | _UDSHL_EXP_API bool isVfwCodec() const; 133 | 134 | /** Returns if you can get/set the codec data. 135 | * @return true/false 136 | */ 137 | _UDSHL_EXP_API bool hasSettings() const; 138 | 139 | /** Returns a string containing the settings of the codec. 140 | * The string may be empty, when no data can be saved/restored by the codec. 141 | */ 142 | std::string getSettings() const 143 | { 144 | return wstoas( getSettings_() ); 145 | } 146 | std::wstring getSettingsW() const 147 | { 148 | return getSettings_(); 149 | } 150 | 151 | /** This method is used to set previously retrieved codec data. 152 | * @return true on success, false on failure 153 | */ 154 | _UDSHL_EXP_API bool setSettings( const dstringa& data ); 155 | _UDSHL_EXP_API bool setSettings( const dstringw& data ); 156 | private: 157 | _UDSHL_EXP_API 158 | static dvector > getAvailableCodecs_(); 159 | _UDSHL_EXP_API 160 | dstringw toString_() const; 161 | _UDSHL_EXP_API 162 | dstringw getSettings_() const; 163 | 164 | _UDSHL_EXP_API HRESULT getInternalInterface_( REFIID riid, void** ppv ); 165 | 166 | /// internal ctor 167 | Codec( const smart_com& op2 ); 168 | Codec( const smart_com& op2 ); 169 | 170 | bool setCodecData( BYTE* pData, DWORD data_size, bool bPure ); 171 | bool getCodecData( BYTE* pData, DWORD& size, bool bPure ) const; 172 | 173 | /** returns the pointer to the current compressor filter, only needed in build filter graph in grabber.cpp */ 174 | smart_com getFilter() const; 175 | 176 | /// the user friendly readable name 177 | dstringw m_ReadableName; 178 | 179 | /// holds the information to create a filter 180 | mutable smart_com m_pFilterInfo; 181 | mutable smart_com m_pFilter; ///< Instance of the compressor filter 182 | }; 183 | }; 184 | 185 | #endif // CODEC_H_INC_ 186 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/MediaStreamContainer.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MEDIASTREAMCONTAINER_H_INC_ 3 | #define MEDIASTREAMCONTAINER_H_INC_ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include "udshl_defs.h" 10 | #include "smart_com.h" 11 | 12 | #include "int_interface_pre.h" 13 | 14 | #include "dstring.h" 15 | #include "dvector.h" 16 | 17 | namespace _DSHOWLIB_NAMESPACE 18 | { 19 | class MediaStreamSink; 20 | class MediaStreamContainer; 21 | 22 | typedef smart_ptr tMediaStreamContainerPtr; 23 | typedef std::vector tMediaStreamContainerList; 24 | typedef smart_ptr tMediaStreamContainerListPtr; 25 | 26 | _UDSHL_EXP_API extern const GUID MSC_AviContainer; 27 | _UDSHL_EXP_API extern const GUID MSC_OGMContainer; 28 | _UDSHL_EXP_API extern const GUID MSC_MatroskaContainer; 29 | 30 | /** This class represents a media stream container, which represents the container destination for 31 | * media streams. 32 | * Standard container types are "AVI" or "OGM". 33 | */ 34 | class MediaStreamContainer 35 | { 36 | friend MediaStreamSink; 37 | public: 38 | /// dtor 39 | _UDSHL_EXP_API ~MediaStreamContainer(); 40 | 41 | /** Returns a list of available container types. 42 | * @return May be 0 when a critical error occurred. May be empty (size() == 0) when no containers were found. 43 | * Otherwise contains the available containers as present in the system. 44 | */ 45 | _UDSHL_EXP_API static dvector > getAvailableMediaStreamContainers_(); 46 | static tMediaStreamContainerListPtr getAvailableMediaStreamContainers() 47 | { 48 | dvector > rval = getAvailableMediaStreamContainers_(); 49 | return new tMediaStreamContainerList( rval.begin(), rval.end() ); 50 | } 51 | 52 | /** Creates the container specified with the id. 53 | * @param id The container id of the container. 54 | * @return 0 when the container could not be found/created, otherwise a reference to the container. 55 | */ 56 | _UDSHL_EXP_API static tMediaStreamContainerPtr create( const GUID& id ); 57 | 58 | /** This creates a copy of the stream container, which is completely independent from the 59 | * current object, but copies the internal state and data of the container. 60 | * @return 61 | */ 62 | _UDSHL_EXP_API tMediaStreamContainerPtr clone() const; 63 | 64 | /** Returns a reference to an internal interface. 65 | * With this function you can fetch an custom interface from the codec. 66 | * To use this function your compiler must support the __uuidof operator and the interface must 67 | * be assigned an iid with the __declspec( uuid( "iid" ) ) compiler option. When this option is 68 | * not available then you should use the other function. 69 | * \param pItf 70 | * \return A reference to the interface requested or 0 if the interface is not supported. 71 | */ 72 | template 73 | smart_com getInternalInterface( smart_com& pItf ) const 74 | { 75 | return getInternalInterface( __uuidof( TItf ), pItf ); 76 | } 77 | 78 | /** Returns a reference to an internal interface. 79 | * With this function you can fetch an custom interface from the codec. 80 | * \par usage 81 | * 82 | * smart_com pItf; 83 | * if( pFilterInfoObject->getInternalInterface( pItf ) == 0 ) 84 | * { 85 | * ... // interface is not supported, so error handling 86 | * } 87 | * else 88 | * { 89 | * ... // use the interface 90 | * } 91 | * 92 | * \param pItf A smart_com to a interface reference. 93 | * \param riid An interface ID. 94 | * \return A reference to the interface requested or 0 if the interface is not supported. 95 | */ 96 | template 97 | smart_com getInternalInterface( REFIID riid, smart_com& pItf ) const 98 | { 99 | pItf = 0; 100 | getInternalInterface_( riid, (void**) &pItf.get() ); 101 | return pItf; 102 | } 103 | 104 | /** The string representation of this container. */ 105 | std::string getDescription() const 106 | { 107 | return toString(); 108 | } 109 | std::wstring getDescriptionW() const 110 | { 111 | return toStringW(); 112 | } 113 | /** The string representation of this container. */ 114 | std::string toString() const 115 | { 116 | return wstoas( toString_() ); 117 | } 118 | std::wstring toStringW() const 119 | { 120 | return toString_(); 121 | } 122 | 123 | _UDSHL_EXP_API bool operator==( const dstringa& ) const; 124 | _UDSHL_EXP_API bool operator==( const dstringw& ) const; 125 | 126 | /** Returns the unique container ID, which you can use to create the container without refering to 127 | * the description string. 128 | */ 129 | _UDSHL_EXP_API GUID getMediaStreamContainerID() const; 130 | 131 | /** Returns if this sink does support a codec. If yes then you can create a sink 132 | * with a FilterInfoObject which contains the codec to use. 133 | * Certain container do support codecs, like AVI others don't like MPEG2. 134 | */ 135 | _UDSHL_EXP_API bool isCustomCodecSupported() const; 136 | 137 | /** Returns the standard file extension used by this container. 138 | * e.g. "avi" for AVI files. 139 | * @return The file extension. 140 | */ 141 | std::string getPreferredFileExtension() const 142 | { 143 | return wstoas( getPreferredFileExtension_() ); 144 | } 145 | std::wstring getPreferredFileExtensionW() const 146 | { 147 | return getPreferredFileExtension_(); 148 | } 149 | private: 150 | _UDSHL_EXP_API dstringw getPreferredFileExtension_() const; 151 | _UDSHL_EXP_API dstringw toString_() const; 152 | 153 | /// copy ctor 154 | MediaStreamContainer( const MediaStreamContainer& ); 155 | 156 | MediaStreamContainer& operator=( const MediaStreamContainer& ); 157 | 158 | MediaStreamContainer( const smart_com& pF ); 159 | MediaStreamContainer( const smart_com& pInfo, 160 | const smart_com& pF ); 161 | 162 | _UDSHL_EXP_API HRESULT getInternalInterface_( REFIID riid, void** ppv ); 163 | 164 | smart_com getFilter() const; 165 | 166 | mutable smart_com m_pFWFilter; 167 | mutable smart_com m_pFWFilterInfo; 168 | }; 169 | }; 170 | 171 | #endif // MEDIASTREAMCONTAINER_H_INC_ 172 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/IVCDPropertyInterfaces.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef IVCDPROPERTYINTERFACES_H_INC_ 3 | #define IVCDPROPERTYINTERFACES_H_INC_ 4 | 5 | #include "IVCDProperty.h" 6 | 7 | namespace _DSHOWLIB_NAMESPACE 8 | { 9 | // {99B44940-BFE1-4083-ADA1-BE703F4B8E03} 10 | static const GUID IID_IVCDRangeProperty = { 0x99B44940, 0xBFE1, 0x4083, { 0xAD, 0xA1, 0xBE, 0x70, 0x3F, 0x4B, 0x8E, 0x03 } }; 11 | // {99B44940-BFE1-4083-ADA1-BE703F4B8E04} 12 | static const GUID IID_IVCDSwitchProperty = { 0x99B44940, 0xBFE1, 0x4083, { 0xAD, 0xA1, 0xBE, 0x70, 0x3F, 0x4B, 0x8E, 0x04 } }; 13 | // {99B44940-BFE1-4083-ADA1-BE703F4B8E05} 14 | static const GUID IID_IVCDButtonProperty = { 0x99B44940, 0xBFE1, 0x4083, { 0xAD, 0xA1, 0xBE, 0x70, 0x3F, 0x4B, 0x8E, 0x05 } }; 15 | // {99B44940-BFE1-4083-ADA1-BE703F4B8E06} 16 | static const GUID IID_IVCDMapStringsProperty = { 0x99B44940, 0xBFE1, 0x4083, { 0xAD, 0xA1, 0xBE, 0x70, 0x3F, 0x4B, 0x8E, 0x06 } }; 17 | // {99B44940-BFE1-4083-ADA1-BE703F4B8E08} 18 | static const GUID IID_IVCDAbsoluteValueProperty = { 0x99B44940, 0xBFE1, 0x4083, { 0xAD, 0xA1, 0xBE, 0x70, 0x3F, 0x4B, 0x8E, 0x08 } }; 19 | // {99B44940-BFE1-4083-ADA1-BE703F4B8E09} 20 | static const GUID IID_IVCDHexProperty = { 0x99B44940, 0xBFE1, 0x4083, { 0xAD, 0xA1, 0xBE, 0x70, 0x3F, 0x4B, 0x8E, 0x09 } }; 21 | // {99B44940-BFE1-4083-ADA1-BE703F4B8E0A} 22 | static const GUID IID_IVCDSwitchProperty2 = { 0x99B44940, 0xBFE1, 0x4083, { 0xAD, 0xA1, 0xBE, 0x70, 0x3F, 0x4B, 0x8E, 0x0A } }; 23 | 24 | struct DEF_INTERFACE_GUID("99B44940-BFE1-4083-ADA1-BE703F4B8E03") IVCDRangeProperty; 25 | struct DEF_INTERFACE_GUID("99B44940-BFE1-4083-ADA1-BE703F4B8E04") IVCDSwitchProperty; 26 | struct DEF_INTERFACE_GUID("99B44940-BFE1-4083-ADA1-BE703F4B8E05") IVCDButtonProperty; 27 | struct DEF_INTERFACE_GUID("99B44940-BFE1-4083-ADA1-BE703F4B8E06") IVCDMapStringsProperty; 28 | struct DEF_INTERFACE_GUID("99B44940-BFE1-4083-ADA1-BE703F4B8E08") IVCDAbsoluteValueProperty; 29 | struct DEF_INTERFACE_GUID("99B44940-BFE1-4083-ADA1-BE703F4B8E09") IVCDHexPropertyInterface; 30 | struct DEF_INTERFACE_GUID("99B44940-BFE1-4083-ADA1-BE703F4B8E0A") IVCDSwitchProperty2; 31 | 32 | struct IVCDRangeProperty : public IVCDPropertyInterface 33 | { 34 | public: 35 | STDMETHOD(get_Value)( long* pVal ) const = 0; 36 | STDMETHOD(put_Value)( long Val ) = 0; 37 | STDMETHOD(get_RangeMin)( long* pMin ) const = 0; 38 | STDMETHOD(get_RangeMax)( long* pMax ) const = 0; 39 | STDMETHOD(get_Default)( long* pDef ) const = 0; 40 | STDMETHOD(get_Delta)( long* pDelta ) const = 0; 41 | 42 | public: // C++ methods 43 | std::pair getRange() const; 44 | long getRangeMin() const; 45 | long getRangeMax() const; 46 | 47 | long getValue() const; 48 | void setValue( long val ); 49 | 50 | long getDefault() const; 51 | long getDelta() const; 52 | }; 53 | 54 | struct IVCDSwitchProperty : public IVCDPropertyInterface 55 | { 56 | public: 57 | STDMETHOD(get_Switch)( VARIANT_BOOL* pVal ) const = 0; 58 | STDMETHOD(put_Switch)( VARIANT_BOOL Val ) = 0; 59 | 60 | void setSwitch( bool b ); 61 | bool getSwitch(); 62 | }; 63 | 64 | struct IVCDSwitchProperty2 : public IVCDSwitchProperty 65 | { 66 | public: 67 | STDMETHOD(get_Default)( VARIANT_BOOL* pVal ) const = 0; 68 | 69 | bool hasDefault(); 70 | bool getDefault(); 71 | }; 72 | 73 | struct IVCDButtonProperty : public IVCDPropertyInterface 74 | { 75 | public: 76 | STDMETHOD(Push)()= 0; 77 | 78 | void push(); 79 | }; 80 | 81 | struct IVCDMapStringsProperty : public IVCDRangeProperty 82 | { 83 | public: 84 | STDMETHOD(get_Strings)( IBSTRCollection** pStringMap ) const = 0; 85 | STDMETHOD(get_String)( BSTR* pString ) const = 0; 86 | STDMETHOD(put_String)( BSTR String ) = 0; 87 | 88 | public: // C++ interface 89 | typedef std::vector tStringVecW; 90 | typedef std::vector tStringVec; 91 | 92 | tStringVecW getStringsW() const; 93 | tStringVecW& getStringsW( tStringVecW& vec ) const; 94 | tStringVec getStrings() const; 95 | tStringVec& getStrings( tStringVec& vec ) const; 96 | 97 | void setString( const std::wstring& str ); 98 | void setString( const std::string& str ); 99 | std::wstring getStringW() const; 100 | std::string getString() const; 101 | }; 102 | 103 | struct IVCDAbsoluteValueProperty : public IVCDPropertyInterface 104 | { 105 | public: 106 | STDMETHOD(get_Value)( double* pVal ) const = 0; 107 | STDMETHOD(put_Value)( double Val ) = 0; 108 | STDMETHOD(get_RangeMin)( double* pMin ) const = 0; 109 | STDMETHOD(get_RangeMax)( double* pMax ) const = 0; 110 | STDMETHOD(get_Default)( double* pDef ) const = 0; 111 | STDMETHOD(get_DimType)( BSTR* pDimType ) const = 0; 112 | STDMETHOD(get_DimFunction)( long* pDimFunction ) const = 0; 113 | public: // C++ methods 114 | enum tAbsDimFunction 115 | { 116 | eLinear = 0x1, 117 | eLog = 0x2, 118 | eOther = 0x3, // >= eOther are other types of functions, currently not defined (use eLinear) 119 | }; 120 | 121 | std::pair getRange() const; 122 | double getRangeMin() const; 123 | double getRangeMax() const; 124 | 125 | double getValue() const; 126 | void setValue( double val ); 127 | double getDefault() const; 128 | 129 | std::wstring getDimTypeW() const; 130 | std::string getDimTypeA() const; 131 | std::string getDimType() const; 132 | 133 | tAbsDimFunction getDimFunction() const; 134 | }; 135 | 136 | struct IVCDHexPropertyInterface : public IVCDPropertyInterface 137 | { 138 | public: 139 | typedef unsigned __int64 uint64_t; 140 | 141 | STDMETHOD(get_Value)( uint64_t* pVal ) const = 0; 142 | STDMETHOD(put_Value)( uint64_t Val ) = 0; 143 | STDMETHOD(get_Mask)( uint64_t* pVal ) const = 0; 144 | public: // C++ methods 145 | uint64_t getValue() const; 146 | void setValue( uint64_t val ); 147 | 148 | uint64_t getMask() const; 149 | }; 150 | 151 | 152 | typedef smart_com tIVCDRangePropertyPtr; 153 | typedef smart_com tIVCDSwitchPropertyPtr; 154 | typedef smart_com tIVCDSwitchProperty2Ptr; 155 | typedef smart_com tIVCDButtonPropertyPtr; 156 | typedef smart_com tIVCDMapStringsPropertyPtr; 157 | typedef smart_com tIVCDAbsoluteValuePropertyPtr; 158 | }; 159 | 160 | #include "IVCDPropertyInterfaces_inl.h" 161 | 162 | #endif // IVCDPROPERTYINTERFACES_H_INC_ -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/VideoFormatItem.h: -------------------------------------------------------------------------------- 1 | // VideoFormatItem.h: interface for the VideoFormatItem class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_VIDEOFORMATITEM_H__AD23522D_3281_4115_8943_C22F95EE0957__INCLUDED_) 6 | #define AFX_VIDEOFORMATITEM_H__AD23522D_3281_4115_8943_C22F95EE0957__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include 13 | #include "udshl_defs.h" 14 | 15 | #include "int_interface_pre.h" 16 | #include "dstring.h" 17 | 18 | namespace dshowlib_dll 19 | { 20 | struct sTISScanningModeInfo; 21 | } 22 | 23 | namespace _DSHOWLIB_NAMESPACE 24 | { 25 | class Grabber; 26 | class GrabberPImpl; 27 | class VideoFormatDesc; 28 | class CSourceFilterType; 29 | 30 | /** Represents a certain Video Format with its size and MEDIASUBTYPE/Colorformat. 31 | * All members will deliver valid values only if isValid() returns true 32 | **/ 33 | class VideoFormatItem 34 | { 35 | friend Grabber; 36 | friend GrabberPImpl; 37 | friend VideoFormatDesc; 38 | friend CSourceFilterType; 39 | public: 40 | /** constructs an empty VideoFormatItem 41 | * the constructed item is invalid (see isValid()) 42 | * @see isValid() 43 | **/ 44 | _UDSHL_EXP_API VideoFormatItem(); 45 | /** copies a VideoFormatItem 46 | * @param op the VideoFormatItem to copy 47 | **/ 48 | _UDSHL_EXP_API VideoFormatItem( const VideoFormatItem& op ); 49 | /** dtor */ 50 | _UDSHL_EXP_API ~VideoFormatItem(); 51 | 52 | /** assignment operator 53 | * @param op2 op2 54 | */ 55 | _UDSHL_EXP_API VideoFormatItem& operator=( const VideoFormatItem& op2 ); 56 | 57 | /** test if instance is a valid format 58 | * @return true if this is valid 59 | **/ 60 | _UDSHL_EXP_API bool isValid() const; 61 | 62 | /** get size of format 63 | * @return the size of a frame with this format in a SIZE struct 64 | **/ 65 | _UDSHL_EXP_API SIZE getSize() const; 66 | 67 | /** get the bit count per pixel. 68 | */ 69 | _UDSHL_EXP_API DWORD getBitsPerPixel() const; 70 | 71 | /** get color format 72 | * @return the GUID of the color format of this format 73 | **/ 74 | _UDSHL_EXP_API GUID getColorformat() const; 75 | _UDSHL_EXP_API GUID getSubtype() const; 76 | 77 | /** get binning factor 78 | * 79 | **/ 80 | UDSHL_DEPRECATE_FUNCTION_T_( "VideoFormatItem::getBinningFactorHorizontal() and VideoFormatItem::getBinningFactorVertical() methods" ) 81 | _UDSHL_EXP_API int getBinningFactor() const; 82 | 83 | _UDSHL_EXP_API int getBinningFactorHorizontal() const; 84 | _UDSHL_EXP_API int getBinningFactorVertical() const; 85 | _UDSHL_EXP_API int getSkippingFactorHorizontal() const; 86 | _UDSHL_EXP_API int getSkippingFactorVertical() const; 87 | 88 | /** 89 | * Internal use only 90 | **/ 91 | int getBinningModeId() const { return m_binningModeId; } 92 | 93 | /** get string representing the Format 94 | * @return a string representation describing the format 95 | * @see operator std::string () 96 | **/ 97 | UDSHL_DEPRECATE_FUNCTION_T_( "VideoFormatItem::toString() method" ) 98 | _UDSHL_EXP_API const char* c_str() const; 99 | 100 | /** Creates a textual representation for this VideoFormatItem 101 | * @return The textual representation. 102 | */ 103 | std::string toString() const 104 | { 105 | return wstoas( toString_() ); 106 | } 107 | std::wstring toStringW() const 108 | { 109 | return toString_(); 110 | } 111 | 112 | /** get string representing the dimensions of this format 113 | * @return a string representing the size of a frame with this format 114 | **/ 115 | std::string getSizeString() const 116 | { 117 | return getSizeString_(); 118 | } 119 | 120 | 121 | /** get string representing the color format of this format 122 | * @return string representing the color format of this format 123 | **/ 124 | std::string getColorformatString() const 125 | { 126 | return wstoas( getColorformatString_() ); 127 | } 128 | std::wstring getColorformatStringW() const 129 | { 130 | return getColorformatString_(); 131 | } 132 | 133 | _UDSHL_EXP_API bool operator<( const VideoFormatItem& op ) const; 134 | 135 | /** test if two formats are equal 136 | * @param op format to compare to this 137 | * @return true if this and op are equal, else false 138 | **/ 139 | _UDSHL_EXP_API bool operator==( const VideoFormatItem& op ) const; 140 | 141 | /** test if two formats are not equal 142 | * @param op format to compare to this 143 | * @return false if this and op are equal, else true 144 | **/ 145 | _UDSHL_EXP_API bool operator!=( const VideoFormatItem& op ) const; 146 | 147 | /** test if this is equal to the string passed in op 148 | * @param op item to compare to this 149 | * @return true if this and op are equal, else false 150 | **/ 151 | _UDSHL_EXP_API bool operator==( const dstringa& op ) const; 152 | _UDSHL_EXP_API bool operator==( const dstringw& op ) const; 153 | 154 | /** generates an invalid item 155 | * @return an invalid item 156 | * @see isValid() 157 | **/ 158 | _UDSHL_EXP_API static VideoFormatItem createInvalid(); 159 | 160 | 161 | /** get internal VideoFormat. should not be used 162 | * @deprecated this function should only be used in the library, but not outside, because you can't do anything with 163 | * a VideoFormat outside 164 | */ 165 | _UDSHL_EXP_API win32_utils::CVideoFormat getVideoFormat() const; 166 | private: 167 | _UDSHL_EXP_API dstringa getSizeString_() const; 168 | _UDSHL_EXP_API dstringw toString_() const; 169 | _UDSHL_EXP_API dstringw getColorformatString_() const; 170 | 171 | win32_utils::CVideoFormat* get() { return m_pInternalData; } 172 | const win32_utils::CVideoFormat* get() const { return m_pInternalData; } 173 | 174 | /** constructs a VideoFormatItem from a VideoFormat 175 | * @param op2 176 | **/ 177 | VideoFormatItem( const win32_utils::CVideoFormat& op2, const dshowlib_dll::sTISScanningModeInfo& smi ); 178 | VideoFormatItem( const win32_utils::CVideoFormat& op2, int binId, int binH, int binV, int skipH, int skipV ); 179 | 180 | win32_utils::CVideoFormat* m_pInternalData; 181 | int m_binningModeId; 182 | int m_binningHorizontal; 183 | int m_binningVertical; 184 | int m_skippingHorizontal; 185 | int m_skippingVertical; 186 | 187 | void initVideoFormatStringMember(); 188 | 189 | dstringa m_VideoFormatString; 190 | }; 191 | 192 | }; 193 | 194 | #endif // !defined(AFX_VIDEOFORMATITEM_H__AD23522D_3281_4115_8943_C22F95EE0957__INCLUDED_) 195 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/c++,opencv,visualstudio 3 | 4 | ### C++ ### 5 | # Prerequisites 6 | *.d 7 | 8 | # Compiled Object files 9 | *.slo 10 | *.lo 11 | *.o 12 | *.obj 13 | 14 | # Precompiled Headers 15 | *.gch 16 | *.pch 17 | 18 | # Compiled Dynamic libraries 19 | *.so 20 | *.dylib 21 | *.dll 22 | 23 | # Fortran module files 24 | *.mod 25 | *.smod 26 | 27 | # Compiled Static libraries 28 | *.lai 29 | *.la 30 | *.a 31 | *.lib 32 | 33 | # Executables 34 | *.exe 35 | *.out 36 | *.app 37 | 38 | ### OpenCV ### 39 | #OpenCV for Mac and Linux 40 | #build and release folders 41 | */CMakeFiles 42 | */CMakeCache.txt 43 | */Makefile 44 | */cmake_install.cmake 45 | .DS_Store 46 | 47 | ### VisualStudio ### 48 | ## Ignore Visual Studio temporary files, build results, and 49 | ## files generated by popular Visual Studio add-ons. 50 | ## 51 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 52 | 53 | # User-specific files 54 | *.suo 55 | *.user 56 | *.userosscache 57 | *.sln.docstates 58 | 59 | # User-specific files (MonoDevelop/Xamarin Studio) 60 | *.userprefs 61 | 62 | # Build results 63 | [Dd]ebug/ 64 | [Dd]ebugPublic/ 65 | [Rr]elease/ 66 | [Rr]eleases/ 67 | x64/ 68 | x86/ 69 | bld/ 70 | [Bb]in/ 71 | [Oo]bj/ 72 | [Ll]og/ 73 | 74 | # Visual Studio 2015 cache/options directory 75 | .vs/ 76 | # Uncomment if you have tasks that create the project's static files in wwwroot 77 | #wwwroot/ 78 | 79 | # MSTest test Results 80 | [Tt]est[Rr]esult*/ 81 | [Bb]uild[Ll]og.* 82 | 83 | # NUNIT 84 | *.VisualState.xml 85 | TestResult.xml 86 | 87 | # Build Results of an ATL Project 88 | [Dd]ebugPS/ 89 | [Rr]eleasePS/ 90 | dlldata.c 91 | 92 | # .NET Core 93 | project.lock.json 94 | project.fragment.lock.json 95 | artifacts/ 96 | **/Properties/launchSettings.json 97 | 98 | *_i.c 99 | *_p.c 100 | *_i.h 101 | *.ilk 102 | *.meta 103 | *.pdb 104 | *.pgc 105 | *.pgd 106 | *.rsp 107 | *.sbr 108 | *.tlb 109 | *.tli 110 | *.tlh 111 | *.tmp 112 | *.tmp_proj 113 | *.log 114 | *.vspscc 115 | *.vssscc 116 | .builds 117 | *.pidb 118 | *.svclog 119 | *.scc 120 | 121 | # Chutzpah Test files 122 | _Chutzpah* 123 | 124 | # Visual C++ cache files 125 | ipch/ 126 | *.aps 127 | *.ncb 128 | *.opendb 129 | *.opensdf 130 | *.sdf 131 | *.cachefile 132 | *.VC.db 133 | *.VC.VC.opendb 134 | 135 | # Visual Studio profiler 136 | *.psess 137 | *.vsp 138 | *.vspx 139 | *.sap 140 | 141 | # TFS 2012 Local Workspace 142 | $tf/ 143 | 144 | # Guidance Automation Toolkit 145 | *.gpState 146 | 147 | # ReSharper is a .NET coding add-in 148 | _ReSharper*/ 149 | *.[Rr]e[Ss]harper 150 | *.DotSettings.user 151 | 152 | # JustCode is a .NET coding add-in 153 | .JustCode 154 | 155 | # TeamCity is a build add-in 156 | _TeamCity* 157 | 158 | # DotCover is a Code Coverage Tool 159 | *.dotCover 160 | 161 | # Visual Studio code coverage results 162 | *.coverage 163 | *.coveragexml 164 | 165 | # NCrunch 166 | _NCrunch_* 167 | .*crunch*.local.xml 168 | nCrunchTemp_* 169 | 170 | # MightyMoose 171 | *.mm.* 172 | AutoTest.Net/ 173 | 174 | # Web workbench (sass) 175 | .sass-cache/ 176 | 177 | # Installshield output folder 178 | [Ee]xpress/ 179 | 180 | # DocProject is a documentation generator add-in 181 | DocProject/buildhelp/ 182 | DocProject/Help/*.HxT 183 | DocProject/Help/*.HxC 184 | DocProject/Help/*.hhc 185 | DocProject/Help/*.hhk 186 | DocProject/Help/*.hhp 187 | DocProject/Help/Html2 188 | DocProject/Help/html 189 | 190 | # Click-Once directory 191 | publish/ 192 | 193 | # Publish Web Output 194 | *.[Pp]ublish.xml 195 | *.azurePubxml 196 | # TODO: Uncomment the next line to ignore your web deploy settings. 197 | # By default, sensitive information, such as encrypted password 198 | # should be stored in the .pubxml.user file. 199 | #*.pubxml 200 | *.pubxml.user 201 | *.publishproj 202 | 203 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 204 | # checkin your Azure Web App publish settings, but sensitive information contained 205 | # in these scripts will be unencrypted 206 | PublishScripts/ 207 | 208 | # NuGet Packages 209 | *.nupkg 210 | # The packages folder can be ignored because of Package Restore 211 | **/packages/* 212 | # except build/, which is used as an MSBuild target. 213 | !**/packages/build/ 214 | # Uncomment if necessary however generally it will be regenerated when needed 215 | #!**/packages/repositories.config 216 | # NuGet v3's project.json files produces more ignorable files 217 | *.nuget.props 218 | *.nuget.targets 219 | 220 | # Microsoft Azure Build Output 221 | csx/ 222 | *.build.csdef 223 | 224 | # Microsoft Azure Emulator 225 | ecf/ 226 | rcf/ 227 | 228 | # Windows Store app package directories and files 229 | AppPackages/ 230 | BundleArtifacts/ 231 | Package.StoreAssociation.xml 232 | _pkginfo.txt 233 | 234 | # Visual Studio cache files 235 | # files ending in .cache can be ignored 236 | *.[Cc]ache 237 | # but keep track of directories ending in .cache 238 | !*.[Cc]ache/ 239 | 240 | # Others 241 | ClientBin/ 242 | ~$* 243 | *~ 244 | *.dbmdl 245 | *.dbproj.schemaview 246 | *.jfm 247 | *.pfx 248 | *.publishsettings 249 | orleans.codegen.cs 250 | 251 | # Since there are multiple workflows, uncomment next line to ignore bower_components 252 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 253 | #bower_components/ 254 | 255 | # RIA/Silverlight projects 256 | Generated_Code/ 257 | 258 | # Backup & report files from converting an old project file 259 | # to a newer Visual Studio version. Backup files are not needed, 260 | # because we have git ;-) 261 | _UpgradeReport_Files/ 262 | Backup*/ 263 | UpgradeLog*.XML 264 | UpgradeLog*.htm 265 | 266 | # SQL Server files 267 | *.mdf 268 | *.ldf 269 | *.ndf 270 | 271 | # Business Intelligence projects 272 | *.rdl.data 273 | *.bim.layout 274 | *.bim_*.settings 275 | 276 | # Microsoft Fakes 277 | FakesAssemblies/ 278 | 279 | # GhostDoc plugin setting file 280 | *.GhostDoc.xml 281 | 282 | # Node.js Tools for Visual Studio 283 | .ntvs_analysis.dat 284 | node_modules/ 285 | 286 | # Typescript v1 declaration files 287 | typings/ 288 | 289 | # Visual Studio 6 build log 290 | *.plg 291 | 292 | # Visual Studio 6 workspace options file 293 | *.opt 294 | 295 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 296 | *.vbw 297 | 298 | # Visual Studio LightSwitch build output 299 | **/*.HTMLClient/GeneratedArtifacts 300 | **/*.DesktopClient/GeneratedArtifacts 301 | **/*.DesktopClient/ModelManifest.xml 302 | **/*.Server/GeneratedArtifacts 303 | **/*.Server/ModelManifest.xml 304 | _Pvt_Extensions 305 | 306 | # Paket dependency manager 307 | .paket/paket.exe 308 | paket-files/ 309 | 310 | # FAKE - F# Make 311 | .fake/ 312 | 313 | # JetBrains Rider 314 | .idea/ 315 | *.sln.iml 316 | 317 | # CodeRush 318 | .cr/ 319 | 320 | # Python Tools for Visual Studio (PTVS) 321 | __pycache__/ 322 | *.pyc 323 | 324 | # Cake - Uncomment if you are using it 325 | # tools/** 326 | # !tools/packages.config 327 | 328 | # Telerik's JustMock configuration file 329 | *.jmconfig 330 | 331 | # BizTalk build output 332 | *.btp.cs 333 | *.btm.cs 334 | *.odx.cs 335 | *.xsd.cs 336 | 337 | ### VisualStudio Patch ### 338 | # By default, sensitive information, such as encrypted password 339 | # should be stored in the .pubxml.user file. 340 | 341 | 342 | # End of https://www.gitignore.io/api/c++,opencv,visualstudio 343 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/iframe_def.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | 6 | #include "udshl_defs.h" 7 | #include "simplectypes.h" 8 | #include "dvector.h" 9 | 10 | 11 | namespace _DSHOWLIB_NAMESPACE 12 | { 13 | struct FrameTypeInfo; 14 | 15 | /** An object implementing the IFrame interface permits access to its image data and the 16 | * frame type of the image. 17 | * 18 | * The pointer returned from getPtr may only be valid in the scope of the function in which get a reference 19 | * to the IFrame passed in. 20 | */ 21 | class IFrame 22 | { 23 | public: 24 | /** Returns the frame type of this frame. */ 25 | virtual const FrameTypeInfo& getFrameType() const = 0; 26 | 27 | /** Get pointer to the frame data. 28 | * @return pointer to the frame buffer. This may be 0. 29 | **/ 30 | virtual BYTE* getPtr() const = 0; 31 | 32 | /** Returns the sample description. */ 33 | virtual const tsMediaSampleDesc& getSampleDesc() const = 0; 34 | 35 | /* Retrieves the extended sample info 36 | * You have to supply a copy target. When the buffer is too small, no data is copied. 37 | * 38 | * Internal function, use media_sample_info::fill to fill the according structure and then perform the necessary operations on that. 39 | * 40 | * @param data_available contains the count of bytes that are available. 41 | * @return Returns false when no data is available or the buffer passed in is too small, 42 | * true otherwise. 43 | */ 44 | virtual bool getMediaSampleInfo_( void* buffer, int buffer_len, int& data_available ) const = 0; 45 | }; 46 | 47 | struct MediaSampleInfo; 48 | 49 | struct MediaSampleInfoDataStore 50 | { 51 | dvector data; 52 | 53 | bool update( const IFrame& frame ); 54 | 55 | /* 56 | * Finds the chunk with the according id. 57 | * REturns either the pointer to the specific chunk or NULL 58 | */ 59 | 60 | UDSHL_EXP_API_ const uint8_t* findChunk( int& data_len, uint32_t chunk_id ) const; 61 | UDSHL_EXP_API_ const MediaSampleInfo* findSampleInfo() const; 62 | /* 63 | * Enumerates the chunks present in data. 64 | * The passed in function object must have the signature of 65 | bool (* func)( uint32_t chunk_id, const uint8_t* chun_data, uint32_t chunk_data_len ) 66 | * 67 | */ 68 | template 69 | void enumChunkItems( TFunc func ) const; 70 | 71 | template 72 | const TStruct* findChunk( uint32_t chunk_id ) const; 73 | 74 | template 75 | const TStruct* findChunk() const; 76 | }; 77 | 78 | #pragma pack(push,1) 79 | struct MediaSampleInfo 80 | { 81 | enum { static_chunk_id = 'info' }; 82 | 83 | uint64_t driver_frame_number; 84 | uint64_t driver_frame_first_packet_time; // in us 85 | uint64_t driver_frame_last_packet_time; // in us 86 | 87 | uint64_t device_time_stamp; // this is the timestamp as supplied by the device, maybe 0 if not available 88 | uint64_t device_frame_number; // this is the frame number as supplied by the device, maybe 0 if not available. 89 | // note that this is device dependent. eg. GigECam wraps to 1 after hitting 2 ^ 16 90 | 91 | uint32_t packet_resends_this_frame; // only applicable for devices with packet resend 92 | uint32_t bytes_missing_this_frame; // number of bytes missing this frame, most likely 0, otherwise this was delivered with DropIncompleteFrames disabled 93 | // note that the bytes missing can be at the end or in the center depending on the protocol used 94 | 95 | uint32_t frame_flags; // 96 | }; 97 | 98 | struct MediaSampleInfoMultiFrameSetFrameId 99 | { 100 | // This is the multi frame set frame id chunk sent by cameras with IMX174, IMX250, IMX252 sensors 101 | enum { static_chunk_id = 0x13370002 }; 102 | 103 | uint32_t reserved0 : 28; 104 | uint32_t frame_id : 2; 105 | uint32_t frame_set : 1; 106 | uint32_t reserved1 : 1; 107 | }; 108 | 109 | #pragma pack(pop) 110 | 111 | template 112 | inline void MediaSampleInfoDataStore::enumChunkItems( TFunc func ) const 113 | { 114 | const uint8_t* ptr = &data[0]; 115 | const uint8_t* ptr_end = &data[0] + data.size(); 116 | 117 | while( (ptr + 8) < ptr_end ) 118 | { 119 | uint32_t chunk_data_len = *reinterpret_cast(ptr + 0); 120 | uint32_t chunk_id = *reinterpret_cast(ptr + 4); 121 | ptr += 8; 122 | 123 | const uint8_t* chunk_data = ptr; 124 | 125 | if( (ptr + chunk_data_len) > ptr_end ) 126 | return; 127 | 128 | bool should_exit = func( chunk_id, chunk_data, chunk_data_len ); 129 | if( should_exit ) 130 | return; 131 | 132 | ptr += chunk_data_len; 133 | } 134 | } 135 | 136 | template 137 | const TStruct* MediaSampleInfoDataStore::findChunk( uint32_t chunk_id ) const 138 | { 139 | int blob_len = 0; 140 | const uint8_t* ptr = findChunk( blob_len, chunk_id ); 141 | if( ptr == 0 ) 142 | return 0; 143 | if( sizeof( TStruct ) > blob_len ) 144 | return 0; 145 | 146 | return reinterpret_cast(ptr); 147 | } 148 | template 149 | const TStruct* MediaSampleInfoDataStore::findChunk() const 150 | { 151 | return findChunk( TStruct::static_chunk_id ); 152 | } 153 | 154 | 155 | inline bool MediaSampleInfoDataStore::update( const IFrame& frame ) 156 | { 157 | if( data.size() < 1024 ) // optimization, don't shrink size if enough space would be available 158 | { 159 | data.clear(); // clear so that the resize does not need to copy 160 | data.resize( 1024 ); // allocate 1024 for the first try 161 | } 162 | 163 | int data_available = 0; 164 | bool rval = frame.getMediaSampleInfo_( &data[0], (int)data.size(), data_available ); 165 | if( data_available == 0 ) // there is no data available 166 | { 167 | data.resize( 0 ); 168 | return false; 169 | } 170 | if( !rval ) 171 | { 172 | data.resize( data_available ); // resize to accommodate more data 173 | 174 | data_available = 0; 175 | rval = frame.getMediaSampleInfo_( &data[0], (int)data.size(), data_available ); 176 | if( !rval ) // some other error 177 | data_available = 0; 178 | } 179 | 180 | data.resize( data_available ); 181 | return rval; 182 | } 183 | 184 | } 185 | 186 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/OverlayBitmap.h: -------------------------------------------------------------------------------- 1 | // OverlayBitmap.h: interface for the OverlayBitmap class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_OVERLAYBITMAP_H__54CAEF21_A1DC_4441_9C7B_76B953EC4D1C__INCLUDED_) 6 | #define AFX_OVERLAYBITMAP_H__54CAEF21_A1DC_4441_9C7B_76B953EC4D1C__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "udshl_defs.h" 13 | #include "smart_com.h" 14 | #include "simplectypes.h" 15 | 16 | #include "dstring.h" 17 | 18 | #include "FrameType.h" 19 | 20 | namespace _DSHOWLIB_NAMESPACE 21 | { 22 | class COverlayBitmapContainer; 23 | class Grabber; 24 | class GrabberPImpl; 25 | 26 | /** With this class you can create and control an overlay drawn onto the frames as they 27 | * are transformed by the system. 28 | * You can get a reference to this class by calling Grabber::getOverlay() or when you get called by 29 | * the GrabberLister::overlayBitmap event. 30 | */ 31 | class _UDSHL_EXP_API OverlayBitmap 32 | { 33 | friend GrabberPImpl; 34 | friend Grabber; 35 | public: 36 | /** dtor */ 37 | ~OverlayBitmap(); 38 | 39 | /** returns an HDC in which the bitmap for the overlay is selected. 40 | * The DC is only valid when beginPaint() was called. 41 | * @return HDC on success otherwise 0 42 | */ 43 | HDC getDC() const; 44 | 45 | /** sets the current drop out color, which is not drawn into the stream. */ 46 | bool setDropOutColor( COLORREF clr ); 47 | /** gets the current drop out color. */ 48 | COLORREF getDropOutColor() const; 49 | 50 | /** sets if the overlay is drawn vertically flipped into the frame. */ 51 | bool setFlipVertical( bool bFlip ); 52 | /** returns if the overlay is flipped vertically. */ 53 | bool getFlipVertical() const; 54 | 55 | /** enables/disables the overlay. */ 56 | bool setEnable( bool bOnOff ); 57 | /** returns if the overlay is enabled. */ 58 | bool getEnable() const; 59 | 60 | /** returns the width of the overlay. */ 61 | long getWidth() const; 62 | /** returns the height of the overlay. */ 63 | long getHeight() const; 64 | 65 | /** begin paint selects the bitmap into the DC and increases the begin paint count. 66 | * You have to call this method before you do any operation on the DC. 67 | * Internally the draw* methods call beginPaint, but it is better that you call beginPaint before you do 68 | * any drawing onto the bitmap. 69 | * When you are done with your drawing tasks, call endPaint. 70 | * Your calls to beginPaint must match those to endPaint to prevent resource leaks. 71 | */ 72 | bool beginPaint(); 73 | /** for each beginPaint you call, there must be corresponding endPaint in your code when you are 74 | * done drawing to the DC. 75 | */ 76 | bool endPaint(); 77 | 78 | /** Sets a new font object by its name. */ 79 | bool setFont( const char* szFaceName, int iSize = 10 ); 80 | bool setFont( const dstringa& szFaceName, int iSize = 10 ); 81 | bool setFont( const dstringw& szFaceName, int iSize = 10 ); 82 | 83 | /** Sets the current font for the next calls to drawText. 84 | * adds a reference count to pFont, which is internally released when the font is not used 85 | * anymore. 86 | * @param pFont IFont derived object. (e.g. created by OleCreateFontIndirect(...) ) 87 | */ 88 | bool setFont( IFont* pFont ); 89 | /** Returns a reference to the currently set font object. 90 | * You have to release the outstanding reference count of the returned pointer by calling "Release()" 91 | * on the object. 92 | * @return The current IFont object used internally by drawText(). 93 | */ 94 | IFont* getFont() const; 95 | 96 | /** sets the background mode for drawText. */ 97 | void setFontTransparent( bool val ); 98 | /** returns the background mode for drawText. */ 99 | bool getFontTransparent() const; 100 | 101 | /** sets the background color for drawText, which is used when getFontTransparent() == false. */ 102 | void setFontBKColor( COLORREF background ); 103 | /** return the background color which is used in drawText. */ 104 | COLORREF getFontBKColor() const; 105 | 106 | /** draws a text at the specified position onto the overlay. 107 | * The text is drawn in the color supplied. If getFontTransparent() == false then the text background 108 | * is drawn in the color specified in setFontBKColor(). 109 | * @param color the foreground color in which the text is drawn. 110 | * @param iX the start x position at which the text is drawn. 111 | * @param iY the start y position at which the text is drawn. 112 | * @param szText the text which is drawn onto the overlay. 113 | */ 114 | bool drawText( COLORREF color, int iX, int iY, const char* text ); 115 | bool drawText( COLORREF color, int iX, int iY, const dstringa& text ); 116 | bool drawText( COLORREF color, int iX, int iY, const dstringw& text ); 117 | 118 | /** draws a line a specified onto the surface. */ 119 | bool drawLine(COLORREF color, int iXStart, int iYStart, int iXEnd, int iYEnd); 120 | /** draws a rectangle onto the overlay, which is completely filled with the color specified. */ 121 | bool drawSolidRect( COLORREF clr, const RECT& rect ); 122 | 123 | bool drawFrameRect( COLORREF clr, const RECT& rect ); 124 | bool drawSolidEllipse( COLORREF color, const RECT& rect ); 125 | bool drawFrameEllipse( COLORREF color, const RECT& rect ); 126 | /** fills the entire overlay with the color specified. */ 127 | bool fill(COLORREF Color); 128 | 129 | /** returns if you can render bitmaps onto the overlay. 130 | * This is not possible when you specify a FrameGrabberSink with UYVY as target. 131 | * 132 | * deprecated, always returns true 133 | */ 134 | bool canRender() const; 135 | 136 | /** Returns the colorformat currently used by the overlay. 137 | * @return Either the according colorformat or eInvalidColorformat when the overlay is currently 138 | * not used. 139 | */ 140 | tColorformatEnum getColorformat() const; 141 | 142 | // since 3.0 143 | enum tOVBColorMode 144 | { 145 | eBESTFIT = 0, //< let the OVB decide 146 | eGRAYSCALE, //< force the OVB to grayscale 147 | eCOLOR, //< force the OVB to color 148 | }; 149 | 150 | /** You can set the color mode of the OverlayBitmap by specifying one of the 151 | * tOVBColorMode members. 152 | * @param newMode The mode to set. This mode will only be accepted when the Grabber 153 | * which owns this OverlayBitmap is not in live mode. 154 | * @return true on success, false otherwise 155 | */ 156 | bool setColorMode( tOVBColorMode newMode ); 157 | tOVBColorMode getColorMode() const; 158 | 159 | /** Returns the position of the OverlayBitmap in the render path. This is helpful if you use 160 | * more than one overlay in your setup. 161 | */ 162 | tPathPosition getPathPosition() const; 163 | 164 | /** Returns the currently used frame type. 165 | * This function is available even outside of live mode, but the returned frame type may not 166 | * correspond to the frame type after the next startLive call. 167 | * @return Frame type of the OverlayBitmap. 168 | */ 169 | FrameTypeInfo getFrameType() const; 170 | protected: 171 | /** internal ctor, do not use. */ 172 | explicit OverlayBitmap( COverlayBitmapContainer* pData ); 173 | mutable COverlayBitmapContainer* m_pData; 174 | }; 175 | }; 176 | 177 | #endif // !defined(AFX_OVERLAYBITMAP_H__54CAEF21_A1DC_4441_9C7B_76B953EC4D1C__INCLUDED_) 178 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/IVCDPropertyInterfaces_inl.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef IVCDPROPERTYINTERFACES_INL_H_INC_ 3 | #define IVCDPROPERTYINTERFACES_INL_H_INC_ 4 | 5 | namespace _DSHOWLIB_NAMESPACE 6 | { 7 | // methods of IVCDRangeProperty 8 | inline std::pair IVCDRangeProperty::getRange() const 9 | { 10 | HRESULT hr; 11 | std::pair rval; 12 | hr = get_RangeMin( &rval.first ); 13 | if( FAILED( hr ) ) throw hr; 14 | hr = get_RangeMax( &rval.second ); 15 | if( FAILED( hr ) ) throw hr; 16 | return rval; 17 | } 18 | inline long IVCDRangeProperty::getRangeMin() const 19 | { 20 | long rval; 21 | HRESULT hr; 22 | hr = get_RangeMin( &rval ); 23 | if( FAILED( hr ) ) throw hr; 24 | return rval; 25 | } 26 | inline long IVCDRangeProperty::getRangeMax() const 27 | { 28 | long rval; 29 | HRESULT hr; 30 | hr = get_RangeMax( &rval ); 31 | if( FAILED( hr ) ) throw hr; 32 | return rval; 33 | } 34 | inline long IVCDRangeProperty::getValue() const 35 | { 36 | long rval; 37 | HRESULT hr = get_Value( &rval ); 38 | if( FAILED( hr ) ) throw hr; 39 | return rval; 40 | } 41 | inline void IVCDRangeProperty::setValue( long val ) 42 | { 43 | HRESULT hr = put_Value( val ); 44 | if( FAILED( hr ) ) throw hr; 45 | } 46 | 47 | inline long IVCDRangeProperty::getDefault() const 48 | { 49 | long rval; 50 | HRESULT hr = get_Default( &rval ); 51 | if( FAILED( hr ) ) throw hr; 52 | return rval; 53 | } 54 | inline long IVCDRangeProperty::getDelta() const 55 | { 56 | long rval; 57 | HRESULT hr = get_Delta( &rval ); 58 | if( FAILED( hr ) ) throw hr; 59 | return rval; 60 | } 61 | 62 | 63 | // methods of IVCDSwitchProperty 64 | inline void IVCDSwitchProperty::setSwitch( bool b ) 65 | { 66 | HRESULT hr = put_Switch( b ? OATRUE : OAFALSE ); 67 | if( FAILED( hr ) ) throw hr; 68 | } 69 | inline bool IVCDSwitchProperty::getSwitch() 70 | { 71 | VARIANT_BOOL rval; 72 | HRESULT hr = get_Switch( &rval ); 73 | if( FAILED( hr ) ) throw hr; 74 | return rval == OATRUE ? true : false; 75 | } 76 | 77 | // methods of IVCDSwitchProperty2 78 | inline bool IVCDSwitchProperty2::hasDefault() 79 | { 80 | VARIANT_BOOL def; 81 | return SUCCEEDED(get_Default( &def )); 82 | } 83 | inline bool IVCDSwitchProperty2::getDefault() 84 | { 85 | VARIANT_BOOL def; 86 | HRESULT hr = get_Default(&def); 87 | if( FAILED(hr) ) 88 | throw hr; 89 | 90 | return (def == OATRUE); 91 | } 92 | 93 | 94 | // methods of IVCDButtonProperty 95 | inline void IVCDButtonProperty::push() 96 | { 97 | HRESULT hr = Push(); 98 | if( FAILED( hr ) ) throw hr; 99 | } 100 | 101 | // methods of IVCDMapStringsProperty 102 | inline IVCDMapStringsProperty::tStringVecW& IVCDMapStringsProperty::getStringsW( 103 | IVCDMapStringsProperty::tStringVecW& vec ) const 104 | { 105 | smart_com pEnum; 106 | HRESULT hr = get_Strings( &pEnum.get() ); 107 | if( FAILED( hr ) ) throw hr; 108 | 109 | long count = 0; 110 | hr = pEnum->get_Count( &count ); 111 | if( FAILED( hr ) ) throw hr; 112 | 113 | for( int i = 0; i < count; ++i ) 114 | { 115 | BSTR pItem = 0; 116 | hr = pEnum->get_Item( i + 1, &pItem ); 117 | if( FAILED( hr ) ) throw hr; 118 | 119 | vec.push_back( pItem ); 120 | 121 | SysFreeString( pItem ); 122 | } 123 | return vec; 124 | } 125 | inline IVCDMapStringsProperty::tStringVecW IVCDMapStringsProperty::getStringsW() const 126 | { 127 | tStringVecW vec; 128 | getStringsW( vec ); 129 | return vec; 130 | } 131 | inline IVCDMapStringsProperty::tStringVec IVCDMapStringsProperty::getStrings() const 132 | { 133 | tStringVec vec; 134 | getStrings( vec ); 135 | return vec; 136 | } 137 | inline IVCDMapStringsProperty::tStringVec& IVCDMapStringsProperty::getStrings( 138 | IVCDMapStringsProperty::tStringVec& vec ) const 139 | { 140 | smart_com pEnum; 141 | HRESULT hr = get_Strings( &pEnum.get() ); 142 | if( FAILED( hr ) ) throw hr; 143 | 144 | long count = 0; 145 | hr = pEnum->get_Count( &count ); 146 | if( FAILED( hr ) ) throw hr; 147 | 148 | for( int i = 0; i < count; ++i ) 149 | { 150 | BSTR pItem = 0; 151 | hr = pEnum->get_Item( i + 1, &pItem ); 152 | if( FAILED( hr ) ) throw hr; 153 | 154 | vec.push_back( wstoas( pItem ) ); 155 | 156 | SysFreeString( pItem ); 157 | } 158 | return vec; 159 | } 160 | 161 | inline void IVCDMapStringsProperty::setString( const std::wstring& str ) 162 | { 163 | BSTR pStr = SysAllocString( str.c_str() ); 164 | HRESULT hr = put_String( pStr ); 165 | SysFreeString( pStr ); 166 | if( FAILED( hr ) ) throw hr; 167 | } 168 | inline void IVCDMapStringsProperty::setString( const std::string& str ) 169 | { 170 | setString( astows( str ) ); 171 | } 172 | inline std::wstring IVCDMapStringsProperty::getStringW() const 173 | { 174 | BSTR item; 175 | HRESULT hr = get_String( &item ); 176 | if( FAILED( hr ) ) throw hr; 177 | std::wstring rval = item; 178 | ::SysFreeString( item ); 179 | return rval; 180 | } 181 | inline std::string IVCDMapStringsProperty::getString() const 182 | { 183 | return wstoas( getStringW() ); 184 | } 185 | 186 | // inline methods of IVCDAbsoluteValueProperty 187 | inline std::pair IVCDAbsoluteValueProperty::getRange() const 188 | { 189 | HRESULT hr; 190 | std::pair rval; 191 | hr = get_RangeMin( &rval.first ); 192 | if( FAILED( hr ) ) throw hr; 193 | hr = get_RangeMax( &rval.second ); 194 | if( FAILED( hr ) ) throw hr; 195 | return rval; 196 | } 197 | inline double IVCDAbsoluteValueProperty::getRangeMin() const 198 | { 199 | double rval; 200 | HRESULT hr = get_RangeMin( &rval ); 201 | if( FAILED( hr ) ) throw hr; 202 | return rval; 203 | } 204 | inline double IVCDAbsoluteValueProperty::getRangeMax() const 205 | { 206 | double rval; 207 | HRESULT hr = get_RangeMax( &rval ); 208 | if( FAILED( hr ) ) throw hr; 209 | return rval; 210 | } 211 | inline double IVCDAbsoluteValueProperty::getValue() const 212 | { 213 | double rval; 214 | HRESULT hr = get_Value( &rval ); 215 | if( FAILED( hr ) ) throw hr; 216 | return rval; 217 | } 218 | inline void IVCDAbsoluteValueProperty::setValue( double val ) 219 | { 220 | HRESULT hr = put_Value( val ); 221 | if( FAILED( hr ) ) throw hr; 222 | } 223 | 224 | inline double IVCDAbsoluteValueProperty::getDefault() const 225 | { 226 | double rval; 227 | HRESULT hr = get_Default( &rval ); 228 | if( FAILED( hr ) ) throw hr; 229 | return rval; 230 | } 231 | 232 | inline std::wstring IVCDAbsoluteValueProperty::getDimTypeW() const 233 | { 234 | BSTR name; 235 | std::wstring rval; 236 | HRESULT hr = get_DimType( &name ); 237 | if( FAILED( hr ) ) throw hr; 238 | rval = name; 239 | SysFreeString( name ); 240 | return rval; 241 | } 242 | inline std::string IVCDAbsoluteValueProperty::getDimTypeA() const 243 | { 244 | std::string rval; 245 | std::wstring wstr = getDimTypeW(); 246 | 247 | return wstoas( wstr, rval ); 248 | } 249 | inline std::string IVCDAbsoluteValueProperty::getDimType() const 250 | { 251 | return getDimTypeA(); 252 | } 253 | 254 | inline IVCDAbsoluteValueProperty::tAbsDimFunction IVCDAbsoluteValueProperty::getDimFunction() const 255 | { 256 | long l; 257 | get_DimFunction( &l ); // should never fail 258 | return (IVCDAbsoluteValueProperty::tAbsDimFunction) l; 259 | } 260 | 261 | inline IVCDHexPropertyInterface::uint64_t IVCDHexPropertyInterface::getValue() const 262 | { 263 | uint64_t rval; 264 | HRESULT hr = get_Value( &rval ); 265 | if( FAILED( hr ) ) throw hr; 266 | return rval; 267 | } 268 | inline void IVCDHexPropertyInterface::setValue( IVCDHexPropertyInterface::uint64_t val ) 269 | { 270 | HRESULT hr = put_Value( val ); 271 | if( FAILED( hr ) ) throw hr; 272 | } 273 | 274 | inline IVCDHexPropertyInterface::uint64_t IVCDHexPropertyInterface::getMask() const 275 | { 276 | uint64_t rval; 277 | HRESULT hr = get_Mask( &rval ); 278 | if( FAILED( hr ) ) throw hr; 279 | return rval; 280 | } 281 | }; 282 | 283 | #endif // IVCDPROPERTYINTERFACES_INL_H_INC_ -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/MemBufferCollection.h: -------------------------------------------------------------------------------- 1 | // MemBufferCollection.h: interface for the MemBuffer class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MEMBUFFERCOLLECTION_H__9DAE8989_42EC_4A63_8328_AD5829AD2D11__INCLUDED_) 6 | #define AFX_MEMBUFFERCOLLECTION_H__9DAE8989_42EC_4A63_8328_AD5829AD2D11__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include 13 | 14 | #include "udshl_defs.h" 15 | #include "simplectypes.h" 16 | #include "smart_ptr.h" 17 | 18 | #include "Error.h" 19 | #include "FrameType.h" 20 | 21 | namespace _DSHOWLIB_NAMESPACE 22 | { 23 | class MemBuffer; 24 | class MemBufferCollection; 25 | 26 | typedef smart_ptr tMemBufferCollectionPtr; 27 | 28 | struct MemBufferCollectionPImpl; 29 | 30 | /** this class implements a memory buffer handling for image buffers. 31 | * it can collect multiple buffers of the same type, i. e. with the same size and colorformat. 32 | * The class provides an init() method to initialize the internal buffers. Any Errors can be 33 | * queried by getLastError(). MemBufferCollection can handle user allocated buffers or allocates 34 | * memory for you. 35 | **/ 36 | class MemBufferCollection 37 | { 38 | public: 39 | _UDSHL_EXP_API ~MemBufferCollection(); 40 | 41 | typedef smart_ptr tMemBufferPtr; 42 | typedef smart_ptr tBmInfHPtr; 43 | 44 | /** get frame Size 45 | * @return size of each Frame in the buffer 46 | **/ 47 | _UDSHL_EXP_API const SIZE& getFrameSize() const; 48 | 49 | /** get colorformat 50 | * @return colorformat for that the buffer was initialized. 51 | * If the buffer is uninitialized, the return value is undefined. 52 | **/ 53 | _UDSHL_EXP_API tColorformatEnum getColorformat() const; 54 | 55 | /** get bit per pixel 56 | * @return number of bits per pixel for the current colorformat 57 | **/ 58 | _UDSHL_EXP_API int getBitsPerPixel() const; 59 | 60 | /** get buffer length 61 | * @return length of the buffer in frames 62 | **/ 63 | _UDSHL_EXP_API DWORD getBufferCount() const; // in frames 64 | 65 | /** get a MemBuffer with a certain index 66 | * @param pos frame number (starting from 0) 67 | * @return the queried MemBuffer 68 | **/ 69 | _UDSHL_EXP_API tMemBufferPtr operator [] ( DWORD pos ) const; 70 | 71 | /** get a MemBuffer with a certain index 72 | * @param pos frame number (starting from 0) 73 | * @return the queried MemBuffer 74 | **/ 75 | _UDSHL_EXP_API tMemBufferPtr getBuffer( DWORD pos ) const; 76 | 77 | /** get the size of one frame buffer 78 | * @return the size of one frame buffer in bytes 79 | **/ 80 | _UDSHL_EXP_API DWORD getBufferSize() const; // in bytes 81 | 82 | /** test whether the buffer is initialized. Deprecated, the collection is always valid. 83 | * @return true, if it is initialized 84 | **/ 85 | UDSHL_DEPRECATE_FUNCTION_ 86 | _UDSHL_EXP_API bool isInit() const; 87 | 88 | /// @return the last occurred error 89 | _UDSHL_EXP_API Error getLastError() const; 90 | 91 | 92 | /** fills given buffer with a certain pattern. 93 | * @param buffno number of buffer to fill with pattern 94 | * @return true on success 95 | **/ 96 | _UDSHL_EXP_API bool fillWithPattern( DWORD buffno, tPatternEnum pattern ); 97 | 98 | /** fills every buffer with a certain pattern. 99 | * @return true on success 100 | **/ 101 | _UDSHL_EXP_API bool fillWithPattern( tPatternEnum pattern ); 102 | 103 | /** writes buffers to disk in a bmp-file for each buffer. 104 | * Attention: existing file are overwritten. 105 | * @param filename is a path and filename relative to the current directory. The name must 106 | * contain one '*' character which will be replaced by the collection number of the 107 | * buffers. 108 | * @return true on success, else false 109 | **/ 110 | UDSHL_DEPRECATE_FUNCTION_T_( "saveToFileBMP functions in a loop" ) 111 | _UDSHL_EXP_API bool save( const dstringa& filename ) const; 112 | UDSHL_DEPRECATE_FUNCTION_T_( "saveToFileBMP functions in a loop" ) 113 | _UDSHL_EXP_API bool save( const dstringw& filename ) const; 114 | 115 | /** return pointer to BitmapInfoHeader struct according to the buffers. 116 | * The size of the returned buffer is sizeof( BITMAPINFOHEADER ) + sizeof( RGBQUAD ) * tBmInfHPtr->biClrUsed 117 | * @return smart_ptr< BITMAPINFOHEADER > with BitmapInfoHeader to this collection 118 | **/ 119 | _UDSHL_EXP_API tBmInfHPtr getBitmapInfoHeader() const; 120 | 121 | 122 | // since 2.0 123 | /** get the size of the valid data in the buffer itself. 124 | * User allocated buffer may be larger than the actual data which is defined through 125 | * (getFrameSize().cx * getFrameSize().cy * getBitsPerPixel()) / 8. 126 | */ 127 | _UDSHL_EXP_API DWORD getBufferDataSize() const; // in bytes 128 | 129 | /** internal method, do not use. 130 | */ 131 | _UDSHL_EXP_API GUID getMediaSubtype() const; 132 | 133 | // since 3.0 134 | /* Returns the frame type of the collection. */ 135 | _UDSHL_EXP_API const FrameTypeInfo& getFrameType() const; 136 | 137 | /** Creates a MemBufferCollection for use with the FrameHandlerSink or the Grabber. 138 | * @param frame_type Must contain a fully specified frame type (no partial frame type allowed). 139 | * @param count The number of buffers the collection should contain. Must be > 0. 140 | * @return 0 when one of the parameters is not valid, otherwise a MemBufferCollection instance. 141 | */ 142 | _UDSHL_EXP_API static tMemBufferCollectionPtr create( const FrameTypeInfo& frame_type, DWORD count ); 143 | 144 | /** Creates a MemBufferCollection for use with the FrameHandlerSink or the Grabber. 145 | * @param frame_type Must contain a fully specified frame type (no partial frame type allowed). 146 | * @param count The number of buffers the collection should contain. Must be > 0. 147 | * @param buffers The user specified image data pointers. These will be used by the MemBuffers for the 148 | * image data. The array must contain pointers, which must not be 0. 149 | * @return 0 when one of the parameters is not valid, otherwise a MemBufferCollection instance. 150 | */ 151 | _UDSHL_EXP_API static tMemBufferCollectionPtr create( const FrameTypeInfo& frame_type, DWORD count, BYTE* buffers[] ); 152 | 153 | /** Creates a new MemBufferCollection from a colorformat and image dimensions. 154 | * @param colorformat The colorformat of the MemBuffers. Must be a valid colorformat. 155 | * @param dim The dimensions of the MemBuffers created. Must be > 0 156 | * @param count The number of buffers the collection should contain. Must be > 0. 157 | * @return 0 when one of the parameters is not valid, otherwise a MemBufferCollection instance. 158 | **/ 159 | _UDSHL_EXP_API static tMemBufferCollectionPtr create( tColorformatEnum colorformat, SIZE dim, DWORD count ); 160 | 161 | /** Creates a new MemBufferCollection from a colorformat and image dimensions. 162 | * The MemBuffers in the collection get the pointers you specified as image data pointers. 163 | * @param colorformat The colorformat of the MemBuffers. Must be a valid colorformat. 164 | * @param dim The dimensions of the MemBuffers created. Must be > 0 165 | * @param count The number of buffers the collection should contain. Must be > 0. 166 | * @param buffers The user specified image data pointers. These will be used by the MemBuffers for the 167 | * image data. The array must contain pointers, which must not be 0. 168 | * @return 0 when one of the parameters is not valid, otherwise a MemBufferCollection instance. 169 | **/ 170 | _UDSHL_EXP_API static tMemBufferCollectionPtr create( tColorformatEnum colorformat, SIZE dim, DWORD count, BYTE* buffers[] ); 171 | protected: 172 | MemBufferCollection( const FrameTypeInfo& type, DWORD buffercount, BYTE* buffers[] ); 173 | private: 174 | /** Copying of MemBufferCollection objects is prohibited. */ 175 | MemBufferCollection( const MemBufferCollection& op ); 176 | void operator=( const MemBufferCollection& op2 ); 177 | 178 | MemBufferCollectionPImpl* m_pP; 179 | }; 180 | }; 181 | 182 | #endif // !defined(AFX_MEMBUFFERCOLLECTION_H__9DAE8989_42EC_4A63_8328_AD5829AD2D11__INCLUDED_) 183 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/FilterInfoObject.h: -------------------------------------------------------------------------------- 1 | // FilterInfoObject.h: interface for the FilterInfoObject class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_FILTERINFOOBJECT_H__4ACDB17A_C8F5_4932_B676_CC930A39EE6D__INCLUDED_) 6 | #define AFX_FILTERINFOOBJECT_H__4ACDB17A_C8F5_4932_B676_CC930A39EE6D__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "udshl_defs.h" 12 | 13 | #include "smart_com.h" 14 | #include "int_interface_pre.h" 15 | 16 | #include "dvector.h" 17 | #include "dstring.h" 18 | 19 | namespace _DSHOWLIB_NAMESPACE 20 | { 21 | class Grabber; 22 | class AviSink; 23 | class MediaStreamSink; 24 | 25 | #define DEPRECATE_FilterInfoObject_CLASS UDSHL_DEPRECATE_FUNCTION_T_("Codec class") 26 | 27 | /** This class is deprecated and can only be used in conjunction with the AviSink. 28 | * The Codec and MediaStreamSink classes supersede this class. 29 | * 30 | * A FilterInfoObject contains the name of a video codec used for avi file compression. 31 | * deprecated, use the Codec object. 32 | */ 33 | class /*UDSHL_DEPRECATE_FUNCTION_*/ FilterInfoObject 34 | { 35 | friend AviSink; 36 | friend Grabber; 37 | friend MediaStreamSink; 38 | public: 39 | /// creates an invalid object 40 | _UDSHL_EXP_API FilterInfoObject(); 41 | /// copy ctor 42 | _UDSHL_EXP_API FilterInfoObject( const FilterInfoObject& ); 43 | /// dtor 44 | _UDSHL_EXP_API virtual ~FilterInfoObject(); 45 | 46 | _UDSHL_EXP_API FilterInfoObject& operator=( const FilterInfoObject& ); 47 | 48 | /** Returns a reference to an internal interface. 49 | * With this function you can fetch an custom interface from the codec. 50 | * To use this function your compiler must support the __uuidof operator and the interface must 51 | * be assigned an iid with the __declspec( uuid( "iid" ) ) compiler option. When this option is 52 | * not available then you should use the other function. 53 | * \param pItf 54 | * \return A reference to the interface requested or 0 if the interface is not supported. 55 | */ 56 | template 57 | smart_com getInternalInterface( smart_com& pItf ) const 58 | { 59 | return getInternalInterface( __uuidof( TItf ), pItf ); 60 | } 61 | 62 | /** Returns a reference to an internal interface. 63 | * With this function you can fetch an custom interface from the codec. 64 | * \par usage 65 | * 66 | * smart_com pItf; 67 | * if( pFilterInfoObject->getInternalInterface( pItf ) == 0 ) 68 | * { 69 | * ... // interface is not supported, so error handling 70 | * } 71 | * else 72 | * { 73 | * ... // use the interface 74 | * } 75 | * 76 | * \param pItf A smart_com to a interface reference. 77 | * \param riid An interface ID. 78 | * \return A reference to the interface requested or 0 if the interface is not supported. 79 | */ 80 | template 81 | smart_com getInternalInterface( REFIID riid, smart_com& pItf ) const 82 | { 83 | pItf = 0; 84 | getInternalInterface_( __uuidof( TItf ), (void**) &pItf.get() ); 85 | return pItf; 86 | } 87 | 88 | /** returns true if this object is valid */ 89 | DEPRECATE_FilterInfoObject_CLASS 90 | _UDSHL_EXP_API bool isValid() const; 91 | /** returns the readable name of this Filter */ 92 | DEPRECATE_FilterInfoObject_CLASS 93 | std::string getName() const 94 | { 95 | return toString(); 96 | } 97 | /** returns the name as char */ 98 | DEPRECATE_FilterInfoObject_CLASS 99 | _UDSHL_EXP_API 100 | const char* c_str() const; 101 | 102 | /** Creates a textual representation for this FilterInfoObject 103 | * @return The textual representation. 104 | */ 105 | DEPRECATE_FilterInfoObject_CLASS 106 | std::string toString() const 107 | { 108 | return wstoas( toString_() ); 109 | } 110 | DEPRECATE_FilterInfoObject_CLASS 111 | std::wstring toStringW() const 112 | { 113 | return toString_(); 114 | } 115 | 116 | /** test if this lies alphabetical before op. 117 | * @param op format to compare to this 118 | * @return true if this < op, else false 119 | **/ 120 | _UDSHL_EXP_API bool operator<( const FilterInfoObject& op ) const; 121 | 122 | /** test if two formats are equal 123 | * @param op format to compare to this 124 | * @return true if this and op are equal, else false 125 | **/ 126 | _UDSHL_EXP_API bool operator==( const FilterInfoObject& op ) const; 127 | 128 | /** test if two formats are not equal 129 | * @param op format to compare to this 130 | * @return false if this and op are equal, else true 131 | **/ 132 | _UDSHL_EXP_API bool operator!=( const FilterInfoObject& op ) const; 133 | 134 | /** test if this is equal to the string passed in op 135 | * @param op item to compare to this 136 | * @return true if this and op are equal, else false 137 | **/ 138 | _UDSHL_EXP_API bool operator==( const dstringa& op ) const; 139 | _UDSHL_EXP_API bool operator==( const dstringw& op ) const; 140 | 141 | /** generates an invalid item 142 | * @return an invalid item 143 | * @see isValid() 144 | **/ 145 | UDSHL_DEPRECATE_FUNCTION_T_( "Codec class" ) 146 | _UDSHL_EXP_API static FilterInfoObject createInvalid(); 147 | 148 | /** returns true if this CODEC has an Dialog. */ 149 | DEPRECATE_FilterInfoObject_CLASS 150 | _UDSHL_EXP_API bool hasDialog() const; 151 | 152 | /** calls the Dialog and saves the Data retrieved after the operation in the local buffer.*/ 153 | DEPRECATE_FilterInfoObject_CLASS 154 | _UDSHL_EXP_API bool callDialog( HWND hParent = 0 ); 155 | 156 | /** Retrieves the current data set in the codec. 157 | * @param pData The data buffer to copy the data into. May be 0 when you only want to retrieve the size of the buffer. 158 | * @param size IN The size of the buffer. 159 | * OUT The size of the data. 160 | * @return true on success, otherwise false. 161 | */ 162 | DEPRECATE_FilterInfoObject_CLASS 163 | _UDSHL_EXP_API bool getCodecData( BYTE* pData, DWORD& size ) const; 164 | DEPRECATE_FilterInfoObject_CLASS 165 | _UDSHL_EXP_API bool setCodecData( BYTE* pData, DWORD data_size ); 166 | 167 | /** returns true if the codec contained is an Video for Windows CODEC */ 168 | DEPRECATE_FilterInfoObject_CLASS 169 | _UDSHL_EXP_API bool isVfwCodec() const; 170 | 171 | /** Returns if you can get/set the codec data. 172 | * @return true/false 173 | */ 174 | DEPRECATE_FilterInfoObject_CLASS 175 | _UDSHL_EXP_API bool isCodecDataAvailable() const; 176 | 177 | DEPRECATE_FilterInfoObject_CLASS 178 | _UDSHL_EXP_API bool hasCodecData() const; 179 | 180 | DEPRECATE_FilterInfoObject_CLASS 181 | std::string getCodecData() const 182 | { 183 | return wstoas( getCodecData_() ); 184 | } 185 | DEPRECATE_FilterInfoObject_CLASS 186 | std::wstring getCodecDataW() const 187 | { 188 | return getCodecData_(); 189 | } 190 | DEPRECATE_FilterInfoObject_CLASS 191 | _UDSHL_EXP_API bool setCodecData( const dstringa& data ); 192 | DEPRECATE_FilterInfoObject_CLASS 193 | _UDSHL_EXP_API bool setCodecData( const dstringw& data ); 194 | private: 195 | _UDSHL_EXP_API dstringw getCodecData_() const; 196 | _UDSHL_EXP_API dstringw toString_() const; 197 | 198 | _UDSHL_EXP_API HRESULT getInternalInterface_( REFIID riid, void** ppv ); 199 | 200 | _UDSHL_EXP_API static void createCodecList( dvector& listToFill ); 201 | 202 | /// internal ctor 203 | _UDSHL_EXP_API FilterInfoObject( const smart_com& op2 ); 204 | _UDSHL_EXP_API FilterInfoObject( const smart_com& op2 ); 205 | 206 | /** returns the pointer to the current compressor filter, only needed in build filter graph in grabber.cpp */ 207 | smart_com getFilter() const; 208 | 209 | /// the user friendly readable name 210 | dstringa m_ReadableName; 211 | 212 | /// holds the information to create a filter 213 | mutable smart_com m_pFilterInfo; 214 | mutable smart_com m_pFilter; ///< Instance of the compressor filter 215 | }; 216 | }; 217 | 218 | #endif // !defined(AFX_FILTERINFOOBJECT_H__4ACDB17A_C8F5_4932_B676_CC930A39EE6D__INCLUDED_) 219 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/dshow_header.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef DSHOW_HEADER_H_INC_ 3 | #define DSHOW_HEADER_H_INC_ 4 | 5 | #pragma once 6 | 7 | #ifdef _USE_DSHOW_ 8 | 9 | #if !defined __DSHOW_INCLUDED__ 10 | // If the following header file cannot be found, you have to add the include directory 11 | // of your DirectX SDK installation to the include path of this project. 12 | // In order to add a directory to the include path, you have to open the C++ Settings dialog 13 | // and select the Page "Preprocessor". In the edit field "Additional include directories" 14 | // the Path has to be added. 15 | // 16 | // The DirectX / DirectShow SDK is avaialble at http://www.microsoft.com. 17 | // If .NET 2005 is in use, then the DirectShow SDK belongs to the "Windows Server 2003 R2 Platform SDK". 18 | // Also the DirectX SDK for .NET 2005 is needed. 19 | // 20 | #include 21 | 22 | #pragma comment ( lib, "strmiids.lib" ) 23 | 24 | #else 25 | #pragma comment ( lib, "strmiids.lib" ) 26 | #endif 27 | 28 | #else 29 | 30 | // When you get errors in the following lines, your options are : 31 | // 1) not include "dshow.h" 32 | // 2) change the include order to include dshow.h before including this header 33 | // 3) #define _USE_DSHOW_ to force this header to include directshow directly when it is needed. 34 | 35 | 36 | // The following definitions are used to emulate the DirectShow headers 37 | // These are the only parts needed by the library from DirectShow. 38 | 39 | 40 | #ifndef MEDIASUBTYPE_NULL 41 | #define MEDIASUBTYPE_NULL GUID_NULL 42 | 43 | static const GUID MEDIASUBTYPE_RGB8 = { 0xe436eb7a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 }; 44 | static const GUID MEDIASUBTYPE_RGB565 = { 0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 }; 45 | static const GUID MEDIASUBTYPE_RGB555 = { 0xe436eb7c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 }; 46 | static const GUID MEDIASUBTYPE_RGB24 = { 0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 }; 47 | static const GUID MEDIASUBTYPE_RGB32 = { 0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 }; 48 | 49 | static const GUID MEDIASUBTYPE_YUYV = { 0x56595559, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 50 | static const GUID MEDIASUBTYPE_IYUV = { 0x56555949, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 51 | static const GUID MEDIASUBTYPE_YVU9 = { 0x39555659, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 52 | static const GUID MEDIASUBTYPE_Y411 = { 0x31313459, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 53 | static const GUID MEDIASUBTYPE_Y41P = { 0x50313459, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 54 | static const GUID MEDIASUBTYPE_YUY2 = { 0x32595559, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 55 | static const GUID MEDIASUBTYPE_YVYU = { 0x55595659, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 56 | static const GUID MEDIASUBTYPE_UYVY = { 0x59565955, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 57 | static const GUID MEDIASUBTYPE_Y211 = { 0x31313259, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 58 | #endif 59 | 60 | 61 | #if !defined __IAMAnalogVideoDecoder_INTERFACE_DEFINED__ 62 | 63 | typedef enum tagAnalogVideoStandard 64 | { 65 | AnalogVideo_None = 0, 66 | AnalogVideo_NTSC_M = 0x1, 67 | AnalogVideo_NTSC_M_J = 0x2, 68 | AnalogVideo_NTSC_433 = 0x4, 69 | AnalogVideo_PAL_B = 0x10, 70 | AnalogVideo_PAL_D = 0x20, 71 | AnalogVideo_PAL_G = 0x40, 72 | AnalogVideo_PAL_H = 0x80, 73 | AnalogVideo_PAL_I = 0x100, 74 | AnalogVideo_PAL_M = 0x200, 75 | AnalogVideo_PAL_N = 0x400, 76 | AnalogVideo_PAL_60 = 0x800, 77 | AnalogVideo_SECAM_B = 0x1000, 78 | AnalogVideo_SECAM_D = 0x2000, 79 | AnalogVideo_SECAM_G = 0x4000, 80 | AnalogVideo_SECAM_H = 0x8000, 81 | AnalogVideo_SECAM_K = 0x10000, 82 | AnalogVideo_SECAM_K1 = 0x20000, 83 | AnalogVideo_SECAM_L = 0x40000, 84 | AnalogVideo_SECAM_L1 = 0x80000, 85 | AnalogVideo_PAL_N_COMBO = 0x100000, 86 | AnalogVideoMask_MCE_NTSC = ( ( ( ( ( ( AnalogVideo_NTSC_M | AnalogVideo_NTSC_M_J ) | AnalogVideo_NTSC_433 ) | AnalogVideo_PAL_M ) | AnalogVideo_PAL_N ) | AnalogVideo_PAL_60 ) | AnalogVideo_PAL_N_COMBO ) , 87 | AnalogVideoMask_MCE_PAL = ( ( ( ( AnalogVideo_PAL_B | AnalogVideo_PAL_D ) | AnalogVideo_PAL_G ) | AnalogVideo_PAL_H ) | AnalogVideo_PAL_I ) , 88 | AnalogVideoMask_MCE_SECAM = ( ( ( ( ( ( ( AnalogVideo_SECAM_B | AnalogVideo_SECAM_D ) | AnalogVideo_SECAM_G ) | AnalogVideo_SECAM_H ) | AnalogVideo_SECAM_K ) | AnalogVideo_SECAM_K1 ) | AnalogVideo_SECAM_L ) | AnalogVideo_SECAM_L1 ) 89 | } AnalogVideoStandard; 90 | 91 | typedef 92 | enum tagPhysicalConnectorType 93 | { PhysConn_Video_Tuner = 1, 94 | PhysConn_Video_Composite = ( PhysConn_Video_Tuner + 1 ) , 95 | PhysConn_Video_SVideo = ( PhysConn_Video_Composite + 1 ) , 96 | PhysConn_Video_RGB = ( PhysConn_Video_SVideo + 1 ) , 97 | PhysConn_Video_YRYBY = ( PhysConn_Video_RGB + 1 ) , 98 | PhysConn_Video_SerialDigital = ( PhysConn_Video_YRYBY + 1 ) , 99 | PhysConn_Video_ParallelDigital = ( PhysConn_Video_SerialDigital + 1 ) , 100 | PhysConn_Video_SCSI = ( PhysConn_Video_ParallelDigital + 1 ) , 101 | PhysConn_Video_AUX = ( PhysConn_Video_SCSI + 1 ) , 102 | PhysConn_Video_1394 = ( PhysConn_Video_AUX + 1 ) , 103 | PhysConn_Video_USB = ( PhysConn_Video_1394 + 1 ) , 104 | PhysConn_Video_VideoDecoder = ( PhysConn_Video_USB + 1 ) , 105 | PhysConn_Video_VideoEncoder = ( PhysConn_Video_VideoDecoder + 1 ) , 106 | PhysConn_Video_SCART = ( PhysConn_Video_VideoEncoder + 1 ) , 107 | PhysConn_Video_Black = ( PhysConn_Video_SCART + 1 ) , 108 | PhysConn_Audio_Tuner = 0x1000, 109 | PhysConn_Audio_Line = ( PhysConn_Audio_Tuner + 1 ) , 110 | PhysConn_Audio_Mic = ( PhysConn_Audio_Line + 1 ) , 111 | PhysConn_Audio_AESDigital = ( PhysConn_Audio_Mic + 1 ) , 112 | PhysConn_Audio_SPDIFDigital = ( PhysConn_Audio_AESDigital + 1 ) , 113 | PhysConn_Audio_SCSI = ( PhysConn_Audio_SPDIFDigital + 1 ) , 114 | PhysConn_Audio_AUX = ( PhysConn_Audio_SCSI + 1 ) , 115 | PhysConn_Audio_1394 = ( PhysConn_Audio_AUX + 1 ) , 116 | PhysConn_Audio_USB = ( PhysConn_Audio_1394 + 1 ) , 117 | PhysConn_Audio_AudioDecoder = ( PhysConn_Audio_USB + 1 ) 118 | } PhysicalConnectorType; 119 | 120 | #endif // __IAMAnalogVideoDecoder_INTERFACE_DEFINED__ 121 | 122 | #if !defined __IAMVideoProcAmp_INTERFACE_DEFINED__ 123 | 124 | typedef 125 | enum tagVideoProcAmpProperty 126 | { VideoProcAmp_Brightness = 0, 127 | VideoProcAmp_Contrast = ( VideoProcAmp_Brightness + 1 ) , 128 | VideoProcAmp_Hue = ( VideoProcAmp_Contrast + 1 ) , 129 | VideoProcAmp_Saturation = ( VideoProcAmp_Hue + 1 ) , 130 | VideoProcAmp_Sharpness = ( VideoProcAmp_Saturation + 1 ) , 131 | VideoProcAmp_Gamma = ( VideoProcAmp_Sharpness + 1 ) , 132 | VideoProcAmp_ColorEnable = ( VideoProcAmp_Gamma + 1 ) , 133 | VideoProcAmp_WhiteBalance = ( VideoProcAmp_ColorEnable + 1 ) , 134 | VideoProcAmp_BacklightCompensation = ( VideoProcAmp_WhiteBalance + 1 ) , 135 | VideoProcAmp_Gain = ( VideoProcAmp_BacklightCompensation + 1 ) 136 | } VideoProcAmpProperty; 137 | 138 | typedef 139 | enum tagVideoProcAmpFlags 140 | { VideoProcAmp_Flags_Auto = 0x1, 141 | VideoProcAmp_Flags_Manual = 0x2 142 | } VideoProcAmpFlags; 143 | 144 | #endif // __IAMVideoProcAmp_INTERFACE_DEFINED__ 145 | 146 | #if !defined __IAMCameraControl_INTERFACE_DEFINED__ 147 | typedef 148 | enum tagCameraControlProperty 149 | { CameraControl_Pan = 0, 150 | CameraControl_Tilt = ( CameraControl_Pan + 1 ) , 151 | CameraControl_Roll = ( CameraControl_Tilt + 1 ) , 152 | CameraControl_Zoom = ( CameraControl_Roll + 1 ) , 153 | CameraControl_Exposure = ( CameraControl_Zoom + 1 ) , 154 | CameraControl_Iris = ( CameraControl_Exposure + 1 ) , 155 | CameraControl_Focus = ( CameraControl_Iris + 1 ) 156 | } CameraControlProperty; 157 | 158 | typedef 159 | enum tagCameraControlFlags 160 | { CameraControl_Flags_Auto = 0x1, 161 | CameraControl_Flags_Manual = 0x2 162 | } CameraControlFlags; 163 | 164 | #endif // __IAMCameraControl_INTERFACE_DEFINED__ 165 | 166 | #ifndef __EDEVDEFS__ 167 | 168 | #define ED_BASE 0x1000L 169 | 170 | #define ED_MODE_PLAY ED_BASE+200L 171 | #define ED_MODE_STOP ED_BASE+201L 172 | #define ED_MODE_FREEZE ED_BASE+202L // really "pause" 173 | #define ED_MODE_THAW ED_BASE+203L 174 | #define ED_MODE_FF ED_BASE+204L 175 | #define ED_MODE_REW ED_BASE+205L 176 | #define ED_MODE_RECORD ED_BASE+206L 177 | #define ED_MODE_RECORD_STROBE ED_BASE+207L 178 | #define ED_MODE_RECORD_FREEZE ED_BASE+808L // pause recording 179 | #define ED_MODE_STEP ED_BASE+208L // same as "jog" 180 | #define ED_MODE_STEP_FWD ED_BASE+208L // same as ED_MODE_STEP 181 | #define ED_MODE_STEP_REV ED_BASE+809L 182 | #define ED_MODE_SHUTTLE ED_BASE+209L 183 | #define ED_MODE_EDIT_CUE ED_BASE+210L 184 | #define ED_MODE_VAR_SPEED ED_BASE+211L 185 | #define ED_MODE_PERFORM ED_BASE+212L // returned status only 186 | #define ED_MODE_LINK_ON ED_BASE+280L 187 | #define ED_MODE_LINK_OFF ED_BASE+281L 188 | #define ED_MODE_NOTIFY_ENABLE ED_BASE+810L 189 | #define ED_MODE_NOTIFY_DISABLE ED_BASE+811L 190 | #define ED_MODE_SHOT_SEARCH ED_BASE+812L 191 | 192 | #endif // __EDEVDEFS__ 193 | 194 | #endif 195 | 196 | #endif // DSHOW_HEADER_H_INC_ 197 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/MemBuffer.h: -------------------------------------------------------------------------------- 1 | // MemBuffer.h: interface for the MemBuffer class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MEMBUFFER_H__E562743E_3382_4481_8532_C2A2E936FF10__INCLUDED_) 6 | #define AFX_MEMBUFFER_H__E562743E_3382_4481_8532_C2A2E936FF10__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "udshl_defs.h" 12 | #include "smart_ptr.h" 13 | 14 | #include "simplectypes.h" 15 | #include "FrameType.h" 16 | #include "dstring.h" 17 | 18 | struct IMediaSample; 19 | 20 | namespace _DSHOWLIB_NAMESPACE 21 | { 22 | struct MemBufferPImpl; 23 | struct MemBufferCollectionPImpl; 24 | class MemBufferCollection; 25 | class Error; 26 | class GrabberPImpl; 27 | 28 | /** This class saves a pointer to a MemBuffer and some necessary information for this buffer. 29 | * The information saved alongside the buffer is the dimension of the frame, the color format and the 30 | * size of the buffer. If this buffer is initialized without user mode data pointer, the memory 31 | * is automatically allocated on initialization and freed on destruction. 32 | * 33 | * Remember that Windows images are usually bottom up. 34 | **/ 35 | class MemBuffer : public IFrame 36 | { 37 | friend MemBufferCollection; 38 | friend MemBufferCollectionPImpl; 39 | public: 40 | typedef smart_ptr< BITMAPINFOHEADER > tBmInfHPtr; 41 | 42 | public: 43 | /** creates a new MemBuffer by copying an existing one 44 | * removed due to inconsistencies in the meaning of this operation 45 | * @param op MemBuffer to copy 46 | **/ 47 | // MemBuffer( const MemBuffer& op ); 48 | _UDSHL_EXP_API ~MemBuffer(); 49 | 50 | /** get internal color format 51 | * @return internal color format 52 | **/ 53 | _UDSHL_EXP_API tColorformatEnum getColorformat() const; 54 | 55 | /** get internal frame size 56 | * @return internal frame size 57 | **/ 58 | _UDSHL_EXP_API const SIZE& getSize() const; 59 | 60 | /** get size of internal buffer 61 | * @return size of internal buffer 62 | **/ 63 | _UDSHL_EXP_API DWORD getBufferSize() const; 64 | 65 | /** get bits per pixel 66 | * @return number of bits per pixel for the current color format 67 | **/ 68 | _UDSHL_EXP_API int getBitsPerPixel() const; 69 | 70 | /** get pointer to internal buffer 71 | * @return pointer to internal buffer 72 | **/ 73 | _UDSHL_EXP_API BYTE* getPtr() const; 74 | 75 | /** get position in collection 76 | * @return position in collection 77 | **/ 78 | _UDSHL_EXP_API DWORD getCollectionPos() const; 79 | 80 | 81 | /** get collection of buffer 82 | * @return the collection of the buffer 83 | **/ 84 | _UDSHL_EXP_API const MemBufferCollection& getCollection() const; 85 | 86 | /** writes buffer to disk in a bmp-file. 87 | * Attention: existing file are overwritten. 88 | * @param filename is a path and filename relative to the current directory. 89 | * @return Error that contains the error if on occurred 90 | **/ 91 | UDSHL_DEPRECATE_FUNCTION_T_( "saveToFileBMP() function" ) 92 | _UDSHL_EXP_API Error save( const dstringa& filename ) const; 93 | UDSHL_DEPRECATE_FUNCTION_T_( "saveToFileBMP() function" ) 94 | _UDSHL_EXP_API Error save( const dstringw& filename ) const; 95 | UDSHL_DEPRECATE_FUNCTION_T_( "saveToFileBMP() function" ) 96 | _UDSHL_EXP_API Error save( const wchar_t* pFilename ) const; 97 | 98 | /** return pointer to BitmapInfoHeader struct according to the buffer 99 | * The size of the returned buffer is sizeof( BITMAPINFOHEADER ) + sizeof( RGBQUAD ) * tBmInfHPtr->biClrUsed 100 | * @return smart_ptr< BITMAPINFOHEADER > with BitmapInforHeader to this buffer 101 | **/ 102 | UDSHL_DEPRECATE_FUNCTION_T_( "createBitmapInfoHeader() function" ) 103 | _UDSHL_EXP_API tBmInfHPtr getBitmapInfoHeader() const; 104 | 105 | /** increases the lock count by one */ 106 | _UDSHL_EXP_API void lock(); 107 | /** decreases the lock count by one */ 108 | _UDSHL_EXP_API void unlock(); 109 | /** forces a complete unlock of the buffer */ 110 | _UDSHL_EXP_API void forceUnlock(); 111 | /** returns if the buffer is locked */ 112 | _UDSHL_EXP_API bool isLocked() const; 113 | 114 | /** returns the WasLockedFlag. 115 | * the WasLockedFlag is set by the grabber, when it cannot copy to this buffer, because the buffer is locked. 116 | */ 117 | _UDSHL_EXP_API bool getWasLockedFlag() const; 118 | /** sets the WasLockedFlag */ 119 | _UDSHL_EXP_API void setWasLockedFlag( bool f ); 120 | 121 | // since 1.4 122 | /** returns the sample description. */ 123 | _UDSHL_EXP_API const tsMediaSampleDesc& getSampleDesc() const; 124 | 125 | // since 3.0 126 | _UDSHL_EXP_API virtual const FrameTypeInfo& getFrameType() const; 127 | 128 | // since 3.4 129 | virtual bool getMediaSampleInfo_( void* buffer, int buffer_len, int& data_available ) const; 130 | 131 | /* 132 | * Do not use, internal function. 133 | */ 134 | void set_sample_info( IMediaSample& sample ); 135 | void set_sample_info( IMediaSample& sample, GrabberPImpl& parent ); 136 | private: 137 | /** Creates a MemBuffer from the collection parent 138 | * Note: May throw bad_alloc 139 | * @param parent The collection to which this MemBuffer belongs 140 | * @param buffer Optional. == nullptr => Allocate own buffer, != nullptr => a User allocated buffer 141 | * @param collectionpos Position of MemBuffer in MemBufferCollection 142 | **/ 143 | MemBuffer( const MemBufferCollection& parent, void* buffer, DWORD collectionpos, const FrameTypeInfo& type ); 144 | private: 145 | MemBufferPImpl* m_pP; 146 | }; 147 | 148 | /** This method saves the IFrame data into a bitmap file. 149 | * The format of the bitmap file (BITMAPINFO) is specified by the IFrame. When the IFrame does have an 150 | * unknown FrameType, then eINVALID_PARAM_VAL is returned. The IFrame data is not converted to another type, 151 | * this means that the bitmap may contain a odd looking image (e.g. UYVY is treated as RGB565). 152 | * @param buf The IFrame to save. 153 | * @param filename The filename of the target file. This file must not exist. 154 | * @return When the frame could not be saved, then eINVALID_PARAM_VAL is returned. Otherwise eNOERROR 155 | */ 156 | Error _UDSHL_EXP_API saveToFileBMP( const IFrame& buf, const dstringa& filename ); 157 | Error _UDSHL_EXP_API saveToFileBMP( const IFrame& buf, const dstringw& filename ); 158 | Error _UDSHL_EXP_API saveToFileBMP( const IFrame& buf, const wchar_t* pFilename ); 159 | /** This method saves the IFrame data into a bitmap file. 160 | * The format of the bitmap file (BITMAPINFO) is specified by the file_fmt parameter. 161 | * When you specify another color format as the IFrame FrameType, then the data is converted on the fly to the 162 | * desired file format. 163 | * @param buf The IFrame to save. 164 | * @param filename The filename of the target file. This file must not exist. 165 | * @param file_fmt The color format of the target file. 166 | * @param bTreatAs If false, then the IFrame data should be converted to the file_fmt, otherwise 167 | * it should be treated as this frame type (this may lead to odd looking images or even 168 | * bitmaps which do have odd width/height). 169 | * @return When the conversion failed or the frame could not be saved, then eINVALID_PARAM_VAL is returned. 170 | * Otherwise eNOERROR. 171 | */ 172 | Error _UDSHL_EXP_API saveToFileBMP( const IFrame& buf, const dstringa& filename, tColorformatEnum file_fmt, bool bTreatAs = false ); 173 | Error _UDSHL_EXP_API saveToFileBMP( const IFrame& buf, const dstringw& filename, tColorformatEnum file_fmt, bool bTreatAs = false ); 174 | Error _UDSHL_EXP_API saveToFileBMP( const IFrame& buf, const wchar_t* pFilename, tColorformatEnum file_fmt, bool bTreatAs = false ); 175 | 176 | /** This method saves the IFrame data into a JPEG file. 177 | * The IFrame data is internally converted into a format which the JPEG library then converts to a JPEG file. 178 | * When the input IFrame data cannot be converted, then the method fails. 179 | * @param buf The IFrame to save. 180 | * @param filename The filename of the target file. This file must not exist. 181 | * @param quality The quality of the created JPEG file. Must be in the range [0,100], with 100 being the highest. 182 | * @return When the conversion failed, then eINVALID_PARAM_VAL is returned. Otherwise eNOERROR. 183 | */ 184 | Error _UDSHL_EXP_API saveToFileJPEG( const IFrame& buf, const dstringa& filename, int quality = 75 ); 185 | Error _UDSHL_EXP_API saveToFileJPEG( const IFrame& buf, const dstringw& filename, int quality = 75 ); 186 | Error _UDSHL_EXP_API saveToFileJPEG( const IFrame& buf, const wchar_t* pFilename, int quality = 75 ); 187 | 188 | /** This method saves the IFrame data into a TIFF file. 189 | * When the input IFrame data cannot be converted into a format that can be stored in a TIFF file, 190 | * the method fails. 191 | * @param buf The IFrame to be saved 192 | * @param fileName The name of the file to be written 193 | * @return When the buffer cannot be saved as a TIFF file, then eINVALID_PARAM_VAL is returned, otherwise eNOERROR. 194 | */ 195 | Error _UDSHL_EXP_API saveToFileTIFF( const IFrame& buf, const dstringa& fileName ); 196 | Error _UDSHL_EXP_API saveToFileTIFF( const IFrame& buf, const dstringw& fileName ); 197 | Error _UDSHL_EXP_API saveToFileTIFF( const IFrame& buf, const wchar_t* pFileName ); 198 | }; 199 | #endif // !defined(AFX_MEMBUFFER_H__E562743E_3382_4481_8532_C2A2E936FF10__INCLUDED_) 200 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/VideoCaptureDeviceItem.h: -------------------------------------------------------------------------------- 1 | // VideoCaptureDeviceItem.h: interface for the VideoCaptureDeviceItem class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_VIDEOCAPTUREDEVICEITEM_H__7ADEF0BC_B575_4806_8ED2_BE6961FE68DE__INCLUDED_) 6 | #define AFX_VIDEOCAPTUREDEVICEITEM_H__7ADEF0BC_B575_4806_8ED2_BE6961FE68DE__INCLUDED_ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "udshl_defs.h" 12 | 13 | #include "smart_com.h" 14 | #include "int_interface_pre.h" 15 | #include "dstring.h" 16 | 17 | namespace DriverInfoReq 18 | { 19 | struct DeviceInfo; 20 | } 21 | 22 | namespace _DSHOWLIB_NAMESPACE 23 | { 24 | class Grabber; 25 | class CSourceFilterType; 26 | class CVideoCaptureDeviceEnum; 27 | 28 | /** En capsules the data to create a VideoCaptureDevice. 29 | */ 30 | class VideoCaptureDeviceItem 31 | { 32 | friend Grabber; 33 | friend CVideoCaptureDeviceEnum; 34 | public: 35 | /** creates an invalid VideoCaptureDeviceItem. */ 36 | _UDSHL_EXP_API VideoCaptureDeviceItem(); 37 | 38 | /** copy constructor 39 | * @param op2 VideoCaptureDeviceItem to copy info new one 40 | **/ 41 | _UDSHL_EXP_API VideoCaptureDeviceItem( const VideoCaptureDeviceItem& op2 ); 42 | /** dtor */ 43 | _UDSHL_EXP_API ~VideoCaptureDeviceItem(); 44 | 45 | /** assignment operator. 46 | * @return this 47 | * @param op2 48 | */ 49 | _UDSHL_EXP_API VideoCaptureDeviceItem& operator=( const VideoCaptureDeviceItem& op2 ); 50 | 51 | /** compares two VideoCaptureDeviceItems 52 | * @param op2 VideoCaptureDeviceItem to compare with this 53 | * @return true, if the device ID and the device name are equal, else false 54 | **/ 55 | _UDSHL_EXP_API bool operator==( const VideoCaptureDeviceItem& op2 ) const; 56 | 57 | /** compares this to a string. This does toString() == op2 58 | * @param op2 string 59 | * @return true/false 60 | */ 61 | bool operator==( const std::string& op2 ) const 62 | { 63 | return *this == astows( op2 ); 64 | } 65 | _UDSHL_EXP_API bool operator==( const dstringw& op2 ) const; 66 | 67 | /** test if instance is a valid device 68 | * @return true if this is valid 69 | **/ 70 | _UDSHL_EXP_API bool isValid() const; 71 | 72 | /** returns the name of the capture device, as returned from its driver 73 | * @return the name of the capture device 74 | **/ 75 | std::string getName() const 76 | { 77 | return toString(); 78 | } 79 | 80 | /** returns the serial number 81 | * @return true on success, false otherwise 82 | */ 83 | _UDSHL_EXP_API bool getSerialNumber( __int64& val ) const; 84 | 85 | /** returns a unique name for this device. This is only available devices which return 86 | * a serial number. 87 | * @return When the device has a SerialNumber then a unique name, otherwise 88 | * a empty string is returned (getUniqueName().empty() == true) 89 | */ 90 | std::string getUniqueName() const 91 | { 92 | return wstoas( getUniqueName_() ); 93 | } 94 | std::wstring getUniqueNameW() const 95 | { 96 | return getUniqueName_(); 97 | } 98 | 99 | 100 | /** returns the unique name of the device in this system. 101 | * USB devices keep the same name as long as you do not change the USB port at which this 102 | * device resides. 103 | * IEEE 1394 devices keep their names, but may have a different name on a different machine. 104 | * @return The display name of the device. 105 | */ 106 | std::string getDisplayName() const 107 | { 108 | return wstoas( getBaseNameW() ); 109 | } 110 | std::wstring getDisplayNameW() const 111 | { 112 | return getDisplayName_(); 113 | } 114 | 115 | /** returns the base name of the device without the identification number appended to the device name. 116 | * @return The base name of the device. 117 | */ 118 | std::string getBaseName() const 119 | { 120 | return wstoas( getBaseNameW() ); 121 | } 122 | /** returns the base name of the device without the identification number appended to the device name. 123 | * @return The base name of the device. 124 | */ 125 | std::wstring getBaseNameW() const 126 | { 127 | return getBaseName_(); 128 | } 129 | 130 | 131 | /** Creates a textual representation for this VideoCaptureDeviceItem 132 | * @return The textual representation. 133 | */ 134 | std::string toString() const 135 | { 136 | return wstoas( toStringW() ); 137 | } 138 | /** Creates a textual representation for this VideoCaptureDeviceItem 139 | * @return The textual representation. 140 | */ 141 | std::wstring toStringW() const 142 | { 143 | return getFriendlyName_(); 144 | } 145 | 146 | 147 | /** returns the name of the capture device, as returned from its driver 148 | * @return the name of the capture device 149 | **/ 150 | UDSHL_DEPRECATE_FUNCTION_T_( "VideoCaptureDeviceItem::toString() method" ) 151 | _UDSHL_EXP_API const char* c_str() const; 152 | 153 | 154 | /** returns the result of a lexicographical compare of the name 155 | * @return true, if this is before op 156 | * @param op the VideoCaptureDeviceItem to compare with 157 | **/ 158 | _UDSHL_EXP_API bool operator<(const VideoCaptureDeviceItem& op) const; 159 | 160 | /** generates an invalid device 161 | * @return an invalid device 162 | * @see isValid() 163 | **/ 164 | _UDSHL_EXP_API static VideoCaptureDeviceItem createInvalid(); 165 | 166 | /** Compares the device's serial number with a given serial number 167 | */ 168 | _UDSHL_EXP_API bool operator==( const __int64& serial ) const; 169 | 170 | /** Returns a reference to an internal interface. 171 | * With this function you can fetch an custom interface from the codec. 172 | * To use this function your compiler must support the __uuidof operator and the interface must 173 | * be assigned an iid with the __declspec( uuid( "iid" ) ) compiler option. When this option is 174 | * not available then you should use the other function. 175 | * \param pItf 176 | * \return A reference to the interface requested or 0 if the interface is not supported. 177 | */ 178 | template 179 | smart_com getInternalInterface( smart_com& pItf ) 180 | { 181 | return getInternalInterface( __uuidof( TItf ), pItf ); 182 | } 183 | 184 | /** Returns a reference to an internal interface. 185 | * \par usage 186 | * 187 | * smart_com pItf; 188 | * if( pCodec->getInternalInterface( pItf ) == 0 ) 189 | * { 190 | * ... // interface is not supported, so error handling 191 | * } 192 | * else 193 | * { 194 | * ... // use the interface 195 | * } 196 | * 197 | * \param pItf A smart_com to a interface reference. 198 | * \param riid An interface ID. 199 | * \return A reference to the interface requested or 0 if the interface is not supported. 200 | */ 201 | template 202 | smart_com getInternalInterface( REFIID riid, smart_com& pItf ) 203 | { 204 | pItf = 0; 205 | getInternalInterface_( riid, (void**) &pItf.get() ); 206 | return pItf; 207 | } 208 | 209 | bool execKsPropQuerySupported( REFGUID guidPropSet, DWORD dwPropID ) 210 | { 211 | DWORD type_supported = 0; 212 | HRESULT hr = execKsPropQuerySupported( guidPropSet, dwPropID, &type_supported ); 213 | return SUCCEEDED( hr ) && type_supported != 0; 214 | } 215 | HRESULT execKsPropSet( REFGUID guidPropSet, DWORD dwPropID, LPVOID pPropData, DWORD cbPropData ) 216 | { 217 | return execKsPropSet( guidPropSet, dwPropID, pPropData, cbPropData, pPropData, cbPropData ); 218 | } 219 | HRESULT execKsPropGet( REFGUID guidPropSet, DWORD dwPropID, LPVOID pPropData, DWORD cbPropData, DWORD& cbReturned ) 220 | { 221 | return execKsPropGet( guidPropSet, dwPropID, pPropData, cbPropData, pPropData, cbPropData, &cbReturned ); 222 | } 223 | 224 | _UDSHL_EXP_API HRESULT execKsPropQuerySupported( REFGUID guidPropSet, DWORD dwPropID, DWORD *pTypeSupport ); 225 | _UDSHL_EXP_API HRESULT execKsPropSet( REFGUID guidPropSet, DWORD dwPropID, LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData ); 226 | _UDSHL_EXP_API HRESULT execKsPropGet( REFGUID guidPropSet, DWORD dwPropID, LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData, DWORD *pcbReturned ); 227 | 228 | _UDSHL_EXP_API HRESULT getDriverVersion( int& major, int& minor, int& spnum, int& build ); 229 | _UDSHL_EXP_API HRESULT getDeviceVersion( unsigned __int64& version ); 230 | 231 | _UDSHL_EXP_API HRESULT getDeviceInfo( DriverInfoReq::DeviceInfo& info ); 232 | 233 | private: 234 | _UDSHL_EXP_API dstringw getUniqueName_() const; 235 | _UDSHL_EXP_API dstringw getDisplayName_() const; 236 | _UDSHL_EXP_API dstringw getBaseName_() const; 237 | _UDSHL_EXP_API dstringw getFriendlyName_() const; 238 | 239 | 240 | /// internal ctor 241 | VideoCaptureDeviceItem( icbase::IDShowFactoryObjectInfo* pInfo, unsigned int num ); 242 | 243 | _UDSHL_EXP_API HRESULT getInternalInterface_( REFIID riid, void** ppv ); 244 | 245 | HRESULT internal_bind() const; 246 | 247 | smart_com getSourceFilterType() const; 248 | 249 | mutable smart_com m_pSourceFilter; 250 | 251 | /// internal data 252 | smart_com m_pInternalData; 253 | 254 | dstringw friendly_name_; 255 | dstringa friendly_name_a_; 256 | }; 257 | }; 258 | 259 | #endif // !defined(AFX_VIDEOCAPTUREDEVICEITEM_H__7ADEF0BC_B575_4806_8ED2_BE6961FE68DE__INCLUDED_) 260 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/SingleCameraControlRobotArm.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Debug 7 | Win32 8 | 9 | 10 | Release 11 | Win32 12 | 13 | 14 | Debug 15 | x64 16 | 17 | 18 | Release 19 | x64 20 | 21 | 22 | 23 | {7145AD21-96E5-4DE7-B3A3-AA7663728595} 24 | Win32Proj 25 | SingleCameraControlRobotArm 26 | 8.1 27 | 28 | 29 | 30 | Application 31 | true 32 | v140 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v140 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v140 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v140 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | $(IncludePath) 76 | 77 | 78 | true 79 | 80 | 81 | false 82 | 83 | 84 | false 85 | 86 | 87 | 88 | 89 | 90 | Level3 91 | Disabled 92 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 93 | 94 | 95 | Console 96 | true 97 | C:\TwinCAT\AdsApi\TcAdsDll\Lib;%(AdditionalLibraryDirectories) 98 | TcAdsDll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 99 | 100 | 101 | 102 | 103 | 104 | 105 | Level3 106 | Disabled 107 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 108 | 109 | 110 | Console 111 | true 112 | 113 | 114 | 115 | 116 | Level3 117 | 118 | 119 | MaxSpeed 120 | true 121 | true 122 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 123 | 124 | 125 | Console 126 | true 127 | true 128 | true 129 | 130 | 131 | 132 | 133 | Level3 134 | 135 | 136 | MaxSpeed 137 | true 138 | true 139 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 140 | 141 | 142 | Console 143 | true 144 | true 145 | true 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/simplectypes.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef SIMPLECTYPES_H_INC 3 | #define SIMPLECTYPES_H_INC 4 | 5 | typedef LONGLONG REFERENCE_TIME; 6 | 7 | #ifndef MAKEFOURCC 8 | #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ 9 | ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ 10 | ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) 11 | #endif //defined(MAKEFOURCC) 12 | 13 | #ifndef __midl 14 | namespace _DSHOWLIB_NAMESPACE 15 | { 16 | #endif 17 | /** the possible error types */ 18 | typedef enum 19 | { 20 | eNOERROR = 0, ///< no error occurred 21 | eUNKNOWN, ///< an unknown error occurred 22 | 23 | eDSHOWLIB_EXCEPTION, ///< an unexpected DShowLibException occurred, please contact the producer's support 24 | eUNEXPECTED_DSHOWLIB_BEHAVIOUR, ///< DShowLib behaves unexpected, please contact the producer's support 25 | 26 | eOUT_OF_MEMORY, ///< out of memory 27 | eWRITE_ERROR, ///< an error occurred while writing 28 | eNO_VIDEO_HARDWARE_FOUND, ///< no video hardware found on this system 29 | 30 | eINVALID_PARAM_VAL, ///< an invalid parameter was passed in 31 | eAUTOMATION_ENABLED, ///< automation is enabled for given property, could not set/get value 32 | eNO_CURRENT_VALUE, ///< no current value for setting is available 33 | eINVALID_MEMBUFFER, ///< the MemBuffer is not compatible to the grabber format or the MemBuffer is not valid 34 | eMODE_ALREADY_ACTIVE, ///< the requested mode is already the active one, we cannot switch 35 | eNO_DEVICE_OPENED, ///< no device opened, please open one to operate 36 | eDEVICE_INVALID, ///< the device has become invalid (e. g. it was unplugged) 37 | eDRIVER_INSTALLATION, ///< driver component not found; please check your driver installation 38 | eNOT_AVALILABLE_WITH_CURRENT_DEVICE, ///< the called function is not available with currently set device 39 | eAUTOMATION_NOT_AVAILABLE, ///< automation is not available for the given property 40 | eDEVICE_NOT_FOUND, ///< the device was not found 41 | eITEM_DOES_NOT_FIT_TO_DEV, ///< the given item does not fit to the current device 42 | eFUNC_NOT_AVAIL_IN_LIVEMODE, ///< this function cannot be called if live mode is active 43 | eFUNC_ONLY_AVAIL_IN_LIVEMODE, ///< this function cannot be called if live mode is not active 44 | eNOT_INITIALIZED, ///< the object is not initialized 45 | eNO_FRAMEGRABBER_SINK, ///< a function was called, which relies on having a FrameGrabberSink as sink_type 46 | eSERIALNUMBER_INVALID, ///< the serial number is invalid 47 | eVIDEOFORMAT_INVALID, ///< the current VideoFormat is invalid 48 | eUNEXPECTED_SINKFORMAT_CHANGE, ///< during building the filter graph, the sink format changed unexpectedly and the MemBufferCollection got invalid to this new format 49 | eNO_EXTERNALTRANSPORT_AVAILABLE, ///< getETMode() and setETMode() don't function without an ExternalTransport capable device 50 | eTIMEOUT_PREMATURLY_ELAPSED, ///< the timeout passed to snapImages( ... ) did elapse before all images could be snaped 51 | 52 | ePASSED_DATA_DOES_NOT_FIT_TO_COMPRESSOR, ///< the data passed to the AviSink does not fit to the Compressor 53 | 54 | eOPTION_NOT_AVAILABLE, ///< an option is not available, e.g. you called setFlipH and the VideoCaptureDevice does not support flipping 55 | eCOMPONENT_NOT_FOUND, ///< a component of the installation was not found, please check your installation 56 | 57 | eNO_CODECS_FOUND, ///< no codec installed on this system 58 | 59 | eINCOMPATIBLE_VERSION, ///< the version of the data format passed to the function is incompatible with the function 60 | eREAD_ERROR, ///< an error occurred while trying to read data from a file 61 | eINCOMPLETE, ///< The operation was only partially successful, e.g. not all properties of the grabber could be restored 62 | 63 | eFILENOTFOUND, 64 | 65 | } tErrorEnum; 66 | 67 | /** the available sink types */ 68 | typedef enum 69 | { 70 | eFRAME_GRABBER_SINK = 0x1, ///< the sink is of type FrameGrabberSink 71 | eMEDIASTREAM_SINK = 0x2, ///< the sink is a type which creates avi/mpeg/... files 72 | eAVI_SINK = 0x6, ///< the sink is of type AviSink 73 | eFRAMEHANDLER_SINK = 0x8, 74 | } tSinkType; 75 | 76 | /** possible OutputColorformats 77 | **/ 78 | typedef enum 79 | { 80 | eInvalidColorformat = 0, ///< invalid color format (do not use !!) 81 | eRGB32 = 1, ///< 32 bit BGRA 82 | eRGB24, ///< 24 bit BGR 83 | //UDSHL_DEPRECATE_FUNCTION_TEXT_( "RGB32 type for better performance and images. ) 84 | eRGB565, ///< 5-6-5 BGR, 16 bit 85 | //UDSHL_DEPRECATE_FUNCTION_TEXT_( "RGB32 type for better performance and images. ) 86 | eRGB555, ///< 5-5-5 BGR, 16 bit 87 | //UDSHL_DEPRECATE_FUNCTION_T_( "Y800 type for better performance and images." ) 88 | eRGB8, ///< 8 bit grey 89 | eY8 = eRGB8, ///< because of old versions, eY8 and eRGB8 are equal 90 | eUYVY, ///< 16 bit YUV format layout U0Y0V0Y1, top down 91 | eY800, ///< 8 bit Y format, top down (this means no transformation between input Y800 and 92 | ///< the sink is needed) 93 | //UDSHL_DEPRECATE_FUNCTION_T_( "native types the camera delivers, like Y16 when available." ) 94 | eYGB1, ///< 16 bit Y (10 bit valid) grey, top down, bits ordered per pixel [76543210______98], 95 | /** Algorithm for converting this layout to eY800 : 96 | BYTE convYGB1toY8( __int16 y ) 97 | { 98 | BYTE* p = (BYTE*) &y; 99 | unsigned __int16 x = ((unsigned int)p[0] << 8) | p[1]; 100 | return (BYTE) ((x >> 2) & 0xFF ); 101 | } 102 | */ 103 | //UDSHL_DEPRECATE_FUNCTION_T_( "native types the camera delivers, like Y16 when available." ) 104 | eYGB0, ///< 16 bit Y (10 bit valid) grey, top down, bits ordered per pixel [10______98765432], 105 | /** Algorithm for converting this layout to eY800 : 106 | BYTE convYGB0toY8( __int16 y ) 107 | { 108 | return (BYTE) (y & 0xFF); 109 | } 110 | */ 111 | eBY8, ///< Bayer Y800 Format 112 | eY16, ///< 16-bit gray, top down. Each pixel is represented by an unsigned 16 bit integer (unsigned short, uint16_t) 113 | /** Algorithm for converting this layout to eY800 : 114 | BYTE convY16toY8( uint16_t y ) 115 | { 116 | return (BYTE) (y >> 8); 117 | } 118 | */ 119 | eRGB64, ///* build the same as RGB32 but each factor is now 16 bit 120 | } tColorformatEnum; 121 | 122 | 123 | /// Mask for RGB565-Format 124 | typedef enum 125 | { 126 | eRGB565_R = 0xf800, ///< Mask for blue (1111100000000000) 127 | eRGB565_G = 0x07e0, ///< Mask for green (0000011111100000) 128 | eRGB565_B = 0x001f, ///< Mask for red (0000000000011111) 129 | } RGB565Mask; 130 | 131 | /// Mask for RGB555-Format 132 | typedef enum 133 | { 134 | eRGB555_R = 0x7c00, ///< Mask for blue (0111110000000000) 135 | eRGB555_G = 0x03e0, ///< Mask for green (0000001111100000) 136 | eRGB555_B = 0x001f, ///< Mask for red (0000000000011111) 137 | } RGB555Mask; 138 | 139 | /// Enumeration of frame type. Member of tsMediaSampleDesc. 140 | typedef enum 141 | { 142 | eFRAME_INTERLEAVED = 0, ///< interleaved frame 143 | eFRAME_FIELD1 = 1, ///< the first field of a frame 144 | eFRAME_FIELD2 = 2, ///< the second field of a frame 145 | } tFrameDesc; 146 | 147 | /** Graph positions 148 | * the graph most likely will look like this : 149 | * 150 | * VCD -> x1 -> tee filter -> x2 -> sink 151 | * -> x3 -> renderer 152 | * 153 | * The positions marked with x(n) can be configured by the following enum 154 | */ 155 | typedef enum 156 | { 157 | ePP_NONE = 0x0, 158 | ePP_DEVICE = 0x1, ///< x1, directly behind the source 159 | ePP_SINK = 0x2, ///< x2, directly in front of a frame grabber sink/codec 160 | ePP_DISPLAY = 0x4, ///< x3, directly in front of the video renderer 161 | } tPathPosition; 162 | 163 | #ifndef __midl 164 | 165 | /// Structure describing the properties of a frame (e.g. a MemBuffer) 166 | typedef struct tsMediaSampleDesc 167 | { 168 | REFERENCE_TIME SampleStart; ///< the start time of the sample as set by the video capture device 169 | REFERENCE_TIME SampleEnd; ///< the end time of the sample as set by the video capture device 170 | DWORD FrameNumber; ///< the frame number of the sample as set by the video capture device 171 | ///< the device does not need to set this field, or keep it updated 172 | tFrameDesc FrameType; ///< the type of the frame 173 | } tsMediaSampleDesc; 174 | 175 | /** Public subtypes which you can use in applications. 176 | * Other common subtypes (which are included by the directshow headers) are : 177 | MEDIASUBTYPE_RGB32 178 | MEDIASUBTYPE_RGB24 179 | MEDIASUBTYPE_RGB565 180 | MEDIASUBTYPE_RGB555 181 | MEDIASUBTYPE_RGB8 182 | MEDIASUBTYPE_UYVY 183 | MEDIASUBTYPE_YUY2 184 | ... 185 | 186 | * When you want to create your own subtypes, then you need to only alter the first DWORD, which is the 187 | * String Representation of your FourCC. 188 | * You may also create your completely own GUIDs which do not correspond to FourCCs, but then no string 189 | * representation can be given by the library. 190 | */ 191 | static const GUID MEDIASUBTYPE_Y800 = { MAKEFOURCC('Y','8','0','0'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }; 192 | static const GUID MEDIASUBTYPE_Y8 = { MAKEFOURCC('Y','8',' ',' '), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }; 193 | static const GUID MEDIASUBTYPE_BY8 = { MAKEFOURCC('B','Y','8',' '), 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 194 | static const GUID MEDIASUBTYPE_YGB0 = { MAKEFOURCC('Y','G','B','0'), 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 195 | static const GUID MEDIASUBTYPE_YGB1 = { MAKEFOURCC('Y','G','B','1'), 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 196 | static const GUID MEDIASUBTYPE_YUY2 = { MAKEFOURCC('Y','U','Y','2'), 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 197 | static const GUID MEDIASUBTYPE_Y16 = { MAKEFOURCC('Y','1','6',' '), 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 198 | static const GUID MEDIASUBTYPE_YUV16PLANAR = { MAKEFOURCC( 'Y', 'U', 'G', 'p' ), 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 199 | static const GUID MEDIASUBTYPE_RGB64 = { MAKEFOURCC( 'R', 'G', 'B', '6' ), 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; 200 | 201 | /// Pattern to user for a buffer fill (to use when debugging) 202 | typedef enum 203 | { 204 | eTERMINATION, ///< fills with 0 and all bits set for all values of the last pixel 205 | eBWH, ///< fills with horizontal lines, black/white 206 | eBWV, ///< fills with vertical lines, black/white 207 | eBWQ, ///< fills with alternate pixels (mini quads) black/white 208 | } tPatternEnum; 209 | #endif 210 | 211 | #ifndef __midl 212 | }; 213 | #endif 214 | 215 | #endif /* SIMPLECTYPES_H_INC */ 216 | -------------------------------------------------------------------------------- /SingleCameraControlRobotArm/IC Imaging Control/classlib/include/VCDPropertyIDTis.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef VCDPROPERTYIDTIS_H_INC_ 3 | #define VCDPROPERTYIDTIS_H_INC_ 4 | 5 | namespace _DSHOWLIB_NAMESPACE 6 | { 7 | static const GUID VCDID_TestPattern = { 0xF7EAA79E, 0x90FA, 0x4969, { 0xB0, 0x5F, 0x9B, 0xDA, 0xF1, 0xA4, 0x32, 0x8F } }; 8 | 9 | static const GUID VCDID_MultiSlope = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x29, 0x90 } }; 10 | 11 | static const GUID VCDElement_MultiSlope_SlopeValue0 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x30, 0x90 } }; 12 | static const GUID VCDElement_MultiSlope_ResetValue0 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x30, 0x91 } }; 13 | static const GUID VCDElement_MultiSlope_SlopeValue1 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x31, 0x90 } }; 14 | static const GUID VCDElement_MultiSlope_ResetValue1 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x31, 0x91 } }; 15 | static const GUID VCDElement_MultiSlope_SlopeValue2 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x32, 0x90 } }; 16 | static const GUID VCDElement_MultiSlope_ResetValue2 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x32, 0x91 } }; 17 | static const GUID VCDElement_MultiSlope_SlopeValue3 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x33, 0x90 } }; 18 | static const GUID VCDElement_MultiSlope_ResetValue3 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x33, 0x91 } }; 19 | static const GUID VCDElement_MultiSlope_SlopeValue4 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x34, 0x90 } }; 20 | static const GUID VCDElement_MultiSlope_ResetValue4 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x34, 0x91 } }; 21 | static const GUID VCDElement_MultiSlope_SlopeValue5 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x35, 0x90 } }; 22 | static const GUID VCDElement_MultiSlope_ResetValue5 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x35, 0x91 } }; 23 | static const GUID VCDElement_MultiSlope_SlopeValue6 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x36, 0x90 } }; 24 | static const GUID VCDElement_MultiSlope_ResetValue6 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x36, 0x91 } }; 25 | static const GUID VCDElement_MultiSlope_SlopeValue7 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x37, 0x90 } }; 26 | static const GUID VCDElement_MultiSlope_ResetValue7 = { 0x630B1F3E, 0x4A0A, 0x4963, { 0x89, 0xB1, 0x86, 0xBA, 0x8F, 0xDA, 0x37, 0x91 } }; 27 | 28 | static const GUID VCDElement_WhiteBalanceBlue = { 0x6519038A, 0x1AD8, 0x4E91, { 0x90, 0x21, 0x66, 0xD6, 0x40, 0x90, 0xCC, 0x85 } }; 29 | static const GUID VCDElement_WhiteBalanceRed = { 0x6519038B, 0x1AD8, 0x4E91, { 0x90, 0x21, 0x66, 0xD6, 0x40, 0x90, 0xCC, 0x85 } }; 30 | static const GUID VCDElement_AutoReference = { 0x6519038C, 0x1AD8, 0x4E91, { 0x90, 0x21, 0x66, 0xD6, 0x40, 0x90, 0xCC, 0x85 } }; 31 | 32 | static const GUID VCDElement_TriggerPolarity = { 0x6519038D, 0x1AD8, 0x4E91, { 0x90, 0x21, 0x66, 0xD6, 0x40, 0x90, 0xCC, 0x85 } }; 33 | static const GUID VCDElement_TriggerMode = { 0x6519038E, 0x1AD8, 0x4E91, { 0x90, 0x21, 0x66, 0xD6, 0x40, 0x90, 0xCC, 0x85 } }; 34 | 35 | static const GUID VCDElement_AutoMaxValue = { 0x6519038F, 0x1AD8, 0x4E91, { 0x90, 0x21, 0x66, 0xD6, 0x40, 0x90, 0xCC, 0x85 } }; 36 | static const GUID VCDElement_AutoMaxValueAuto = { 0x65190390, 0x1AD8, 0x4E91, { 0x90, 0x21, 0x66, 0xD6, 0x40, 0x90, 0xCC, 0x85 } }; 37 | static const GUID VCDElement_AutoMinValue = { 0x65190391, 0x1AD8, 0x4E91, { 0x90, 0x21, 0x66, 0xD6, 0x40, 0x90, 0xCC, 0x85 } }; 38 | 39 | 40 | static const GUID VCDID_Binning = { 0x4f95a06d, 0x9c15, 0x407b, { 0x96, 0xab, 0xcf, 0x3f, 0xed, 0x4, 0x7b, 0xa4 } }; 41 | 42 | // 2CED6FD6-AB4D-4C74-904C-D682E53B9CC5 43 | static const GUID VCDID_PartialScanOffset = { 0x2CED6FD6, 0xAB4D, 0x4C74, { 0x90, 0x4C, 0xD6, 0x82, 0xE5, 0x3B, 0x9C, 0xC5 } }; 44 | 45 | // 5E59F654-7B47-4458-B4C6-5D4F0D175FC1 46 | static const GUID VCDElement_PartialScanOffsetX = { 0x5E59F654, 0x7B47, 0x4458, { 0xB4, 0xC6, 0x5D, 0x4F, 0x0D, 0x17, 0x5F, 0xC1 } }; 47 | // 87FB6C02-98A8-46B0-B18D-6442D9775CD3 48 | static const GUID VCDElement_PartialScanOffsetY = { 0x87FB6C02, 0x98A8, 0x46B0, { 0xB1, 0x8D, 0x64, 0x42, 0xD9, 0x77, 0x5C, 0xD3 } }; 49 | 50 | static const GUID VCDID_GPIO = { 0x86D89D69, 0x9880, 0x4618, { 0x9B, 0xF6, 0xDE, 0xD5, 0xE8, 0x38, 0x34, 0x49 } }; 51 | 52 | static const GUID VCDElement_GPIOIn = { 0x7D006621, 0x761D, 0x4B88, { 0x9C, 0x5F, 0x8B, 0x90, 0x68, 0x57, 0xA5, 0x00 } }; 53 | static const GUID VCDElement_GPIOOut = { 0x7D006621, 0x761D, 0x4B88, { 0x9C, 0x5F, 0x8B, 0x90, 0x68, 0x57, 0xA5, 0x01 } }; 54 | static const GUID VCDElement_GPIOWrite = { 0x7D006621, 0x761D, 0x4B88, { 0x9C, 0x5F, 0x8B, 0x90, 0x68, 0x57, 0xA5, 0x02 } }; 55 | static const GUID VCDElement_GPIORead = { 0x7D006621, 0x761D, 0x4B88, { 0x9C, 0x5F, 0x8B, 0x90, 0x68, 0x57, 0xA5, 0x03 } }; 56 | 57 | // DC320EDE-DF2E-4A90-B926-71417C71C57C 58 | static const GUID VCDID_Strobe = { 0xDC320EDE, 0xDF2E, 0x4A90, { 0xB9, 0x26, 0x71, 0x41, 0x7C, 0x71, 0xC5, 0x7C } }; 59 | 60 | // B41DB628-0975-43F8-A9D9-7E0380580ACA 61 | static const GUID VCDElement_StrobePolarity = { 0xB41DB628, 0x0975, 0x43F8, { 0xA9, 0xD9, 0x7E, 0x03, 0x80, 0x58, 0x0A, 0xCA } }; 62 | static const GUID VCDElement_StrobeDuration = { 0xB41DB628, 0x0975, 0x43F8, { 0xA9, 0xD9, 0x7E, 0x03, 0x80, 0x58, 0x0A, 0xCB } }; 63 | static const GUID VCDElement_StrobeDelay = { 0xB41DB628, 0x0975, 0x43F8, { 0xA9, 0xD9, 0x7E, 0x03, 0x80, 0x58, 0x0A, 0xCC } }; 64 | 65 | static const GUID VCDElement_StrobeMode = { 0xB41DB628, 0x0975, 0x43F8, { 0xA9, 0xD9, 0x7E, 0x03, 0x80, 0x58, 0x0A, 0xCD } }; 66 | 67 | // {3A3A8F77-6440-46cc-940A-8752B02E6C29} 68 | static const GUID VCDID_ColorEnhancement = { 0x3a3a8f77, 0x6440, 0x46cc, { 0x94, 0xa, 0x87, 0x52, 0xb0, 0x2e, 0x6c, 0x29 } }; 69 | 70 | // {8407E480-175A-498c-8171-08BD987CC1AC} 71 | static const GUID VCDElement_WhiteBalanceGreen = { 0x8407e480, 0x175a, 0x498c, { 0x81, 0x71, 0x8, 0xbd, 0x98, 0x7c, 0xc1, 0xac } }; 72 | 73 | static const GUID VCDElement_PartialScanAutoCenter = { 0x36eaa683, 0x3321, 0x44be, { 0x9d, 0x73, 0xe1, 0xfd, 0x4c, 0x3f, 0xdb, 0x87 } }; 74 | 75 | 76 | // {FDB4003C-552C-4faa-B87B-42E888D54147} 77 | static const GUID VCDElement_SoftwareTrigger = { 0xfdb4003c, 0x552c, 0x4faa, { 0xb8, 0x7b, 0x42, 0xe8, 0x88, 0xd5, 0x41, 0x47 } }; 78 | 79 | // {C337CFB8-EA08-4E69-A655-586937B6AFEC} 80 | static const GUID VCDElement_TriggerDelay = { 0xc337cfb8, 0xea08, 0x4e69, { 0xa6, 0x55, 0x58, 0x69, 0x37, 0xb6, 0xaf, 0xec } }; 81 | 82 | // {859A76B9-E289-472B-AB05-C9B3F26DCAA0} 83 | static const GUID VCDElement_TriggerOperation = { 0x859a76b9, 0xe289, 0x472b, { 0xab, 0x5, 0xc9, 0xb3, 0xf2, 0x6d, 0xca, 0xa0 } }; 84 | 85 | // {07D2DD39-3F10-4E0F-8EE5-3EED067A53C6} 86 | static const GUID VCDElement_OnePushRunning = { 0x7d2dd39, 0x3f10, 0x4e0f, { 0x8e, 0xe5, 0x3e, 0xed, 0x6, 0x7a, 0x53, 0xc6 } }; 87 | 88 | // {8C3430E8-0E35-4535-8015-EB17A740D44F} 89 | static const GUID VCDElement_WhiteBalanceCY = { 0x8c3430e8, 0xe35, 0x4535, { 0x80, 0x15, 0xeb, 0x17, 0xa7, 0x40, 0xd4, 0x4f } }; 90 | 91 | // {7747C873-614C-4492-BC93-CC9547698854} 92 | static const GUID VCDElement_WhiteBalanceMG = { 0x7747c873, 0x614c, 0x4492, { 0xbc, 0x93, 0xcc, 0x95, 0x47, 0x69, 0x88, 0x54 } }; 93 | 94 | // {8CA6642E-D3E5-4ED8-95A1-B13D7131B465} 95 | static const GUID VCDElement_AutoRoiEnable = { 0x8ca6642e, 0xd3e5, 0x4ed8, { 0x95, 0xa1, 0xb1, 0x3d, 0x71, 0x31, 0xb4, 0x65 } }; 96 | // {8CA6642F-D3E5-4ED8-95A1-B13D7131B465} 97 | static const GUID VCDElement_AutoRoiLeft = { 0x8ca6642f, 0xd3e5, 0x4ed8, { 0x95, 0xa1, 0xb1, 0x3d, 0x71, 0x31, 0xb4, 0x65 } }; 98 | // {8CA66430-D3E5-4ED8-95A1-B13D7131B465} 99 | static const GUID VCDElement_AutoRoiTop = { 0x8ca66430, 0xd3e5, 0x4ed8, { 0x95, 0xa1, 0xb1, 0x3d, 0x71, 0x31, 0xb4, 0x65 } }; 100 | // {8CA66431-D3E5-4ED8-95A1-B13D7131B465} 101 | static const GUID VCDElement_AutoRoiRight = { 0x8ca66431, 0xd3e5, 0x4ed8, { 0x95, 0xa1, 0xb1, 0x3d, 0x71, 0x31, 0xb4, 0x65 } }; 102 | // {8CA66432-D3E5-4ED8-95A1-B13D7131B465} 103 | static const GUID VCDElement_AutoRoiBottom = { 0x8ca66432, 0xd3e5, 0x4ed8, { 0x95, 0xa1, 0xb1, 0x3d, 0x71, 0x31, 0xb4, 0x65 } }; 104 | // {49E806F3-7CDA-48BA-A67B-CDEDE8728C99} 105 | static const GUID VCDElement_AutoRoiLeftRelative = { 0x49E806F3, 0x7CDA, 0x48BA, { 0xA6, 0x7B, 0xCD, 0xED, 0xE8, 0x72, 0x8C, 0x99 } }; 106 | // {9333F45C-1AFC-42B0-80F7-6DFF083C86FD} 107 | static const GUID VCDElement_AutoRoiTopRelative = { 0x9333F45C, 0x1AFC, 0x42B0, { 0x80, 0xF7, 0x6D, 0xFF, 0x08, 0x3C, 0x86, 0xFD } }; 108 | // {67E6E9BC-8544-4CC8-A9C3-E463BE699B1E} 109 | static const GUID VCDElement_AutoRoiWidthRelative = { 0x67E6E9BC, 0x8544, 0x4CC8, { 0xA9, 0xC3, 0xE4, 0x63, 0xBE, 0x69, 0x9B, 0x1E } }; 110 | // {8EC2ED61-B33A-4590-9E62-C43228953B59} 111 | static const GUID VCDElement_AutoRoiHeightRelative = { 0x8EC2ED61, 0xB33A, 0x4590, { 0x9E, 0x62, 0xC4, 0x32, 0x28, 0x95, 0x3B, 0x59 } }; 112 | 113 | static const GUID VCDElement_WhiteBalanceMode = { 0xAB98F78D, 0x18A6, 0x4EB2, { 0xA5, 0x56, 0xC1, 0x10, 0x10, 0xEC, 0x9D, 0xF7 } }; 114 | static const GUID VCDElement_Auto_Preset = { 0xE5F037C5, 0xA466, 0x4F80, { 0xA7, 0x17, 0x3E, 0x50, 0x60, 0x53, 0x27, 0x4A } }; 115 | static const GUID VCDElement_Auto_TemperaturePreset = { 0x88143B6D, 0xA1C5, 0x45D6, { 0xBF, 0x7F, 0x95, 0xF6, 0x44, 0x7A, 0xB1, 0xBE } }; 116 | static const GUID VCDElement_Temperature = { 0xB8D65671, 0x94E0, 0x4DBB, { 0x92, 0x75, 0x0C, 0x29, 0xD4, 0xF6, 0xBA, 0x87 } }; 117 | 118 | static const GUID VCDID_Denoise = { 0xC3C9944A, 0xE6F6, 0x4E25, { 0xA0, 0xBE, 0x53, 0xC0, 0x66, 0xAB, 0x65, 0xD8 } }; 119 | static const GUID VCDID_Highlightreduction = { 0x546541AD, 0xC815, 0x4D82, { 0xAF, 0xA9, 0x9D, 0x59, 0xAF, 0x9F, 0x39, 0x9E } }; 120 | static const GUID VCDID_IRCutFilter = { 0x7608DD7D, 0xA1F8, 0x4BB4, { 0x8A, 0x73, 0x88, 0x84, 0x20, 0x9E, 0x90, 0x19 } }; 121 | 122 | static const GUID VCDID_PropertySets = { 0xA24E5340, 0xBC75, 0x4B5B, { 0xB1, 0x42, 0x09, 0x17, 0xC2, 0xCC, 0xFB, 0x3D } }; 123 | static const GUID VCDElement_PropertySetSelector = { 0x54F4C7E5, 0xB045, 0x4D63, { 0xA2, 0x77, 0x9B, 0x23, 0x9E, 0x8D, 0x31, 0x29 } }; 124 | static const GUID VCDElement_PropertySetActivate = { 0x5EB42E01, 0xC231, 0x458D, { 0x97, 0x24, 0x43, 0x00, 0x95, 0x08, 0x8D, 0x18 } }; 125 | 126 | // {E33B9C58-0BF8-442D-8035-B4ABD7AF44AA} 127 | static const GUID VCDID_FlipHorizontal = { 0xE33B9C58, 0x0BF8, 0x442D, { 0x80, 0x35, 0xB4, 0xAB, 0xD7, 0xAF, 0x44, 0xAA } }; 128 | // {E33B9C58-0BF8-442D-8035-B4ABD7AF44AB} 129 | static const GUID VCDID_FlipVertical = { 0xE33B9C58, 0x0BF8, 0x442D, { 0x80, 0x35, 0xB4, 0xAB, 0xD7, 0xAF, 0x44, 0xAB } }; 130 | 131 | // {9CF42696-7C51-4BFE-8D83-296D729C42A2} 132 | static const GUID VCDElement_TriggerMaskTime = { 0x9CF42696, 0x7C51, 0x4BFE, { 0x8D, 0x83, 0x29, 0x6D, 0x72, 0x9C, 0x42, 0xA2 } }; 133 | 134 | // {6A9D1F4E-B0AB-4472-9BB3-C6448A1D49DA} 135 | static const GUID VCDElement_TriggerDebounceTime = { 0x6A9D1F4E, 0xB0AB, 0x4472, { 0x9B, 0xB3, 0xC6, 0x44, 0x8A, 0x1D, 0x49, 0xDA } }; 136 | 137 | // {B89A9D2C-51FD-4C2D-80DF-89B642781B7E} 138 | static const GUID VCDElement_TriggerNoiseSuppressionTime = { 0xB89A9D2C, 0x51FD, 0x4C2D, { 0x80, 0xDF, 0x89, 0xB6, 0x42, 0x78, 0x1B, 0x7E } }; 139 | }; 140 | 141 | #endif // VCDPROPERTYIDTIS_H_INC_ --------------------------------------------------------------------------------