DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Data class for Camera
.
More...
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. More... | |
using | CameraModesType = std::vector< std::string > |
List type containing strings of modes the camera can operate in. More... | |
using | TimeType = std::chrono::milliseconds |
Time type describing the camera's times like its exposure time. More... | |
Public Types inherited from DynExp::InstrumentDataBase | |
using | TaskQueueType = std::list< std::unique_ptr< TaskBase > > |
Type of an instrument task queue owning the tasks within. More... | |
using | TaskQueueIteratorType = TaskQueueType::const_iterator |
Const iterator type to elements of TaskQueueType . More... | |
Public Member Functions | |
CameraData ()=default | |
virtual | ~CameraData ()=default |
auto | GetImageWidth () const noexcept |
Getter for ImageWidth. More... | |
void | SetImageWidth (ImageDimensionType ImageWidth) noexcept |
Setter for ImageWidth. More... | |
auto | GetImageHeight () const noexcept |
Getter for ImageHeight. More... | |
void | SetImageHeight (ImageDimensionType ImageHeight) noexcept |
Setter for ImageHeight. More... | |
auto | GetCameraModes () const |
Getter for CameraModes. More... | |
void | SetCameraModes (CameraModesType CameraModes) |
Setter for CameraModes. More... | |
TimeType | GetMinExposureTime () const |
Getter for MinExposureTime. More... | |
TimeType | GetMaxExposureTime () const |
Getter for MaxExposureTime. More... | |
TimeType | GetExposureTime () const |
Getter for CurrentExposureTime. More... | |
void | SetMinExposureTime (TimeType MinExposureTime) |
Setter for MinExposureTime. More... | |
void | SetMaxExposureTime (TimeType MaxExposureTime) |
Setter for MaxExposureTime. More... | |
void | SetExposureTime (TimeType CurrentExposureTime) |
Setter for CurrentExposureTime. More... | |
auto | GetCurrentFPS () const noexcept |
Getter for CurrentFPS. More... | |
void | SetCurrentFPS (float CurrentFPS) noexcept |
Setter for CurrentFPS. More... | |
auto | GetComputeHistogram () const noexcept |
Getter for ComputeHistogram. More... | |
void | SetComputeHistogram (ComputeHistogramType ComputeHistogram) const noexcept |
Setter for ComputeHistogram. Adjustable by modules. More... | |
auto | GetIntensityHistogram () const noexcept |
Getter for IntensityHistogram. More... | |
void | SetIntensityHistogram (Util::ImageHistogramType &&IntensityHistogram) noexcept |
Setter for IntensityHistogram. Moves from argument. More... | |
auto | GetRGBHistogram () const noexcept |
Getter for RGBHistogram. More... | |
void | SetRGBHistogram (Util::ImageRGBHistogramType &&RGBHistogram) noexcept |
Setter for RGBHistogram. Moves from argument. More... | |
const auto & | GetImageTransformation () const noexcept |
Getter for ImageTransformation. More... | |
void | SetImageTransformation (const ImageTransformationType &Transformation) const noexcept |
Setter for ImageTransformation. Adjustable by modules. More... | |
QImage | GetImage () const |
Moving getter for CurrentImage. More... | |
QImage | GetImageCopy (const QRect &RegionOfInterest=QRect()) const |
Copying getter for CurrentImage. This function is more expensive than GetImage() . More... | |
bool | IsImageAvailbale () const noexcept |
Determines whether an image is currently available. More... | |
void | SetImage (QImage &&Other) |
Setter for CurrentImage. More... | |
void | ClearImage () const |
Resets CurrentImage to a default-constructed empty image and IntensityHistogram as well as RGBHistogram to default-constructed empty histograms. More... | |
auto | GetCapturingState () const noexcept |
Returns the camera's current capturing state. More... | |
bool | IsCapturing () const noexcept |
Determines whether the camera is currently capturing an image. More... | |
bool | IsCapturingSingle () const noexcept |
Determines whether the camera is currently capturing a single image. More... | |
bool | IsCapturingContinuously () const noexcept |
Determines whether the camera is currently capturing images consecutively. More... | |
Public Member Functions inherited from DynExp::InstrumentDataBase | |
InstrumentDataBase () | |
virtual | ~InstrumentDataBase () |
auto | GetLastUpdateTime () const |
Getter for LastUpdate. More... | |
auto | GetException () const noexcept |
Getter for InstrumentDataBase::InstrumentException. More... | |
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. More... | |
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. More... | |
std::unique_ptr< TaskBase > | PopTaskFront () |
Removes a task from the front of an instrument's task queue. More... | |
std::unique_ptr< TaskBase > | PopTaskBack () |
Removes a task from the back of an instrument's task queue. More... | |
auto | GetTaskFront () noexcept |
Getter for first enqueued task. More... | |
auto | GetTaskBack () noexcept |
Getter for last enqueued task. More... | |
size_t | GetNumEnqueuedTasks () const noexcept |
Getter for the instrument task queue's length. More... | |
std::unique_ptr< TaskBase > | PopFinishedTask () |
Removes a task from the front of an instrument's list of finished tasks. More... | |
size_t | GetNumFinishedTasks () const noexcept |
Getter for the length of the instrument's list of finished tasks. More... | |
bool | IsQueueClosed () const noexcept |
Determines whether the instrument task queue is closed. More... | |
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. More... | |
Private Attributes | |
ImageDimensionType | ImageWidth = 0 |
Width of the images the camera captures. More... | |
ImageDimensionType | ImageHeight = 0 |
Height of the images the camera captures. More... | |
CameraModesType | CameraModes |
Image capturing modes the camera can work in. More... | |
TimeType | MinExposureTime |
Minimal exposure time the camera supports. More... | |
TimeType | MaxExposureTime |
Maximal exposure time the camera supports. More... | |
TimeType | CurrentExposureTime |
Current exposure time of the camera. More... | |
float | CurrentFPS = 0.f |
Current frames per second when the camera is capturing images continuously. More... | |
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. More... | |
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. More... | |
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. More... | |
ImageTransformationType | ImageTransformation |
Image transformation to be applied to each captured image. Logical const-ness: allow modules to communicate to this instrument by adjusting ImageTransformation. More... | |
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. More... | |
Additional Inherited Members | |
Public Attributes inherited from DynExp::InstrumentDataBase | |
InstrumentBaseOnlyType | InstrumentBaseOnly |
Allow exclusive access to some of InstrumentDataBase's private methods to InstrumentBase . More... | |
InstrumenThreadOnlyType | InstrumentThreadOnly |
Allow exclusive access to some of InstrumentDataBase's private methods to the instrument thread InstrumentThreadMain() . More... | |
Protected Member Functions inherited from Util::ISynchronizedPointerLockable | |
ISynchronizedPointerLockable () | |
~ISynchronizedPointerLockable () | |
Object should never be destroyed before completely unlocked. More... | |
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::PVCamData, and DynExpInstr::DummyCameraData.
|
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::PVCamData, and DynExpInstr::DummyCameraData.
|
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.