f2b2a7eb4a
Implement the basic barebone structure of GIF recording. While it is likely broken (probably black frames and similar issues) it's a good start. Good night.
31 lines
686 B
C++
31 lines
686 B
C++
#ifndef RECORDINGFORMATS_HPP
|
|
#define RECORDINGFORMATS_HPP
|
|
|
|
#include <QDir>
|
|
#include <QFile>
|
|
#include <QImage>
|
|
#include <QString>
|
|
#include <functional>
|
|
|
|
class RecordingFormats {
|
|
public:
|
|
enum Format { GIF, None };
|
|
RecordingFormats(Format f);
|
|
std::function<void(QImage)> getConsumer();
|
|
std::function<QByteArray()> getFinalizer();
|
|
std::function<bool()> getValidator();
|
|
QImage::Format getFormat();
|
|
|
|
static QString getExt(Format f);
|
|
|
|
private:
|
|
std::function<void(QImage)> consumer;
|
|
std::function<bool()> validator;
|
|
std::function<QByteArray()> finalizer;
|
|
QImage::Format iFormat;
|
|
QDir tmpDir;
|
|
int frame = 0;
|
|
};
|
|
|
|
#endif // RECORDINGFORMATS_HPP
|