blob: b8e820bc82f16f333aed5639fa0e59e93207f0f8 [file] [log] [blame]
Zack Rusin952e9d42011-04-09 23:37:21 -04001#include "apisurface.h"
2
3#include <QDebug>
4#include <QSysInfo>
5
6ApiSurface::ApiSurface()
7{
8}
9
10QSize ApiSurface::size() const
11{
12 return m_size;
13}
14
15void ApiSurface::setSize(const QSize &size)
16{
17 m_size = size;
18}
19
José Fonsecab794df12011-04-12 08:28:45 +010020int ApiSurface::numChannels() const
21{
22 return m_numChannels;
23}
24
25void ApiSurface::setNumChannels(int numChannels)
26{
27 m_numChannels = numChannels;
28}
29
Zack Rusin952e9d42011-04-09 23:37:21 -040030void ApiSurface::contentsFromBase64(const QByteArray &base64)
31{
32 QByteArray dataArray = QByteArray::fromBase64(base64);
Zack Rusinaa0a7822011-04-25 00:05:48 -040033 m_image.loadFromData(dataArray, "png");
Zack Rusin952e9d42011-04-09 23:37:21 -040034 m_thumb = m_image.scaled(64, 64, Qt::KeepAspectRatio);
Zack Rusin952e9d42011-04-09 23:37:21 -040035}
36
37QImage ApiSurface::image() const
38{
39 return m_image;
40}
41
42QImage ApiSurface::thumb() const
43{
44 return m_thumb;
45}
46
Zack Rusinb25c4b92011-11-16 22:43:34 -050047
48int ApiSurface::depth() const
49{
50 return m_depth;
51}
52
53void ApiSurface::setDepth(int depth)
54{
55 m_depth = depth;
56}
57
Zack Rusin952e9d42011-04-09 23:37:21 -040058ApiTexture::ApiTexture()
José Fonseca18081d52011-05-07 00:10:25 +010059 : ApiSurface()
Zack Rusin952e9d42011-04-09 23:37:21 -040060{
61}
62
José Fonseca18081d52011-05-07 00:10:25 +010063QString ApiTexture::label() const
Zack Rusin952e9d42011-04-09 23:37:21 -040064{
José Fonseca18081d52011-05-07 00:10:25 +010065 return m_label;
Zack Rusin952e9d42011-04-09 23:37:21 -040066}
67
José Fonseca18081d52011-05-07 00:10:25 +010068void ApiTexture::setLabel(const QString &str)
Zack Rusin952e9d42011-04-09 23:37:21 -040069{
José Fonseca18081d52011-05-07 00:10:25 +010070 m_label = str;
Zack Rusin952e9d42011-04-09 23:37:21 -040071}
Zack Rusina6846412011-04-10 19:51:44 -040072
73ApiFramebuffer::ApiFramebuffer()
74 : ApiSurface()
75{
76}
77
78QString ApiFramebuffer::type() const
79{
80 return m_type;
81}
82
83void ApiFramebuffer::setType(const QString &str)
84{
85 m_type = str;
86}
Zack Rusinb25c4b92011-11-16 22:43:34 -050087