MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / bitDepthToBytes

Function bitDepthToBytes

src/bindings/python/PyUtils.cpp:88–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88py::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
113long chanOrderToNumChannels(ChannelOrdering chanOrder)
114{

Callers 1

bindPyPlanarImageDescFunction · 0.85

Calls 1

BitDepthToStringFunction · 0.85

Tested by

no test coverage detected