MMDevice  70
Public Member Functions | Static Public Attributes | List of all members
MM::Camera Class Referenceabstract

#include <MMDevice.h>

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

Public Member Functions

virtual DeviceType GetType () const
 
virtual int SnapImage ()=0
 
virtual const unsigned char * GetImageBuffer ()=0
 
virtual const unsigned char * GetImageBuffer (unsigned channelNr)=0
 
virtual const unsigned int * GetImageBufferAsRGB32 ()=0
 
virtual unsigned GetNumberOfComponents () const =0
 
virtual int GetComponentName (unsigned component, char *name)=0
 
virtual int unsigned GetNumberOfChannels () const =0
 
virtual int GetChannelName (unsigned channel, char *name)=0
 
virtual long GetImageBufferSize () const =0
 
virtual unsigned GetImageWidth () const =0
 
virtual unsigned GetImageHeight () const =0
 
virtual unsigned GetImageBytesPerPixel () const =0
 
virtual unsigned GetBitDepth () const =0
 
virtual double GetPixelSizeUm () 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 bool SupportsMultiROI ()=0
 
virtual bool IsMultiROISet ()=0
 
virtual int GetMultiROICount (unsigned &count)=0
 
virtual int SetMultiROI (const unsigned *xs, const unsigned *ys, const unsigned *widths, const unsigned *heights, unsigned numROIs)=0
 
virtual int GetMultiROI (unsigned *xs, unsigned *ys, unsigned *widths, unsigned *heights, unsigned *length)=0
 
virtual int StartSequenceAcquisition (long numImages, double interval_ms, bool stopOnOverflow)=0
 
virtual int StartSequenceAcquisition (double interval_ms)=0
 
virtual int StopSequenceAcquisition ()=0
 
virtual int PrepareSequenceAcqusition ()=0
 
virtual bool IsCapturing ()=0
 
virtual void GetTags (char *serializedMetadata)=0
 
virtual void AddTag (const char *key, const char *deviceLabel, const char *value)=0
 
virtual void RemoveTag (const char *key)=0
 
virtual int IsExposureSequenceable (bool &isSequenceable) const =0
 
virtual int GetExposureSequenceMaxLength (long &nrEvents) const =0
 
virtual int StartExposureSequence ()=0
 
virtual int StopExposureSequence ()=0
 
virtual int ClearExposureSequence ()=0
 
virtual int AddToExposureSequence (double exposureTime_ms)=0
 
virtual int SendExposureSequence () const =0
 
- Public Member Functions inherited from MM::Device
virtual unsigned GetNumberOfProperties () const =0
 
virtual int GetProperty (const char *name, char *value) const =0
 
virtual int SetProperty (const char *name, const char *value)=0
 
virtual bool HasProperty (const char *name) const =0
 
virtual bool GetPropertyName (unsigned idx, char *name) const =0
 
virtual int GetPropertyReadOnly (const char *name, bool &readOnly) const =0
 
virtual int GetPropertyInitStatus (const char *name, bool &preInit) const =0
 
virtual int HasPropertyLimits (const char *name, bool &hasLimits) const =0
 
virtual int GetPropertyLowerLimit (const char *name, double &lowLimit) const =0
 
virtual int GetPropertyUpperLimit (const char *name, double &hiLimit) const =0
 
virtual int GetPropertyType (const char *name, MM::PropertyType &pt) const =0
 
virtual unsigned GetNumberOfPropertyValues (const char *propertyName) const =0
 
virtual bool GetPropertyValueAt (const char *propertyName, unsigned index, char *value) const =0
 
virtual int IsPropertySequenceable (const char *name, bool &isSequenceable) const =0
 
virtual int GetPropertySequenceMaxLength (const char *propertyName, long &nrEvents) const =0
 
virtual int StartPropertySequence (const char *propertyName)=0
 
virtual int StopPropertySequence (const char *propertyName)=0
 
virtual int ClearPropertySequence (const char *propertyName)=0
 
virtual int AddToPropertySequence (const char *propertyName, const char *value)=0
 
virtual int SendPropertySequence (const char *propertyName)=0
 
