]> git.cworth.org Git - apitrace/blobdiff - gui/apisurface.h
Rescale the image pixels using the full precision.
[apitrace] / gui / apisurface.h
index 9c7115ec2b4696844157be6ec757585758d82013..ed6debe6ec2e662be64ddaee6d3098f961d0c6c8 100644 (file)
@@ -5,6 +5,10 @@
 #include <QSize>
 #include <QString>
 
+namespace image {
+    class Image;
+}
+
 class ApiSurface
 {
 public:
@@ -13,23 +17,31 @@ public:
     QSize size() const;
     void setSize(const QSize &size);
 
-    int numChannels() const;
-    void setNumChannels(int numChannels);
-
     int depth() const;
     void setDepth(int depth);
 
+    QString formatName() const;
+    void setFormatName(const QString &str);
+
     void contentsFromBase64(const QByteArray &base64);
 
-    QImage image() const;
+    QByteArray base64Data() const;
     QImage thumb() const;
 
+    static image::Image *imageFromBase64(const QByteArray &data);
+    static QImage qimageFromRawImage(const image::Image *img,
+                                     float lowerValue = 0.0f,
+                                     float upperValue = 1.0f,
+                                     bool opaque = false,
+                                     bool alpha = false);
+
 private:
     QSize  m_size;
     int m_numChannels;
-    QImage m_image;
+    QByteArray m_base64Data;
     QImage m_thumb;
     int m_depth;
+    QString m_formatName;
 };