MCPcopy Create free account
hub / github.com/IENT/YUView / parseCodingType

Method parseCodingType

tools/standardTextToCode/codingType.py:23–37  ·  view source on GitHub ↗
(self, descriptor : str)

Source from the content-addressed store, hash-verified

21 self.codingType = None
22 self.parseCodingType(descriptor)
23 def parseCodingType(self, descriptor : str):
24 if (descriptor.startswith("f(")):
25 self.codingType = Coding.FIXED_CODE
26 self.length = int(descriptor[2:-1])
27 elif (descriptor.startswith("u(v)")):
28 self.codingType = Coding.UNSIGNED_VARIABLE
29 elif (descriptor.startswith("u(")):
30 self.codingType = Coding.UNSIGNED_FIXED
31 self.length = int(descriptor[2:-1])
32 elif (descriptor.startswith("ue(v)")):
33 self.codingType = Coding.UNSIGNED_EXP
34 elif (descriptor.startswith("se(v)")):
35 self.codingType = Coding.SIGNED_EXP
36 else:
37 raise SyntaxError("Unknown descriptor type " + descriptor)
38 def __str__(self):
39 if (self.codingType == Coding.FIXED_CODE):
40 return f"f({self.length})"

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected