MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / LoadImageFromFile

Method LoadImageFromFile

plugins/video/macro-condition-video.cpp:250–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250bool MacroConditionVideo::LoadImageFromFile()
251{
252 const QFileInfo info(QString::fromStdString(_file));
253 _loadedFileLastModified = info.lastModified();
254 _loadedFile = _file;
255 if (!_matchImage.load(info.absoluteFilePath())) {
256 blog(LOG_WARNING, "Cannot load image data from file '%s'",
257 _file.c_str());
258 (&_matchImage)->~QImage();
259 new (&_matchImage) QImage();
260 _patternImageData = {};
261 return false;
262 }
263
264 _matchImage =
265 _matchImage.convertToFormat(QImage::Format::Format_RGBA8888);
266 _patternMatchParameters.image = _matchImage;
267 _patternImageData = CreatePatternData(_matchImage);
268
269 emit InputFileChanged();
270 return true;
271}
272
273void MacroConditionVideo::SetPageSegMode(tesseract::PageSegMode mode)
274{

Callers 3

ConditionChangedMethod · 0.80
ImagePathChangedMethod · 0.80
UseAlphaAsMaskChangedMethod · 0.80

Calls 3

CreatePatternDataFunction · 0.85
loadMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected