Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
image_decoder.h
Go to the documentation of this file.
1#ifndef IMAGE_DECODER_H
2#define IMAGE_DECODER_H
3
4#include <QObject>
5
14class ImageDecoder final : public QObject {
15 Q_OBJECT
16
17public:
23 explicit ImageDecoder(const QByteArray &image_data, QObject *parent = nullptr)
24 : QObject(parent), image_data_(image_data) {
25 }
26
31 ~ImageDecoder() override {
32 }
33
38 static void ReleaseResources() {
39 }
40
47 QImage Decode();
48
49signals:
54 void imageReady(const QImage &image);
55
60 void error(const QString &message);
61
68 void imageInfo(int width, int height, bool has_alpha);
69
70private:
72 QByteArray image_data_;
73};
74
75#endif // IMAGE_DECODER_H
void imageReady(const QImage &image)
Emitted when the image has been successfully decoded.
void imageInfo(int width, int height, bool has_alpha)
Emitted after successful decoding, providing basic image information.
QImage Decode()
Attempts to decode the image data stored internally. Uses QImage::loadFromData() to perform the decod...
Definition image_decoder.cpp:5
ImageDecoder(const QByteArray &image_data, QObject *parent=nullptr)
Constructs an ImageDecoder object.
Definition image_decoder.h:23
~ImageDecoder() override
Destructor. Does not require special resource management like FFmpeg-based decoders.
Definition image_decoder.h:31
void error(const QString &message)
Emitted if an error occurs during image loading or decoding.
static void ReleaseResources()
Static method placeholder for resource release. In this Qt-based implementation, there are no specifi...
Definition image_decoder.h:38
QByteArray image_data_
Stores the raw image data provided in the constructor.
Definition image_decoder.h:72