MCPcopy
hub / github.com/xxlong0/Wonder3D / read_next_bytes

Function read_next_bytes

instant-nsr-pl/datasets/colmap_utils.py:69–78  ·  view source on GitHub ↗

Read and unpack the next bytes from a binary file. :param fid: :param num_bytes: Sum of combination of {2, 4, 8}, e.g. 2, 6, 16, 30, etc. :param format_char_sequence: List of {c, e, f, d, h, H, i, I, l, L, q, Q}. :param endian_character: Any of {@, =, <, >, !} :return: Tuple of r

(fid, num_bytes, format_char_sequence, endian_character="<")

Source from the content-addressed store, hash-verified

67
68
69def read_next_bytes(fid, num_bytes, format_char_sequence, endian_character="<"):
70 """Read and unpack the next bytes from a binary file.
71 :param fid:
72 :param num_bytes: Sum of combination of {2, 4, 8}, e.g. 2, 6, 16, 30, etc.
73 :param format_char_sequence: List of {c, e, f, d, h, H, i, I, l, L, q, Q}.
74 :param endian_character: Any of {@, =, <, >, !}
75 :return: Tuple of read and unpacked values.
76 """
77 data = fid.read(num_bytes)
78 return struct.unpack(endian_character + format_char_sequence, data)
79
80
81def read_cameras_text(path):

Callers 3

read_cameras_binaryFunction · 0.85
read_images_binaryFunction · 0.85
read_points3d_binaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected