MMDevice  70
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
CCameraBase< U > Class Template Referenceabstract

#include <DeviceBase.h>

Inheritance diagram for CCameraBase< U >:
CDeviceBase< MM::Camera, U > MM::Camera MM::Device

Classes

class  BaseSequenceThread
 
class  CaptureRestartHelper
 

Public Member Functions

virtual const unsigned char * GetImageBuffer ()=0
 
virtual unsigned GetImageWidth () const =0
 
virtual unsigned GetImageHeight () const =0
 
virtual unsigned GetImageBytesPerPixel () const =0
 
virtual int SnapImage ()=0
 
virtual bool Busy ()
 
virtual int StartSequenceAcquisition (double interval)
 
virtual int StopSequenceAcquisition ()
 
virtual double GetPixelSizeUm () const
 
virtual unsigned GetNumberOfComponents () const
 
virtual int GetComponentName (unsigned channel, char *name)
 
virtual unsigned GetNumberOfChannels () const
 
virtual int GetChannelName (unsigned, char *name)
 
virtual const unsigned char * GetImageBuffer (unsigned)
 
virtual const unsigned int * GetImageBufferAsRGB32 ()
 
virtual void GetTags (char *serializedMetadata)
 
virtual int PrepareSequenceAcqusition ()
 
virtual int StartSequenceAcquisition (long numImages, double interval_ms, bool stopOnOverflow)
 
virtual int GetExposureSequenceMaxLength (long &) const
 
virtual int StartExposureSequence ()
 
virtual int StopExposureSequence ()
 
virtual int ClearExposureSequence ()
 
virtual int AddToExposureSequence (double)
 
virtual int SendExposureSequence () const
 
virtual bool IsCapturing ()
 
virtual void AddTag (const char *key, const char *deviceLabel, const char *value)
 
virtual void RemoveTag (const char *key)
 
virtual bool SupportsMultiROI ()
 
virtual bool IsMultiROISet ()
 
virtual int GetMultiROICount (unsigned &)
 
virtual int SetMultiROI (const unsigned *, const unsigned *, const unsigned *, const unsigned *, unsigned)
 
virtual int GetMultiROI (unsigned *, unsigned *, unsigned *, unsigned *, unsigned *)
 
- Public Member Functions inherited from CDeviceBase< MM::Camera, U >
virtual HDEVMODULE GetModuleHandle () const
 
virtual void SetModuleName (const char *name)
 
virtual void GetModuleName (char *name) const
 
virtual void SetDescription (const char *descr)
 
virtual void GetDescription (char *name) const
 
virtual void SetModuleHandle (HDEVMODULE hModule)
 
virtual void SetLabel (const char *label)
 
virtual void GetLabel (char *name) const
 
virtual double GetDelayMs () const
 
virtual void SetDelayMs (double delay)
 
virtual void SetCallback (MM::Core *cbk)
 
virtual bool UsesDelay ()
 
virtual unsigned GetNumberOfProperties () const
 
virtual int GetProperty (const char *name, char *value) const
 
int GetProperty (const char *name, double &val)
 
int GetProperty (const char *name, long &val)
 
bool IsPropertyEqualTo (const char *name, const char *val) const
 
virtual int GetPropertyReadOnly (const char *name, bool &readOnly) const
 
virtual int GetPropertyInitStatus (const char *name, bool &preInit) const
 
virtual int HasPropertyLimits (const char *name, bool &hasLimits) const
 
virtual int GetPropertyLowerLimit (const char *name, double &lowLimit) const
 
virtual int GetPropertyUpperLimit (const char *name, double &hiLimit) const
 
virtual int IsPropertySequenceable (const char *name, bool &sequenceable) const
 
virtual int GetPropertySequenceMaxLength (const char *name, long &nrEvents) const
 
virtual int StartPropertySequence (const char *name)
 
virtual int StopPropertySequence (const char *name)
 
virtual int ClearPropertySequence (const char *name)
 
virtual int AddToPropertySequence (const char *name, const char *value)
 
virtual int SendPropertySequence (const char *name)
 
virtual bool GetPropertyName (unsigned uIdx, char *name) const
 
virtual int GetPropertyType (const char *name, MM::PropertyType &pt) const
 
virtual int SetProperty (const char *name, const char *value)
 
virtual bool HasProperty (const char *name) const
 
virtual unsigned GetNumberOfPropertyValues (const char *propertyName) const
 
virtual bool GetPropertyValueAt (const char *propertyName, unsigned index, char *value) const
 
int CreateProperty (const char *name, const char *value, MM::PropertyType eType, bool readOnly, MM::ActionFunctor *pAct=0, bool isPreInitProperty=false)
 
int CreatePropertyWithHandler (const char *name, const char *value, MM::PropertyType eType, bool readOnly, int(U::*memberFunction)(MM::PropertyBase *pProp, MM::ActionType eAct), bool isPreInitProperty=false)
 
int CreateIntegerProperty (const char *name, long value, bool readOnly, MM::ActionFunctor *pAct=0, bool isPreInitProperty=false)
 
int CreateFloatProperty (const char *name, double value, bool readOnly, MM::ActionFunctor *pAct=0, bool isPreInitProperty=false)
 
int CreateStringProperty (const char *name, const char *value, bool readOnly, MM::ActionFunctor *pAct=0, bool isPreInitProperty=false)
 
int SetPropertyLimits (const char *name, double low, double high)
 
int SetAllowedValues (const char *name, std::vector< std::string > &values)
 
int ClearAllowedValues (const char *name)
 
int AddAllowedValue (const char *name, const char *value)
 
int AddAllowedValue (const char *name, const char *value, long data)
 
int GetPropertyData (const char *name, const char *value, long &data)
 
int GetCurrentPropertyData (const char *name, long &data)
 
int UpdateStatus ()
 
int UpdateProperty (const char *name)
 
int ApplyProperty (const char *name)
 
virtual bool GetErrorText (int errorCode, char *text) const
 
virtual bool SupportsDeviceDetection (void)
 
virtual MM::DeviceDetectionStatus DetectDevice (void)
 
virtual void SetParentID (const char *parentId)
 
virtual void GetParentID (char *parentID) const
 
- Public Member Functions inherited from MM::Camera
virtual DeviceType GetType () const
 
virtual long GetImageBufferSize () const =0
 
virtual unsigned GetBitDepth () const =0
 
virtual int GetBinning () const =0
 
virtual int SetBinning (int binSize)=0
 
virtual void SetExposure (double exp_ms)=0
 
virtual double GetExposure () const =0
 
virtual int SetROI (unsigned x, unsigned y, unsigned xSize, unsigned ySize)=0
 
virtual int GetROI (unsigned &x, unsigned &y, unsigned &xSize, unsigned &ySize)=0
 
virtual int ClearROI ()=0
 
virtual int IsExposureSequenceable (bool &isSequenceable) const =0
 
- Public Member Functions inherited from MM::Device
 MM_DEPRECATED (virtual HDEVMODULE GetModuleHandle() const)=0
 
 MM_DEPRECATED (virtual void SetModuleHandle(HDEVMODULE hLibraryHandle))=0
 
virtual int Initialize ()=0
 
virtual int Shutdown ()=0
 
virtual void GetName (char *name) const =0
 

Protected Member Functions

virtual std::vector< std::string > GetTagKeys ()
 
virtual std::string GetTagValue (const char *key)
 
virtual int ThreadRun (void)
 
virtual int InsertImage ()
 
virtual double GetIntervalMs ()
 
virtual long GetImageCounter ()
 
virtual long GetNumberOfImages ()
 
virtual void OnThreadExiting () throw ()
 
virtual bool isStopOnOverflow ()
 
virtual void setStopOnOverflow (bool stop)
 
- Protected Member Functions inherited from CDeviceBase< MM::Camera, U >
void SetErrorText (int errorCode, const char *text)
 
const char * GetMorePropertyErrorInfo (void) const
 
void SetMorePropertyErrorInfo (const char *ptext) const
 
int LogMessage (const char *msg, bool debugOnly=false) const
 
int LogMessage (const std::string &msg, bool debugOnly=false) const
 
int LogMessageCode (const int errorCode, bool debugOnly=false) const
 
int LogTimeDiff (MM::MMTime start, MM::MMTime end, const std::string &message, bool debugOnly=false) const
 
int LogTimeDiff (MM::MMTime start, MM::MMTime end, bool debugOnly=false) const
 
void InitializeDefaultErrorMessages ()
 
MM::DeviceGetDevice (const char *deviceLabel) const
 
void GetLoadedDeviceOfType (MM::DeviceType devType, char *deviceName, const unsigned int deviceIterator)
 
int WriteToComPort (const char *portLabel, const unsigned char *buf, unsigned bufLength)
 
int SendSerialCommand (const char *portName, const char *command, const char *term)
 
int GetSerialAnswer (const char *portName, const char *term, std::string &ans)
 
int ReadFromComPort (const char *portLabel, unsigned char *buf, unsigned bufLength, unsigned long &read)
 
int PurgeComPort (const char *portLabel)
 
MM::PortType GetSerialPortType (const char *portLabel)
 
int OnPropertiesChanged ()
 
int OnPropertyChanged (const char *propName, const char *propValue)
 
int OnStagePositionChanged (double pos)
 
int OnXYStagePositionChanged (double xPos, double yPos)
 
int OnExposureChanged (double exposure)
 
int OnSLMExposureChanged (double exposure)
 
int OnMagnifierChanged ()
 
unsigned long GetClockTicksUs ()
 
MM::MMTime GetCurrentMMTime ()
 
bool IsCallbackRegistered () const
 
MM::CoreGetCoreCallback () const
 
void EnableDelay (bool state=true)
 
void CreateHubIDProperty ()
 
MM::HubGetParentHub () const
 
T_HUB * AssignToHub ()
 

Friends

class BaseSequenceThread
 

Additional Inherited Members

- Public Types inherited from CDeviceBase< MM::Camera, U >
typedef MM::Action< U > CPropertyAction
 
typedef MM::ActionEx< U > CPropertyActionEx
 
- Static Public Attributes inherited from MM::Camera
static const DeviceType Type = CameraDevice
 

Detailed Description

template<class U>
class CCameraBase< U >

Base class for creating camera device adapters. This class has a functional constructor - must be invoked from the derived class.

Member Function Documentation

◆ AddTag()

template<class U >
virtual void CCameraBase< U >::AddTag ( const char *  key,
const char *  deviceLabel,
const char *  value 
)
inlinevirtual

Adds new tag or modifies the value of an existing one These will automatically be added to images inserted into the circular buffer. Use this mechanism for tags that do not change often. For metadata that change often, create an instance of metadata yourself and add to one of the versions of the InsertImage function

Implements MM::Camera.

◆ GetChannelName()

template<class U >
virtual int CCameraBase< U >::GetChannelName ( unsigned  ,
char *  name 
)
inlinevirtual

Multi-channel cameras should provide names for their channels Single channel cameras do not need to override this default implementation

Implements MM::Camera.

References CDeviceUtils::CopyLimitedString().

◆ GetComponentName()

template<class U >
virtual int CCameraBase< U >::GetComponentName ( unsigned  component,
char *  name 
)
inlinevirtual

Returns the name for each component

Implements MM::Camera.

References CDeviceUtils::CopyLimitedString().

◆ GetImageBuffer() [1/2]

template<class U >
virtual const unsigned char* CCameraBase< U >::GetImageBuffer ( )
pure virtual

Returns pixel data. Required by the MM::Camera API. GetImageBuffer will be called shortly after SnapImage returns. Use it to wait for camera read-out and transfer of data into memory Return a pointer to a buffer containing the image data The calling program will assume the size of the buffer based on the values obtained from GetImageBufferSize(), which in turn should be consistent with values returned by GetImageWidth(), GetImageHeight(), GetImageBytesPerPixel(), and getNumberOfComponents(). The calling program also assumes that camera never changes the size of the pixel buffer on its own. In other words, the buffer can change only if appropriate properties are set (such as binning, pixel type, etc.) Multi-Channel cameras should return the content of the first channel in this call.

