From 8f6f2604a40efcbdbfd04cdf7b21f7c955e0a72f Mon Sep 17 00:00:00 2001 From: Jules Fouchy Date: Thu, 17 Oct 2024 19:30:34 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Image.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Image.cpp b/src/Image.cpp index 40d4093..dc82ddb 100644 --- a/src/Image.cpp +++ b/src/Image.cpp @@ -83,12 +83,12 @@ static auto YUYV_to_RGB24(uint8_t const* yuyv, Resolution resolution) -> std::sh int const g1 = (y1 - 88 * u - 183 * v) >> 8; int const b1 = (y1 + 454 * u) >> 8; - rgb_data[i * 3 / 2 + 0] = std::clamp(r0, 0, 255); // NOLINT(*pointer-arithmetic) - rgb_data[i * 3 / 2 + 1] = std::clamp(g0, 0, 255); // NOLINT(*pointer-arithmetic) - rgb_data[i * 3 / 2 + 2] = std::clamp(b0, 0, 255); // NOLINT(*pointer-arithmetic) - rgb_data[i * 3 / 2 + 3] = std::clamp(r1, 0, 255); // NOLINT(*pointer-arithmetic) - rgb_data[i * 3 / 2 + 4] = std::clamp(g1, 0, 255); // NOLINT(*pointer-arithmetic) - rgb_data[i * 3 / 2 + 5] = std::clamp(b1, 0, 255); // NOLINT(*pointer-arithmetic) + rgb_data[i * 3 / 2 + 0] = static_cast(std::clamp(r0, 0, 255)); // NOLINT(*pointer-arithmetic) + rgb_data[i * 3 / 2 + 1] = static_cast(std::clamp(g0, 0, 255)); // NOLINT(*pointer-arithmetic) + rgb_data[i * 3 / 2 + 2] = static_cast(std::clamp(b0, 0, 255)); // NOLINT(*pointer-arithmetic) + rgb_data[i * 3 / 2 + 3] = static_cast(std::clamp(r1, 0, 255)); // NOLINT(*pointer-arithmetic) + rgb_data[i * 3 / 2 + 4] = static_cast(std::clamp(g1, 0, 255)); // NOLINT(*pointer-arithmetic) + rgb_data[i * 3 / 2 + 5] = static_cast(std::clamp(b1, 0, 255)); // NOLINT(*pointer-arithmetic) } return std::shared_ptr{rgb_data};