Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit 698a22a

Browse files
committed
Fix v4l2 signal threshold comparison
1 parent ed6fbd9 commit 698a22a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

deploy/hyperion.tar.gz

0 Bytes
Binary file not shown.

include/utils/ColorRgb.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,9 @@ inline bool operator<(const ColorRgb & lhs, const ColorRgb & rhs)
5555
{
5656
return (lhs.red < rhs.red) && (lhs.green < rhs.green) && (lhs.blue < rhs.blue);
5757
}
58+
59+
/// Compare operator to check if a color is 'smaller' than or 'equal' to another color
60+
inline bool operator<=(const ColorRgb & lhs, const ColorRgb & rhs)
61+
{
62+
return (lhs.red <= rhs.red) && (lhs.green <= rhs.green) && (lhs.blue <= rhs.blue);
63+
}

libsrc/grabber/v4l2/V4L2Grabber.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ void V4L2Grabber::process_image(const uint8_t * data)
695695

696696
ColorRgb & rgb = image(xDest, yDest);
697697
yuv2rgb(y, u, v, rgb.red, rgb.green, rgb.blue);
698-
noSignal &= rgb < _noSignalThresholdColor;
698+
noSignal &= rgb <= _noSignalThresholdColor;
699699
}
700700
}
701701

0 commit comments

Comments
 (0)