@classmethod
def from_transfer_format(cls, fmt, raw_bytes, resolution):
    """
        Given the raw bytes string received from the socket and the resolution of the image, this method will create
        a new PhantomImage object from that information using the format identified by the given string format token
        name "fmt"

        CHANGELOG

        Added 28.02.2019

        Changed 12.07.2019
        Added the 'P12L' format

        :param fmt:
        :param raw_bytes:
        :param resolution:
        :return:
        """
    _methods = {'P16': cls.from_p16, 'P16R': cls.from_p16, 'P8': cls.
        from_p8, 'P8R': cls.from_p8, 'P10': cls.from_p10, 'P12L': cls.
        from_p12l()}
    return _methods[fmt](raw_bytes, resolution)
