| 916 | |
| 917 | |
| 918 | ImageBitDepthEnum |
| 919 | Node::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 | |
| 947 | ImageBitDepthEnum |
| 948 | Node::getBestSupportedBitDepth() const |
no test coverage detected