2023-10-26 12:53:25 +02:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
|
|
|
|
|
|
#ifndef RECIPE_H
|
|
|
|
|
#define RECIPE_H
|
|
|
|
|
|
|
|
|
|
#include <QImage>
|
|
|
|
|
#include <QMap>
|
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
|
|
namespace Tasking {
|
|
|
|
|
class Group;
|
|
|
|
|
template <typename T>
|
2023-11-19 14:50:55 +01:00
|
|
|
class Storage;
|
2023-10-26 12:53:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const int s_sizeInterval = 10;
|
|
|
|
|
static const int s_imageCount = 100;
|
|
|
|
|
static const int s_maxSize = s_sizeInterval * s_imageCount;
|
|
|
|
|
|
|
|
|
|
class QNetworkAccessManager;
|
|
|
|
|
|
2024-01-14 15:06:27 +01:00
|
|
|
// TODO: Add an QObject with signal for feeding the images progressively.
|
2023-10-26 12:53:25 +02:00
|
|
|
class ExternalData
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QNetworkAccessManager *inputNam = nullptr;
|
|
|
|
|
QUrl inputUrl;
|
|
|
|
|
QMap<int, QImage> outputImages;
|
|
|
|
|
std::optional<QString> outputError;
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-19 14:50:55 +01:00
|
|
|
Tasking::Group recipe(const Tasking::Storage<ExternalData> &externalStorage);
|
2023-10-26 12:53:25 +02:00
|
|
|
|
|
|
|
|
#endif // RECIPE_H
|