mirror of
https://github.com/vale981/Taevitas
synced 2025-03-05 09:31:42 -05:00
setup_ui
This commit is contained in:
parent
4d2ef3db07
commit
9242ca6ff8
32 changed files with 6515 additions and 126 deletions
BIN
Taevitas
BIN
Taevitas
Binary file not shown.
18
Taevitas.pro
18
Taevitas.pro
|
@ -22,10 +22,20 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
linux {
|
||||
LIBS += bin/libflycapture.so
|
||||
}
|
||||
|
||||
SOURCES += main.cpp\
|
||||
mainwindow.cpp
|
||||
SOURCES += src/main.cpp\
|
||||
src/mainwindow.cpp
|
||||
|
||||
HEADERS += mainwindow.h
|
||||
HEADERS += src/mainwindow.h\
|
||||
include/flycapture2.h
|
||||
|
||||
FORMS += mainwindow.ui
|
||||
FORMS += src/forms/mainwindow.ui
|
||||
|
||||
DESTDIR = build
|
||||
OBJECTS_DIR = $${DESTDIR}/.obj
|
||||
MOC_DIR = $${DESTDIR}/.moc
|
||||
RCC_DIR = $${DESTDIR}/.rcc
|
||||
UI_DIR = src/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.2.0, 2017-03-08T14:48:17. -->
|
||||
<!-- Written by QtCreator 4.2.0, 2017-03-08T20:48:32. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
@ -54,7 +54,9 @@
|
|||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap"/>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuelist type="QVariantList" key="ClangStaticAnalyzer.SuppressedDiagnostics"/>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
|
@ -300,14 +302,17 @@
|
|||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">-1</value>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Taevitas</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/hiro/Documents/Projects/Taevitas/Taevitas/Taevitas.pro</value>
|
||||
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">Taevitas.pro</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default"></value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
|
|
BIN
bin/libflycapture.so.2
Normal file
BIN
bin/libflycapture.so.2
Normal file
Binary file not shown.
BIN
build/Taevitas
Executable file
BIN
build/Taevitas
Executable file
Binary file not shown.
132
include/flycapture/#AVIRecorder.h#
Executable file
132
include/flycapture/#AVIRecorder.h#
Executable file
|
@ -0,0 +1,132 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2009 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: AVIRecorder.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_AVIRECORDER_H
|
||||
#define PGR_FC2_AVIRECORDER_H
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
class Error;
|
||||
class Image;
|
||||
|
||||
/**
|
||||
* The AVIRecorder class provides the functionality for the user to record
|
||||
* images to an AVI file.
|
||||
*/
|
||||
class FLYCAPTURE2_API AVIRecorder
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
AVIRecorder();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~AVIRecorder();
|
||||
|
||||
/**
|
||||
* Open an AVI file in preparation for writing Images to disk.
|
||||
* The size of AVI files is limited to 2GB. The filenames are
|
||||
* automatically generated using the filename specified.
|
||||
*
|
||||
* @param pFileName The filename of the AVI file.
|
||||
* @param pOption Options to apply to the AVI file.
|
||||
*
|
||||
* @see AVIClose()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIOpen(
|
||||
const char* pFileName,
|
||||
AVIOption* pOption );
|
||||
|
||||
/**
|
||||
* Open an MJPEG AVI file in preparation for writing Images to disk.
|
||||
* The size of AVI files is limited to 2GB. The filenames are
|
||||
* automatically generated using the filename specified.
|
||||
*
|
||||
* @param pFileName The filename of the AVI file.
|
||||
* @param pOption MJPEG options to apply to the AVI file.
|
||||
*
|
||||
* @see AVIClose()
|
||||
* @see MJPGOption
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIOpen(
|
||||
const char* pFileName,
|
||||
MJPGOption* pOption );
|
||||
|
||||
|
||||
/**
|
||||
* Open an H264 MP4 file in preparation for writing Images to disk.
|
||||
* The size of MP4 files is limited to 2GB. The filenames are
|
||||
* automatically generated using the filename specified.
|
||||
*
|
||||
* @param pFileName The filename of the MP4 file.
|
||||
* @param pOption H264 options to apply to the MP4 file.
|
||||
*
|
||||
* @see AVIClose()
|
||||
* @see H264Option
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIOpen(
|
||||
const char* pFileName,
|
||||
H264Option* pOption );
|
||||
|
||||
|
||||
/**
|
||||
* Append an image to the AVI/MP4 file.
|
||||
*
|
||||
* @param pImage The image to append.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIAppend( Image* pImage);
|
||||
|
||||
/**
|
||||
* Close the AVI/MP4 file.
|
||||
*
|
||||
* @see AVIOpen()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIClose( );
|
||||
|
||||
private:
|
||||
|
||||
AVIRecorder( const AVIRecorder& );
|
||||
AVIRecorder& operator=( const AVIRecorder& );
|
||||
|
||||
struct AVIRecorderData; // Forward declaration
|
||||
|
||||
AVIRecorderData* m_pAVIRecorderData;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //PGR_FC2_AVIRECORDER_H
|
132
include/flycapture/AVIRecorder.h
Executable file
132
include/flycapture/AVIRecorder.h
Executable file
|
@ -0,0 +1,132 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2009 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: AVIRecorder.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_AVIRECORDER_H
|
||||
#define PGR_FC2_AVIRECORDER_H
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
class Error;
|
||||
class Image;
|
||||
|
||||
/**
|
||||
* The AVIRecorder class provides the functionality for the user to record
|
||||
* images to an AVI file.
|
||||
*/
|
||||
class FLYCAPTURE2_API AVIRecorder
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
AVIRecorder();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~AVIRecorder();
|
||||
|
||||
/**
|
||||
* Open an AVI file in preparation for writing Images to disk.
|
||||
* The size of AVI files is limited to 2GB. The filenames are
|
||||
* automatically generated using the filename specified.
|
||||
*
|
||||
* @param pFileName The filename of the AVI file.
|
||||
* @param pOption Options to apply to the AVI file.
|
||||
*
|
||||
* @see AVIClose()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIOpen(
|
||||
const char* pFileName,
|
||||
AVIOption* pOption );
|
||||
|
||||
/**
|
||||
* Open an MJPEG AVI file in preparation for writing Images to disk.
|
||||
* The size of AVI files is limited to 2GB. The filenames are
|
||||
* automatically generated using the filename specified.
|
||||
*
|
||||
* @param pFileName The filename of the AVI file.
|
||||
* @param pOption MJPEG options to apply to the AVI file.
|
||||
*
|
||||
* @see AVIClose()
|
||||
* @see MJPGOption
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIOpen(
|
||||
const char* pFileName,
|
||||
MJPGOption* pOption );
|
||||
|
||||
|
||||
/**
|
||||
* Open an H264 MP4 file in preparation for writing Images to disk.
|
||||
* The size of MP4 files is limited to 2GB. The filenames are
|
||||
* automatically generated using the filename specified.
|
||||
*
|
||||
* @param pFileName The filename of the MP4 file.
|
||||
* @param pOption H264 options to apply to the MP4 file.
|
||||
*
|
||||
* @see AVIClose()
|
||||
* @see H264Option
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIOpen(
|
||||
const char* pFileName,
|
||||
H264Option* pOption );
|
||||
|
||||
|
||||
/**
|
||||
* Append an image to the AVI/MP4 file.
|
||||
*
|
||||
* @param pImage The image to append.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIAppend( Image* pImage);
|
||||
|
||||
/**
|
||||
* Close the AVI/MP4 file.
|
||||
*
|
||||
* @see AVIOpen()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error AVIClose( );
|
||||
|
||||
private:
|
||||
|
||||
AVIRecorder( const AVIRecorder& );
|
||||
AVIRecorder& operator=( const AVIRecorder& );
|
||||
|
||||
struct AVIRecorderData; // Forward declaration
|
||||
|
||||
AVIRecorderData* m_pAVIRecorderData;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //PGR_FC2_AVIRECORDER_H
|
381
include/flycapture/BusManager.h
Executable file
381
include/flycapture/BusManager.h
Executable file
|
@ -0,0 +1,381 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: BusManager.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_BUSMANAGER_H
|
||||
#define PGR_FC2_BUSMANAGER_H
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
class Error;
|
||||
class TopologyNode;
|
||||
|
||||
/**
|
||||
* Bus event callback function prototype. Defines the syntax of the
|
||||
* callback function that is passed into RegisterCallback() and
|
||||
* UnregisterCallback(). It is recommended that minimal handling be
|
||||
* performed in this callback as it will block internal processing
|
||||
* of bus events until it returns.
|
||||
*/
|
||||
typedef void (*BusEventCallback)( void* pParameter, unsigned int serialNumber );
|
||||
|
||||
/**
|
||||
* Handle that is returned when registering a callback. It is required
|
||||
* when unregistering the callback.
|
||||
*/
|
||||
typedef void* CallbackHandle;
|
||||
|
||||
/**
|
||||
* The BusManager class provides the functionality for the user to get an
|
||||
* PGRGuid for a desired camera or device easily. Once the
|
||||
* camera or device token is found, it can then be used to connect to the
|
||||
* camera or device through the camera class or device class. In addition,
|
||||
* the BusManager class provides the ability to be notified when a camera
|
||||
* or device is added or removed or some event occurs on the PC.
|
||||
*/
|
||||
class FLYCAPTURE2_API BusManager
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
BusManager();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~BusManager();
|
||||
|
||||
/**
|
||||
* Fire a bus reset. The actual bus reset is only fired for the
|
||||
* specified 1394 bus, but it will effectively cause a global bus
|
||||
* reset for the library.
|
||||
*
|
||||
* @param pGuid PGRGuid of the camera or the device to cause bus reset.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error FireBusReset( PGRGuid* pGuid);
|
||||
|
||||
/**
|
||||
* Gets the number of cameras attached to the PC.
|
||||
*
|
||||
* @param pNumCameras The number of cameras attached.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetNumOfCameras( unsigned int* pNumCameras );
|
||||
|
||||
/**
|
||||
* Gets the PGRGuid for a camera with the specified IPv4 address.
|
||||
*
|
||||
* @param ipAddress IP address to get GUID for.
|
||||
* @param pGuid Unique PGRGuid for the camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetCameraFromIPAddress(
|
||||
IPAddress ipAddress,
|
||||
PGRGuid* pGuid );
|
||||
|
||||
/**
|
||||
* Gets the PGRGuid for a camera on the PC. It uniquely identifies
|
||||
* the camera specified by the index and is used to identify the camera
|
||||
* during a Camera::Connect() call.
|
||||
*
|
||||
* @param index Zero based index of camera.
|
||||
* @param pGuid Unique PGRGuid for the camera.
|
||||
*
|
||||
* @see GetCameraFromSerialNumber()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetCameraFromIndex(
|
||||
unsigned int index,
|
||||
PGRGuid* pGuid );
|
||||
|
||||
/**
|
||||
* Gets the PGRGuid for a camera on the PC. It uniquely identifies
|
||||
* the camera specified by the serial number and is used to identify the camera
|
||||
* during a Camera::Connect() call.
|
||||
*
|
||||
* @param serialNumber Serial number of camera.
|
||||
* @param pGuid Unique PGRGuid for the camera.
|
||||
*
|
||||
* @see GetCameraFromIndex()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetCameraFromSerialNumber(
|
||||
unsigned int serialNumber,
|
||||
PGRGuid* pGuid );
|
||||
|
||||
/**
|
||||
* Gets the serial number of the camera with the specified index.
|
||||
*
|
||||
* @param index Zero based index of desired camera.
|
||||
* @param pSerialNumber Serial number of camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetCameraSerialNumberFromIndex(
|
||||
unsigned int index,
|
||||
unsigned int* pSerialNumber );
|
||||
|
||||
/**
|
||||
* Gets the interface type associated with a PGRGuid. This is useful
|
||||
* in situations where there is a need to enumerate all cameras
|
||||
* for a particular interface.
|
||||
*
|
||||
* @param pGuid The PGRGuid to get the interface for.
|
||||
* @param pInterfaceType The interface type of the PGRGuid.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetInterfaceTypeFromGuid(
|
||||
PGRGuid *pGuid,
|
||||
InterfaceType* pInterfaceType );
|
||||
|
||||
/**
|
||||
* Gets the number of devices. This may include hubs, host controllers
|
||||
* and other hardware devices (including cameras).
|
||||
*
|
||||
* @param pNumDevices The number of devices found.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetNumOfDevices( unsigned int* pNumDevices );
|
||||
|
||||
/**
|
||||
* Gets the PGRGuid for a device. It uniquely identifies the device
|
||||
* specified by the index.
|
||||
*
|
||||
* @param index Zero based index of device.
|
||||
* @param pGuid Unique PGRGuid for the device.
|
||||
*
|
||||
* @see GetNumOfDevices()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetDeviceFromIndex(
|
||||
unsigned int index,
|
||||
PGRGuid* pGuid );
|
||||
|
||||
/**
|
||||
* Read a phy register on the specified device. The full address
|
||||
* to be read from is determined by the page, port and address.
|
||||
*
|
||||
* @param guid PGRGuid of the device to read from.
|
||||
* @param page Page to read from.
|
||||
* @param port Port to read from.
|
||||
* @param address Address to read from.
|
||||
* @param pValue Value read from the phy register.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ReadPhyRegister(
|
||||
PGRGuid guid,
|
||||
unsigned int page,
|
||||
unsigned int port,
|
||||
unsigned int address,
|
||||
unsigned int* pValue );
|
||||
|
||||
/**
|
||||
* Write a phy register on the specified device. The full address
|
||||
* to be written to is determined by the page, port and address.
|
||||
*
|
||||
* @param guid PGRGuid of the device to write to.
|
||||
* @param page Page to write to.
|
||||
* @param port Port to write to.
|
||||
* @param address Address to write to.
|
||||
* @param value Value to write to phy register.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error WritePhyRegister(
|
||||
PGRGuid guid,
|
||||
unsigned int page,
|
||||
unsigned int port,
|
||||
unsigned int address,
|
||||
unsigned int value );
|
||||
|
||||
/**
|
||||
* Read usb link info for the port that the specified device is connected to.
|
||||
*
|
||||
* @param guid PGRGuid of the device to read from.
|
||||
* @param pValue Value read from the card register.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetUsbLinkInfo(
|
||||
PGRGuid guid,
|
||||
unsigned int* pValue );
|
||||
|
||||
/**
|
||||
* Read usb port status for the port that the specified device is connected to.
|
||||
*
|
||||
* @param guid PGRGuid of the device to read from.
|
||||
* @param pValue Value read from the card register.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetUsbPortStatus(
|
||||
PGRGuid guid,
|
||||
unsigned int* pValue );
|
||||
|
||||
/**
|
||||
* Gets the topology information for the PC.
|
||||
*
|
||||
* @param pNode TopologyNode object that will contain the topology
|
||||
* information.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetTopology(
|
||||
TopologyNode* pNode );
|
||||
|
||||
/**
|
||||
* Register a callback function that will be called when the
|
||||
* specified callback event occurs.
|
||||
*
|
||||
* @param busEventCallback Pointer to function that will receive
|
||||
the callback.
|
||||
* @param callbackType Type of callback to register for.
|
||||
* @param pParameter Callback parameter to be passed to callback.
|
||||
* @param pCallbackHandle Unique callback handle used for
|
||||
* unregistering callback.
|
||||
*
|
||||
* @see UnregisterCallback()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error RegisterCallback(
|
||||
BusEventCallback busEventCallback,
|
||||
BusCallbackType callbackType,
|
||||
void* pParameter,
|
||||
CallbackHandle* pCallbackHandle );
|
||||
|
||||
/**
|
||||
* Unregister a callback function.
|
||||
*
|
||||
* @param callbackHandle Unique callback handle.
|
||||
*
|
||||
* @see RegisterCallback()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error UnregisterCallback( CallbackHandle callbackHandle );
|
||||
|
||||
/**
|
||||
* Force a rescan of the buses. This does not trigger a bus reset.
|
||||
* However, any current connections to a Camera object will be
|
||||
* invalidated.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error RescanBus();
|
||||
|
||||
/**
|
||||
* Force the camera with the specific MAC address to the specified
|
||||
* IP address, subnet mask and default gateway. This is useful in
|
||||
* situations where a GigE Vision camera is using Persistent IP and the
|
||||
* application's subnet is different from the device subnet.
|
||||
*
|
||||
* @param macAddress MAC address of the camera.
|
||||
* @param ipAddress IP address to set on the camera.
|
||||
* @param subnetMask Subnet mask to set on the camera.
|
||||
* @param defaultGateway Default gateway to set on the camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error ForceIPAddressToCamera(
|
||||
MACAddress macAddress,
|
||||
IPAddress ipAddress,
|
||||
IPAddress subnetMask,
|
||||
IPAddress defaultGateway );
|
||||
|
||||
/**
|
||||
* Force all cameras on the network to be assigned sequential IP addresses
|
||||
* on the same subnet as the netowrk adapters that they are connected to.
|
||||
* This is useful in situations where a GigE Vision cameras are using
|
||||
* Persistent IP addresses and the application's subnet is different from
|
||||
* the devices.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error ForceAllIPAddressesAutomatically();
|
||||
|
||||
/**
|
||||
* Force a camera on the network to be assigned an IP address
|
||||
* on the same subnet as the netowrk adapters that it is connected to.
|
||||
* This is useful in situations where GigE Vision cameras are using IP
|
||||
* addresses in a subnet different from the host's subnet.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error ForceAllIPAddressesAutomatically(unsigned int serialNumber);
|
||||
|
||||
/**
|
||||
* Discover all cameras connected to the network even if they reside
|
||||
* on a different subnet. This is useful in situations where GigE Vision
|
||||
* cameras are using IP addresses in a subnet different from the host's
|
||||
* subnet. After discovering the camera, it is easy to use
|
||||
* ForceIPAddressToCamera() to set a different IP configuration.
|
||||
*
|
||||
* @param gigECameras Pointer to an array of CameraInfo structures.
|
||||
* @param arraySize Size of the array. Number of discovered cameras
|
||||
* is returned in the same value.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
* If the error is PGRERROR_BUFFER_TOO_SMALL then arraySize will
|
||||
* contain the minimum size needed for gigECameras array.
|
||||
*/
|
||||
static Error DiscoverGigECameras(
|
||||
CameraInfo* gigECameras,
|
||||
unsigned int* arraySize );
|
||||
|
||||
/**
|
||||
* Query CCP status on camera with corresponding PGRGuid. This is
|
||||
* useful to determine if a GigE camera can be controlled.
|
||||
*
|
||||
* @param pGuid PGRGuid of the camera
|
||||
* @param pControlable Indicates whether camera is controllable
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error IsCameraControlable(
|
||||
PGRGuid* pGuid, bool* pControlable );
|
||||
|
||||
private:
|
||||
|
||||
BusManager( const BusManager& );
|
||||
BusManager& operator=( const BusManager& );
|
||||
|
||||
struct BusManagerData; // Forward declaration
|
||||
|
||||
BusManagerData* m_pBusManagerData;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //PGR_FC2_BUSMANAGER_H
|
329
include/flycapture/Camera.h
Executable file
329
include/flycapture/Camera.h
Executable file
|
@ -0,0 +1,329 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: Camera.h 278996 2016-04-27 20:31:09Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_CAMERA_H_
|
||||
#define PGR_FC2_CAMERA_H_
|
||||
|
||||
#include "CameraBase.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
/**
|
||||
* The Camera object represents a physical camera that uses the IIDC
|
||||
* register set. The object must first be connected to using Connect()
|
||||
* before any other operations can proceed.
|
||||
*
|
||||
* It is possible for more than 1 Camera object to connect to a single
|
||||
* physical camera. However, isochronous transmission to more than
|
||||
* 1 Camera object is not supported.
|
||||
*
|
||||
* @nosubgrouping
|
||||
*/
|
||||
class FLYCAPTURE2_API Camera : public CameraBase
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
Camera();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~Camera();
|
||||
|
||||
/**
|
||||
* @name DCAM Formats
|
||||
*
|
||||
* These functions deal with DCAM video mode and frame rate
|
||||
* on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Query the camera to determine if the specified video mode and
|
||||
* frame rate is supported.
|
||||
*
|
||||
* @param videoMode Video mode to check.
|
||||
* @param frameRate Frame rate to check.
|
||||
* @param pSupported Whether the video mode and frame rate is
|
||||
* supported.
|
||||
*
|
||||
* @see GetVideoModeAndFrameRate()
|
||||
* @see SetVideoModeAndFrameRate()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetVideoModeAndFrameRateInfo(
|
||||
VideoMode videoMode,
|
||||
FrameRate frameRate,
|
||||
bool* pSupported);
|
||||
|
||||
/**
|
||||
* Get the current video mode and frame rate from the camera. If
|
||||
* the camera is in Format7, the video mode will be VIDEOMODE_FORMAT7
|
||||
* and the frame rate will be FRAMERATE_FORMAT7.
|
||||
*
|
||||
* @param pVideoMode Current video mode.
|
||||
* @param pFrameRate Current frame rate.
|
||||
*
|
||||
* @see GetVideoModeAndFrameRateInfo()
|
||||
* @see SetVideoModeAndFrameRate()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetVideoModeAndFrameRate(
|
||||
VideoMode* pVideoMode,
|
||||
FrameRate* pFrameRate );
|
||||
|
||||
/**
|
||||
* Set the specified video mode and frame rate to the camera. It is
|
||||
* not possible to set the camera to VIDEOMODE_FORMAT7 or
|
||||
* FRAMERATE_FORMAT7. Use the Format7 functions to set the camera
|
||||
* into Format7.
|
||||
*
|
||||
* @param videoMode Video mode to set to camera.
|
||||
* @param frameRate Frame rate to set to camera.
|
||||
*
|
||||
* @see GetVideoModeAndFrameRateInfo()
|
||||
* @see GetVideoModeAndFrameRate()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetVideoModeAndFrameRate(
|
||||
VideoMode videoMode,
|
||||
FrameRate frameRate );
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Format7
|
||||
*
|
||||
* These functions deal with Format7 custom image control on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Retrieve the availability of Format7 custom image mode and the
|
||||
* camera capabilities for the specified Format7 mode. The mode must
|
||||
* be specified in the Format7Info structure in order for the
|
||||
* function to succeed.
|
||||
*
|
||||
* @param pInfo Structure to be filled with the capabilities of the
|
||||
* specified mode and the current state in the specified
|
||||
* mode.
|
||||
* @param pSupported Whether the specified mode is supported.
|
||||
*
|
||||
* @see ValidateFormat7Settings()
|
||||
* @see GetFormat7Configuration()
|
||||
* @see SetFormat7Configuration()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetFormat7Info(
|
||||
Format7Info* pInfo,
|
||||
bool* pSupported );
|
||||
|
||||
/**
|
||||
* Validates Format7ImageSettings structure and returns valid packet
|
||||
* size information if the image settings are valid. The current
|
||||
* image settings are cached while validation is taking place. The
|
||||
* cached settings are restored when validation is complete.
|
||||
*
|
||||
* @param pImageSettings Structure containing the image settings.
|
||||
* @param pSettingsAreValid Whether the settings are valid.
|
||||
* @param pPacketInfo Packet size information that can be used to
|
||||
* determine a valid packet size.
|
||||
*
|
||||
* @see GetFormat7Info()
|
||||
* @see GetFormat7Configuration()
|
||||
* @see SetFormat7Configuration()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ValidateFormat7Settings(
|
||||
const Format7ImageSettings* pImageSettings,
|
||||
bool* pSettingsAreValid,
|
||||
Format7PacketInfo* pPacketInfo );
|
||||
|
||||
/**
|
||||
* Get the current Format7 configuration from the camera. This call
|
||||
* will only succeed if the camera is already in Format7.
|
||||
*
|
||||
* @param pImageSettings Current image settings.
|
||||
* @param pPacketSize Current packet size.
|
||||
* @param pPercentage Current packet size as a percentage.
|
||||
*
|
||||
* @see GetFormat7Info()
|
||||
* @see ValidateFormat7Settings()
|
||||
* @see SetFormat7Configuration()
|
||||
* @see GetVideoModeAndFrameRate()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetFormat7Configuration(
|
||||
Format7ImageSettings* pImageSettings,
|
||||
unsigned int* pPacketSize,
|
||||
float* pPercentage );
|
||||
|
||||
/**
|
||||
* Set the current Format7 configuration to the camera.
|
||||
*
|
||||
* @param pImageSettings Image settings to be written to the camera.
|
||||
* @param packetSize Packet size to be written to the camera.
|
||||
*
|
||||
* @see GetFormat7Info()
|
||||
* @see ValidateFormat7Settings()
|
||||
* @see GetFormat7Configuration()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetFormat7Configuration(
|
||||
const Format7ImageSettings* pImageSettings,
|
||||
unsigned int packetSize );
|
||||
|
||||
/**
|
||||
* Set the current Format7 configuration to the camera.
|
||||
*
|
||||
* @param pImageSettings Image settings to be written to the camera.
|
||||
* @param percentSpeed Percentage of packet size to be written to
|
||||
* the camera.
|
||||
*
|
||||
* @see GetFormat7Info()
|
||||
* @see ValidateFormat7Settings()
|
||||
* @see GetFormat7Configuration()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetFormat7Configuration(
|
||||
const Format7ImageSettings* pImageSettings,
|
||||
float percentSpeed );
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* The following functions are inherited from CameraBase. See
|
||||
* CameraBase.h for further information.
|
||||
*/
|
||||
|
||||
virtual Error Connect( PGRGuid* pGuid = NULL );
|
||||
virtual Error Disconnect();
|
||||
virtual bool IsConnected();
|
||||
virtual Error SetCallback(
|
||||
ImageEventCallback callbackFn,
|
||||
const void* pCallbackData = NULL );
|
||||
virtual Error StartCapture(
|
||||
ImageEventCallback callbackFn = NULL,
|
||||
const void* pCallbackData = NULL );
|
||||
static Error StartSyncCapture(
|
||||
unsigned int numCameras,
|
||||
const Camera **ppCameras,
|
||||
const ImageEventCallback *pCallbackFns = NULL,
|
||||
const void** pCallbackDataArray = NULL );
|
||||
virtual Error RetrieveBuffer( Image* pImage );
|
||||
virtual Error StopCapture();
|
||||
virtual Error WaitForBufferEvent( Image* pImage, unsigned int eventNumber );
|
||||
virtual Error SetUserBuffers(
|
||||
unsigned char* const pMemBuffers,
|
||||
int size,
|
||||
int numBuffers );
|
||||
virtual Error GetConfiguration( FC2Config* pConfig );
|
||||
virtual Error SetConfiguration( const FC2Config* pConfig );
|
||||
virtual Error GetCameraInfo( CameraInfo* pCameraInfo );
|
||||
virtual Error GetPropertyInfo( PropertyInfo* pPropInfo );
|
||||
virtual Error GetProperty( Property* pProp );
|
||||
virtual Error SetProperty(
|
||||
const Property* pProp,
|
||||
bool broadcast = false );
|
||||
virtual Error GetGPIOPinDirection( unsigned int pin, unsigned int* pDirection);
|
||||
virtual Error SetGPIOPinDirection( unsigned int pin, unsigned int direction, bool broadcast = false );
|
||||
virtual Error GetTriggerModeInfo( TriggerModeInfo* pTriggerModeInfo );
|
||||
virtual Error GetTriggerMode( TriggerMode* pTriggerMode );
|
||||
virtual Error SetTriggerMode(
|
||||
const TriggerMode* pTriggerMode,
|
||||
bool broadcast = false );
|
||||
virtual Error FireSoftwareTrigger( bool broadcast = false );
|
||||
virtual Error GetTriggerDelayInfo( TriggerDelayInfo* pTriggerDelayInfo );
|
||||
virtual Error GetTriggerDelay( TriggerDelay* pTriggerDelay );
|
||||
virtual Error SetTriggerDelay(
|
||||
const TriggerDelay* pTriggerDelay,
|
||||
bool broadcast = false );
|
||||
virtual Error GetStrobeInfo( StrobeInfo* pStrobeInfo );
|
||||
virtual Error GetStrobe( StrobeControl* pStrobeControl );
|
||||
virtual Error SetStrobe(
|
||||
const StrobeControl* pStrobeControl,
|
||||
bool broadcast = false );
|
||||
virtual Error GetLUTInfo( LUTData* pData );
|
||||
virtual Error GetLUTBankInfo(
|
||||
unsigned int bank,
|
||||
bool* pReadSupported,
|
||||
bool* pWriteSupported );
|
||||
virtual Error GetActiveLUTBank( unsigned int* pActiveBank );
|
||||
virtual Error SetActiveLUTBank( unsigned int activeBank );
|
||||
virtual Error EnableLUT( bool on );
|
||||
virtual Error GetLUTChannel(
|
||||
unsigned int bank,
|
||||
unsigned int channel,
|
||||
unsigned int sizeEntries,
|
||||
unsigned int* pEntries );
|
||||
virtual Error SetLUTChannel(
|
||||
unsigned int bank,
|
||||
unsigned int channel,
|
||||
unsigned int sizeEntries,
|
||||
const unsigned int* pEntries );
|
||||
virtual Error GetMemoryChannel( unsigned int* pCurrentChannel );
|
||||
virtual Error SaveToMemoryChannel( unsigned int channel );
|
||||
virtual Error RestoreFromMemoryChannel( unsigned int channel );
|
||||
virtual Error GetMemoryChannelInfo( unsigned int* pNumChannels );
|
||||
virtual Error GetEmbeddedImageInfo( EmbeddedImageInfo* pInfo );
|
||||
virtual Error SetEmbeddedImageInfo( EmbeddedImageInfo* pInfo );
|
||||
virtual Error WriteRegister(
|
||||
unsigned int address,
|
||||
unsigned int value,
|
||||
bool broadcast=false);
|
||||
virtual Error ReadRegister(
|
||||
unsigned int address,
|
||||
unsigned int* pValue );
|
||||
virtual Error WriteRegisterBlock(
|
||||
unsigned short addressHigh,
|
||||
unsigned int addressLow,
|
||||
const unsigned int* pBuffer,
|
||||
unsigned int length );
|
||||
virtual Error ReadRegisterBlock(
|
||||
unsigned short addressHigh,
|
||||
unsigned int addressLow,
|
||||
unsigned int* pBuffer,
|
||||
unsigned int length );
|
||||
static const char* GetRegisterString( unsigned int registerVal);
|
||||
virtual Error GetCycleTime(TimeStamp *timeStamp);
|
||||
virtual Error GetStats( CameraStats* pStats );
|
||||
virtual Error ResetStats();
|
||||
|
||||
virtual Error RegisterEvent( EventOptions* pOpts );
|
||||
virtual Error DeregisterEvent( EventOptions* pOpts );
|
||||
virtual Error RegisterAllEvents( EventOptions* pOpts );
|
||||
virtual Error DeregisterAllEvents( void );
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PGR_FC2_CAMERA_H_
|
941
include/flycapture/CameraBase.h
Executable file
941
include/flycapture/CameraBase.h
Executable file
|
@ -0,0 +1,941 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: CameraBase.h 297567 2016-09-02 20:03:45Z erich $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_CAMERABASE_H_
|
||||
#define PGR_FC2_CAMERABASE_H_
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
class Error;
|
||||
class Image;
|
||||
|
||||
/**
|
||||
* Image event callback function prototype. Defines the syntax of the
|
||||
* image callback function that is passed into StartCapture(). It is
|
||||
* possible for this function to be called simultaneously. Therefore,
|
||||
* users must make sure that code in the callback is thread safe.
|
||||
*/
|
||||
typedef void (*ImageEventCallback)( class Image* pImage, const void* pCallbackData );
|
||||
|
||||
/**
|
||||
* The CameraBase class is an abstract base class that defines a general
|
||||
* interface to a camera.
|
||||
*
|
||||
* @nosubgrouping
|
||||
*/
|
||||
class FLYCAPTURE2_API CameraBase
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
CameraBase() {}
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~CameraBase() {}
|
||||
|
||||
/**
|
||||
* @name Connection and Image Retrieval
|
||||
*
|
||||
* These functions deal with connections and image retrieval from
|
||||
* the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Connects the camera object to the camera specified by the GUID.
|
||||
* If the guid is omitted or set to NULL, the connection will be made
|
||||
* to the first camera detected on the PC (i.e. index = 0).
|
||||
*
|
||||
* @param pGuid The unique identifier for a specific camera on the PC.
|
||||
*
|
||||
* @see BusManager::GetCameraFromIndex()
|
||||
* @see BusManager::GetCameraFromSerialNumber()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Connect( PGRGuid* pGuid = NULL ) = 0;
|
||||
|
||||
/**
|
||||
* Disconnects the camera object from the camera. This allows another
|
||||
* physical camera specified by a GUID to be connected to the camera
|
||||
* object.
|
||||
*
|
||||
* @see Connect()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Disconnect() = 0;
|
||||
|
||||
/**
|
||||
* Checks if the camera object is connected to a physical camera
|
||||
* specified by a GUID.
|
||||
*
|
||||
* @see Connect()
|
||||
* @see Disconnect()
|
||||
*
|
||||
* @return Whether Connect() was called on the camera object.
|
||||
*/
|
||||
virtual bool IsConnected() = 0;
|
||||
|
||||
/**
|
||||
* Sets the callback data to be used on completion of image transfer.
|
||||
* To clear the current stored callback data, pass in NULL for both
|
||||
* arguments.
|
||||
*
|
||||
* @param callbackFn A function to be called when a new image is
|
||||
* received.
|
||||
* @param pCallbackData A pointer to data that can be passed to the
|
||||
* callback function.
|
||||
*
|
||||
* @see StartCapture()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetCallback(
|
||||
ImageEventCallback callbackFn,
|
||||
const void* pCallbackData = NULL ) = 0;
|
||||
|
||||
/**
|
||||
* Starts isochronous image capture. It will use either the current
|
||||
* video mode or the most recently set video mode of the camera.
|
||||
* The optional callback function parameter is called on completion of
|
||||
* image transfer.
|
||||
* When a callback function is specified, the grab mode will determine how
|
||||
* images are delivered.
|
||||
* If the grab mode has not been set, or has been set to DROP_FRAMES
|
||||
* the default behavior is to requeue images for DMA if they have
|
||||
* not been delivered by the time the next image transfer completes.
|
||||
* If BUFFER_FRAMES is specified, the next image in the sequence will
|
||||
* be delivered. Note that for the BUFFER_FRAMES case, if delivery
|
||||
* does not keep up with the DMA process, images will be lost.
|
||||
* The default behavior is to perform DROP_FRAMES image delivery
|
||||
* Alternatively, the callback parameter can be set to NULL
|
||||
* and RetrieveBuffer() can be called as a blocking call to get
|
||||
* the image data.
|
||||
*
|
||||
* @param callbackFn A function to be called when a new image is
|
||||
* received.
|
||||
* @param pCallbackData A pointer to data that can be passed to the
|
||||
* callback function.
|
||||
*
|
||||
* @see RetrieveBuffer()
|
||||
* @see StartSyncCapture()
|
||||
* @see StopCapture()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error StartCapture(
|
||||
ImageEventCallback callbackFn = NULL,
|
||||
const void* pCallbackData = NULL ) = 0;
|
||||
|
||||
/**
|
||||
* Starts isochronous image capture on multiple cameras. On each frame,
|
||||
* the time stamps across the cameras are aligned which means the frames
|
||||
* are synchronized. Note that the cameras must be synchronized by
|
||||
* external means in order for this function to work. This means that
|
||||
* the cameras should either be on the same bus, hardware synchronized
|
||||
* (e.g. through triggering) or Multisync is running.
|
||||
* Note: The use of this function with GigE Cameras is not supported.
|
||||
*
|
||||
* @param numCameras Number of Camera objects in the ppCameras array.
|
||||
* @param ppCameras Array of pointers to Camera objects containing the
|
||||
* cameras to be started and synchronized.
|
||||
* @param pCallbackFns Array of callback functions for each camera.
|
||||
* @param pCallbackDataArray Array of callback data pointers.
|
||||
*
|
||||
* @see RetrieveBuffer()
|
||||
* @see StartCapture()
|
||||
* @see StopCapture()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error StartSyncCapture(
|
||||
unsigned int numCameras,
|
||||
const CameraBase **ppCameras,
|
||||
const ImageEventCallback* pCallbackFns = NULL,
|
||||
const void** pCallbackDataArray = NULL );
|
||||
|
||||
/**
|
||||
* Retrieves the the next image object containing the next image.
|
||||
* If the grab mode has not been set, or has been set to DROP_FRAMES
|
||||
* the default behavior is to requeue images for DMA if they have
|
||||
* not been retrieved by the time the next image transfer completes.
|
||||
* If BUFFER_FRAMES is specified, the next image in the sequence will
|
||||
* be retrieved. Note that for the BUFFER_FRAMES case, if retrieval
|
||||
* does not keep up with the DMA process, images will be lost.
|
||||
* The default behavior is to perform DROP_FRAMES image retrieval.
|
||||
*
|
||||
* @param pImage Pointer to Image object to store image data.
|
||||
*
|
||||
* @see StartCapture()
|
||||
* @see StopCapture()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error RetrieveBuffer( Image* pImage ) = 0;
|
||||
|
||||
/**
|
||||
* Stops isochronous image transfer and cleans up all associated
|
||||
* resources.
|
||||
* If an image callback function (specified in the StartCapture() call)
|
||||
* is currently executing, StopCapture() will not return until after
|
||||
* the callback has completed.
|
||||
*
|
||||
* @see StartCapture()
|
||||
* @see RetrieveBuffer()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error StopCapture() = 0;
|
||||
|
||||
/**
|
||||
* Retrieves the next image event containing the next part of the image.
|
||||
*
|
||||
* @param pImage Pointer to Image object to store image data.
|
||||
* @param eventNumber The event number to wait for.
|
||||
*
|
||||
* @see StartCapture()
|
||||
* @see RetrieveBuffer()
|
||||
* @see StopCapture()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error WaitForBufferEvent( Image* pImage, unsigned int eventNumber ) = 0;
|
||||
|
||||
/**
|
||||
* Specify user allocated buffers to use as image data buffers.
|
||||
* To prevent image tearing, the size of each buffer should be equal to
|
||||
* ((unsigned int)(bufferSize + packetSize - 1)/packetSize) * packetSize.
|
||||
* The total size should be (size * numBuffers) or larger.
|
||||
* The packet Size that should be used differs between interfaces:
|
||||
* Firewire: Use the Format7 packet size.
|
||||
* Usb2: First round to Format7 packet size then round to 512 bytes.
|
||||
* Usb3: Use a packet size of 1024 bytes.
|
||||
* GigE: No need to do any rounding on GigE
|
||||
*
|
||||
* @param pMemBuffers Pointer to memory buffers to be written to.
|
||||
* @param size The size of each buffer (in bytes).
|
||||
* @param numBuffers Number of buffers in the array.
|
||||
*
|
||||
* @see StartCapture()
|
||||
* @see RetrieveBuffer()
|
||||
* @see StopCapture()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetUserBuffers(
|
||||
unsigned char* const pMemBuffers,
|
||||
int size,
|
||||
int numBuffers ) = 0;
|
||||
|
||||
/**
|
||||
* Get the configuration associated with the camera object.
|
||||
*
|
||||
* @param pConfig Pointer to the configuration structure to be filled.
|
||||
*
|
||||
* @see SetConfiguration()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetConfiguration( FC2Config* pConfig ) = 0;
|
||||
|
||||
/**
|
||||
* Set the configuration associated with the camera object.
|
||||
*
|
||||
* @param pConfig Pointer to the configuration structure to be used.
|
||||
*
|
||||
* @see GetConfiguration()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetConfiguration( const FC2Config* pConfig ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Information and Properties
|
||||
*
|
||||
* These functions deal with information and properties can be
|
||||
* retrieved from the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Retrieves information from the camera such as serial number, model
|
||||
* name and other camera information.
|
||||
*
|
||||
* @param pCameraInfo Pointer to the camera information structure
|
||||
* to be filled.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetCameraInfo( CameraInfo* pCameraInfo ) = 0;
|
||||
|
||||
/**
|
||||
* Retrieves information about the specified camera property. The
|
||||
* property type must be specified in the PropertyInfo structure
|
||||
* passed into the function in order for the function to succeed.
|
||||
*
|
||||
* @param pPropInfo Pointer to the PropertyInfo structure to be filled.
|
||||
*
|
||||
* @see GetProperty()
|
||||
* @see SetProperty()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetPropertyInfo( PropertyInfo* pPropInfo ) = 0;
|
||||
|
||||
/**
|
||||
* Reads the settings for the specified property from the camera. The
|
||||
* property type must be specified in the Property structure passed
|
||||
* into the function in order for the function to succeed. If auto
|
||||
* is on, the integer and abs values returned may not be consistent
|
||||
* with each other.
|
||||
*
|
||||
* @param pProp Pointer to the Property structure to be filled.
|
||||
*
|
||||
* @see GetPropertyInfo()
|
||||
* @see SetProperty()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetProperty( Property* pProp ) = 0;
|
||||
|
||||
/**
|
||||
* Writes the settings for the specified property to the camera. The
|
||||
* property type must be specified in the Property structure passed
|
||||
* into the function in order for the function to succeed.
|
||||
* The absControl flag controls whether the absolute or integer value
|
||||
* is written to the camera. Use GetPropertyInfo() to query which
|
||||
* options are available for a specific property.
|
||||
*
|
||||
* @param pProp Pointer to the Property structure to be used.
|
||||
* @param broadcast Whether the action should be broadcast.
|
||||
*
|
||||
* @see GetPropertyInfo()
|
||||
* @see GetProperty()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetProperty(
|
||||
const Property* pProp,
|
||||
bool broadcast = false ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name General Purpose Input / Output
|
||||
*
|
||||
* These functions deal with general GPIO pin control on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Get the GPIO pin direction for the specified pin. This is not a
|
||||
* required call when using the trigger or strobe functions as
|
||||
* the pin direction is set automatically internally.
|
||||
*
|
||||
* @param pin Pin to get the direction for.
|
||||
* @param pDirection Direction of the pin. 0 for input, 1 for output.
|
||||
*
|
||||
* @see SetGPIOPinDirection()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetGPIOPinDirection( unsigned int pin, unsigned int* pDirection) = 0;
|
||||
|
||||
/**
|
||||
* Set the GPIO pin direction for the specified pin. This is useful if
|
||||
* there is a need to set the pin into an input pin (i.e. to read the
|
||||
* voltage) off the pin without setting it as a trigger source. This
|
||||
* is not a required call when using the trigger or strobe functions as
|
||||
* the pin direction is set automatically internally.
|
||||
*
|
||||
* @param pin Pin to get the direction for.
|
||||
* @param direction Direction of the pin. 0 for input, 1 for output.
|
||||
* @param broadcast Whether the action should be broadcast.
|
||||
*
|
||||
* @see GetGPIOPinDirection()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetGPIOPinDirection( unsigned int pin, unsigned int direction, bool broadcast = false ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Trigger
|
||||
*
|
||||
* These functions deal with trigger control on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Retrieve trigger information from the camera.
|
||||
*
|
||||
* @param pTriggerModeInfo Structure to receive trigger information.
|
||||
*
|
||||
* @see GetTriggerMode()
|
||||
* @see SetTriggerMode()
|
||||
* @see GetTriggerDelayInfo()
|
||||
* @see GetTriggerDelay()
|
||||
* @see SetTriggerDelay()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetTriggerModeInfo( TriggerModeInfo* pTriggerModeInfo ) = 0;
|
||||
|
||||
/**
|
||||
* Retrieve current trigger settings from the camera.
|
||||
*
|
||||
* @param pTriggerMode Structure to receive trigger mode settings.
|
||||
*
|
||||
* @see GetTriggerModeInfo()
|
||||
* @see SetTriggerMode()
|
||||
* @see GetTriggerDelayInfo()
|
||||
* @see GetTriggerDelay()
|
||||
* @see SetTriggerDelay()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetTriggerMode( TriggerMode* pTriggerMode ) = 0;
|
||||
|
||||
/**
|
||||
* Set the specified trigger settings to the camera.
|
||||
*
|
||||
* @param pTriggerMode Structure providing trigger mode settings.
|
||||
* @param broadcast Whether the action should be broadcast.
|
||||
*
|
||||
* @see GetTriggerModeInfo()
|
||||
* @see GetTriggerMode()
|
||||
* @see GetTriggerDelayInfo()
|
||||
* @see GetTriggerDelay()
|
||||
* @see SetTriggerDelay()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetTriggerMode(
|
||||
const TriggerMode* pTriggerMode,
|
||||
bool broadcast = false ) = 0;
|
||||
|
||||
/**
|
||||
* Fire the software trigger according to the DCAM specifications.
|
||||
*
|
||||
* @param broadcast Whether the action should be broadcast.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error FireSoftwareTrigger( bool broadcast = false ) = 0;
|
||||
|
||||
/**
|
||||
* Retrieve trigger delay information from the camera.
|
||||
*
|
||||
* @param pTriggerDelayInfo Structure to receive trigger delay information.
|
||||
*
|
||||
* @see GetTriggerModeInfo()
|
||||
* @see GetTriggerMode()
|
||||
* @see SetTriggerMode()
|
||||
* @see GetTriggerDelay()
|
||||
* @see SetTriggerDelay()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetTriggerDelayInfo( TriggerDelayInfo* pTriggerDelayInfo ) = 0;
|
||||
|
||||
/**
|
||||
* Retrieve current trigger delay settings from the camera.
|
||||
*
|
||||
* @param pTriggerDelay Structure to receive trigger delay settings.
|
||||
*
|
||||
* @see GetTriggerModeInfo()
|
||||
* @see GetTriggerMode()
|
||||
* @see SetTriggerMode()
|
||||
* @see GetTriggerDelayInfo()
|
||||
* @see SetTriggerDelay()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetTriggerDelay( TriggerDelay* pTriggerDelay ) = 0;
|
||||
|
||||
/**
|
||||
* Set the specified trigger delay settings to the camera.
|
||||
*
|
||||
* @param pTriggerDelay Structure providing trigger delay settings.
|
||||
* @param broadcast Whether the action should be broadcast.
|
||||
*
|
||||
* @see GetTriggerModeInfo()
|
||||
* @see GetTriggerMode()
|
||||
* @see SetTriggerMode()
|
||||
* @see GetTriggerDelayInfo()
|
||||
* @see GetTriggerDelay()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetTriggerDelay(
|
||||
const TriggerDelay* pTriggerDelay,
|
||||
bool broadcast = false ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Strobe
|
||||
*
|
||||
* These functions deal with strobe control on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Retrieve strobe information from the camera.
|
||||
*
|
||||
* @param pStrobeInfo Structure to receive strobe information.
|
||||
*
|
||||
* @see GetStrobe()
|
||||
* @see SetStrobe()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetStrobeInfo( StrobeInfo* pStrobeInfo ) = 0;
|
||||
|
||||
/**
|
||||
* Retrieve current strobe settings from the camera. The strobe pin
|
||||
* must be specified in the structure before being passed in to
|
||||
* the function.
|
||||
*
|
||||
* @param pStrobeControl Structure to receive strobe settings.
|
||||
*
|
||||
* @see GetStrobeInfo()
|
||||
* @see SetStrobe()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetStrobe( StrobeControl* pStrobeControl ) = 0;
|
||||
|
||||
/**
|
||||
* Set current strobe settings to the camera. The strobe pin
|
||||
* must be specified in the structure before being passed in to
|
||||
* the function.
|
||||
*
|
||||
* @param pStrobeControl Structure providing strobe settings.
|
||||
* @param broadcast Whether the action should be broadcast.
|
||||
*
|
||||
* @see GetStrobeInfo()
|
||||
* @see GetStrobe()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetStrobe(
|
||||
const StrobeControl* pStrobeControl,
|
||||
bool broadcast = false ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Look Up Table
|
||||
*
|
||||
* These functions deal with Look Up Table control on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Query if LUT support is available on the camera. Note that some cameras
|
||||
* may report support for the LUT and return an inputBitDepth of 0. In these
|
||||
* cases use log2(numEntries) for the inputBitDepth.
|
||||
*
|
||||
* @param pData The LUT structure to be filled.
|
||||
*
|
||||
* @see EnableLUT()
|
||||
* @see GetLUTChannel()
|
||||
* @see SetLUTChannel()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetLUTInfo( LUTData* pData ) = 0;
|
||||
|
||||
/**
|
||||
* Query the read/write status of a single LUT bank.
|
||||
*
|
||||
* @param bank The bank to query.
|
||||
* @param pReadSupported Whether reading from the bank is supported.
|
||||
* @param pWriteSupported Whether writing to the bank is supported.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetLUTBankInfo(
|
||||
unsigned int bank,
|
||||
bool* pReadSupported,
|
||||
bool* pWriteSupported ) = 0;
|
||||
|
||||
/**
|
||||
* Get the LUT bank that is currently being used. For cameras with
|
||||
* PGR LUT, the active bank is always 0.
|
||||
*
|
||||
* @param pActiveBank The currently active bank.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetActiveLUTBank( unsigned int* pActiveBank ) = 0;
|
||||
|
||||
/**
|
||||
* Set the LUT bank that will be used.
|
||||
*
|
||||
* @param activeBank The bank to be set as active.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetActiveLUTBank( unsigned int activeBank ) = 0;
|
||||
|
||||
/**
|
||||
* Enable or disable LUT functionality on the camera.
|
||||
*
|
||||
* @param on Whether to enable or disable LUT.
|
||||
*
|
||||
* @see GetLUTInfo()
|
||||
* @see GetLUTChannel()
|
||||
* @see SetLUTChannel()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error EnableLUT( bool on ) = 0;
|
||||
|
||||
/**
|
||||
* Get the LUT channel settings from the camera.
|
||||
*
|
||||
* @param bank Bank to retrieve.
|
||||
* @param channel Channel to retrieve.
|
||||
* @param sizeEntries Number of entries in LUT table to read.
|
||||
* @param pEntries Array to store LUT entries.
|
||||
*
|
||||
* @see GetLUTInfo()
|
||||
* @see EnableLUT()
|
||||
* @see SetLUTChannel()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetLUTChannel(
|
||||
unsigned int bank,
|
||||
unsigned int channel,
|
||||
unsigned int sizeEntries,
|
||||
unsigned int* pEntries ) = 0;
|
||||
|
||||
/**
|
||||
* Set the LUT channel settings to the camera.
|
||||
*
|
||||
* @param bank Bank to set.
|
||||
* @param channel Channel to set.
|
||||
* @param sizeEntries Number of entries in LUT table to write. This must be the
|
||||
* same size as numEntries returned by GetLutInfo().
|
||||
* @param pEntries Array containing LUT entries to write.
|
||||
*
|
||||
* @see GetLUTInfo()
|
||||
* @see EnableLUT()
|
||||
* @see GetLUTChannel()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetLUTChannel(
|
||||
unsigned int bank,
|
||||
unsigned int channel,
|
||||
unsigned int sizeEntries,
|
||||
const unsigned int* pEntries ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Memory Channels
|
||||
*
|
||||
* These functions deal with memory channel control on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Retrieve the current memory channel from the camera.
|
||||
*
|
||||
* @param pCurrentChannel Current memory channel.
|
||||
*
|
||||
* @see SaveToMemoryChannel()
|
||||
* @see RestoreFromMemoryChannel()
|
||||
* @see GetMemoryChannelInfo()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetMemoryChannel( unsigned int* pCurrentChannel ) = 0;
|
||||
|
||||
/**
|
||||
* Save the current settings to the specfied current memory channel.
|
||||
*
|
||||
* @param channel Memory channel to save to.
|
||||
*
|
||||
* @see GetMemoryChannel()
|
||||
* @see RestoreFromMemoryChannel()
|
||||
* @see GetMemoryChannelInfo()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SaveToMemoryChannel( unsigned int channel ) = 0;
|
||||
|
||||
/**
|
||||
* Restore the specfied current memory channel.
|
||||
*
|
||||
* @param channel Memory channel to restore from.
|
||||
*
|
||||
* @see GetMemoryChannel()
|
||||
* @see SaveToMemoryChannel()
|
||||
* @see GetMemoryChannelInfo()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error RestoreFromMemoryChannel( unsigned int channel ) = 0;
|
||||
|
||||
/**
|
||||
* Query the camera for memory channel support. If the number of
|
||||
* channels is 0, then memory channel support is not available.
|
||||
*
|
||||
* @param pNumChannels Number of memory channels supported.
|
||||
*
|
||||
* @see GetMemoryChannel()
|
||||
* @see SaveToMemoryChannel()
|
||||
* @see RestoreFromMemoryChannel()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetMemoryChannelInfo( unsigned int* pNumChannels ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Embedded Image Information
|
||||
*
|
||||
* These functions deal with embedded image information control
|
||||
* on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Get the current status of the embedded image information register,
|
||||
* as well as the availability of each embedded property.
|
||||
*
|
||||
* @param pInfo Structure to be filled.
|
||||
*
|
||||
* @see SetEmbeddedImageInfo()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetEmbeddedImageInfo( EmbeddedImageInfo* pInfo ) = 0;
|
||||
|
||||
/**
|
||||
* Sets the on/off values of the embedded image information structure
|
||||
* to the camera.
|
||||
*
|
||||
* @param pInfo Structure to be used.
|
||||
*
|
||||
* @see GetEmbeddedImageInfo()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetEmbeddedImageInfo( EmbeddedImageInfo* pInfo ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Register Operation
|
||||
*
|
||||
* These functions deal with register operation on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Write to the specified register on the camera.
|
||||
*
|
||||
* @param address DCAM address to be written to.
|
||||
* @param value The value to be written.
|
||||
* @param broadcast Whether the action should be broadcast.
|
||||
*
|
||||
* @see ReadRegister()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error WriteRegister(
|
||||
unsigned int address,
|
||||
unsigned int value,
|
||||
bool broadcast=false) = 0;
|
||||
|
||||
/**
|
||||
* Read the specified register from the camera.
|
||||
*
|
||||
* @param address DCAM address to be read from.
|
||||
* @param pValue The value that is read.
|
||||
*
|
||||
* @see WriteRegister()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ReadRegister(
|
||||
unsigned int address,
|
||||
unsigned int* pValue ) = 0;
|
||||
|
||||
/**
|
||||
* Write to the specified register block on the camera.
|
||||
*
|
||||
* @param addressHigh Top 16 bits of the 48 bit absolute address to
|
||||
* write to.
|
||||
* @param addressLow Bottom 32 bits of the 48 bits absolute address to
|
||||
* write to.
|
||||
* @param pBuffer Array containing data to be written.
|
||||
* @param length Size of array, in quadlets.
|
||||
*
|
||||
* @see ReadRegisterBlock()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error WriteRegisterBlock(
|
||||
unsigned short addressHigh,
|
||||
unsigned int addressLow,
|
||||
const unsigned int* pBuffer,
|
||||
unsigned int length ) = 0;
|
||||
|
||||
/**
|
||||
* Read from the specified register block on the camera.
|
||||
*
|
||||
* @param addressHigh Top 16 bits of the 48 bit absolute address to
|
||||
* read from.
|
||||
* @param addressLow Bottom 32 bits of the 48 bits absolute address to
|
||||
* read from.
|
||||
* @param pBuffer Array to store read data.
|
||||
* @param length Size of array, in quadlets.
|
||||
*
|
||||
* @see WriteRegisterBlock()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ReadRegisterBlock(
|
||||
unsigned short addressHigh,
|
||||
unsigned int addressLow,
|
||||
unsigned int* pBuffer,
|
||||
unsigned int length ) = 0;
|
||||
|
||||
/**
|
||||
* Returns a text representation of the register value.
|
||||
*
|
||||
* @param registerVal The register value to query.
|
||||
*
|
||||
* @return The text representation of the register.
|
||||
*/
|
||||
static const char* GetRegisterString( unsigned int registerVal);
|
||||
|
||||
/**
|
||||
* Returns a Timestamp struct containing 1394 CYCLE_TIME information
|
||||
*
|
||||
* @param registerVal The register value to query.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetCycleTime(TimeStamp *timeStamp) = 0;
|
||||
|
||||
/*
|
||||
* Returns the camera diagnostic infomation.
|
||||
*
|
||||
* @param pStats Pointer to the CameraStats structure.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetStats( CameraStats* pStats ) = 0;
|
||||
|
||||
/*
|
||||
* Reset the camera diagnostic infomation.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ResetStats() = 0;
|
||||
|
||||
/*
|
||||
* Register the camera to issue a custom callback function call for a
|
||||
* specific device event.
|
||||
*
|
||||
* @param pOpts Pointer to the EventOptions structure which defines the
|
||||
* callback function to use, the event for which to register
|
||||
* the device, and a pointer to user data (optional) to be
|
||||
* passed to the callback function.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error RegisterEvent( EventOptions* pOpts ) = 0;
|
||||
|
||||
/*
|
||||
* De-register an event previously registered with the camera.
|
||||
*
|
||||
* @param pOpts Pointer to the EventOptions structure which defines the
|
||||
* callback function to use, the event for which to register
|
||||
* the device, and a pointer to user data (optional) to be
|
||||
* passed to the callback function. The callback function and
|
||||
* user data elements of the EventOptions structure are ignored
|
||||
* in this call, and just the event name within the structure is
|
||||
* used with this function call.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error DeregisterEvent( EventOptions* pOpts ) = 0;
|
||||
|
||||
/*
|
||||
* Register the camera to issue a custom callback function call for a
|
||||
* specific device event.
|
||||
*
|
||||
* @param pOpts Pointer to the EventOptions structure which defines the
|
||||
* callback function to use, the event for which to register
|
||||
* the device, and a pointer to user data (optional) to be
|
||||
* passed to the callback function. The event name element of
|
||||
* the structure is ignored with this function call. If a single
|
||||
* event has already been registered via RegisterEvent(), this
|
||||
* call will fail, as the user could accidentally change the
|
||||
* the internal callback function pointer for a queued event.
|
||||
* The user will need to de-register all registered events,
|
||||
* then call this function again.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error RegisterAllEvents( EventOptions* pOpts ) = 0;
|
||||
|
||||
/*
|
||||
* De-register all events registered with the camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error DeregisterAllEvents( void ) = 0;
|
||||
|
||||
/*@}*/
|
||||
|
||||
protected:
|
||||
struct CameraData; // Forward declaration
|
||||
CameraData* m_pCameraData;
|
||||
|
||||
private:
|
||||
CameraBase( const CameraBase& );
|
||||
CameraBase& operator=( const CameraBase& );
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PGR_FC2_CAMERABASE_H_
|
148
include/flycapture/Error.h
Executable file
148
include/flycapture/Error.h
Executable file
|
@ -0,0 +1,148 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: Error.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_ERROR_H
|
||||
#define PGR_FC2_ERROR_H
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
#include <stdio.h>
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
struct ErrorImpl;
|
||||
|
||||
/**
|
||||
* The Error object represents an error that is returned from the library.
|
||||
* Overloaded operators allow comparisons against other Error objects or
|
||||
* the ErrorType enumeration.
|
||||
*/
|
||||
class FLYCAPTURE2_API Error
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
Error();
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*/
|
||||
Error( const Error& error );
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~Error();
|
||||
|
||||
/**
|
||||
* Assignment operator.
|
||||
*/
|
||||
virtual Error& operator=( const Error& error );
|
||||
|
||||
/**
|
||||
* Equality operator.
|
||||
*/
|
||||
virtual bool operator==( const Error& error ) const;
|
||||
|
||||
/**
|
||||
* Equality operator. This overloaded operator compares the
|
||||
* ErrorType of the Error against the specified ErrorType.
|
||||
*/
|
||||
virtual bool operator==( const ErrorType& errorType ) const;
|
||||
|
||||
/**
|
||||
* Inequality operator.
|
||||
*/
|
||||
virtual bool operator!=( const Error& error ) const;
|
||||
|
||||
/**
|
||||
* Inequality operator. This overloaded operator compares the
|
||||
* ErrorType of the Error against the specified ErrorType.
|
||||
*/
|
||||
virtual bool operator!=( const ErrorType& errorType ) const;
|
||||
|
||||
/**
|
||||
* Retrieve the ErrorType of the error.
|
||||
*
|
||||
* @return The ErrorType of the error.
|
||||
*/
|
||||
virtual ErrorType GetType() const;
|
||||
|
||||
/**
|
||||
* Retrieve the top level description of the error that occurred.
|
||||
*
|
||||
* @return A string with the error description.
|
||||
*/
|
||||
virtual const char* GetDescription() const;
|
||||
|
||||
/**
|
||||
* Retrieve the line number where the error originated.
|
||||
*
|
||||
* @return The line number.
|
||||
*/
|
||||
virtual unsigned int GetLine() const;
|
||||
|
||||
/**
|
||||
* Retrieve the source filename where the error originated.
|
||||
*
|
||||
* @return A string with the file name.
|
||||
*/
|
||||
virtual const char* GetFilename() const;
|
||||
|
||||
/**
|
||||
* Get the error which caused this error.
|
||||
*
|
||||
* @return An error object representing the cause of this error.
|
||||
*/
|
||||
virtual Error GetCause() const;
|
||||
|
||||
/**
|
||||
* Retrieve the build date of the file where the error originated.
|
||||
*
|
||||
* @return A string with the build date and time.
|
||||
*/
|
||||
virtual const char* GetBuildDate() const;
|
||||
|
||||
/**
|
||||
* Retrieve the support information.
|
||||
* It is not implemented in this release.
|
||||
*
|
||||
* @return A string containing support information.
|
||||
*/
|
||||
virtual const char* CollectSupportInformation() const;
|
||||
|
||||
/**
|
||||
* Print a formatted log trace to stderr.
|
||||
*/
|
||||
virtual void PrintErrorTrace() const;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
ErrorType m_type;
|
||||
ErrorImpl* m_pImpl;
|
||||
friend class InternalError;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PGR_FC2_ERROR_H
|
65
include/flycapture/FlyCapture2.h
Executable file
65
include/flycapture/FlyCapture2.h
Executable file
|
@ -0,0 +1,65 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: FlyCapture2.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_FLYCAPTURE2_H
|
||||
#define PGR_FC2_FLYCAPTURE2_H
|
||||
|
||||
//=============================================================================
|
||||
// Global header file for FlyCapture2.
|
||||
//
|
||||
// By including this file, all required header files for full FlyCapture2
|
||||
// operation will be included automatically. It is recommended that this file
|
||||
// be used instead of manually including individual header files.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Platform-specific definitions
|
||||
//=============================================================================
|
||||
#include "FlyCapture2Platform.h"
|
||||
|
||||
//=============================================================================
|
||||
// Global definitions
|
||||
//=============================================================================
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
//=============================================================================
|
||||
// PGR Error class
|
||||
//=============================================================================
|
||||
#include "Error.h"
|
||||
|
||||
//=============================================================================
|
||||
// FlyCapture2 classes
|
||||
//=============================================================================
|
||||
#include "BusManager.h"
|
||||
#include "Camera.h"
|
||||
#include "GigECamera.h"
|
||||
#include "Image.h"
|
||||
|
||||
//=============================================================================
|
||||
// Utility classes
|
||||
//=============================================================================
|
||||
#include "Utilities.h"
|
||||
#include "AVIRecorder.h"
|
||||
#include "TopologyNode.h"
|
||||
#include "ImageStatistics.h"
|
||||
|
||||
#endif // PGR_FC2_FLYCAPTURE2_H
|
||||
|
65
include/flycapture/FlyCapture2.h~
Executable file
65
include/flycapture/FlyCapture2.h~
Executable file
|
@ -0,0 +1,65 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: FlyCapture2.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_FLYCAPTURE2_H
|
||||
#define PGR_FC2_FLYCAPTURE2_H
|
||||
|
||||
//=============================================================================
|
||||
// Global header file for FlyCapture2.
|
||||
//
|
||||
// By including this file, all required header files for full FlyCapture2
|
||||
// operation will be included automatically. It is recommended that this file
|
||||
// be used instead of manually including individual header files.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Platform-specific definitions
|
||||
//=============================================================================
|
||||
#include "FlyCapture2Platform.h"
|
||||
|
||||
//=============================================================================
|
||||
// Global definitions
|
||||
//=============================================================================
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
//=============================================================================
|
||||
// PGR Error class
|
||||
//=============================================================================
|
||||
#include "Error.h"
|
||||
|
||||
//=============================================================================
|
||||
// FlyCapture2 classes
|
||||
//=============================================================================
|
||||
#include "BusManager.h"
|
||||
#include "Camera.h"
|
||||
#include "GigECamera.h"
|
||||
#include "Image.h"
|
||||
|
||||
//=============================================================================
|
||||
// Utility classes
|
||||
//=============================================================================
|
||||
#include "Utilities.h"
|
||||
#include "AVIRecorder.h"
|
||||
#include "TopologyNode.h"
|
||||
#include "ImageStatistics.h"
|
||||
|
||||
#endif // PGR_FC2_FLYCAPTURE2_H
|
||||
|
1905
include/flycapture/FlyCapture2Defs.h
Executable file
1905
include/flycapture/FlyCapture2Defs.h
Executable file
File diff suppressed because it is too large
Load diff
234
include/flycapture/FlyCapture2GUI.h
Executable file
234
include/flycapture/FlyCapture2GUI.h
Executable file
|
@ -0,0 +1,234 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with PGR.
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_FLYCAPTURE2GUI_H
|
||||
#define PGR_FC2_FLYCAPTURE2GUI_H
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
// Forward declaration
|
||||
class CameraBase;
|
||||
|
||||
/**
|
||||
* The CameraControlDlg object represents a dialog that provides
|
||||
* a graphical interface to a specified camera.
|
||||
*/
|
||||
class FLYCAPTURE2_API CameraControlDlg
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
CameraControlDlg();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
~CameraControlDlg();
|
||||
|
||||
/**
|
||||
* Connect dialog to a camera.
|
||||
*
|
||||
* @param pCamera Camera object to connect the dialog to.
|
||||
*/
|
||||
void Connect(CameraBase* pCamera);
|
||||
|
||||
/**
|
||||
* Disconnect a connected camera from the dialog.
|
||||
*/
|
||||
void Disconnect();
|
||||
|
||||
/**
|
||||
* Show the dialog.
|
||||
*/
|
||||
void Show();
|
||||
|
||||
/**
|
||||
* Show the dialog.
|
||||
*/
|
||||
void Show(void* pParent);
|
||||
|
||||
/**
|
||||
* Show the modal dialog.
|
||||
*/
|
||||
void ShowModal();
|
||||
|
||||
/**
|
||||
* Show the modal dialog.
|
||||
*/
|
||||
void ShowModal(void* pParent);
|
||||
|
||||
/**
|
||||
* Hide the dialog
|
||||
*/
|
||||
void Hide();
|
||||
|
||||
/**
|
||||
* Get the visibility of the dialog.
|
||||
*
|
||||
* @return Whether the dialog is visible.
|
||||
*/
|
||||
bool IsVisible();
|
||||
|
||||
/**
|
||||
* Change the title of the window. This has to be called after
|
||||
* calling Connect().
|
||||
*
|
||||
* @param title Null-terminated string representing the title.
|
||||
*/
|
||||
void SetTitle(const char* title);
|
||||
|
||||
private:
|
||||
struct CamCtlData; // Forward declaration
|
||||
|
||||
CamCtlData* m_pCamCtlData;
|
||||
|
||||
CameraControlDlg( const CameraControlDlg& );
|
||||
CameraControlDlg& operator=( const CameraControlDlg& );
|
||||
};
|
||||
|
||||
/**
|
||||
* The CameraSelectionDlg object represents a dialog that provides
|
||||
* a graphical interface that lists the number of cameras available to
|
||||
* the library.
|
||||
*/
|
||||
class FLYCAPTURE2_API CameraSelectionDlg
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
CameraSelectionDlg();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
~CameraSelectionDlg();
|
||||
|
||||
/**
|
||||
* Show the CameraSelectionDlg.
|
||||
*
|
||||
* @param pOk Whether Ok (true) or Cancel (false) was clicked.
|
||||
* @param pGuid Array of PGRGuids containing the selected cameras.
|
||||
* @param pSize Size of PGRGuid array.
|
||||
*/
|
||||
void ShowModal(bool* pOk, PGRGuid* pGuid, unsigned int* pSize);
|
||||
|
||||
/**
|
||||
* Set the window title.
|
||||
*
|
||||
* @param title Null-terminated string representing the title.
|
||||
*/
|
||||
void SetTitle(const char* title);
|
||||
|
||||
private:
|
||||
struct CamSelectionData; // Forward declaration
|
||||
|
||||
CamSelectionData* m_pCamSelectionData;
|
||||
|
||||
CameraSelectionDlg( const CameraSelectionDlg& );
|
||||
CameraSelectionDlg& operator=( const CameraSelectionDlg& );
|
||||
};
|
||||
|
||||
#ifdef GENICAM
|
||||
/**
|
||||
* The PropertyGridDlg object represents a dialog that provides
|
||||
* a graphical interface to a GeniCam nodemap.
|
||||
*/
|
||||
class FLYCAPTURE2_API PropertyGridDlg
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
PropertyGridDlg();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
~PropertyGridDlg();
|
||||
|
||||
/**
|
||||
* Connect dialog to a camera.
|
||||
*
|
||||
* @param pCamera Camera object to connect the dialog to.
|
||||
*/
|
||||
void Connect(CameraBase* pCamera);
|
||||
void Connect(CameraBase* pCamera, const char* xmlPath);
|
||||
|
||||
/**
|
||||
* Disconnect a connected camera from the dialog.
|
||||
*/
|
||||
void Disconnect();
|
||||
|
||||
/**
|
||||
* Show the dialog.
|
||||
*/
|
||||
void Show();
|
||||
|
||||
/**
|
||||
* Show the dialog.
|
||||
*/
|
||||
void Show(void* pParent);
|
||||
|
||||
/**
|
||||
* Show the modal dialog.
|
||||
*/
|
||||
void ShowModal();
|
||||
|
||||
/**
|
||||
* Show the modal dialog.
|
||||
*/
|
||||
void ShowModal(void* pParent);
|
||||
|
||||
/**
|
||||
* Hide the dialog
|
||||
*/
|
||||
void Hide();
|
||||
|
||||
/**
|
||||
* Get the visibility of the dialog.
|
||||
*
|
||||
* @return Whether the dialog is visible.
|
||||
*/
|
||||
bool IsVisible();
|
||||
|
||||
/**
|
||||
* Change the title of the window. This has to be called after
|
||||
* calling Connect().
|
||||
*
|
||||
* @param title Null-terminated string representing the title.
|
||||
*/
|
||||
void SetTitle(const char* title);
|
||||
|
||||
void RefreshProperties();
|
||||
bool IsConnected();
|
||||
private:
|
||||
struct PropGridData; // Forward declaration
|
||||
|
||||
PropGridData* m_pPropGridData;
|
||||
|
||||
PropertyGridDlg( const PropertyGridDlg& );
|
||||
PropertyGridDlg& operator=( const PropertyGridDlg& );
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // PGR_FC2_FLYCAPTURE2GUI_H
|
79
include/flycapture/FlyCapture2Platform.h
Executable file
79
include/flycapture/FlyCapture2Platform.h
Executable file
|
@ -0,0 +1,79 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: FlyCapture2Platform.h 284515 2016-06-02 18:11:05Z erich $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_FLYCAPTURE2PLATFORM_H
|
||||
#define PGR_FC2_FLYCAPTURE2PLATFORM_H
|
||||
|
||||
//=============================================================================
|
||||
// Platform-specific header file for FlyCapture2.
|
||||
//
|
||||
// All the platform-specific code that is required by individual compilers
|
||||
// to produce the appropriate code for each platform.
|
||||
//=============================================================================
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
|
||||
// Windows 32-bit and 64-bit
|
||||
#ifdef FLYCAPTURE2_EXPORT
|
||||
#define FLYCAPTURE2_API __declspec( dllexport )
|
||||
#elif defined(FLYCAPTURE2_STATIC)
|
||||
#define FLYCAPTURE2_API
|
||||
#else
|
||||
#define FLYCAPTURE2_API __declspec( dllimport )
|
||||
#endif
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Provide a common naming scheme for fixed-width integer types
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER >= 1600
|
||||
#include <cstdint>
|
||||
#else
|
||||
//typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
//typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#endif
|
||||
#elif __GNUC__ >=3
|
||||
#include <cstdint>
|
||||
#endif
|
||||
|
||||
#elif defined(MAC_OSX)
|
||||
|
||||
// Mac OSX
|
||||
|
||||
#else
|
||||
// Linux and all others
|
||||
|
||||
// Using GCC 4 where hiding attributes is possible
|
||||
#define FLYCAPTURE2_API __attribute__ ((visibility ("default")))
|
||||
#define FLYCAPTURE2_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
|
||||
#endif
|
||||
|
||||
#endif // PGR_FC2_FLYCAPTURE2PLATFORM_H
|
||||
|
451
include/flycapture/GigECamera.h
Executable file
451
include/flycapture/GigECamera.h
Executable file
|
@ -0,0 +1,451 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2010 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: GigECamera.h 278996 2016-04-27 20:31:09Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_GIGECAMERA_H_
|
||||
#define PGR_FC2_GIGECAMERA_H_
|
||||
|
||||
#include "CameraBase.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
/**
|
||||
* The GigECamera object represents a physical Gigabit Ethernet camera.
|
||||
* The object must first be connected to using Connect() before any
|
||||
* other operations can proceed.
|
||||
*
|
||||
* Please see Camera.h for basic functions that this class inherits from.
|
||||
*
|
||||
* @nosubgrouping
|
||||
*/
|
||||
class FLYCAPTURE2_API GigECamera : public CameraBase
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
GigECamera();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~GigECamera();
|
||||
|
||||
/**
|
||||
* @name GVCP Register Operation
|
||||
*
|
||||
* These functions deal with GVCP register operation on the camera.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Write a GVCP register.
|
||||
*
|
||||
* @param address GVCP address to be written to.
|
||||
* @param value The value to be written.
|
||||
* @param broadcast Whether the action should be broadcast.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error WriteGVCPRegister(
|
||||
unsigned int address,
|
||||
unsigned int value,
|
||||
bool broadcast = false);
|
||||
|
||||
/**
|
||||
* Read a GVCP register.
|
||||
*
|
||||
* @param address GVCP address to be read from.
|
||||
* @param pValue The value that is read.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ReadGVCPRegister(
|
||||
unsigned int address,
|
||||
unsigned int* pValue );
|
||||
|
||||
/**
|
||||
* Write a GVCP register block.
|
||||
*
|
||||
* @param address GVCP address to be write to.
|
||||
* @param pBuffer Array containing data to be written.
|
||||
* @param length Size of array, in quadlets.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error WriteGVCPRegisterBlock(
|
||||
unsigned int address,
|
||||
const unsigned int* pBuffer,
|
||||
unsigned int length );
|
||||
|
||||
/**
|
||||
* Read a GVCP register block.
|
||||
*
|
||||
* @param address GVCP address to be read from.
|
||||
* @param pBuffer Array for data to be read into.
|
||||
* @param length Size of array, in quadlets.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ReadGVCPRegisterBlock(
|
||||
unsigned int address,
|
||||
unsigned int* pBuffer,
|
||||
unsigned int length );
|
||||
|
||||
/**
|
||||
* Write a GVCP Memory block.
|
||||
*
|
||||
* @param address GVCP address to be write to.
|
||||
* @param pBuffer Array containing data to be written in increments.
|
||||
* @param length Size of array, in quadlets.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error WriteGVCPMemory(
|
||||
unsigned int address,
|
||||
const unsigned char* pBuffer,
|
||||
unsigned int length );
|
||||
|
||||
/**
|
||||
* Read a GVCP memory block.
|
||||
*
|
||||
* @param address GVCP address to be read from.
|
||||
* @param pBuffer Array for data to be read into.
|
||||
* @param length Size of array, in quadlets.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ReadGVCPMemory(
|
||||
unsigned int address,
|
||||
unsigned char* pBuffer,
|
||||
unsigned int length );
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name GigE property manipulation
|
||||
*
|
||||
* These functions deal with GigE properties.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Get the specified GigEProperty. The GigEPropertyType field must
|
||||
* be set in order for this function to succeed.
|
||||
*
|
||||
* @param pGigEProp The GigE property to get.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetGigEProperty( GigEProperty* pGigEProp );
|
||||
|
||||
/**
|
||||
* Set the specified GigEProperty. The GigEPropertyType field must
|
||||
* be set in order for this function to succeed.
|
||||
*
|
||||
* @param pGigEProp The GigE property to set.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetGigEProperty( const GigEProperty* pGigEProp );
|
||||
|
||||
/**
|
||||
* Discover the largest packet size that works for the network link
|
||||
* between the PC and the camera. This is useful in cases where
|
||||
* there may be multiple links between the PC and the camera and
|
||||
* there is a possiblity of a component not supporting the
|
||||
* recommended jumbo frame packet size of 9000.
|
||||
*
|
||||
* @param packetSize The maximum packet size supported by the link.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error DiscoverGigEPacketSize( unsigned int* packetSize );
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name GigE image settings
|
||||
*
|
||||
* These functions deal with GigE image setting.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Check if the particular imaging mode is supported by the camera.
|
||||
*
|
||||
* @param mode The mode to check.
|
||||
* @param isSupported Whether the mode is supported.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error QueryGigEImagingMode( Mode mode, bool* isSupported );
|
||||
|
||||
/**
|
||||
* Get the current imaging mode on the camera.
|
||||
*
|
||||
* @param mode Current imaging mode on the camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetGigEImagingMode( Mode* mode );
|
||||
|
||||
/**
|
||||
* Set the current imaging mode to the camera. This should only be
|
||||
* done when the camera is not streaming images.
|
||||
*
|
||||
* @param mode Imaging mode to set to the camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetGigEImagingMode( Mode mode );
|
||||
|
||||
/**
|
||||
* Get information about the image settings possible on the camera.
|
||||
*
|
||||
* @param pInfo Image settings information.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetGigEImageSettingsInfo( GigEImageSettingsInfo* pInfo );
|
||||
|
||||
/**
|
||||
* Get the current image settings on the camera.
|
||||
*
|
||||
* @param pImageSettings Current image settings on camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetGigEImageSettings( GigEImageSettings* pImageSettings );
|
||||
|
||||
/**
|
||||
* Set the image settings specified to the camera.
|
||||
*
|
||||
* @param pImageSettings Image settings to set to camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetGigEImageSettings( const GigEImageSettings* pImageSettings );
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name GigE image binning settings
|
||||
*
|
||||
* These functions deal with GigE image binning settings.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Get the current binning settings on the camera.
|
||||
*
|
||||
* @param horzBinnningValue Current horizontal binning value.
|
||||
* @param vertBinnningValue Current vertical binning value.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetGigEImageBinningSettings( unsigned int* horzBinnningValue, unsigned int* vertBinnningValue );
|
||||
|
||||
/**
|
||||
* Set the specified binning values to the camera. It is recommended
|
||||
* that GetGigEImageSettingsInfo() be called after this function
|
||||
* succeeds to retrieve the new image settings information for
|
||||
* the new binning mode.
|
||||
*
|
||||
* @param horzBinnningValue Horizontal binning value.
|
||||
* @param vertBinnningValue Vertical binning value.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetGigEImageBinningSettings( unsigned int horzBinnningValue, unsigned int vertBinnningValue );
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name GigE image stream configuration
|
||||
*
|
||||
* These functions deal with GigE image stream configuration.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Get the number of stream channels present on the camera.
|
||||
*
|
||||
* @param numChannels Number of stream channels present.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetNumStreamChannels( unsigned int* numChannels );
|
||||
|
||||
/**
|
||||
* Get the stream channel information for the specified channel.
|
||||
*
|
||||
* @param channel Channel number to use.
|
||||
* @param pChannel Stream channel information for the specified channel.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetGigEStreamChannelInfo( unsigned int channel, GigEStreamChannel* pChannel );
|
||||
|
||||
/**
|
||||
* Set the stream channel information for the specified channel.
|
||||
*
|
||||
* Note that the source UDP port of the stream channel is read-only.
|
||||
*
|
||||
* @param channel Channel number to use.
|
||||
* @param pChannel Stream channel information to use for the specified channel.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetGigEStreamChannelInfo( unsigned int channel, GigEStreamChannel* pChannel );
|
||||
|
||||
/**
|
||||
* Get the current gige config on the camera.
|
||||
*
|
||||
* @param pGigEConfig Current configuration on camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error GetGigEConfig( GigEConfig* pGigEConfig );
|
||||
|
||||
/**
|
||||
* Set the gige config specified to the camera.
|
||||
*
|
||||
* @param pGigEConfig configuration to set to camera.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetGigEConfig( const GigEConfig* pGigEConfig );
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* The following functions are inherited from CameraBase. See
|
||||
* CameraBase.h for further information.
|
||||
*/
|
||||
|
||||
virtual Error Connect( PGRGuid* pGuid = NULL );
|
||||
virtual Error Disconnect();
|
||||
virtual bool IsConnected();
|
||||
virtual Error SetCallback(
|
||||
ImageEventCallback callbackFn,
|
||||
const void* pCallbackData = NULL );
|
||||
virtual Error StartCapture(
|
||||
ImageEventCallback callbackFn = NULL,
|
||||
const void* pCallbackData = NULL );
|
||||
|
||||
/**
|
||||
* StartSyncCapture() with GigE Cameras is not supported.
|
||||
* This function has been deprecated and will be removed
|
||||
* in a future version of FlyCapture.
|
||||
*/
|
||||
static Error StartSyncCapture(
|
||||
unsigned int numCameras,
|
||||
const GigECamera **ppCameras,
|
||||
const ImageEventCallback *pCallbackFns = NULL,
|
||||
const void** pCallbackDataArray = NULL );
|
||||
virtual Error RetrieveBuffer( Image* pImage );
|
||||
virtual Error StopCapture();
|
||||
virtual Error WaitForBufferEvent( Image* pImage, unsigned int eventNumber );
|
||||
virtual Error SetUserBuffers(
|
||||
unsigned char* const pMemBuffers,
|
||||
int size,
|
||||
int numBuffers );
|
||||
virtual Error GetConfiguration( FC2Config* pConfig );
|
||||
virtual Error SetConfiguration( const FC2Config* pConfig );
|
||||
virtual Error GetCameraInfo( CameraInfo* pCameraInfo );
|
||||
virtual Error GetPropertyInfo( PropertyInfo* pPropInfo );
|
||||
virtual Error GetProperty( Property* pProp );
|
||||
virtual Error SetProperty(
|
||||
const Property* pProp,
|
||||
bool broadcast = false );
|
||||
virtual Error GetGPIOPinDirection( unsigned int pin, unsigned int* pDirection);
|
||||
virtual Error SetGPIOPinDirection( unsigned int pin, unsigned int direction, bool broadcast = false );
|
||||
virtual Error GetTriggerModeInfo( TriggerModeInfo* pTriggerModeInfo );
|
||||
virtual Error GetTriggerMode( TriggerMode* pTriggerMode );
|
||||
virtual Error SetTriggerMode(
|
||||
const TriggerMode* pTriggerMode,
|
||||
bool broadcast = false );
|
||||
virtual Error FireSoftwareTrigger( bool broadcast = false );
|
||||
virtual Error GetTriggerDelayInfo( TriggerDelayInfo* pTriggerDelayInfo );
|
||||
virtual Error GetTriggerDelay( TriggerDelay* pTriggerDelay );
|
||||
virtual Error SetTriggerDelay(
|
||||
const TriggerDelay* pTriggerDelay,
|
||||
bool broadcast = false );
|
||||
virtual Error GetStrobeInfo( StrobeInfo* pStrobeInfo );
|
||||
virtual Error GetStrobe( StrobeControl* pStrobeControl );
|
||||
virtual Error SetStrobe(
|
||||
const StrobeControl* pStrobeControl,
|
||||
bool broadcast = false );
|
||||
virtual Error GetLUTInfo( LUTData* pData );
|
||||
virtual Error GetLUTBankInfo(
|
||||
unsigned int bank,
|
||||
bool* pReadSupported,
|
||||
bool* pWriteSupported );
|
||||
virtual Error GetActiveLUTBank( unsigned int* pActiveBank );
|
||||
virtual Error SetActiveLUTBank( unsigned int activeBank );
|
||||
virtual Error EnableLUT( bool on );
|
||||
virtual Error GetLUTChannel(
|
||||
unsigned int bank,
|
||||
unsigned int channel,
|
||||
unsigned int sizeEntries,
|
||||
unsigned int* pEntries );
|
||||
virtual Error SetLUTChannel(
|
||||
unsigned int bank,
|
||||
unsigned int channel,
|
||||
unsigned int sizeEntries,
|
||||
const unsigned int* pEntries );
|
||||
virtual Error GetMemoryChannel( unsigned int* pCurrentChannel );
|
||||
virtual Error SaveToMemoryChannel( unsigned int channel );
|
||||
virtual Error RestoreFromMemoryChannel( unsigned int channel );
|
||||
virtual Error GetMemoryChannelInfo( unsigned int* pNumChannels );
|
||||
virtual Error GetEmbeddedImageInfo( EmbeddedImageInfo* pInfo );
|
||||
virtual Error SetEmbeddedImageInfo( EmbeddedImageInfo* pInfo );
|
||||
virtual Error WriteRegister(
|
||||
unsigned int address,
|
||||
unsigned int value,
|
||||
bool broadcast=false);
|
||||
virtual Error ReadRegister(
|
||||
unsigned int address,
|
||||
unsigned int* pValue );
|
||||
virtual Error WriteRegisterBlock(
|
||||
unsigned short addressHigh,
|
||||
unsigned int addressLow,
|
||||
const unsigned int* pBuffer,
|
||||
unsigned int length );
|
||||
virtual Error ReadRegisterBlock(
|
||||
unsigned short addressHigh,
|
||||
unsigned int addressLow,
|
||||
unsigned int* pBuffer,
|
||||
unsigned int length );
|
||||
static const char* GetRegisterString( unsigned int registerVal);
|
||||
Error GetCycleTime(TimeStamp *timeStamp);
|
||||
virtual Error GetStats( CameraStats* pStats );
|
||||
virtual Error ResetStats();
|
||||
|
||||
virtual Error RegisterEvent( EventOptions* pOpts );
|
||||
virtual Error DeregisterEvent( EventOptions* pOpts );
|
||||
virtual Error RegisterAllEvents( EventOptions* pOpts );
|
||||
virtual Error DeregisterAllEvents( void );
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PGR_FC2_GIGECAMERA_H_
|
562
include/flycapture/Image.h
Executable file
562
include/flycapture/Image.h
Executable file
|
@ -0,0 +1,562 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: Image.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_IMAGE_H
|
||||
#define PGR_FC2_IMAGE_H
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
class Error;
|
||||
class ImageStatistics;
|
||||
|
||||
/**
|
||||
* The Image class is used to retrieve images from a camera, convert
|
||||
* between multiple pixel formats and save images to disk. Operations on
|
||||
* Image objects are not guaranteed to be thread safe. It is recommended
|
||||
* that operations on Image objects be protected by thread synchronization
|
||||
* constructs such as mutexes.
|
||||
*/
|
||||
class FLYCAPTURE2_API Image
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Set the default color processing algorithm. This method will be
|
||||
* used for any image with the DEFAULT algorithm set. The method used
|
||||
* is determined at the time of the Convert() call, therefore the most
|
||||
* recent execution of this function will take precedence. The default
|
||||
* setting is shared within the current process.
|
||||
*
|
||||
* @param defaultMethod The color processing algorithm to set.
|
||||
*
|
||||
* @see GetDefaultColorProcessing()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error SetDefaultColorProcessing(
|
||||
ColorProcessingAlgorithm defaultMethod );
|
||||
|
||||
/**
|
||||
* Get the default color processing algorithm.
|
||||
*
|
||||
* @see SetDefaultColorProcessing()
|
||||
*
|
||||
* @return The default color processing algorithm.
|
||||
*/
|
||||
static ColorProcessingAlgorithm GetDefaultColorProcessing();
|
||||
|
||||
/**
|
||||
* Set the default output pixel format. This format will be used for any
|
||||
* call to Convert() that does not specify an output format. The format
|
||||
* used will be determined at the time of the Convert() call, therefore
|
||||
* the most recent execution of this function will take precedence.
|
||||
* The default is shared within the current process.
|
||||
*
|
||||
* @param format The output pixel format to set.
|
||||
*
|
||||
* @see GetDefaultOutputFormat()
|
||||
*
|
||||
* @return The default color processing algorithm.
|
||||
*/
|
||||
static Error SetDefaultOutputFormat( PixelFormat format );
|
||||
|
||||
/**
|
||||
* Get the default output pixel format.
|
||||
*
|
||||
* @see SetDefaultOutputFormat()
|
||||
*
|
||||
* @return The default pixel format.
|
||||
*/
|
||||
static PixelFormat GetDefaultOutputFormat();
|
||||
|
||||
/**
|
||||
* Calculate the bits per pixel for the specified pixel format.
|
||||
*
|
||||
* @param format The pixel format.
|
||||
*
|
||||
* @return The bits per pixel.
|
||||
*/
|
||||
static unsigned int DetermineBitsPerPixel( PixelFormat format );
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
Image();
|
||||
|
||||
/**
|
||||
* Construct an Image object with the specified arguments.
|
||||
* Ownership of the image buffer is not transferred to the Image object.
|
||||
* It is the user's responsibility to delete the buffer when it is
|
||||
* no longer in use.
|
||||
*
|
||||
* @param rows Rows in the image.
|
||||
* @param cols Columns in the image.
|
||||
* @param stride Stride of the image buffer.
|
||||
* @param pData Pointer to the image buffer.
|
||||
* @param dataSize Size of the image buffer.
|
||||
* @param format Pixel format.
|
||||
* @param bayerFormat Format of the Bayer tiled raw image.
|
||||
*/
|
||||
Image(
|
||||
unsigned int rows,
|
||||
unsigned int cols,
|
||||
unsigned int stride,
|
||||
unsigned char* pData,
|
||||
unsigned int dataSize,
|
||||
PixelFormat format,
|
||||
BayerTileFormat bayerFormat = NONE );
|
||||
|
||||
/**
|
||||
* Construct an Image object with the specified arguments.
|
||||
* Ownership of the image buffer is not transferred to the Image object.
|
||||
* It is the user's responsibility to delete the buffer when it is
|
||||
* no longer in use.
|
||||
*
|
||||
* @param rows Rows in the image.
|
||||
* @param cols Columns in the image.
|
||||
* @param stride Stride of the image buffer.
|
||||
* @param pData Pointer to the image buffer.
|
||||
* @param dataSize Size of the image buffer.
|
||||
* @param receivedDataSize Actual size of data.
|
||||
* @param format Pixel format.
|
||||
* @param bayerFormat Format of the Bayer tiled raw image.
|
||||
*/
|
||||
Image(
|
||||
unsigned int rows,
|
||||
unsigned int cols,
|
||||
unsigned int stride,
|
||||
unsigned char* pData,
|
||||
unsigned int dataSize,
|
||||
unsigned int receivedDataSize,
|
||||
PixelFormat format,
|
||||
BayerTileFormat bayerFormat = NONE );
|
||||
|
||||
/**
|
||||
* Construct an Image object with the specified arguments.
|
||||
* Ownership of the image buffer is not transferred to the Image object.
|
||||
* It is the user's responsibility to delete the buffer when it is
|
||||
* no longer in use.
|
||||
*
|
||||
* @param pData Pointer to the image buffer.
|
||||
* @param dataSize Size of the image buffer.
|
||||
*/
|
||||
Image(
|
||||
unsigned char* pData,
|
||||
unsigned int dataSize);
|
||||
|
||||
/**
|
||||
* Construct an Image object with the specified arguments.
|
||||
*
|
||||
* @param rows Rows in the image.
|
||||
* @param cols Columns in the image.
|
||||
* @param format Pixel format.
|
||||
* @param bayerFormat Format of the Bayer tiled raw image.
|
||||
*/
|
||||
Image(
|
||||
unsigned int rows,
|
||||
unsigned int cols,
|
||||
PixelFormat format,
|
||||
BayerTileFormat bayerFormat = NONE );
|
||||
|
||||
/**
|
||||
* Copy constructor. Both images will point to the same image buffer
|
||||
* internally.
|
||||
*/
|
||||
Image( const Image& image );
|
||||
|
||||
/**
|
||||
* Default destructor. The internal image buffer will be released if
|
||||
* there are no other Image objects holding a reference to it. This
|
||||
* will also allow the buffer to be requeued internally.
|
||||
*/
|
||||
virtual ~Image();
|
||||
|
||||
/**
|
||||
* Assignment operator. Both images will point to the same image buffer
|
||||
* internally. If the Image already has a buffer attached to it, it will
|
||||
* will be released.
|
||||
*
|
||||
* @param image The image to copy from.
|
||||
*/
|
||||
virtual Image& operator=( const Image& image );
|
||||
|
||||
/**
|
||||
* Indexing operator.
|
||||
*
|
||||
* @param index The index of the byte to return.
|
||||
*
|
||||
* @return The address of the specified byte from the image data.
|
||||
*/
|
||||
virtual unsigned char* operator[]( unsigned int index );
|
||||
|
||||
/**
|
||||
* Indexing operator.
|
||||
*
|
||||
* @param row The row of the pixel to return.
|
||||
* @param col The column of the pixel to return.
|
||||
*
|
||||
* @return The address of the specified byte from the image data.
|
||||
*/
|
||||
virtual unsigned char* operator()(
|
||||
unsigned int row,
|
||||
unsigned int col );
|
||||
|
||||
/**
|
||||
* Perform a deep copy of the Image. After this operation, the image
|
||||
* contents and member variables will be the same. The Images will not
|
||||
* share a buffer. The Image's current buffer will not be released.
|
||||
*
|
||||
* @param pImage The Image to copy the data from.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error DeepCopy( const Image* pImage );
|
||||
|
||||
/**
|
||||
* Sets the dimensions of the image object.
|
||||
*
|
||||
* @param rows Number of rows to set.
|
||||
* @param cols Number of cols to set.
|
||||
* @param stride Stride to set.
|
||||
* @param pixelFormat Pixel format to set.
|
||||
* @param bayerFormat Bayer tile format to set.
|
||||
*
|
||||
* @see GetDimensions()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetDimensions(
|
||||
unsigned int rows,
|
||||
unsigned int cols,
|
||||
unsigned int stride,
|
||||
PixelFormat pixelFormat,
|
||||
BayerTileFormat bayerFormat );
|
||||
|
||||
/**
|
||||
* Set the data of the Image object.
|
||||
* Ownership of the image buffer is not transferred to the Image object.
|
||||
* It is the user's responsibility to delete the buffer when it is
|
||||
* no longer in use.
|
||||
*
|
||||
* @param pData Pointer to the image buffer.
|
||||
* @param dataSize Size of the image buffer.
|
||||
*/
|
||||
virtual Error SetData(
|
||||
const unsigned char* pData,
|
||||
unsigned int dataSize );
|
||||
|
||||
/**
|
||||
* Set the block id of the Image object.
|
||||
*
|
||||
* @param blockId The blockId to assign to the image.
|
||||
*/
|
||||
virtual Error SetBlockId( const unsigned int blockId);
|
||||
|
||||
/**
|
||||
* get the block id of the Image object.
|
||||
*
|
||||
* @return The blockId assigned to the image.
|
||||
*/
|
||||
virtual unsigned int GetBlockId();
|
||||
|
||||
/**
|
||||
* Get the current pixel format.
|
||||
*
|
||||
* @return The current pixel format.
|
||||
*/
|
||||
virtual PixelFormat GetPixelFormat() const;
|
||||
|
||||
/**
|
||||
* Get the current color processing algorithm.
|
||||
*
|
||||
* @see SetColorProcessing()
|
||||
*
|
||||
* @return The current color processing algorithm.
|
||||
*/
|
||||
virtual ColorProcessingAlgorithm GetColorProcessing() const;
|
||||
|
||||
/**
|
||||
* Set the color processing algorithm. This should be set on the
|
||||
* input Image object.
|
||||
*
|
||||
* @param colorProc The color processing algorithm to use.
|
||||
*
|
||||
* @see GetColorProcessing()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error SetColorProcessing( ColorProcessingAlgorithm colorProc );
|
||||
|
||||
/**
|
||||
* Get the number of columns in the image.
|
||||
*
|
||||
* @return The number of columns.
|
||||
*/
|
||||
virtual unsigned int GetCols() const;
|
||||
|
||||
/**
|
||||
* Get the number of rows in the image.
|
||||
*
|
||||
* @return The number of rows.
|
||||
*/
|
||||
virtual unsigned int GetRows() const;
|
||||
|
||||
/**
|
||||
* Get the stride in the image.
|
||||
*
|
||||
* @return The stride (The number of bytes between rows of the image).
|
||||
*/
|
||||
virtual unsigned int GetStride() const;
|
||||
|
||||
/**
|
||||
* Get the bits per pixel of the image.
|
||||
*
|
||||
* @return The bits per pixel.
|
||||
*/
|
||||
virtual unsigned int GetBitsPerPixel() const;
|
||||
|
||||
/**
|
||||
* Get the Bayer tile format of the image.
|
||||
*
|
||||
* @return The Bayer tile format.
|
||||
*/
|
||||
virtual BayerTileFormat GetBayerTileFormat() const;
|
||||
|
||||
/**
|
||||
* Get the size of the buffer associated with the image, in bytes.
|
||||
*
|
||||
* @return The size of the buffer, in bytes.
|
||||
*/
|
||||
virtual unsigned int GetDataSize() const;
|
||||
|
||||
/**
|
||||
* Get the size of the compressed data, in bytes. A compressed image
|
||||
* will have a maximum size equal to GetDataSize(), but may actually
|
||||
* contain less data, depending on the compression level.
|
||||
* For uncompressed images, a value smaller than the data size may
|
||||
* indicate lost data.
|
||||
*
|
||||
* @return The size of the compressed data, in bytes. 0 when camera
|
||||
* not sending compressed data.
|
||||
*/
|
||||
virtual unsigned int GetReceivedDataSize() const;
|
||||
|
||||
/**
|
||||
* Get the image dimensions associated with the image.
|
||||
*
|
||||
* @param pRows Number of rows.
|
||||
* @param pCols Number of columns.
|
||||
* @param pStride The stride.
|
||||
* @param pPixelFormat Pixel format.
|
||||
* @param pBayerFormat Bayer tile format.
|
||||
*/
|
||||
virtual void GetDimensions(
|
||||
unsigned int* pRows,
|
||||
unsigned int* pCols = NULL,
|
||||
unsigned int* pStride = NULL,
|
||||
PixelFormat* pPixelFormat = NULL,
|
||||
BayerTileFormat* pBayerFormat = NULL ) const;
|
||||
|
||||
/**
|
||||
* Get a pointer to the data associated with the image. This function
|
||||
* is considered unsafe. The pointer returned could be invalidated if
|
||||
* the buffer is resized or released. The pointer may also be
|
||||
* invalidated if the Image object is passed to
|
||||
* Camera::RetrieveBuffer(). It is recommended that a Image::DeepCopy()
|
||||
* be performed if a seperate copy of the Image data is required
|
||||
* for further processing.
|
||||
*
|
||||
* @return A pointer to the image data.
|
||||
*/
|
||||
virtual unsigned char* GetData();
|
||||
|
||||
virtual unsigned char* const GetData() const;
|
||||
|
||||
/**
|
||||
* Get the metadata associated with the image. This includes
|
||||
* embedded image information.
|
||||
*
|
||||
* @return Metadata associated with the image.
|
||||
*/
|
||||
virtual ImageMetadata GetMetadata() const;
|
||||
|
||||
/**
|
||||
* Calculate statistics associated with the image. In order to collect
|
||||
* statistics for a particular channel, the enabled flag for the
|
||||
* channel must be set to true. Statistics can only be collected for
|
||||
* images in Mono8, Mono16, RGB, RGBU, BGR and BGRU.
|
||||
*
|
||||
* @param pStatistics The ImageStatistics object to hold the statistics.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error CalculateStatistics( ImageStatistics* pStatistics );
|
||||
|
||||
/**
|
||||
* Get the timestamp data associated with the image.
|
||||
*
|
||||
* @return Timestamp data associated with the image.
|
||||
*/
|
||||
virtual TimeStamp GetTimeStamp() const;
|
||||
|
||||
/**
|
||||
* Save the image to the specified file name with the file format
|
||||
* specified.
|
||||
*
|
||||
* @param pFilename Filename to save image with.
|
||||
* @param format File format to save in.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Save(
|
||||
const char* pFilename,
|
||||
ImageFileFormat format = FROM_FILE_EXT );
|
||||
|
||||
/**
|
||||
* Save the image to the specified file name with the options specified.
|
||||
*
|
||||
* @param pFilename Filename to save image with.
|
||||
* @param pOption Options to use while saving image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Save(
|
||||
const char* pFilename,
|
||||
PNGOption* pOption );
|
||||
|
||||
/**
|
||||
* Save the image to the specified file name with the options specified.
|
||||
*
|
||||
* @param pFilename Filename to save image with.
|
||||
* @param pOption Options to use while saving image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Save(
|
||||
const char* pFilename,
|
||||
PPMOption* pOption );
|
||||
|
||||
/**
|
||||
* Save the image to the specified file name with the options specified.
|
||||
*
|
||||
* @param pFilename Filename to save image with.
|
||||
* @param pOption Options to use while saving image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Save(
|
||||
const char* pFilename,
|
||||
PGMOption* pOption );
|
||||
|
||||
/**
|
||||
* Save the image to the specified file name with the options specified.
|
||||
*
|
||||
* @param pFilename Filename to save image with.
|
||||
* @param pOption Options to use while saving image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Save(
|
||||
const char* pFilename,
|
||||
TIFFOption* pOption );
|
||||
|
||||
/**
|
||||
* Save the image to the specified file name with the options specified.
|
||||
*
|
||||
* @param pFilename Filename to save image with.
|
||||
* @param pOption Options to use while saving image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Save(
|
||||
const char* pFilename,
|
||||
JPEGOption* pOption );
|
||||
|
||||
/**
|
||||
* Save the image to the specified file name with the options specified.
|
||||
*
|
||||
* @param pFilename Filename to save image with.
|
||||
* @param pOption Options to use while saving image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Save(
|
||||
const char* pFilename,
|
||||
JPG2Option* pOption );
|
||||
|
||||
/**
|
||||
* Save the image to the specified file name with the options specified.
|
||||
*
|
||||
* @param pFilename Filename to save image with.
|
||||
* @param pOption Options to use while saving image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Save(
|
||||
const char* pFilename,
|
||||
BMPOption* pOption );
|
||||
|
||||
/**
|
||||
* Converts the current image buffer to the specified output format and
|
||||
* stores the result in the specified image. The destination image
|
||||
* does not need to be configured in any way before the call is made.
|
||||
*
|
||||
* @param format Output format of the converted image.
|
||||
* @param pDestImage Destination image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Convert(
|
||||
PixelFormat format,
|
||||
Image* pDestImage ) const;
|
||||
|
||||
/**
|
||||
* Converts the current image buffer to the specified output format and
|
||||
* stores the result in the specified image. The destination image
|
||||
* does not need to be configured in anyway before the call is made.
|
||||
*
|
||||
* @param pDestImage Destination image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error Convert( Image* pDestImage ) const;
|
||||
|
||||
/**
|
||||
* Release the buffer associated with the Image. If no buffer is
|
||||
* associated, the function does nothing.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
virtual Error ReleaseBuffer();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
friend class Iso;
|
||||
struct ImageImpl;
|
||||
ImageImpl* m_pImpl;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //PGR_FC2_IMAGE_H
|
238
include/flycapture/ImageStatistics.h
Executable file
238
include/flycapture/ImageStatistics.h
Executable file
|
@ -0,0 +1,238 @@
|
|||
//=============================================================================
|
||||
// Copyright 2009 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: ImageStatistics.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_IMAGESTATISTICS_H
|
||||
#define PGR_FC2_IMAGESTATISTICS_H
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
class Error;
|
||||
|
||||
/**
|
||||
* The ImageStatistics object represents image statistics for an image.
|
||||
*/
|
||||
class FLYCAPTURE2_API ImageStatistics
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Channels that allow statistics to be calculated.
|
||||
*/
|
||||
enum StatisticsChannel
|
||||
{
|
||||
GREY,
|
||||
RED,
|
||||
GREEN,
|
||||
BLUE,
|
||||
HUE,
|
||||
SATURATION,
|
||||
LIGHTNESS,
|
||||
NUM_STATISTICS_CHANNELS
|
||||
};
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
ImageStatistics();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~ImageStatistics();
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*/
|
||||
ImageStatistics( const ImageStatistics& other );
|
||||
|
||||
/**
|
||||
* Assignment operator.
|
||||
*
|
||||
* @param other The ImageStatistics object to copy from.
|
||||
*/
|
||||
ImageStatistics& operator=( const ImageStatistics& other );
|
||||
|
||||
/**
|
||||
* Enable all channels.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error EnableAll();
|
||||
|
||||
/**
|
||||
* Disable all channels.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error DisableAll();
|
||||
|
||||
/**
|
||||
* Enable only the grey channel.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error EnableGreyOnly();
|
||||
|
||||
/**
|
||||
* Enable only the RGB channels.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error EnableRGBOnly();
|
||||
|
||||
/**
|
||||
* Enable only the HSL channels.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error EnableHSLOnly();
|
||||
|
||||
/**
|
||||
* Get the status of a statistics channel.
|
||||
*
|
||||
* @param channel The statistics channel.
|
||||
* @param pEnabled Whether the channel is enabled.
|
||||
*
|
||||
* @see SetChannelStatus()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error GetChannelStatus(
|
||||
StatisticsChannel channel,
|
||||
bool* pEnabled ) const;
|
||||
|
||||
/**
|
||||
* Set the status of a statistics channel.
|
||||
*
|
||||
* @param channel The statistics channel.
|
||||
* @param enabled Whether the channel should be enabled.
|
||||
*
|
||||
* @see GetChannelStatus()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error SetChannelStatus(
|
||||
StatisticsChannel channel,
|
||||
bool enabled );
|
||||
|
||||
/**
|
||||
* Get the range of a statistics channel. The values returned
|
||||
* are the maximum possible values for any given pixel in the image.
|
||||
* This is generally 0-255 for 8 bit images, and 0-65535 for
|
||||
* 16 bit images.
|
||||
*
|
||||
* @param channel The statistics channel.
|
||||
* @param pMin The minimum possible value.
|
||||
* @param pMax The maximum possible value.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error GetRange(
|
||||
StatisticsChannel channel,
|
||||
unsigned int* pMin,
|
||||
unsigned int* pMax ) const;
|
||||
|
||||
/**
|
||||
* Get the range of a statistics channel. The values returned
|
||||
* are the maximum values recorded for all pixels in the image.
|
||||
*
|
||||
* @param channel The statistics channel.
|
||||
* @param pPixelValueMin The minimum pixel value.
|
||||
* @param pPixelValueMax The maximum pixel value.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error GetPixelValueRange(
|
||||
StatisticsChannel channel,
|
||||
unsigned int* pPixelValueMin,
|
||||
unsigned int* pPixelValueMax ) const;
|
||||
|
||||
/**
|
||||
* Get the number of unique pixel values in the image.
|
||||
*
|
||||
* @param channel The statistics channel.
|
||||
* @param pNumPixelValues The number of unique pixel values.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error GetNumPixelValues(
|
||||
StatisticsChannel channel,
|
||||
unsigned int* pNumPixelValues ) const;
|
||||
|
||||
/**
|
||||
* Get the mean of the image.
|
||||
*
|
||||
* @param channel The statistics channel.
|
||||
* @param pPixelValueMean The mean of the image.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error GetMean(
|
||||
StatisticsChannel channel,
|
||||
float* pPixelValueMean ) const;
|
||||
|
||||
/**
|
||||
* Get the histogram for the image.
|
||||
*
|
||||
* @param channel The statistics channel.
|
||||
* @param ppHistogram Pointer to an array containing the histogram.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error GetHistogram(
|
||||
StatisticsChannel channel,
|
||||
int** ppHistogram ) const;
|
||||
|
||||
/**
|
||||
* Get all statistics for the image.
|
||||
*
|
||||
* @param channel The statistics channel.
|
||||
* @param pRangeMin The minimum possible value.
|
||||
* @param pRangeMax The maximum possible value.
|
||||
* @param pPixelValueMin The minimum pixel value.
|
||||
* @param pPixelValueMax The maximum pixel value.
|
||||
* @param pNumPixelValues The number of unique pixel values.
|
||||
* @param pPixelValueMean The mean of the image.
|
||||
* @param ppHistogram Pointer to an array containing the histogram.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
Error GetStatistics(
|
||||
StatisticsChannel channel,
|
||||
unsigned int* pRangeMin = NULL,
|
||||
unsigned int* pRangeMax = NULL,
|
||||
unsigned int* pPixelValueMin = NULL,
|
||||
unsigned int* pPixelValueMax = NULL,
|
||||
unsigned int* pNumPixelValues = NULL,
|
||||
float* pPixelValueMean = NULL,
|
||||
int** ppHistogram = NULL ) const;
|
||||
|
||||
private:
|
||||
friend class ImageStatsCalculator;
|
||||
struct ImageStatisticsData;
|
||||
ImageStatisticsData* m_pData;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
199
include/flycapture/TopologyNode.h
Executable file
199
include/flycapture/TopologyNode.h
Executable file
|
@ -0,0 +1,199 @@
|
|||
//=============================================================================
|
||||
// Copyright 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: TopologyNode.h 285597 2016-06-08 23:29:31Z erich $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_TOPOLOGYNODE_H
|
||||
#define PGR_FC2_TOPOLOGYNODE_H
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
class Error;
|
||||
|
||||
/**
|
||||
* The TopologyNode class contains topology information that can be
|
||||
* used to generate a tree structure of all cameras and devices connected
|
||||
* to a computer.
|
||||
*/
|
||||
class FLYCAPTURE2_API TopologyNode
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Possible states of a port on a node.
|
||||
*/
|
||||
enum PortType
|
||||
{
|
||||
NOT_CONNECTED = 1,
|
||||
CONNECTED_TO_PARENT,
|
||||
CONNECTED_TO_CHILD
|
||||
};
|
||||
|
||||
/**
|
||||
* Type of node.
|
||||
*/
|
||||
enum NodeType
|
||||
{
|
||||
COMPUTER,
|
||||
BUS,
|
||||
CAMERA,
|
||||
NODE
|
||||
};
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
TopologyNode();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param guid The PGRGuid of the node (if applicable).
|
||||
* @param deviceId Device ID of the node.
|
||||
* @param nodeType Type of the node.
|
||||
* @param interfaceType Interface type of the node.
|
||||
*/
|
||||
TopologyNode(
|
||||
PGRGuid guid,
|
||||
int deviceId,
|
||||
NodeType nodeType,
|
||||
InterfaceType interfaceType );
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
*/
|
||||
virtual ~TopologyNode();
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*/
|
||||
TopologyNode( const TopologyNode& other );
|
||||
|
||||
/**
|
||||
* Assignment operator.
|
||||
*
|
||||
* @param other The TopologyNode to copy from.
|
||||
*/
|
||||
virtual TopologyNode& operator=( const TopologyNode& other );
|
||||
|
||||
/**
|
||||
* Get the PGRGuid associated with the node.
|
||||
*
|
||||
* @return PGRGuid of the node.
|
||||
*/
|
||||
virtual PGRGuid GetGuid();
|
||||
|
||||
/**
|
||||
* Get the device ID associated with the node.
|
||||
*
|
||||
* @return Device ID of the node.
|
||||
*/
|
||||
virtual int GetDeviceId();
|
||||
|
||||
/**
|
||||
* Get the node type associated with the node.
|
||||
*
|
||||
* @return Node type of the node.
|
||||
*/
|
||||
virtual NodeType GetNodeType();
|
||||
|
||||
/**
|
||||
* Get the interface type associated with the node.
|
||||
*
|
||||
* @return Interface type of the node.
|
||||
*/
|
||||
virtual InterfaceType GetInterfaceType();
|
||||
|
||||
/**
|
||||
* Get the number of child nodes.
|
||||
*
|
||||
* @return Number of child nodes.
|
||||
*/
|
||||
virtual unsigned int GetNumChildren();
|
||||
|
||||
/**
|
||||
* Get child node located at the specified position.
|
||||
*
|
||||
* @param position Position of the node.
|
||||
*
|
||||
* @return TopologyNode at the specified position.
|
||||
*/
|
||||
virtual TopologyNode GetChild( unsigned int position );
|
||||
|
||||
/**
|
||||
* Add the specified TopologyNode as a child of the node.
|
||||
*
|
||||
* @param childNode The TopologyNode to add.
|
||||
*/
|
||||
virtual void AddChild( TopologyNode childNode );
|
||||
|
||||
/**
|
||||
* Get the number of ports.
|
||||
*
|
||||
* @return Number of ports.
|
||||
*/
|
||||
virtual unsigned int GetNumPorts();
|
||||
|
||||
/**
|
||||
* Get type of port located at the specified position.
|
||||
*
|
||||
* @param position Position of the port.
|
||||
*
|
||||
* @return PortType at the specified position.
|
||||
*/
|
||||
virtual PortType GetPortType( unsigned int position );
|
||||
|
||||
/**
|
||||
* Add the specified PortType as a port of the node.
|
||||
*
|
||||
* @param childPort The port to add.
|
||||
*/
|
||||
virtual void AddPortType( PortType childPort );
|
||||
|
||||
/**
|
||||
* Assign a PGRGuid and device ID to the node.
|
||||
*
|
||||
* @param guid PGRGuid to be assigned.
|
||||
* @param deviceId Device ID to be assigned.
|
||||
*
|
||||
* @return Whether the data was successfully set to the node.
|
||||
*/
|
||||
virtual bool AssignGuidToNode( PGRGuid guid, int deviceId );
|
||||
|
||||
/**
|
||||
* Assign a PGRGuid, device ID and nodeType to the node.
|
||||
*
|
||||
* @param guid PGRGuid to be assigned.
|
||||
* @param deviceId Device ID to be assigned.
|
||||
* @param nodeType NodeType to be assigned
|
||||
*
|
||||
* @return Whether the data was successfully set to the node.
|
||||
*/
|
||||
virtual bool AssignGuidToNode(PGRGuid guid, int deviceId, NodeType nodeType);
|
||||
|
||||
private:
|
||||
struct TopologyNodeData;
|
||||
TopologyNodeData* m_pData;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
213
include/flycapture/Utilities.h
Executable file
213
include/flycapture/Utilities.h
Executable file
|
@ -0,0 +1,213 @@
|
|||
//=============================================================================
|
||||
// Copyright © 2008 Point Grey Research, Inc. All Rights Reserved.
|
||||
//
|
||||
// This software is the confidential and proprietary information of Point
|
||||
// Grey Research, Inc. ("Confidential Information"). You shall not
|
||||
// disclose such Confidential Information and shall use it only in
|
||||
// accordance with the terms of the license agreement you entered into
|
||||
// with Point Grey Research, Inc. (PGR).
|
||||
//
|
||||
// PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// $Id: Utilities.h 244578 2015-08-21 23:30:57Z matthewg $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PGR_FC2_UTILITIES_H_
|
||||
#define PGR_FC2_UTILITIES_H_
|
||||
|
||||
#include "FlyCapture2Platform.h"
|
||||
#include "FlyCapture2Defs.h"
|
||||
#include <string>
|
||||
|
||||
namespace FlyCapture2
|
||||
{
|
||||
class Error;
|
||||
|
||||
/** Possible operating systems. */
|
||||
enum OSType
|
||||
{
|
||||
WINDOWS_X86, /**< All Windows 32-bit variants. */
|
||||
WINDOWS_X64, /**< All Windows 64-bit variants. */
|
||||
LINUX_X86, /**< All Linux 32-bit variants. */
|
||||
LINUX_X64, /**< All Linux 32-bit variants. */
|
||||
MAC, /**< Mac OSX. */
|
||||
UNKNOWN_OS, /**< Unknown operating system. */
|
||||
OSTYPE_FORCE_32BITS = FULL_32BIT_VALUE
|
||||
};
|
||||
|
||||
/** Possible byte orders. */
|
||||
enum ByteOrder
|
||||
{
|
||||
BYTE_ORDER_LITTLE_ENDIAN,
|
||||
BYTE_ORDER_BIG_ENDIAN,
|
||||
BYTE_ORDER_FORCE_32BITS = FULL_32BIT_VALUE
|
||||
};
|
||||
|
||||
/** Description of the system. */
|
||||
struct SystemInfo
|
||||
{
|
||||
/** Operating system type as described by OSType. */
|
||||
OSType osType;
|
||||
|
||||
/** Detailed description of the operating system. */
|
||||
char osDescription[sk_maxStringLength];
|
||||
|
||||
/** Byte order of the system. */
|
||||
ByteOrder byteOrder;
|
||||
|
||||
/** Amount of memory available on the system. */
|
||||
size_t sysMemSize;
|
||||
|
||||
/** Detailed description of the CPU. */
|
||||
char cpuDescription[sk_maxStringLength];
|
||||
|
||||
/** Number of cores on all CPUs on the system. */
|
||||
size_t numCpuCores;
|
||||
|
||||
/** List of drivers used. */
|
||||
char driverList[sk_maxStringLength];
|
||||
|
||||
/** List of libraries used. */
|
||||
char libraryList[sk_maxStringLength];
|
||||
|
||||
/** Detailed description of the GPU. */
|
||||
char gpuDescription[sk_maxStringLength];
|
||||
|
||||
/** Screen resolution width in pixels. */
|
||||
size_t screenWidth;
|
||||
|
||||
/** Screen resolution height in pixels. */
|
||||
size_t screenHeight;
|
||||
|
||||
/** Reserved for future use. */
|
||||
unsigned int reserved[16];
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Async command callback function prototype. Defines the syntax of the
|
||||
* async command function that is passed into LaunchCommandAsync().
|
||||
*/
|
||||
typedef void (*AsyncCommandCallback)( class Error retError, void* pUserData );
|
||||
|
||||
/**
|
||||
* The Utility class is generally used to query for general system
|
||||
* information such as operating system, available memory etc.
|
||||
* It can also be used to launch browsers, CHM viewers or terminal commands.
|
||||
*/
|
||||
class FLYCAPTURE2_API Utilities
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Check for driver compatibility for the given camera guid.
|
||||
*
|
||||
* @param guid Pointer to the guid of the device to check.
|
||||
*
|
||||
* @return PGR_NO_ERROR if the library is compatible with the currently
|
||||
* loaded driver, otherwise an error indicating the type of failure.
|
||||
*/
|
||||
static Error CheckDriver(const PGRGuid* guid);
|
||||
|
||||
/**
|
||||
* Get the driver's name for a device
|
||||
*
|
||||
* @param guid Pointer to the guid of the device to check.
|
||||
* @param deviceName The device name will be returned in this string
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error GetDriverDeviceName(const PGRGuid* guid, std::string& deviceName);
|
||||
|
||||
/**
|
||||
* Get system information.
|
||||
*
|
||||
* @param pSystemInfo Structure to receive system information.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error GetSystemInfo(
|
||||
SystemInfo* pSystemInfo );
|
||||
|
||||
/**
|
||||
* Get library version.
|
||||
*
|
||||
* @param pVersion Structure to receive the library version.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error GetLibraryVersion(
|
||||
FC2Version* pVersion );
|
||||
|
||||
/**
|
||||
* Launch a URL in the system default browser.
|
||||
*
|
||||
* @param pAddress URL to open in browser.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error LaunchBrowser(
|
||||
const char* pAddress );
|
||||
|
||||
/**
|
||||
* Open a CHM file in the system default CHM viewer.
|
||||
*
|
||||
* @param pFileName Filename of CHM file to open.
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error LaunchHelp(
|
||||
const char* pFileName );
|
||||
|
||||
/**
|
||||
* Execute a command in the terminal. This is a blocking call that
|
||||
* will return when the command completes.
|
||||
*
|
||||
* @param pCommand Command to execute.
|
||||
*
|
||||
* @see LaunchCommandAsync()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error LaunchCommand(
|
||||
const char* pCommand );
|
||||
|
||||
/**
|
||||
* Execute a command in the terminal. This is a non-blocking call that
|
||||
* will return immediately. The return value of the command can be
|
||||
* retrieved in the callback.
|
||||
*
|
||||
* @param pCommand Command to execute.
|
||||
* @param pCallback Callback to fire when command is complete.
|
||||
* @param pUserData Data pointer to pass to callback.
|
||||
*
|
||||
* @see LaunchCommand()
|
||||
*
|
||||
* @return An Error indicating the success or failure of the function.
|
||||
*/
|
||||
static Error LaunchCommandAsync(
|
||||
const char* pCommand,
|
||||
AsyncCommandCallback pCallback,
|
||||
void* pUserData );
|
||||
|
||||
protected:
|
||||
private:
|
||||
Utilities();
|
||||
~Utilities();
|
||||
|
||||
Utilities( const Utilities& other );
|
||||
Utilities& operator=( const Utilities& other );
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif // PGR_FC2_UTILITIES_H_
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QMenuBar" name="menuBar" />
|
||||
<widget class="QToolBar" name="mainToolBar" />
|
||||
<widget class="QWidget" name="centralWidget" />
|
||||
<widget class="QStatusBar" name="statusBar" />
|
||||
</widget>
|
||||
<layoutDefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
6
src/.clang_complete
Normal file
6
src/.clang_complete
Normal file
|
@ -0,0 +1,6 @@
|
|||
-Wall
|
||||
-I/usr/include/qt
|
||||
-I/usr/include/qt/QtWidgets
|
||||
-I/usr/include/qt/QtGui
|
||||
-I/usr/include/qt/QtCore
|
||||
--std=c++11
|
145
src/forms/mainwindow.ui
Normal file
145
src/forms/mainwindow.ui
Normal file
|
@ -0,0 +1,145 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>408</width>
|
||||
<height>298</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Taevitas</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>134</width>
|
||||
<height>172</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Start</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>FPS: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="fps_box">
|
||||
<property name="value">
|
||||
<number>18</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Save Frames</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="preview_button">
|
||||
<property name="text">
|
||||
<string>Preview Camera</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>102</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>134</width>
|
||||
<height>102</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Select Camera</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Output Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="3">
|
||||
<widget class="QGraphicsView" name="preview_widget">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
32
src/mainwindow.cpp
Normal file
32
src/mainwindow.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include <QPushButton>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow) {
|
||||
ui->setupUi(this);
|
||||
|
||||
// Hide Preview Widget
|
||||
ui->preview_widget->hide();
|
||||
adjustSize();
|
||||
|
||||
// Connect Events
|
||||
connect(ui->preview_button, &QPushButton::clicked, this, &MainWindow::toggle_preview);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// Show/Hide Preview
|
||||
void MainWindow::toggle_preview(bool checked) {
|
||||
if(checked)
|
||||
ui->preview_widget->show();
|
||||
else
|
||||
ui->preview_widget->hide();
|
||||
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
|
22
src/mainwindow.cpp~
Normal file
22
src/mainwindow.cpp~
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow) {
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->testButton, &QPushButton::clicked, this, &MainWindow::hb);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::hb() {
|
||||
if(ui->testButton->property("cc").toInt() == 0)
|
||||
ui->testButton->setProperty("cc", 1);
|
||||
ui->testButton->setText(ui->testButton->property("cc").toString());
|
||||
ui->testButton->setProperty("cc", ui->testButton->property("cc").toInt() + 1);
|
||||
}
|
26
src/mainwindow.h
Normal file
26
src/mainwindow.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
private slots:
|
||||
void toggle_preview(bool);
|
||||
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
|
@ -17,6 +17,9 @@ public:
|
|||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
public slots:
|
||||
void hb();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
173
src/ui_mainwindow.h
Normal file
173
src/ui_mainwindow.h
Normal file
|
@ -0,0 +1,173 @@
|
|||
/********************************************************************************
|
||||
** Form generated from reading UI file 'mainwindow.ui'
|
||||
**
|
||||
** Created by: Qt User Interface Compiler version 5.7.1
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef UI_MAINWINDOW_H
|
||||
#define UI_MAINWINDOW_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QButtonGroup>
|
||||
#include <QtWidgets/QCheckBox>
|
||||
#include <QtWidgets/QComboBox>
|
||||
#include <QtWidgets/QFrame>
|
||||
#include <QtWidgets/QGraphicsView>
|
||||
#include <QtWidgets/QGridLayout>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QSpinBox>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_MainWindow
|
||||
{
|
||||
public:
|
||||
QWidget *centralWidget;
|
||||
QGridLayout *gridLayout;
|
||||
QFrame *frame;
|
||||
QVBoxLayout *verticalLayout;
|
||||
QPushButton *pushButton;
|
||||
QFrame *frame_3;
|
||||
QHBoxLayout *horizontalLayout;
|
||||
QLabel *label_2;
|
||||
QSpinBox *fps_box;
|
||||
QCheckBox *checkBox;
|
||||
QPushButton *preview_button;
|
||||
QFrame *frame_2;
|
||||
QVBoxLayout *verticalLayout_2;
|
||||
QComboBox *comboBox;
|
||||
QPushButton *pushButton_2;
|
||||
QGraphicsView *preview_widget;
|
||||
|
||||
void setupUi(QMainWindow *MainWindow)
|
||||
{
|
||||
if (MainWindow->objectName().isEmpty())
|
||||
MainWindow->setObjectName(QStringLiteral("MainWindow"));
|
||||
MainWindow->resize(408, 298);
|
||||
centralWidget = new QWidget(MainWindow);
|
||||
centralWidget->setObjectName(QStringLiteral("centralWidget"));
|
||||
gridLayout = new QGridLayout(centralWidget);
|
||||
gridLayout->setSpacing(6);
|
||||
gridLayout->setContentsMargins(11, 11, 11, 11);
|
||||
gridLayout->setObjectName(QStringLiteral("gridLayout"));
|
||||
frame = new QFrame(centralWidget);
|
||||
frame->setObjectName(QStringLiteral("frame"));
|
||||
frame->setEnabled(true);
|
||||
frame->setMaximumSize(QSize(134, 172));
|
||||
frame->setFrameShape(QFrame::StyledPanel);
|
||||
frame->setFrameShadow(QFrame::Raised);
|
||||
verticalLayout = new QVBoxLayout(frame);
|
||||
verticalLayout->setSpacing(6);
|
||||
verticalLayout->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
|
||||
pushButton = new QPushButton(frame);
|
||||
pushButton->setObjectName(QStringLiteral("pushButton"));
|
||||
pushButton->setFlat(false);
|
||||
|
||||
verticalLayout->addWidget(pushButton);
|
||||
|
||||
frame_3 = new QFrame(frame);
|
||||
frame_3->setObjectName(QStringLiteral("frame_3"));
|
||||
frame_3->setFrameShape(QFrame::StyledPanel);
|
||||
frame_3->setFrameShadow(QFrame::Raised);
|
||||
horizontalLayout = new QHBoxLayout(frame_3);
|
||||
horizontalLayout->setSpacing(6);
|
||||
horizontalLayout->setContentsMargins(11, 11, 11, 11);
|
||||
horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
|
||||
label_2 = new QLabel(frame_3);
|
||||
label_2->setObjectName(QStringLiteral("label_2"));
|
||||
|
||||
horizontalLayout->addWidget(label_2);
|
||||
|
||||
fps_box = new QSpinBox(frame_3);
|
||||
fps_box->setObjectName(QStringLiteral("fps_box"));
|
||||
fps_box->setValue(18);
|
||||
|
||||
horizontalLayout->addWidget(fps_box);
|
||||
|
||||
|
||||
verticalLayout->addWidget(frame_3);
|
||||
|
||||
checkBox = new QCheckBox(frame);
|
||||
checkBox->setObjectName(QStringLiteral("checkBox"));
|
||||
|
||||
verticalLayout->addWidget(checkBox);
|
||||
|
||||
preview_button = new QPushButton(frame);
|
||||
preview_button->setObjectName(QStringLiteral("preview_button"));
|
||||
preview_button->setCheckable(true);
|
||||
|
||||
verticalLayout->addWidget(preview_button);
|
||||
|
||||
|
||||
gridLayout->addWidget(frame, 1, 0, 1, 1);
|
||||
|
||||
frame_2 = new QFrame(centralWidget);
|
||||
frame_2->setObjectName(QStringLiteral("frame_2"));
|
||||
frame_2->setMinimumSize(QSize(0, 102));
|
||||
frame_2->setMaximumSize(QSize(134, 102));
|
||||
frame_2->setFrameShape(QFrame::StyledPanel);
|
||||
frame_2->setFrameShadow(QFrame::Raised);
|
||||
verticalLayout_2 = new QVBoxLayout(frame_2);
|
||||
verticalLayout_2->setSpacing(6);
|
||||
verticalLayout_2->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
|
||||
comboBox = new QComboBox(frame_2);
|
||||
comboBox->setObjectName(QStringLiteral("comboBox"));
|
||||
|
||||
verticalLayout_2->addWidget(comboBox);
|
||||
|
||||
pushButton_2 = new QPushButton(frame_2);
|
||||
pushButton_2->setObjectName(QStringLiteral("pushButton_2"));
|
||||
|
||||
verticalLayout_2->addWidget(pushButton_2);
|
||||
|
||||
|
||||
gridLayout->addWidget(frame_2, 0, 0, 1, 1);
|
||||
|
||||
preview_widget = new QGraphicsView(centralWidget);
|
||||
preview_widget->setObjectName(QStringLiteral("preview_widget"));
|
||||
preview_widget->setEnabled(false);
|
||||
|
||||
gridLayout->addWidget(preview_widget, 0, 1, 3, 1);
|
||||
|
||||
MainWindow->setCentralWidget(centralWidget);
|
||||
|
||||
retranslateUi(MainWindow);
|
||||
|
||||
QMetaObject::connectSlotsByName(MainWindow);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *MainWindow)
|
||||
{
|
||||
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Taevitas", Q_NULLPTR));
|
||||
pushButton->setText(QApplication::translate("MainWindow", "Start", Q_NULLPTR));
|
||||
label_2->setText(QApplication::translate("MainWindow", "FPS: ", Q_NULLPTR));
|
||||
checkBox->setText(QApplication::translate("MainWindow", "Save Frames", Q_NULLPTR));
|
||||
preview_button->setText(QApplication::translate("MainWindow", "Preview Camera", Q_NULLPTR));
|
||||
comboBox->clear();
|
||||
comboBox->insertItems(0, QStringList()
|
||||
<< QApplication::translate("MainWindow", "Select Camera", Q_NULLPTR)
|
||||
);
|
||||
pushButton_2->setText(QApplication::translate("MainWindow", "Output Folder", Q_NULLPTR));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow: public Ui_MainWindow {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_MAINWINDOW_H
|
|
@ -1,69 +0,0 @@
|
|||
/********************************************************************************
|
||||
** Form generated from reading UI file 'mainwindow.ui'
|
||||
**
|
||||
** Created by: Qt User Interface Compiler version 5.7.1
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef UI_MAINWINDOW_H
|
||||
#define UI_MAINWINDOW_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QButtonGroup>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
#include <QtWidgets/QStatusBar>
|
||||
#include <QtWidgets/QToolBar>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_MainWindow
|
||||
{
|
||||
public:
|
||||
QMenuBar *menuBar;
|
||||
QToolBar *mainToolBar;
|
||||
QWidget *centralWidget;
|
||||
QStatusBar *statusBar;
|
||||
|
||||
void setupUi(QMainWindow *MainWindow)
|
||||
{
|
||||
if (MainWindow->objectName().isEmpty())
|
||||
MainWindow->setObjectName(QStringLiteral("MainWindow"));
|
||||
MainWindow->resize(400, 300);
|
||||
menuBar = new QMenuBar(MainWindow);
|
||||
menuBar->setObjectName(QStringLiteral("menuBar"));
|
||||
MainWindow->setMenuBar(menuBar);
|
||||
mainToolBar = new QToolBar(MainWindow);
|
||||
mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
|
||||
MainWindow->addToolBar(mainToolBar);
|
||||
centralWidget = new QWidget(MainWindow);
|
||||
centralWidget->setObjectName(QStringLiteral("centralWidget"));
|
||||
MainWindow->setCentralWidget(centralWidget);
|
||||
statusBar = new QStatusBar(MainWindow);
|
||||
statusBar->setObjectName(QStringLiteral("statusBar"));
|
||||
MainWindow->setStatusBar(statusBar);
|
||||
|
||||
retranslateUi(MainWindow);
|
||||
|
||||
QMetaObject::connectSlotsByName(MainWindow);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *MainWindow)
|
||||
{
|
||||
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", Q_NULLPTR));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow: public Ui_MainWindow {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_MAINWINDOW_H
|
Loading…
Add table
Reference in a new issue