| 86 | } |
| 87 | |
| 88 | py::ssize_t bitDepthToBytes(BitDepth bitDepth) |
| 89 | { |
| 90 | std::string name, err; |
| 91 | |
| 92 | switch(bitDepth) |
| 93 | { |
| 94 | case BIT_DEPTH_UINT8: |
| 95 | return 1; |
| 96 | case BIT_DEPTH_UINT10: |
| 97 | case BIT_DEPTH_UINT12: |
| 98 | case BIT_DEPTH_UINT16: |
| 99 | case BIT_DEPTH_F16: |
| 100 | return 2; |
| 101 | case BIT_DEPTH_F32: |
| 102 | return 4; |
| 103 | case BIT_DEPTH_UINT14: |
| 104 | case BIT_DEPTH_UINT32: |
| 105 | case BIT_DEPTH_UNKNOWN: |
| 106 | default: |
| 107 | err = "Error: Unsupported bit-depth: "; |
| 108 | err += BitDepthToString(bitDepth); |
| 109 | throw Exception(err.c_str()); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | long chanOrderToNumChannels(ChannelOrdering chanOrder) |
| 114 | { |
no test coverage detected