def convert8bit_(x): return 0 if x <= 0 else (255 if x >= 1 else uint8(x * 255 + 0.5))
def convert16bit_(x): return 0 if x <= 0 else ((2**16 - 1) if x >= 1 else uint16(x * (2**16 - 1) + 0.5))
def convert8bit_(x): return 0 if x <= 0 else (255 if x >= 1 else uint8(x * 255 + 0.5))
def convert16bit_(x): return 0 if x <= 0 else ((2**16 - 1) if x >= 1 else uint16(x * (2**16 - 1) + 0.5))