From b25c4b9fccc76976d633bc5b183a84553ab01998 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 16 Nov 2011 22:43:34 -0500 Subject: [PATCH] Add depth info to the surfaces. --- gui/apisurface.cpp | 12 ++++++++++++ gui/apisurface.h | 4 ++++ gui/apitracecall.cpp | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/gui/apisurface.cpp b/gui/apisurface.cpp index 050c081..b8e820b 100644 --- a/gui/apisurface.cpp +++ b/gui/apisurface.cpp @@ -44,6 +44,17 @@ QImage ApiSurface::thumb() const return m_thumb; } + +int ApiSurface::depth() const +{ + return m_depth; +} + +void ApiSurface::setDepth(int depth) +{ + m_depth = depth; +} + ApiTexture::ApiTexture() : ApiSurface() { @@ -73,3 +84,4 @@ void ApiFramebuffer::setType(const QString &str) { m_type = str; } + diff --git a/gui/apisurface.h b/gui/apisurface.h index bdf21a3..9c7115e 100644 --- a/gui/apisurface.h +++ b/gui/apisurface.h @@ -16,6 +16,9 @@ public: int numChannels() const; void setNumChannels(int numChannels); + int depth() const; + void setDepth(int depth); + void contentsFromBase64(const QByteArray &base64); QImage image() const; @@ -26,6 +29,7 @@ private: int m_numChannels; QImage m_image; QImage m_thumb; + int m_depth; }; diff --git a/gui/apitracecall.cpp b/gui/apitracecall.cpp index 5f2d976..26f20ba 100644 --- a/gui/apitracecall.cpp +++ b/gui/apitracecall.cpp @@ -458,6 +458,8 @@ ApiTraceState::ApiTraceState(const QVariantMap &parsedJson) image[QLatin1String("__normalized__")].toBool(); int numChannels = image[QLatin1String("__channels__")].toInt(); + int depth = + image[QLatin1String("__depth__")].toInt(); Q_ASSERT(type == QLatin1String("uint8")); Q_ASSERT(normalized == true); @@ -468,6 +470,7 @@ ApiTraceState::ApiTraceState(const QVariantMap &parsedJson) ApiTexture tex; tex.setSize(size); + tex.setDepth(depth); tex.setNumChannels(numChannels); tex.setLabel(itr.key()); tex.contentsFromBase64(dataArray); @@ -485,6 +488,7 @@ ApiTraceState::ApiTraceState(const QVariantMap &parsedJson) QString type = buffer[QLatin1String("__type__")].toString(); bool normalized = buffer[QLatin1String("__normalized__")].toBool(); int numChannels = buffer[QLatin1String("__channels__")].toInt(); + int depth = buffer[QLatin1String("__depth__")].toInt(); Q_ASSERT(type == QLatin1String("uint8")); Q_ASSERT(normalized == true); @@ -495,6 +499,7 @@ ApiTraceState::ApiTraceState(const QVariantMap &parsedJson) ApiFramebuffer fbo; fbo.setSize(size); + fbo.setDepth(depth); fbo.setNumChannels(numChannels); fbo.setType(itr.key()); fbo.contentsFromBase64(dataArray); -- 2.7.4