| 248 | } |
| 249 | |
| 250 | bool 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 | |
| 273 | void MacroConditionVideo::SetPageSegMode(tesseract::PageSegMode mode) |
| 274 | { |
no test coverage detected