def __init__(self, width, height, fmt, data, source=None,
                 flip_vertical=True, source_image=None,
                 rowlength=0):
        assert fmt in ImageData._supported_fmts

        #: Decoded image format, one of a available texture format
        self.fmt = fmt

        #: Data for each mipmap.
        self.mipmaps = {}
        self.add_mipmap(0, width, height, data, rowlength)

        #: Image source, if available
        self.source = source

        #: Indicate if the texture will need to be vertically flipped
        self.flip_vertical = flip_vertical

        # the original image, which we might need to save if it is a memoryview
        self.source_image = source_image
dataset/ETHPy150Open kivy/kivy/kivy/core/image/__init__.py/ImageData.__init__/original