Mech-Eye API 2.4.0
API reference documentation for Mech-Eye 3D Laser Profiler
Loading...
Searching...
No Matches
ProfileData.h
1#pragma once
2#include "api_global.h"
3#include "BatchArray.h"
4#include "CommonTypes.h"
5#include "ErrorStatus.h"
6
7namespace mmind {
8namespace eye {
9
10class ProfileBatchImpl;
11
15struct Profile
16{
17 unsigned int profileIndex{0};
18 unsigned int encoder{0};
19 const unsigned char* intensity{nullptr};
20 const float* depth{nullptr};
22};
23
29class MMIND_API_EXPORT ProfileBatch
30{
31public:
35 enum class BatchFlag {
36 Success =
37 0,
38 Incomplete = 0x1,
40 };
41
42 using ProfileIndexArray = BatchArray<unsigned int>;
43 using EncoderArray = BatchArray<unsigned int>;
44 using IntensityImage = BatchArray<unsigned char>;
45 using DepthMap = BatchArray<float>;
46
50 ProfileBatch(size_t width);
51
55 ~ProfileBatch() = default;
56
60 size_t width() const;
61
65 size_t height() const;
66
71 size_t validHeight() const;
72
76 bool isEmpty() const;
77
81 void reserve(size_t height);
82
86 bool append(const ProfileBatch& batch);
87
91 void clear();
92
96 Profile getProfile(size_t profileIndex) const;
97
103
109
114
125
129 int getFlag() const;
130
134 bool checkFlag(BatchFlag flag) const;
135
136private:
137 std::shared_ptr<ProfileBatchImpl> _impl;
138 friend class ProfilerImpl;
139 friend class VirtualProfilerImpl;
140};
141} // namespace eye
142} // namespace mmind
Represents the data struct of the profile data.
Definition BatchArray.h:15
Represents a batch of profiles, which can be obtained by calling Profiler::retrieveBatchData()....
Definition ProfileData.h:30
bool isEmpty() const
Checks if the ProfileBatch object has no elements.
EncoderArray getEncoderArray() const
Gets an array of encoder values of all profiles in the batch. Each profile data corresponds to an enc...
IntensityImage getIntensityImage() const
Gets the intensity image data in the batch. The invalid data of intensity image is 0.
int getFlag() const
Gets the flags of the ProfileBatch object. See BatchFlag for details.
void reserve(size_t height)
Reserves the input height for the ProfileBatch object.
size_t validHeight() const
Returns the valid height of the ProfileBatch object (the number of profiles with valid intensity and ...
void clear()
Clears the data in the ProfileBatch object.
~ProfileBatch()=default
Default destructor.
bool checkFlag(BatchFlag flag) const
Checks if the BatchFlag value of the ProfileBatch object matches the input value.
ProfileBatch(size_t width)
Constructor.
ProfileIndexArray getProfileIndexArray() const
Gets an array of indices of all profiles in the batch. Each profile data corresponds to an index.
size_t width() const
Returns the width of the ProfileBatch object (the number of data points per profile).
ErrorStatus getErrorStatus() const
Gets the error code and description of the function.
bool append(const ProfileBatch &batch)
Appends the data of one ProfileBatch object to another.
size_t height() const
Returns the height of the ProfileBatch object (the number of profiles in the batch).
BatchFlag
Describes the status of the ProfileBatch object.
Definition ProfileData.h:35
DepthMap getDepthMap() const
Gets the depth map data in the batch. Each point in DepthMap contains the Z information in the laser ...
Profile getProfile(size_t profileIndex) const
Gets a profile in the batch by inputting the index of the profile.
Describes the types of errors.
Definition ErrorStatus.h:12
Describes a single profile.
Definition ProfileData.h:16
const unsigned char * intensity
Pointer to the intensity values of the profile.
Definition ProfileData.h:19
unsigned int encoder
Corresponding encoder value of the profile.
Definition ProfileData.h:18
const float * depth
Definition ProfileData.h:20
unsigned int profileIndex
Index of the profile.
Definition ProfileData.h:17