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

Method checkForPremultWarningAndCheckboxes

Engine/Node.cpp:7085–7150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7083}
7084
7085void
7086Node::checkForPremultWarningAndCheckboxes()
7087{
7088 if ( isOutputNode() ) {
7089 return;
7090 }
7091 KnobBoolPtr chans[4];
7092 KnobStringPtr premultWarn = _imp->premultWarning.lock();
7093 if (!premultWarn) {
7094 return;
7095 }
7096 NodePtr prefInput = getPreferredInputNode();
7097
7098 //Do not display a warning for Roto paint
7099 if ( !prefInput || _imp->effect->isRotoPaintNode() ) {
7100 //No input, do not warn
7101 premultWarn->setSecret(true);
7102
7103 return;
7104 }
7105 for (int i = 0; i < 4; ++i) {
7106 chans[i] = _imp->enabledChan[i].lock();
7107
7108 //No checkboxes
7109 if (!chans[i]) {
7110 premultWarn->setSecret(true);
7111
7112 return;
7113 }
7114
7115 //not RGBA
7116 if ( chans[i]->getIsSecret() ) {
7117 return;
7118 }
7119 }
7120
7121 ImagePremultiplicationEnum premult = _imp->effect->getPremult();
7122
7123 //not premult
7124 if (premult != eImagePremultiplicationPremultiplied) {
7125 premultWarn->setSecret(true);
7126
7127 return;
7128 }
7129
7130 bool checked[4];
7131 checked[3] = chans[3]->getValue();
7132
7133 //alpha unchecked
7134 if (!checked[3]) {
7135 premultWarn->setSecret(true);
7136
7137 return;
7138 }
7139 for (int i = 0; i < 3; ++i) {
7140 checked[i] = chans[i]->getValue();
7141 if (!checked[i]) {
7142 premultWarn->setSecret(false);

Callers 1

Calls 5

getIsSecretMethod · 0.80
lockMethod · 0.45
setSecretMethod · 0.45
getPremultMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected