]> git.cworth.org Git - apitrace/blob - gui/apisurface.h
79afaf927ca5ccc9780b0de69dfb430d0e8814d4
[apitrace] / gui / apisurface.h
1 #ifndef APISURFACE_H
2 #define APISURFACE_H
3
4 #include <QImage>
5 #include <QSize>
6 #include <QString>
7
8 namespace image {
9     class Image;
10 }
11
12 class ApiSurface
13 {
14 public:
15     ApiSurface();
16
17     QSize size() const;
18     void setSize(const QSize &size);
19
20     int depth() const;
21     void setDepth(int depth);
22
23     QString formatName() const;
24     void setFormatName(const QString &str);
25
26     void contentsFromBase64(const QByteArray &base64);
27
28     QByteArray base64Data() const;
29     QImage thumb() const;
30
31     static image::Image *imageFromBase64(const QByteArray &data);
32     static QImage qimageFromRawImage(const image::Image *img);
33
34 private:
35     QSize  m_size;
36     int m_numChannels;
37     QByteArray m_base64Data;
38     QImage m_thumb;
39     int m_depth;
40     QString m_formatName;
41 };
42
43
44 class ApiTexture : public ApiSurface
45 {
46 public:
47     ApiTexture();
48
49     QString label() const;
50     void setLabel(const QString &str);
51
52 private:
53     QString m_label;
54 };
55
56 class ApiFramebuffer : public ApiSurface
57 {
58 public:
59     ApiFramebuffer();
60
61     QString type() const;
62     void setType(const QString &str);
63
64 private:
65     QString m_type;
66
67 };
68
69 #endif