classPiiCameraDriver
#include <PiiCameraDriver.h>
A common interface for cameras that read images into a frame buffer.
Inherits QObject
Inherited by PiiMultiCamDriver
Description
Images are stored as frames containing at least one scan line. Valid frame sizes are determined by the type of camera and the driver.
Frames are captured by initiating a capture sequence by startCapture(). Whenever a new frame is ready, the driver invokes the frameCaptured() function of a registered listener.
PiiCameraDriver is designed to suit the needs detailed in the paragraphs below (and hopefully others).
On-line video via DMA
High-speed cameras
Line-scan cameras
Non-DMA devices
Accessing frame buffers
Classes
| class |
A listener that receives image capture events. |
Properties
|
int
|
|
|
int
|
|
|
int
|
|
Public types
|
enum
|
{
SoftwareTrigger, HardwareTrigger
}
|
Constructors and destructor
|
(
)
|
|
|
(
)
|
Public member functions
|
virtual int
|
(
)
= 0
Returns bits per pixel. |
|
virtual QStringList
|
(
)
= 0
Returns a list of the cameras that can be automatically detected by the driver. |
|
virtual int
|
(
)
Returns camera type. |
|
virtual bool
|
(
)
= 0
Closes an initialized driver. |
|
virtual void *
|
(
Returns a pointer to the beginning of a frame buffer. |
|
virtual QSize
|
(
)
= 0
Returns frame size. |
|
virtual int
|
(
)
= 0
Returns image format. |
|
virtual void
|
Initializes the driver. |
|
virtual bool
|
(
)
= 0
Returns |
|
virtual bool
|
(
)
= 0
Returns |
|
virtual Listener *
|
(
)
Returns the current listener or 0 if there is no listener. |
|
virtual QVariant
|
(
|
|
QVariantMap &
|
(
)
Returns the reference to the map where is all critical properties. |
|
virtual bool
|
(
Returns true if the driver must be initialized again when setting the property named as 'name'. |
|
virtual QSize
|
(
)
= 0
Returns resolution. |
|
virtual bool
|
Sets frame size. |
|
virtual bool
|
(
Set image format. |
|
virtual void
|
Sets the listener that handles received image frames. |
|
virtual bool
|
|
|
virtual bool
|
(
Sets the trigger mode. |
|
virtual bool
|
(
Starts capturing frames. |
|
virtual bool
|
(
)
= 0
Stops capturing frames. |
|
virtual bool
|
(
)
= 0
Tells to the driver that the next image must be triggered now. |
|
virtual TriggerMode
|
(
)
= 0
Returns the trigger mode. |
Property details
-
int bitsPerPixel
[read] -
int cameraType
[read] -
QSize frameSize
[read, write] -
int imageFormat
[read, write] -
QSize resolution
[read]
Enumeration details
-
enum TriggerMode
Function details
-
PiiCameraDriver
() -
~PiiCameraDriver
() -
virtual int bitsPerPixel
()[pure virtual]Returns bits per pixel.
-
Returns a list of the cameras that can be automatically detected by the driver.
Note that this is not necessarily a complete list of accessible cameras. The IDs on the list can be used as the cameraId parameter to the initialize().
-
virtual int cameraType
()[virtual]Returns camera type.
Default implementation returns PiiCamera::AreaScan.
-
virtual bool close
()[pure virtual]Closes an initialized driver.
After
close(), initialize() must be called again before the driver is functional.Returns
trueon success,falseotherwise -
virtual void * frameBuffer
(- int frameIndex = 0
[pure virtual]Returns a pointer to the beginning of a frame buffer.
Parameters
- frameIndex
the index of the frame buffer
Returns
the frame buffer's memory address
-
Returns frame size.
-
virtual int imageFormat
()[pure virtual]Returns image format.
-
Initializes the driver.
This function is called before frames are being captured. The driver implementation may now initialize DMA buffers, connect to a camera etc.
The driver may be able to handle many cameras. The active unit is selected by a generic camera id. With frame grabbers, the camera id is typically just a zero-based numerical unit index. Other possibilities include, for example, network addresses. The cameraList() function returns a list of automatically found camera IDs.
You can configure camera driver via properties, but sometimes you must call initialize(cameraId) again before your configuration value is updated.
Exceptions
- PiiCameraDriverException&
if the initialization could not be performed.
-
virtual bool isCapturing
()[pure virtual]Returns
trueif frames are currently being captured andfalseotherwise. -
virtual bool isOpen
()[pure virtual]Returns
trueif the driver is open andfalseotherwise. -
Returns the current listener or 0 if there is no listener.
-
-
QVariantMap & propertyMap
()Returns the reference to the map where is all critical properties.
-
virtual bool requiresInitialization
(- const char * name
[virtual]Returns true if the driver must be initialized again when setting the property named as 'name'.
The default implementation returns false.
-
Returns resolution.
-
Sets frame size.
Default implementation does nothing.
-
virtual bool setImageFormat
(- int format
[pure virtual]Set image format.
Default implementation does nothing.
-
Sets the listener that handles received image frames.
-
-
virtual bool setTriggerMode
(- TriggerMode mode
[pure virtual]Sets the trigger mode.
-
virtual bool startCapture
(- int frames = 0
[pure virtual]Starts capturing frames.
Parameters
- frames
the maximum number of frames to capture. If this value is less than one, frames will be captured until explicitly interrupted.
Returns
trueif the capture was successfully started,falseotherwise -
virtual bool stopCapture
()[pure virtual]Stops capturing frames.
Returns
trueif the capture was successfully stopped,falseotherwise. -
virtual bool triggerImage
()[pure virtual]Tells to the driver that the next image must be triggered now.
-
virtual TriggerMode triggerMode
()[pure virtual]Returns the trigger mode.
Add a note
Not a single note added yet. Be the first, add yours.