MCPcopy Create free account
hub / github.com/ImageEngine/cortex / channelsToRead

Method channelsToRead

src/IECoreImage/ImageReader.cpp:645–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643}
644
645void ImageReader::channelsToRead( vector<string> &names )
646{
647 vector<string> allNames;
648 channelNames( allNames );
649
650 ConstStringVectorParameterPtr p = channelNamesParameter();
651 const StringVectorData *d = static_cast<const StringVectorData *>( p->getValue() );
652
653 // give all channels when no list is provided
654 if (!d->readable().size())
655 {
656 names = allNames;
657 return;
658 }
659
660 // otherwise, copy in the requested names from the parameter set.
661 // this is intersection(A, D)
662 names.clear();
663 for (vector<string>::const_iterator it = d->readable().begin(); it != d->readable().end(); it++)
664 {
665 if (find(allNames.begin(), allNames.end(), *it) != allNames.end())
666 {
667 names.push_back(*it);
668 }
669 }
670}
671
672StringVectorParameter *ImageReader::channelNamesParameter()
673{

Callers

nothing calls this directly

Calls 8

findFunction · 0.85
readableMethod · 0.80
channelNamesFunction · 0.50
getValueMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected