]> git.cworth.org Git - apitrace/blob - gui/apisurface.cpp
bfc6cfdf128038d6e6b18a6afb057ebeb53e50e2
[apitrace] / gui / apisurface.cpp
1 #include "apisurface.h"
2 #include "thumbnail.h"
3
4 #include <QDebug>
5 #include <QSysInfo>
6
7 ApiSurface::ApiSurface()
8 {
9 }
10
11 QSize ApiSurface::size() const
12 {
13     return m_size;
14 }
15
16 void ApiSurface::setSize(const QSize &size)
17 {
18     m_size = size;
19 }
20
21 int ApiSurface::numChannels() const
22 {
23     return m_numChannels;
24 }
25
26 void ApiSurface::setNumChannels(int numChannels)
27 {
28     m_numChannels = numChannels;
29 }
30
31 void ApiSurface::contentsFromBase64(const QByteArray &base64)
32 {
33     QByteArray dataArray = QByteArray::fromBase64(base64);
34     m_image.loadFromData(dataArray, "png");
35     m_thumb = thumbnail(m_image);
36 }
37
38 QImage ApiSurface::image() const
39 {
40     return m_image;
41 }
42
43 QImage ApiSurface::thumb() const
44 {
45     return m_thumb;
46 }
47
48 int ApiSurface::depth() const
49 {
50     return m_depth;
51 }
52
53 void ApiSurface::setDepth(int depth)
54 {
55     m_depth = depth;
56 }
57
58 QString ApiSurface::formatName() const
59 {
60     return m_formatName;
61 }
62
63 void ApiSurface::setFormatName(const QString &str)
64 {
65     m_formatName = str;
66 }
67
68
69 ApiTexture::ApiTexture()
70     : ApiSurface()
71 {
72 }
73
74 QString ApiTexture::label() const
75 {
76     return m_label;
77 }
78
79 void ApiTexture::setLabel(const QString &str)
80 {
81     m_label = str;
82 }
83
84 ApiFramebuffer::ApiFramebuffer()
85     : ApiSurface()
86 {
87 }
88
89 QString ApiFramebuffer::type() const
90 {
91     return m_type;
92 }
93
94 void ApiFramebuffer::setType(const QString &str)
95 {
96     m_type = str;
97 }
98