Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 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 | |||||
José Fonseca | b794df1 | 2011-04-12 08:28:45 +0100 | [diff] [blame] | 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 | |||||
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 30 | void ApiSurface::contentsFromBase64(const QByteArray &base64) |
31 | { | ||||
32 | QByteArray dataArray = QByteArray::fromBase64(base64); | ||||
Zack Rusin | aa0a782 | 2011-04-25 00:05:48 -0400 | [diff] [blame] | 33 | m_image.loadFromData(dataArray, "png"); |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 34 | m_thumb = m_image.scaled(64, 64, Qt::KeepAspectRatio); |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 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 | |||||
Zack Rusin | b25c4b9 | 2011-11-16 22:43:34 -0500 | [diff] [blame] | 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 | |||||
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 58 | ApiTexture::ApiTexture() |
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 59 | : ApiSurface() |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 60 | { |
61 | } | ||||
62 | |||||
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 63 | QString ApiTexture::label() const |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 64 | { |
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 65 | return m_label; |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 66 | } |
67 | |||||
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 68 | void ApiTexture::setLabel(const QString &str) |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 69 | { |
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 70 | m_label = str; |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 71 | } |
Zack Rusin | a684641 | 2011-04-10 19:51:44 -0400 | [diff] [blame] | 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 | } | ||||
Zack Rusin | b25c4b9 | 2011-11-16 22:43:34 -0500 | [diff] [blame] | 87 |