Skip to content

Commit

Permalink
Add pixel type in the header tree viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
afichet committed May 18, 2023
1 parent 7a5a58b commit 2121e0f
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/model/attribute/LayerItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,18 @@ HeaderItem* LayerItem::constructItemHierarchy(
if (m_childItems.size() == 0) {
// This is a terminal leaf
assert(m_pChannel != nullptr);

QString type = "framebuffer";
switch (m_pChannel->type) {
case Imf::PixelType::UINT: type += " (uint32)"; break;
case Imf::PixelType::HALF: type += " (half)"; break;
case Imf::PixelType::FLOAT: type += " (float)"; break;
default: break;
}

return new HeaderItem(
parent,
{QString::fromStdString(m_leafName), "", "framebuffer"},
{QString::fromStdString(m_leafName), "", type},
QString::fromStdString(partName),
partID,
QString::fromStdString(m_leafName),
Expand Down Expand Up @@ -350,9 +359,18 @@ HeaderItem* LayerItem::constructItemHierarchy(
// Both are valid but I prefer the nested representation
// OpenEXRItem* leafNode = new OpenEXRItem(parent, {m_rootName, "",
// "framebuffer"});

QString type = "framebuffer";
switch (m_pChannel->type) {
case Imf::PixelType::UINT: type += " (uint32)"; break;
case Imf::PixelType::HALF: type += " (half)"; break;
case Imf::PixelType::FLOAT: type += " (float)"; break;
default: break;
}

new HeaderItem(
currRoot,
{".", "", "framebuffer"},
{".", "", type},
QString::fromStdString(partName),
partID,
QString::fromStdString(m_leafName),
Expand Down

0 comments on commit 2121e0f

Please sign in to comment.