add hashing and operator== to Description
This commit is contained in:
@ -175,8 +175,8 @@ bool Camera::chooseFormat()
|
|||||||
switch(formats[i])
|
switch(formats[i])
|
||||||
{
|
{
|
||||||
case ARV_PIXEL_FORMAT_MONO_8:
|
case ARV_PIXEL_FORMAT_MONO_8:
|
||||||
case ARV_PIXEL_FORMAT_MONO_10:
|
//case ARV_PIXEL_FORMAT_MONO_10:
|
||||||
case ARV_PIXEL_FORMAT_MONO_12:
|
//case ARV_PIXEL_FORMAT_MONO_12:
|
||||||
case ARV_PIXEL_FORMAT_RGB_8_PLANAR:
|
case ARV_PIXEL_FORMAT_RGB_8_PLANAR:
|
||||||
case ARV_PIXEL_FORMAT_BAYER_BG_8:
|
case ARV_PIXEL_FORMAT_BAYER_BG_8:
|
||||||
format = formats[i];
|
format = formats[i];
|
||||||
|
13
uvoscam.h
13
uvoscam.h
@ -37,12 +37,23 @@ class Camera
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct Description
|
class Description
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
std::string vendor;
|
std::string vendor;
|
||||||
std::string serial;
|
std::string serial;
|
||||||
std::string id;
|
std::string id;
|
||||||
std::string model;
|
std::string model;
|
||||||
|
|
||||||
|
size_t getHash() const
|
||||||
|
{
|
||||||
|
return std::hash<std::string>{}(vendor + serial + id + model);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const Description& in) const
|
||||||
|
{
|
||||||
|
return in.getHash() == getHash();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr size_t BUFFER_DEPTH = 8;
|
static constexpr size_t BUFFER_DEPTH = 8;
|
||||||
|
Reference in New Issue
Block a user