Skip to content

Commit

Permalink
add mask channel to consideration for number of channels
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilDohne committed Dec 18, 2024
1 parent 8032cf7 commit eea9d14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/src/DeclareImageLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ void declareImageLayer(py::module& m, const std::string& extension) {

imageLayer.def_property_readonly("num_channels", [](Class& self)
{
return self.m_ImageData.size();
return self.m_ImageData.size() + self.m_LayerMask.has_value();
});

imageLayer.def_property_readonly("channels", [](Class& self)
Expand All @@ -674,6 +674,10 @@ void declareImageLayer(py::module& m, const std::string& extension) {
{
indices.push_back(key.index);
}
if (self.m_LayerMask)
{
indices.push_back(-2);
}
return indices;
});
}

0 comments on commit eea9d14

Please sign in to comment.