Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Micro-Manager
XenethCamera
Commits
3ecf37a8
Commit
3ecf37a8
authored
May 31, 2021
by
Rossa, Lutz
Browse files
replace tabs with spaces
parent
22ce90b4
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
XenethCamera.cpp
View file @
3ecf37a8
This diff is collapsed.
Click to expand it.
XenethCamera.h
View file @
3ecf37a8
...
...
@@ -34,104 +34,104 @@
class
XenethCamera
:
public
CCameraBase
<
XenethCamera
>
{
public:
XenethCamera
();
~
XenethCamera
();
// Inherited via CCameraBase
int
Initialize
();
int
Shutdown
();
void
GetName
(
char
*
name
)
const
;
long
GetImageBufferSize
()
const
;
unsigned
GetBitDepth
()
const
;
int
GetBinning
()
const
;
int
SetBinning
(
int
binSize
);
void
SetExposure
(
double
exp_ms
);
double
GetExposure
()
const
;
int
SetROI
(
unsigned
uX
,
unsigned
uY
,
unsigned
uWidth
,
unsigned
uHeight
);
int
GetROI
(
unsigned
&
x
,
unsigned
&
y
,
unsigned
&
xSize
,
unsigned
&
ySize
);
int
ClearROI
();
int
IsExposureSequenceable
(
bool
&
isSequenceable
)
const
;
const
unsigned
char
*
GetImageBuffer
();
unsigned
GetImageWidth
()
const
;
unsigned
GetImageHeight
()
const
;
unsigned
GetImageBytesPerPixel
()
const
;
int
SnapImage
();
int
StartSequenceAcquisition
(
long
numImages
,
double
interval_ms
,
bool
stopOnOverflow
);
int
StopSequenceAcquisition
();
void
OnThreadExiting
()
throw
();
unsigned
GetNumberOfComponents
()
const
;
const
unsigned
int
*
GetImageBufferAsRGB32
();
/// <summary>
/// this function is called before the DLL is unloaded to shut down existing devices
/// </summary>
static
void
DllMainShutdown
();
XenethCamera
();
~
XenethCamera
();
// Inherited via CCameraBase
int
Initialize
();
int
Shutdown
();
void
GetName
(
char
*
name
)
const
;
long
GetImageBufferSize
()
const
;
unsigned
GetBitDepth
()
const
;
int
GetBinning
()
const
;
int
SetBinning
(
int
binSize
);
void
SetExposure
(
double
exp_ms
);
double
GetExposure
()
const
;
int
SetROI
(
unsigned
uX
,
unsigned
uY
,
unsigned
uWidth
,
unsigned
uHeight
);
int
GetROI
(
unsigned
&
x
,
unsigned
&
y
,
unsigned
&
xSize
,
unsigned
&
ySize
);
int
ClearROI
();
int
IsExposureSequenceable
(
bool
&
isSequenceable
)
const
;
const
unsigned
char
*
GetImageBuffer
();
unsigned
GetImageWidth
()
const
;
unsigned
GetImageHeight
()
const
;
unsigned
GetImageBytesPerPixel
()
const
;
int
SnapImage
();
int
StartSequenceAcquisition
(
long
numImages
,
double
interval_ms
,
bool
stopOnOverflow
);
int
StopSequenceAcquisition
();
void
OnThreadExiting
()
throw
();
unsigned
GetNumberOfComponents
()
const
;
const
unsigned
int
*
GetImageBufferAsRGB32
();
/// <summary>
/// this function is called before the DLL is unloaded to shut down existing devices
/// </summary>
static
void
DllMainShutdown
();
private:
class
XenethProperty
{
public:
XenethProperty
()
:
m_iType
(
XType_None
)
{}
XenethProperty
(
const
XenethProperty
&
)
=
default
;
XenethProperty
(
XenethProperty
&&
)
=
default
;
XenethProperty
&
operator
=
(
const
XenethProperty
&
)
=
default
;
XenethProperty
&
operator
=
(
XenethProperty
&&
)
=
default
;
XPropType
m_iType
;
std
::
string
m_szName
;
std
::
string
m_szCategory
;
std
::
string
m_szUnit
;
std
::
string
m_szRange
;
std
::
string
m_szValue
;
};
mutable
bool
m_bInitialized
;
class
XenethProperty
{
public:
XenethProperty
()
:
m_iType
(
XType_None
)
{}
XenethProperty
(
const
XenethProperty
&
)
=
default
;
XenethProperty
(
XenethProperty
&&
)
=
default
;
XenethProperty
&
operator
=
(
const
XenethProperty
&
)
=
default
;
XenethProperty
&
operator
=
(
XenethProperty
&&
)
=
default
;
XPropType
m_iType
;
std
::
string
m_szName
;
std
::
string
m_szCategory
;
std
::
string
m_szUnit
;
std
::
string
m_szRange
;
std
::
string
m_szValue
;
};
mutable
bool
m_bInitialized
;
mutable
bool
m_bInitializing
;
unsigned
char
m_byPixelSize
;
std
::
string
m_szCameraPath
;
std
::
string
m_szCalibrationFile
;
XCHANDLE
m_hCamera
;
std
::
vector
<
XenethProperty
>
m_aProperties
;
long
m_lExposurePropertyIndex
;
static
std
::
list
<
XenethCamera
*>
m_apInstances
;
mutable
unsigned
m_uRoiX
;
mutable
unsigned
m_uRoiY
;
mutable
unsigned
m_uRoiW
;
mutable
unsigned
m_uRoiH
;
std
::
vector
<
unsigned
char
>
m_abyImage
;
std
::
vector
<
unsigned
char
>
m_abyROI
;
/// <summary>
/// convienence function to create a MM property with local action function
/// </summary>
/// <param name="szName">name of property</param>
/// <param name="szValue">initial value as string</param>
/// <param name="eType">data type (string, float, integer)</param>
/// <param name="bReadOnly">read only flag</param>
/// <param name="pFunction">setter/getter function</param>
/// <param name="bIsPreInitProperty">pre-init flag</param>
/// <returns></returns>
int
XenethCreateProperty
(
const
char
*
szName
,
const
char
*
szValue
,
MM
::
PropertyType
eType
,
bool
bReadOnly
,
int
(
XenethCamera
::*
pFunction
)(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
),
bool
bIsPreInitProperty
);
/// <summary>
/// called while getting/setting camera path property
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnCameraPath
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// called while getting/setting calibration file path property
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnCalibrationFile
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
unsigned
char
m_byPixelSize
;
std
::
string
m_szCameraPath
;
std
::
string
m_szCalibrationFile
;
XCHANDLE
m_hCamera
;
std
::
vector
<
XenethProperty
>
m_aProperties
;
long
m_lExposurePropertyIndex
;
static
std
::
list
<
XenethCamera
*>
m_apInstances
;
/// list of active instances for exit
mutable
unsigned
m_uRoiX
;
mutable
unsigned
m_uRoiY
;
mutable
unsigned
m_uRoiW
;
mutable
unsigned
m_uRoiH
;
std
::
vector
<
unsigned
char
>
m_abyImage
;
std
::
vector
<
unsigned
char
>
m_abyROI
;
/// <summary>
/// convienence function to create a MM property with local action function
/// </summary>
/// <param name="szName">name of property</param>
/// <param name="szValue">initial value as string</param>
/// <param name="eType">data type (string, float, integer)</param>
/// <param name="bReadOnly">read only flag</param>
/// <param name="pFunction">setter/getter function</param>
/// <param name="bIsPreInitProperty">pre-init flag</param>
/// <returns></returns>
int
XenethCreateProperty
(
const
char
*
szName
,
const
char
*
szValue
,
MM
::
PropertyType
eType
,
bool
bReadOnly
,
int
(
XenethCamera
::*
pFunction
)(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
),
bool
bIsPreInitProperty
);
/// <summary>
/// called while getting/setting camera path property
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnCameraPath
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// called while getting/setting calibration file path property
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnCalibrationFile
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// called while getting/setting log file path property
...
...
@@ -141,34 +141,34 @@ private:
/// <returns>success or error code</returns>
int
OnLogFile
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// called while getting/setting binning
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnBinning
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// called while getting/setting, which property is the exposure time
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnExposureProperty
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// called while getting/setting autogenerated camera path property
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnCameraProperty
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// update ROI image from camera image
/// </summary>
void
UpdateROI
();
/// <summary>
/// called while getting/setting binning
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnBinning
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// called while getting/setting, which property is the exposure time
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnExposureProperty
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// called while getting/setting autogenerated camera path property
/// </summary>
/// <param name="pProp">property value</param>
/// <param name="eAct">action type: get, set, ...</param>
/// <returns>success or error code</returns>
int
OnCameraProperty
(
MM
::
PropertyBase
*
pProp
,
MM
::
ActionType
eAct
);
/// <summary>
/// update ROI image from camera image
/// </summary>
void
UpdateROI
();
/// <summary>
/// convert a time from ms into device unit
...
...
@@ -186,10 +186,10 @@ private:
/// <returns>converted time or input value</returns>
static
double
ToMilliseconds
(
double
dValue
,
const
char
*
szSourceUnit
);
/// <summary>
/// convert Xeneth result code into micro-manager error code
/// </summary>
/// <param name="code">Xeneth function result</param>
/// <returns>registered error code for Xeneth result</returns>
static
int
ConvertXenethResult
(
ErrCode
code
);
/// <summary>
/// convert Xeneth result code into micro-manager error code
/// </summary>
/// <param name="code">Xeneth function result</param>
/// <returns>registered error code for Xeneth result</returns>
static
int
ConvertXenethResult
(
ErrCode
code
);
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment