| 7150 | } // Node::checkForPremultWarningAndCheckboxes |
| 7151 | |
| 7152 | int |
| 7153 | Node::getMaskChannel(int inputNb, const std::list<ImagePlaneDesc>& availableLayers, ImagePlaneDesc* comps) const |
| 7154 | { |
| 7155 | *comps = ImagePlaneDesc::getNoneComponents(); |
| 7156 | |
| 7157 | std::map<int, MaskSelector >::const_iterator it = _imp->maskSelectors.find(inputNb); |
| 7158 | |
| 7159 | if ( it == _imp->maskSelectors.end() ) { |
| 7160 | return -1; |
| 7161 | } |
| 7162 | ChoiceOption maskChannelID = it->second.channel.lock()->getActiveEntry(); |
| 7163 | |
| 7164 | for (std::list<ImagePlaneDesc>::const_iterator it2 = availableLayers.begin(); it2 != availableLayers.end(); ++it2) { |
| 7165 | |
| 7166 | std::size_t nChans = (std::size_t)it2->getNumComponents(); |
| 7167 | for (std::size_t c = 0; c < nChans; ++c) { |
| 7168 | ChoiceOption channelOption = it2->getChannelOption(c); |
| 7169 | if (channelOption.id == maskChannelID.id) { |
| 7170 | *comps = *it2; |
| 7171 | return c; |
| 7172 | } |
| 7173 | } |
| 7174 | } |
| 7175 | return -1; |
| 7176 | } |
| 7177 | |
| 7178 | bool |
| 7179 | Node::refreshChannelSelectors() |
no test coverage detected