virtual bool GetErrorText (int errorCode, char *errMessage) const =0
 
virtual bool Busy ()=0
 
virtual double GetDelayMs () const =0
 
virtual void SetDelayMs (double delay)=0
 
virtual bool UsesDelay ()=0
 
 MM_DEPRECATED (virtual HDEVMODULE GetModuleHandle() const)=0
 
 MM_DEPRECATED (virtual void SetModuleHandle(HDEVMODULE hLibraryHandle))=0
 
virtual void SetLabel (const char *label)=0
 
virtual void GetLabel (char *name) const =0
 
virtual void SetModuleName (const char *moduleName)=0
 
virtual void GetModuleName (char *moduleName) const =0
 
virtual void SetDescription (const char *description)=0
 
virtual void GetDescription (char *description) const =0
 
virtual int Initialize ()=0
 
virtual int Shutdown ()=0
 
virtual void GetName (char *name) const =0
 
virtual void SetCallback (Core *callback)=0
 
virtual bool SupportsDeviceDetection (void)=0
 
virtual MM::DeviceDetectionStatus DetectDevice (void)=0
 
virtual void SetParentID (const char *parentId)=0
 
virtual void GetParentID (char *parentID) const =0
 

Static Public Attributes

static const DeviceType Type = CameraDevice
 

Detailed Description

Camera API

Member Function Documentation

◆ AddTag()

virtual void MM::Camera::AddTag ( const char *  key,
const char *  deviceLabel,
const char *  value 
)
pure virtual

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

Implemented in CCameraBase< U >.

◆ ClearROI()

virtual int MM::Camera::ClearROI ( )
pure virtual

Resets the Region of Interest to full frame.

◆ GetBinning()

virtual int MM::Camera::GetBinning ( ) const
pure virtual

Returns the current binning factor.

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

◆ GetBitDepth()

virtual unsigned MM::Camera::GetBitDepth ( ) const
pure virtual

Returns the bit depth (dynamic range) of the pixel. This does not affect the buffer size, it just gives the client application a guideline on how to interpret pixel values. Required by the MM::Camera API.

◆ GetChannelName()

virtual int MM::Camera::GetChannelName ( unsigned  channel,
char *  name 
)
pure virtual

Returns the name for each Channel. An implementation of this function is provided in DeviceBase.h. It will return an empty string

Implemented in CCameraBase< U >.

◆ GetComponentName()

virtual int MM::Camera::GetComponentName ( unsigned  component,
char *  name 
)
pure virtual

Returns the name for each component

Implemented in CCameraBase< U >.

◆ GetExposure()

virtual double MM::Camera::GetExposure ( ) const
pure virtual

Returns the current exposure setting in milliseconds.

◆ GetImageBuffer() [1/2]

virtual const unsigned char* MM::Camera::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).

Implemented in CCameraBase< U >.

◆ GetImageBuffer() [2/2]

virtual const unsigned char* MM::Camera::GetImageBuffer ( unsigned  channelNr)
pure virtual

Returns pixel data for cameras with multiple channels. See description for GetImageBuffer() for details. Use this overloaded version for cameras with multiple channels When calling this function for a single channel camera, this function should return the content of the imagebuffer as returned by the function GetImageBuffer(). This behavior is implemented in the DeviceBase. When GetImageBuffer() is called for a multi-channel camera, the camera adapter should return the ImageBuffer for the first channel

Parameters
channelNrNumber of the channel for which the image data are requested.

Implemented in CCameraBase< U >.

◆ GetImageBufferAsRGB32()

virtual const unsigned int* MM::Camera::GetImageBufferAsRGB32 ( )
pure virtual

Returns pixel data with interleaved RGB pixels in 32 bpp format

Implemented in CCameraBase< U >.

◆ GetImageBufferSize()

virtual long MM::Camera::GetImageBufferSize ( ) const
pure virtual

Returns the size in bytes of the image buffer. Required by the MM::Camera API. For multi-channel cameras, return the size of a single channel

◆ GetImageBytesPerPixel()

virtual unsigned MM::Camera::GetImageBytesPerPixel ( ) const
pure virtual

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

Implemented in CCameraBase< U >.

◆ GetImageHeight()

virtual unsigned MM::Camera::GetImageHeight ( ) const
pure virtual

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

Implemented in CCameraBase< U >.

◆ GetImageWidth()

virtual unsigned MM::Camera::GetImageWidth ( ) const
pure virtual

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

Implemented in CCameraBase< U >.

◆ GetNumberOfChannels()

virtual int unsigned MM::Camera::GetNumberOfChannels ( ) const
pure virtual

Returns the number of simultaneous channels that camera is capable of. This should be used by devices capable of generating multiple channels of imagedata simultaneously. Note: this should not be used by color cameras (use getNumberOfComponents instead).

Implemented in CCameraBase< U >.

◆ GetNumberOfComponents()

virtual unsigned MM::Camera::GetNumberOfComponents ( ) const
pure virtual

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

Implemented in CCameraBase< U >.

◆ GetPixelSizeUm()

virtual double MM::Camera::GetPixelSizeUm ( ) const
pure virtual

Returns binnings factor. Used to calculate current pixelsize Not appropriately named. Implemented in DeviceBase.h

Implemented in CCameraBase< U >.

◆ GetROI()

virtual int MM::Camera::GetROI ( unsigned &  x,
unsigned &  y,
unsigned &  xSize,
unsigned &  ySize 
)
pure virtual

Returns the actual dimensions of the current ROI.

◆ GetTags()

virtual void MM::Camera::GetTags ( char *  serializedMetadata)
pure virtual

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

Implemented in CCameraBase< U >.

◆ IsCapturing()

virtual bool MM::Camera::IsCapturing ( )
pure virtual

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

Implemented in CCameraBase< U >.

◆ IsExposureSequenceable()

virtual int MM::Camera::IsExposureSequenceable ( bool &  isSequenceable) const
pure virtual

Returns whether a camera's exposure time can be sequenced. If returning true, then a Camera adapter class should also inherit the SequenceableExposure class and implement its methods.

◆ PrepareSequenceAcqusition()

virtual int MM::Camera::PrepareSequenceAcqusition ( )
pure virtual

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

Implemented in CCameraBase< U >.

◆ RemoveTag()

virtual void MM::Camera::RemoveTag ( const char *  key)
pure virtual

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

Implemented in CCameraBase< U >.

◆ SetBinning()

virtual int MM::Camera::SetBinning ( int  binSize)
pure virtual

Sets binning factor.

◆ SetExposure()

virtual void MM::Camera::SetExposure ( double  exp_ms)
pure virtual

Sets exposure in milliseconds.

◆ SetROI()

virtual int MM::Camera::SetROI ( unsigned  x,
unsigned  y,
unsigned  xSize,
unsigned  ySize 
)
pure virtual

Sets the camera Region Of Interest. Required by the MM::Camera API. This command will change the dimensions of the image. Depending on the hardware capabilities the camera may not be able to configure the exact dimensions requested - but should try do as close as possible. If the hardware does not have this capability the software should simulate the ROI by appropriately cropping each frame.

Parameters
x- top-left corner coordinate
y- top-left corner coordinate
xSize- width
ySize- height

◆ SnapImage()

virtual int MM::Camera::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.

Implemented in CCameraBase< U >.

◆ StartSequenceAcquisition() [1/2]

virtual int MM::Camera::StartSequenceAcquisition ( double  interval_ms)
pure virtual

Starts Sequence Acquisition with given interval. Most camera adapters will ignore this number

Implemented in CCameraBase< U >.

◆ StartSequenceAcquisition() [2/2]

virtual int MM::Camera::StartSequenceAcquisition ( long  numImages,
double  interval_ms,
bool  stopOnOverflow 
)
pure virtual

Starts continuous acquisition.

Implemented in CCameraBase< U >.

◆ StopSequenceAcquisition()

virtual int MM::Camera::StopSequenceAcquisition ( )
pure virtual

Stops an ongoing sequence acquisition

Implemented in CCameraBase< U >.


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