Supported data types are byte (8 bits per pixel, 1 component), short (16 bits per pixel, 1 component), float (32 bits per pixel, 1 component, not supported by the UI yet), RGB_32 (8 bits per component, 4 components), RGB_64 (16 bits per component, 4 components, not supported by UI yet).
RGB buffers are expected to be in big endian ARGB format (ARGB8888), which means that on little endian format (currently most/all? code is compiled for little endian architecture), the format is BGRA888 (see: https://en.wikipedia.org/wiki/RGBA_color_model).

Implements MM::Camera.

Referenced by CCameraBase< U >::GetImageBuffer().

◆ GetImageBuffer() [2/2]

template<class U >
virtual const unsigned char* CCameraBase< U >::GetImageBuffer ( unsigned  )
inlinevirtual

Version of GetImageBuffer for multi-channel cameras Single channel (standard) cameras do not need to override this

Implements MM::Camera.

References CCameraBase< U >::GetImageBuffer(), and CCameraBase< U >::GetNumberOfChannels().

◆ GetImageBufferAsRGB32()

template<class U >
virtual const unsigned int* CCameraBase< U >::GetImageBufferAsRGB32 ( )
inlinevirtual

Returns pixel data with interleaved RGB pixels in 32 bpp format

Implements MM::Camera.

◆ GetImageBytesPerPixel()

template<class U >
virtual unsigned CCameraBase< U >::GetImageBytesPerPixel ( ) const
pure virtual

Returns image buffer pixel depth in bytes. Required by the MM::Camera API.

Implements MM::Camera.

◆ GetImageHeight()

template<class U >
virtual unsigned CCameraBase< U >::GetImageHeight ( ) const
pure virtual

Returns image buffer Y-size in pixels. Required by the MM::Camera API.

Implements MM::Camera.

◆ GetImageWidth()

template<class U >
virtual unsigned CCameraBase< U >::GetImageWidth ( ) const
pure virtual

Returns image buffer X-size in pixels. Required by the MM::Camera API.

Implements MM::Camera.

◆ GetNumberOfChannels()

template<class U >
virtual unsigned CCameraBase< U >::GetNumberOfChannels ( ) const
inlinevirtual

Multi-Channel cameras use this function to indicate how many channels they provide. Single channel cameras do not need to override this

Implements MM::Camera.

Referenced by CCameraBase< U >::GetImageBuffer().

◆ GetNumberOfComponents()

template<class U >
virtual unsigned CCameraBase< U >::GetNumberOfComponents ( ) const
inlinevirtual

Returns the number of components in this image. This is '1' for grayscale cameras, and '4' for RGB cameras.

Implements MM::Camera.

◆ GetPixelSizeUm()

template<class U >
virtual double CCameraBase< U >::GetPixelSizeUm ( ) const
inlinevirtual

Default implementation of the pixel size scaling.

Implements MM::Camera.

References MM::Camera::GetBinning().

◆ GetTags()

template<class U >
virtual void CCameraBase< U >::GetTags ( char *  serializedMetadata)
inlinevirtual

Get the metadata tags stored in this device. These tags will automatically be add to the metadata of an image inserted into the circular buffer

Implements MM::Camera.

◆ IsCapturing()

template<class U >
virtual bool CCameraBase< U >::IsCapturing ( )
inlinevirtual

Flag to indicate whether Sequence Acquisition is currently running. Return true when Sequence acquisition is active, false otherwise

Implements MM::Camera.

Referenced by CCameraBase< U >::StartSequenceAcquisition().

◆ PrepareSequenceAcqusition()

template<class U >
virtual int CCameraBase< U >::PrepareSequenceAcqusition ( )
inlinevirtual

Sets up the camera so that Sequence acquisition can start without delay

Implements MM::Camera.

◆ RemoveTag()

template<class U >
virtual void CCameraBase< U >::RemoveTag ( const char *  key)
inlinevirtual

Removes an existing tag from the metadata associated with this device These tags will automatically be add to the metadata of an image inserted into the circular buffer

Implements MM::Camera.

◆ SnapImage()

template<class U >
virtual int CCameraBase< U >::SnapImage ( )
pure virtual

Performs exposure and grabs a single image. Required by the MM::Camera API.

SnapImage should start the image exposure in the camera and block until the exposure is finished. It should not wait for read-out and transfer of data. Return DEVICE_OK on success, error code otherwise.

Implements MM::Camera.

References CDeviceBase< MM::Camera, U >::CreateProperty(), and CDeviceBase< MM::Camera, U >::SetAllowedValues().

◆ StartSequenceAcquisition() [1/2]

template<class U >
virtual int CCameraBase< U >::StartSequenceAcquisition ( double  interval)
inlinevirtual

Continuous sequence acquisition. Default to sequence acquisition with a high number of images

Implements MM::Camera.

◆ StartSequenceAcquisition() [2/2]

template<class U >
virtual int CCameraBase< U >::StartSequenceAcquisition ( long  numImages,
double  interval_ms,
bool  stopOnOverflow 
)
inlinevirtual

◆ StopSequenceAcquisition()

template<class U >
virtual int CCameraBase< U >::StopSequenceAcquisition ( )
inlinevirtual

Stop and wait for the thread finished

Implements MM::Camera.


The documentation for this class was generated from the following file: