Fix exact image match not wokring when using images with alpha channel

The screenshots taken from video sources were using the image format
Format_RGBX8888 instead of Format_RGBA8888.
The alpha channel of screenshots taken from OBS would be blended with a
black background while this step would be not performed for files loaded
to macht match the video sources.
This commit is contained in:
WarmUpTill 2021-10-17 20:08:50 +02:00 committed by WarmUpTill
parent b2da8faf37
commit 254eabfa8d
3 changed files with 4 additions and 9 deletions

View File

@ -222,13 +222,8 @@ bool MacroConditionVideo::LoadImageFromFile()
return false;
}
if (_condition == VideoCondition::PATTERN && _useAlphaAsMask) {
_matchImage = _matchImage.convertToFormat(
QImage::Format::Format_RGBA8888);
} else {
_matchImage = _matchImage.convertToFormat(
QImage::Format::Format_RGBX8888);
}
_matchImage =
_matchImage.convertToFormat(QImage::Format::Format_RGBA8888);
_patternData = createPatternData(_matchImage);
return true;
}

View File

@ -79,7 +79,7 @@ void AdvSSScreenshotObj::Copy()
uint8_t *videoData = nullptr;
uint32_t videoLinesize = 0;
image = QImage(cx, cy, QImage::Format::Format_RGBX8888);
image = QImage(cx, cy, QImage::Format::Format_RGBA8888);
if (gs_stagesurface_map(stagesurf, &videoData, &videoLinesize)) {
int linesize = image.bytesPerLine();

View File

@ -266,7 +266,7 @@ bool VideoSwitch::loadImageFromFile()
return false;
}
matchImage =
matchImage.convertToFormat(QImage::Format::Format_RGBX8888);
matchImage.convertToFormat(QImage::Format::Format_RGBA8888);
return true;
}