ó <×ļ[c@s9ddlmZddlmZmZddlmZddlZddgdd gd d gd d ggZej dd„de ƒxLeD]8\Z Z ye dkrÜddl mZmZmZddlmZmZnĆe d krddlmZmZmZddlmZmZn‚e d kr^ddlmZmZmZddlmZmZnAe d krŸddlmZmZmZddlmZmZnWneefk r¼qŒnXe ZPqŒWeZdZ dd„Zd„Z d„Z!d„Z"d„Z#er#defd„ƒYZ$nd„Z%d„Z&dS(i(tImage(tisPathtpy3i’’’’(tBytesIONt5tPyQt5tside2tPySide2t4tPyQt4tsidetPySidetkeycCs|dtjkS(Ni(tsystmodules(t qt_version((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pytstreverse(tQImagetqRgbatQPixmap(tQBuffert QIODevicei’cCst||||ƒd@S(sA(Internal) Turns an RGB color into a Qt compatible color integer.I’’’’(R(trtgtbta((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pytrgb8scCs¹tƒ}|jtjƒ|jƒr8|j|dƒn|j|dƒtƒ}y|j|jƒƒWn*t k r”|jt |jƒƒƒnX|j ƒ|j dƒt j|ƒS(ss :param im: A PIL Image object, or a file name (given either as Python string or a PyQt string object) tpngtppmi(RtopenRt ReadWritethasAlphaChanneltsaveRtwritetdatat TypeErrortstrtclosetseekR(timtbufferR((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pyt fromqimage?s      cCs t|ƒS(N(R*(R(((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pyt fromqpixmapYsc CsÅidd6dd6dd6|}||}t|dƒ\}}||rMdnd}| d}|si|Sg} xFtt|ƒ|ƒD].} | j|| || d|!d|ƒq†Wd j| ƒS( sE converts each scanline of data from 8 bit to 32 bit aligned it1itLtPiist(tdivmodtrangetlentappendtjoin( tbytestwidthtmodetbits_per_pixelt bits_per_linetfull_bytes_per_linetremaining_bits_per_linetbytes_per_linet extra_paddingtnew_datati((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pyt align8to32gs   c CsLd}d}t|dƒrQtr9t|jƒdƒ}qQt|jƒdƒ}nt|ƒrotj|ƒ}n|j dkrŠt j }nz|j dkrŪt j }g}xYt dƒD]}|jt|||ƒƒqµWn)|j dkrIt j }g}|jƒ}xüt dt|ƒdƒD]$}|jt|||d!ŒƒqWn»|j d krv|jd d ƒ}t j}nŽ|j d krńy|jd d ƒ}WnGtk rä|jƒ\}}}} tjd |||| fƒ}nXt j}ntd|j ƒ‚|p)t|jƒ|jd|j ƒ} i| d6|d6|d6|d6S(NttoUtf8sutf-8R,R-iR.iitRGBtrawtBGRXtRGBAtBGRAsunsupported image mode %rR#R(tformatt colortable(tNonethasattrRR%RAtunicodeRRRR7Rt Format_MonotFormat_Indexed8R1R3Rt getpaletteR2ttobytest Format_RGB32t SystemErrortsplittmerget Format_ARGB32t ValueErrorR@tsize( R(R#RHRGR?tpaletteRRRRt__data((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pyt_toqclass_helper…sF      %  " (tImageQtcBseZd„ZRS(cCsqt|ƒ}|d|_tj||j|djd|djd|dƒ|drm|j|dƒndS(sņ An PIL image wrapper for Qt. This is a subclass of PyQt's QImage class. :param im: A PIL Image object, or a file name (given either as Python string or a PyQt string object). R#R(iiRGRHN(RYt_ImageQt__dataRt__init__RVt setColorTable(tselfR(tim_data((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pyR\·s    (t__name__t __module__R\(((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pyRZµscCs t|ƒS(N(RZ(R(((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pyttoqimageĢscCs:|jdkr!|jdƒ}nt|ƒ}tj|ƒS(NRBRE(R7tconvertRbRt fromImage(R(tqimage((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pyt toqpixmapŠs ('R/Rt_utilRRtioRR t qt_versionstsorttTrueRt qt_modulet PyQt5.QtGuiRRRt PyQt5.QtCoreRRt PySide2.QtGuitPySide2.QtCoret PyQt4.QtGuit PyQt4.QtCoret PySide.QtGuit PySide.QtCoret ImportErrort RuntimeErrortqt_is_installedtFalseRIRR*R+R@RYRZRbRf(((s+/tmp/pip-build-SKekGm/pillow/PIL/ImageQt.pytsL             /