MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / makeInfoForInput

Method makeInfoForInput

Engine/Node.cpp:1537–1657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1535}
1536
1537std::string
1538Node::makeInfoForInput(int inputNumber) const
1539{
1540 if ( (inputNumber < -1) || ( inputNumber >= getNInputs() ) ) {
1541 return "";
1542 }
1543 EffectInstancePtr input;
1544 if (inputNumber != -1) {
1545 input = _imp->effect->getInput(inputNumber);
1546 /*if (input) {
1547 input = input->getNearestNonIdentity( getApp()->getTimeLine()->currentFrame() );
1548 }*/
1549 } else {
1550 input = _imp->effect;
1551 }
1552
1553 if (!input) {
1554 return "";
1555 }
1556
1557
1558 double time = getApp()->getTimeLine()->currentFrame();
1559 std::stringstream ss;
1560 { // input name
1561 QString inputName;
1562 if (inputNumber != -1) {
1563 inputName = QString::fromUtf8( getInputLabel(inputNumber).c_str() );
1564 } else {
1565 inputName = tr("Output");
1566 }
1567 ss << "<b><font color=\"orange\">" << tr("%1:").arg(inputName).toStdString() << "</font></b><br />";
1568 }
1569 { // image format
1570 ss << "<b>" << tr("Layers:").toStdString() << "</b> <font color=#c8c8c8>";
1571 std::list<ImagePlaneDesc> availableLayers;
1572 input->getAvailableLayers(time, ViewIdx(0), -1, &availableLayers); // get the layers in the input's output (thus the -1)!
1573 std::list<ImagePlaneDesc>::iterator next = availableLayers.begin();
1574 if ( next != availableLayers.end() ) {
1575 ++next;
1576 }
1577 for (std::list<ImagePlaneDesc>::iterator it = availableLayers.begin(); it != availableLayers.end(); ++it) {
1578
1579 ss << " " << it->getPlaneLabel() << '.' << it->getChannelsLabel();
1580 if ( next != availableLayers.end() ) {
1581 ss << ", ";
1582 ++next;
1583 }
1584 }
1585 ss << "</font><br />";
1586 }
1587 {
1588 ImageBitDepthEnum depth = _imp->effect->getBitDepth(inputNumber);
1589 QString depthStr = tr("unknown");
1590 switch (depth) {
1591 case eImageBitDepthByte:
1592 depthStr = tr("8u");
1593 break;
1594 case eImageBitDepthShort:

Callers

nothing calls this directly

Calls 15

getAppFunction · 0.85
toStdStringMethod · 0.80
getFrameRange_publicMethod · 0.80
ViewIdxClass · 0.70
getInputMethod · 0.45
currentFrameMethod · 0.45
getTimeLineMethod · 0.45
getAvailableLayersMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getBitDepthMethod · 0.45

Tested by

no test coverage detected