]> git.cworth.org Git - apitrace/blob - gui/apisurface.cpp
Add depth info to the surfaces.
[apitrace] / gui / apisurface.cpp
1 #include "apisurface.h"
2
3 #include <QDebug>
4 #include <QSysInfo>
5
6 ApiSurface::ApiSurface()
7 {
8 }
9
10 QSize ApiSurface::size() const
11 {
12     return m_size;
13 }
14
15 void ApiSurface::setSize(const QSize &size)
16 {
17     m_size = size;
18 }
19
20 int ApiSurface::numChannels() const
21 {
22     return m_numChannels;
23 }
24
25 void ApiSurface::setNumChannels(int numChannels)
26 {
27     m_numChannels = numChannels;
28 }
29
30 void ApiSurface::contentsFromBase64(const QByteArray &base64)
31 {
32     QByteArray dataArray = QByteArray::fromBase64(base64);
33     m_image.loadFromData(dataArray, "png");
34     m_thumb = m_image.scaled(64, 64, Qt::KeepAspectRatio);
35 }
36
37 QImage ApiSurface::image() const
38 {
39     return m_image;
40 }
41
42 QImage ApiSurface::thumb() const
43 {
44     return m_thumb;
45 }
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 ApiTexture::ApiTexture()
59     : ApiSurface()
60 {
61 }
62
63 QString ApiTexture::label() const
64 {
65     return m_label;
66 }
67
68 void ApiTexture::setLabel(const QString &str)
69 {
70     m_label = str;
71 }
72
73 ApiFramebuffer::ApiFramebuffer()
74     : ApiSurface()
75 {
76 }
77
78 QString ApiFramebuffer::type() const
79 {
80     return m_type;
81 }
82
83 void ApiFramebuffer::setType(const QString &str)
84 {
85     m_type = str;
86 }
87