Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 1 | #include "apisurface.h" |
José Fonseca | 3f45640 | 2012-03-25 20:59:24 +0100 | [diff] [blame] | 2 | #include "thumbnail.h" |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 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 | |||||
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 21 | void ApiSurface::contentsFromBase64(const QByteArray &base64) |
22 | { | ||||
23 | QByteArray dataArray = QByteArray::fromBase64(base64); | ||||
Zack Rusin | aa0a782 | 2011-04-25 00:05:48 -0400 | [diff] [blame] | 24 | m_image.loadFromData(dataArray, "png"); |
José Fonseca | 3f45640 | 2012-03-25 20:59:24 +0100 | [diff] [blame] | 25 | m_thumb = thumbnail(m_image); |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 26 | } |
27 | |||||
28 | QImage ApiSurface::image() const | ||||
29 | { | ||||
30 | return m_image; | ||||
31 | } | ||||
32 | |||||
33 | QImage ApiSurface::thumb() const | ||||
34 | { | ||||
35 | return m_thumb; | ||||
36 | } | ||||
37 | |||||
Zack Rusin | b25c4b9 | 2011-11-16 22:43:34 -0500 | [diff] [blame] | 38 | int ApiSurface::depth() const |
39 | { | ||||
40 | return m_depth; | ||||
41 | } | ||||
42 | |||||
43 | void ApiSurface::setDepth(int depth) | ||||
44 | { | ||||
45 | m_depth = depth; | ||||
46 | } | ||||
47 | |||||
Zack Rusin | e181b99 | 2011-11-17 16:00:41 -0500 | [diff] [blame] | 48 | QString ApiSurface::formatName() const |
49 | { | ||||
50 | return m_formatName; | ||||
51 | } | ||||
52 | |||||
53 | void ApiSurface::setFormatName(const QString &str) | ||||
54 | { | ||||
55 | m_formatName = str; | ||||
56 | } | ||||
57 | |||||
58 | |||||
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 59 | ApiTexture::ApiTexture() |
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 60 | : ApiSurface() |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 61 | { |
62 | } | ||||
63 | |||||
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 64 | QString ApiTexture::label() const |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 65 | { |
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 66 | return m_label; |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 67 | } |
68 | |||||
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 69 | void ApiTexture::setLabel(const QString &str) |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 70 | { |
José Fonseca | 18081d5 | 2011-05-07 00:10:25 +0100 | [diff] [blame] | 71 | m_label = str; |
Zack Rusin | 952e9d4 | 2011-04-09 23:37:21 -0400 | [diff] [blame] | 72 | } |
Zack Rusin | a684641 | 2011-04-10 19:51:44 -0400 | [diff] [blame] | 73 | |
74 | ApiFramebuffer::ApiFramebuffer() | ||||
75 | : ApiSurface() | ||||
76 | { | ||||
77 | } | ||||
78 | |||||
79 | QString ApiFramebuffer::type() const | ||||
80 | { | ||||
81 | return m_type; | ||||
82 | } | ||||
83 | |||||
84 | void ApiFramebuffer::setType(const QString &str) | ||||
85 | { | ||||
86 | m_type = str; | ||||
87 | } | ||||
Zack Rusin | b25c4b9 | 2011-11-16 22:43:34 -0500 | [diff] [blame] | 88 |