diff options
author | Sebastian Fricke <sebastian.fricke@posteo.net> | 2021-01-26 19:48:52 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-02-04 21:00:38 +0200 |
commit | c440c828bc071effb76e60968c9d4a4a74c134df (patch) | |
tree | dc1cd84c3e2c0fe82189d06961d253806ad626a1 /include | |
parent | 11a946bc22212abd9eef467633e8ab359df57299 (diff) |
libcamera: bayer_format: Overload ==/!= operators for BayerFormats
Enable to test two Bayer formats for equality by checking if the order
of the color channels, the bit depth of the pattern, and the packing
scheme match. Additionally, add the reverse operation (!=), which negates
the equality test result.
Signed-off-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/internal/bayer_format.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h index 62814154..5b8c1dc9 100644 --- a/include/libcamera/internal/bayer_format.h +++ b/include/libcamera/internal/bayer_format.h @@ -57,6 +57,12 @@ public: Packing packing; }; +bool operator==(const BayerFormat &lhs, const BayerFormat &rhs); +static inline bool operator!=(const BayerFormat &lhs, const BayerFormat &rhs) +{ + return !(lhs == rhs); +} + } /* namespace libcamera */ #endif /* __LIBCAMERA_INTERNAL_BAYER_FORMAT_H__ */ |