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

Method getClosestSupportedBitDepth

Engine/NodeMain.cpp:918–945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

916
917
918ImageBitDepthEnum
919Node::getClosestSupportedBitDepth(ImageBitDepthEnum depth)
920{
921 bool foundShort = false;
922 bool foundByte = false;
923
924 for (std::list<ImageBitDepthEnum>::const_iterator it = _imp->supportedDepths.begin(); it != _imp->supportedDepths.end(); ++it) {
925 if (*it == depth) {
926 return depth;
927 } else if (*it == eImageBitDepthFloat) {
928 return eImageBitDepthFloat;
929 } else if (*it == eImageBitDepthShort) {
930 foundShort = true;
931 } else if (*it == eImageBitDepthByte) {
932 foundByte = true;
933 }
934 }
935 if (foundShort) {
936 return eImageBitDepthShort;
937 } else if (foundByte) {
938 return eImageBitDepthByte;
939 } else {
940 ///The plug-in doesn't support any bitdepth, the program shouldn't even have reached here.
941 assert(false);
942
943 return eImageBitDepthNone;
944 }
945}
946
947ImageBitDepthEnum
948Node::getBestSupportedBitDepth() const

Callers 3

getDefaultMetadataMethod · 0.80
checkMetadataMethod · 0.80

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected