|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Data class for Camera.
More...
#include <Camera.h>
Inheritance diagram for DynExpInstr::CameraData:Classes | |
| struct | ImageTransformationType |
| Type describing an image transformation. More... | |
Public Types | |
| enum class | CapturingStateType { Stopped , CapturingSingle , CapturingContinuously } |
| Type indicating whether the camera is currently capturing images. More... | |
| enum class | ComputeHistogramType { NoHistogram , IntensityHistogram , RGBHistogram , IntensityAndRGBHistogram } |
| Type indicating whether histograms should be computed for newly captured images. More... | |
| using | ImageDimensionType = unsigned int |
| Type describing image dimensions such as width and height. | |
| using | CameraModesType = std::vector< std::string > |
| List type containing strings of modes the camera can operate in. | |
| using | TimeType = std::chrono::milliseconds |
| Time type describing the camera's times like its exposure time. | |
Public Types inherited from DynExp::InstrumentDataBase | |
| using | TaskQueueType = std::list< std::unique_ptr< TaskBase > > |
| Type of an instrument task queue owning the tasks within. | |
| using | TaskQueueIteratorType = TaskQueueType::const_iterator |
Const iterator type to elements of TaskQueueType. | |
Public Member Functions | |
| CameraData ()=default | |
| virtual | ~CameraData ()=default |
| auto | GetImageWidth () const noexcept |
| Getter for ImageWidth. | |
| void | SetImageWidth (ImageDimensionType ImageWidth) noexcept |
| Setter for ImageWidth. | |
| auto | GetImageHeight () const noexcept |
| Getter for ImageHeight. | |
| void | SetImageHeight (ImageDimensionType ImageHeight) noexcept |
| Setter for ImageHeight. | |
| auto | GetCameraModes () const |
| Getter for CameraModes. | |
| void | SetCameraModes (CameraModesType CameraModes) |
| Setter for CameraModes. | |
| TimeType | GetMinExposureTime () const |
| Getter for MinExposureTime. | |
| TimeType | GetMaxExposureTime () const |
| Getter for MaxExposureTime. | |
| TimeType | GetExposureTime () const |
| Getter for CurrentExposureTime. | |
| void | SetMinExposureTime (TimeType MinExposureTime) |
| Setter for MinExposureTime. | |
| void | SetMaxExposureTime (TimeType MaxExposureTime) |
| Setter for MaxExposureTime. | |
| void | SetExposureTime (TimeType CurrentExposureTime) |
| Setter for CurrentExposureTime. | |
| auto | GetCurrentFPS () const noexcept |
| Getter for CurrentFPS. | |
| void | SetCurrentFPS (float CurrentFPS) noexcept |
| Setter for CurrentFPS. | |
| auto | GetComputeHistogram () const noexcept |
| Getter for ComputeHistogram. | |
| void | SetComputeHistogram (ComputeHistogramType ComputeHistogram) const noexcept |
| Setter for ComputeHistogram. Adjustable by modules. | |
| auto | GetIntensityHistogram () const noexcept |
| Getter for IntensityHistogram. | |
| void | SetIntensityHistogram (Util::ImageHistogramType &&IntensityHistogram) noexcept |
| Setter for IntensityHistogram. Moves from argument. | |
| auto | GetRGBHistogram () const noexcept |
| Getter for RGBHistogram. | |
| void | SetRGBHistogram (Util::ImageRGBHistogramType &&RGBHistogram) noexcept |
| Setter for RGBHistogram. Moves from argument. | |
| const auto & | GetImageTransformation () const noexcept |
| Getter for ImageTransformation. | |
| void | SetImageTransformation (const ImageTransformationType &Transformation) const noexcept |
| Setter for ImageTransformation. Adjustable by modules. | |
| QImage | GetImage () const |
| Moving getter for CurrentImage. | |
| QImage | GetImageCopy (const QRect &RegionOfInterest=QRect()) const |
Copying getter for CurrentImage. This function is more expensive than GetImage(). | |
| bool | IsImageAvailbale () const noexcept |
| Determines whether an image is currently available. | |
| void | SetImage (QImage &&Other) |
| Setter for CurrentImage. | |
| void | ClearImage () const |
| Resets CurrentImage to a default-constructed empty image and IntensityHistogram as well as RGBHistogram to default-constructed empty histograms. | |
| auto | GetCapturingState () const noexcept |
| Returns the camera's current capturing state. | |
| bool | IsCapturing () const noexcept |
| Determines whether the camera is currently capturing an image. | |
| bool | IsCapturingSingle () const noexcept |
| Determines whether the camera is currently capturing a single image. | |
| bool | IsCapturingContinuously () const noexcept |
| Determines whether the camera is currently capturing images consecutively. | |
Public Member Functions inherited from DynExp::InstrumentDataBase | |
| InstrumentDataBase () | |
| virtual | ~InstrumentDataBase () |
| auto | GetLastUpdateTime () const |
| Getter for LastUpdate. | |
| auto | GetException () const noexcept |
| Getter for InstrumentDataBase::InstrumentException. | |
| void | EnqueueTask (std::unique_ptr< TaskBase > &&Task) |
| Enqueues a task at the back of an instrument's task queue and notifies the instrument about the new task. | |
| void | EnqueuePriorityTask (std::unique_ptr< TaskBase > &&Task) |
| Enqueues a task at the front of an instrument's task queue and notifies the instrument about the new task. | |
| std::unique_ptr< TaskBase > | PopTaskFront () |
| Removes a task from the front of an instrument's task queue. | |
| std::unique_ptr< TaskBase > | PopTaskBack () |
| Removes a task from the back of an instrument's task queue. | |
| auto | GetTaskFront () noexcept |
| Getter for first enqueued task. | |
| auto | GetTaskBack () noexcept |
| Getter for last enqueued task. | |
| size_t | GetNumEnqueuedTasks () const noexcept |
| Getter for the instrument task queue's length. | |
| std::unique_ptr< TaskBase > | PopFinishedTask () |
| Removes a task from the front of an instrument's list of finished tasks. | |
| size_t | GetNumFinishedTasks () const noexcept |
| Getter for the length of the instrument's list of finished tasks. | |
| bool | IsQueueClosed () const noexcept |
| Determines whether the instrument task queue is closed. | |
Public Member Functions inherited from Util::INonCopyable | |
| INonCopyable (const INonCopyable &)=delete | |
| INonCopyable & | operator= (const INonCopyable &)=delete |
Private Member Functions | |
| void | ResetImpl (dispatch_tag< InstrumentDataBase >) override final |
| virtual void | ResetImpl (dispatch_tag< CameraData >) |
Override | |
Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that Override by derived classes. | |
| virtual CapturingStateType | GetCapturingStateChild () const noexcept=0 |
| Returns the camera's current capturing state. | |
Private Attributes | |
| ImageDimensionType | ImageWidth = 0 |
| Width of the images the camera captures. | |
| ImageDimensionType | ImageHeight = 0 |
| Height of the images the camera captures. | |
| CameraModesType | CameraModes |
| Image capturing modes the camera can work in. | |
| TimeType | MinExposureTime |
| Minimal exposure time the camera supports. | |
| TimeType | MaxExposureTime |
| Maximal exposure time the camera supports. | |
| TimeType | CurrentExposureTime |
| Current exposure time of the camera. | |
| float | CurrentFPS = 0.f |
| Current frames per second when the camera is capturing images continuously. | |
| ComputeHistogramType | ComputeHistogram = ComputeHistogramType::NoHistogram |
| Determines the histogram types to be computed for each captured image. Logical const-ness: allow modules to communicate to this instrument by adjusting ComputeHistogram. | |
| Util::ImageHistogramType | IntensityHistogram = {} |
Intensity (grayscale) histogram belonging to CurrentImage. The histogram is computed if ComputeHistogram is set accordingly. Logical const-ness: allow const member function ClearImage() to clear the histogram. | |
| Util::ImageRGBHistogramType | RGBHistogram = {} |
Color (RGB) histograms belonging to CurrentImage. The histograms are computed if ComputeHistogram is set accordingly. Logical const-ness: allow const member function ClearImage() to clear the histograms. | |
| ImageTransformationType | ImageTransformation |
| Image transformation to be applied to each captured image. Logical const-ness: allow modules to communicate to this instrument by adjusting ImageTransformation. | |
| QImage | CurrentImage |
Current image captured by the camera. Logical const-ness: allow const member function GetImage() to move from CurrentImage and ClearImage() to clear it. | |
Additional Inherited Members | |
Public Attributes inherited from DynExp::InstrumentDataBase | |
| InstrumentBaseOnlyType | InstrumentBaseOnly |
Allow exclusive access to some of InstrumentDataBase's private methods to InstrumentBase. | |
| InstrumenThreadOnlyType | InstrumentThreadOnly |
Allow exclusive access to some of InstrumentDataBase's private methods to the instrument thread InstrumentThreadMain(). | |
Protected Member Functions inherited from Util::ISynchronizedPointerLockable | |
| ISynchronizedPointerLockable () | |
| ~ISynchronizedPointerLockable () | |
| Object should never be destroyed before completely unlocked. | |
Protected Member Functions inherited from Util::INonCopyable | |
| constexpr | INonCopyable ()=default |
| ~INonCopyable ()=default | |
| struct DynExpInstr::CameraData::ImageTransformationType |
| using DynExpInstr::CameraData::CameraModesType = std::vector<std::string> |
| using DynExpInstr::CameraData::ImageDimensionType = unsigned int |
| using DynExpInstr::CameraData::TimeType = std::chrono::milliseconds |
|
strong |
|
strong |
Type indicating whether histograms should be computed for newly captured images.
|
default |
|
virtualdefault |
| void DynExpInstr::CameraData::ClearImage | ( | ) | const |
Resets CurrentImage to a default-constructed empty image and IntensityHistogram as well as RGBHistogram to default-constructed empty histograms.
Definition at line 77 of file Camera.cpp.
|
inline |
Getter for CameraModes.
|
inlinenoexcept |
Returns the camera's current capturing state.
|
privatepure virtualnoexcept |
Returns the camera's current capturing state.
Implemented in DynExpInstr::DummyCameraData, and DynExpInstr::PVCamData.
|
inlinenoexcept |
Getter for ComputeHistogram.
|
inlinenoexcept |
Getter for CurrentFPS.
|
inline |
Getter for CurrentExposureTime.
| QImage DynExpInstr::CameraData::GetImage | ( | ) | const |
Moving getter for CurrentImage.
GetImage() or GetImageCopy() will fail until a new image has been captured. | Util::EmptyException | is thrown if CurrentImage is empty. |
Definition at line 55 of file Camera.cpp.
| QImage DynExpInstr::CameraData::GetImageCopy | ( | const QRect & | RegionOfInterest = QRect() | ) | const |
Copying getter for CurrentImage. This function is more expensive than GetImage().
| RegionOfInterest | Region of interest to copy and return. Refer to Qt documentation of QImage::copy(). |
| Util::EmptyException | is thrown if CurrentImage is empty. |
Definition at line 64 of file Camera.cpp.
|
inlinenoexcept |
Getter for ImageHeight.
|
inlinenoexcept |
Getter for ImageTransformation.
|
inlinenoexcept |
Getter for ImageWidth.
|
inlinenoexcept |
Getter for IntensityHistogram.
|
inline |
Getter for MaxExposureTime.
|
inline |
Getter for MinExposureTime.
|
inlinenoexcept |
Getter for RGBHistogram.
|
inlinenoexcept |
Determines whether the camera is currently capturing an image.
GetCapturingState() returns anything else than CapturingStateType::Stopped, false otherwise.
|
inlinenoexcept |
Determines whether the camera is currently capturing images consecutively.
GetCapturingState() returns CapturingStateType::CapturingContinuously, false otherwise.
|
inlinenoexcept |
Determines whether the camera is currently capturing a single image.
GetCapturingState() returns CapturingStateType::CapturingSingle, false otherwise.
|
inlinenoexcept |
Determines whether an image is currently available.
|
inlineprivatevirtual |
Reimplemented in DynExpInstr::DummyCameraData, and DynExpInstr::PVCamData.
|
finaloverrideprivate |
Definition at line 85 of file Camera.cpp.
|
inline |
Setter for CameraModes.
|
inlinenoexcept |
Setter for ComputeHistogram. Adjustable by modules.
|
inlinenoexcept |
Setter for CurrentFPS.
|
inline |
Setter for CurrentExposureTime.
| void DynExpInstr::CameraData::SetImage | ( | QImage && | Other | ) |
Setter for CurrentImage.
| Other | Image to set CurrentImage to by moving from Other. |
Definition at line 72 of file Camera.cpp.
|
inlinenoexcept |
Setter for ImageHeight.
|
inlinenoexcept |
Setter for ImageTransformation. Adjustable by modules.
|
inlinenoexcept |
Setter for ImageWidth.
|
inlinenoexcept |
Setter for IntensityHistogram. Moves from argument.
|
inline |
Setter for MaxExposureTime.
|
inline |
Setter for MinExposureTime.
|
inlinenoexcept |
Setter for RGBHistogram. Moves from argument.
|
private |
|
mutableprivate |
Determines the histogram types to be computed for each captured image. Logical const-ness: allow modules to communicate to this instrument by adjusting ComputeHistogram.
|
private |
|
private |
|
mutableprivate |
Current image captured by the camera. Logical const-ness: allow const member function GetImage() to move from CurrentImage and ClearImage() to clear it.
|
private |
|
mutableprivate |
Image transformation to be applied to each captured image. Logical const-ness: allow modules to communicate to this instrument by adjusting ImageTransformation.
|
private |
|
mutableprivate |
Intensity (grayscale) histogram belonging to CurrentImage. The histogram is computed if ComputeHistogram is set accordingly. Logical const-ness: allow const member function ClearImage() to clear the histogram.
|
private |
|
private |
|
mutableprivate |
Color (RGB) histograms belonging to CurrentImage. The histograms are computed if ComputeHistogram is set accordingly. Logical const-ness: allow const member function ClearImage() to clear the histograms.