]> git.cworth.org Git - apitrace/blob - gui/apisurface.h
retrace: Implement glxCopySubBufferMESA
[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                                      float lowerValue = 0.0f,
34                                      float upperValue = 1.0f,
35                                      bool opaque = false,
36                                      bool alpha = false);
37
38 private:
39     QSize  m_size;
40     int m_numChannels;
41     QByteArray m_base64Data;
42     QImage m_thumb;
43     int m_depth;
44     QString m_formatName;
45 };
46
47
48 class ApiTexture : public ApiSurface
49 {
50 public:
51     ApiTexture();
52
53     QString label() const;
54     void setLabel(const QString &str);
55
56 private:
57     QString m_label;
58 };
59
60 class ApiFramebuffer : public ApiSurface
61 {
62 public:
63     ApiFramebuffer();
64
65     QString type() const;
66     void setType(const QString &str);
67
68 private:
69     QString m_type;
70
71 };
72
73 #endif