An error occurred while loading the file. Please try again.
-
John Koleszar authored
This allows removing a large number of transform size specific functions, as well as supporting 444/alpha by routing all code through the subsampling-aware path. Change-Id: Ieb085cebe9f37f24fc24de179898b22abfda08a4
4529c68b
lipiworker.cpp 5.83 KiB
/****************************************************************************
**
** Copyright (C) 2015 Digia Plc
** All rights reserved.
** For any questions to Digia, please use contact form at http://www.qt.io
**
** This file is part of the Qt Virtual Keyboard add-on for Qt Enterprise.
**
** Licensees holding valid Qt Enterprise licenses may use this file in
** accordance with the Qt Enterprise License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** contact form at http://www.qt.io
**
****************************************************************************/
#include "lipiworker.h"
#include "virtualkeyboarddebug.h"
#include <QTime>
#include "LTKShapeRecognizer.h"
#include "LTKErrors.h"
void LipiLoadModelDataTask::run()
{
VIRTUALKEYBOARD_DEBUG() << "LipiLoadModelDataTask::run()";
#ifdef QT_VIRTUALKEYBOARD_DEBUG
QTime perf;
perf.start();
#endif
int result = shapeRecognizer->loadModelData();
#ifdef QT_VIRTUALKEYBOARD_DEBUG
VIRTUALKEYBOARD_DEBUG() << "LipiLoadModelDataTask::run(): time:" << perf.elapsed() << "ms";
#endif
if (result != SUCCESS)
qWarning() << QString("Error %1: %2").arg(result).arg(getErrorMessage(result).c_str());
}
LipiRecognitionTask::LipiRecognitionTask(const LTKCaptureDevice& deviceInfo,
const LTKScreenContext& screenContext,
const vector<int>& inSubsetOfClasses,
float confThreshold,
int numChoices,
int resultId) :
LipiTask(),
deviceInfo(deviceInfo),
screenContext(screenContext),
inSubsetOfClasses(inSubsetOfClasses),
confThreshold(confThreshold),
numChoices(numChoices),
resultVector(new vector<LTKShapeRecoResult>()),
_resultId(resultId),
stateRunning(false),
stateCancelled(false)
{
}
void LipiRecognitionTask::run()
{
VIRTUALKEYBOARD_DEBUG() << "LipiRecognitionTask::run()";
if (!shapeRecognizer || !resultVector)
return;
{
QMutexLocker stateGuard(&stateLock);
stateRunning = true;