]> git.cworth.org Git - apitrace/blobdiff - gui/apisurface.h
gui: show the original pixel values in the surface viewer
[apitrace] / gui / apisurface.h
index 50dd5d0ce68c771a3d035cb9ea44f4471fb2ed6e..79afaf927ca5ccc9780b0de69dfb430d0e8814d4 100644 (file)
@@ -5,6 +5,10 @@
 #include <QSize>
 #include <QString>
 
+namespace image {
+    class Image;
+}
+
 class ApiSurface
 {
 public:
@@ -13,15 +17,27 @@ public:
     QSize size() const;
     void setSize(const QSize &size);
 
+    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);
+
 private:
     QSize  m_size;
-    QImage m_image;
+    int m_numChannels;
+    QByteArray m_base64Data;
     QImage m_thumb;
+    int m_depth;
+    QString m_formatName;
 };
 
 
@@ -30,19 +46,24 @@ class ApiTexture : public ApiSurface
 public:
     ApiTexture();
 
-    int unit() const;
-    void setUnit(int un);
+    QString label() const;
+    void setLabel(const QString &str);
+
+private:
+    QString m_label;
+};
 
-    int level() const;
-    void setLevel(int l);
+class ApiFramebuffer : public ApiSurface
+{
+public:
+    ApiFramebuffer();
 
-    QString target() const;
-    void setTarget(const QString &str);
+    QString type() const;
+    void setType(const QString &str);
 
 private:
-    int m_unit;
-    int m_level;
-    QString m_target;
+    QString m_type;
+
 };
 
 #endif