def float_to_rgb(float_rgb):
""" Converts a packed float RGB format to an RGB list
Args:
float_rgb: RGB value packed as a float
Returns:
color (list): 3-element list of integers [0-255,0-255,0-255]
"""
s = struct.pack('>f', float_rgb)
i = struct.unpack('>l', s)[0]
pack = ctypes.c_uint32(i).value
r = (pack & 0x00FF0000) >> 16
g = (pack & 0x0000FF00) >> 8
b = (pack & 0x000000FF)
color = [r,g,b]
return color
pcl_helper.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录