

def scale_quantum_to_int8(quantum):
    'Straightforward port of :c:func:`ScaleQuantumToChar()` inline\n    function.\n\n    :param quantum: quantum value\n    :type quantum: :class:`numbers.Integral`\n    :returns: 8bit integer of the given ``quantum`` value\n    :rtype: :class:`numbers.Integral`\n\n    .. versionadded:: 0.3.0\n\n    '
    if (quantum <= 0):
        return 0
    table = {
        8: 1,
        16: 257.0,
        32: 16843009.0,
        64: 7.234017283807667e+16,
    }
    v = (quantum / table[QUANTUM_DEPTH])
    if (quantum >= 255):
        return 255
    return int((v + 0.5))

dataset/ETHPy150Open dahlia/wand/wand/color.py scale_quantum_to_int8/VarMisuse@64/200 `v`->`quantum`