diff --git a/src/effects/Mask.cpp b/src/effects/Mask.cpp index 69f6e63f..bf720c0b 100644 --- a/src/effects/Mask.cpp +++ b/src/effects/Mask.cpp @@ -110,13 +110,13 @@ std::shared_ptr Mask::GetFrame(std::shared_ptr // Get the average luminosity int gray_value = qGray(R, G, B); + // Adjust the brightness + gray_value += (255 * brightness_value); + // Adjust the contrast float factor = (259 * (contrast_value + 255)) / (255 * (259 - contrast_value)); gray_value = constrain((factor * (gray_value - 128)) + 128); - // Adjust the brightness - gray_value += (255 * brightness_value); - // Constrain the value from 0 to 255 gray_value = constrain(gray_value);