cehua_lyf
2019-03-06 3c8ee0a8a524a6251d7d5aae2372e76fd8a99b9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ŒôXc@s›ddlZddlZddlZddd„ƒYZd„Zd„Zdd„Zd„Zdd    „Zdd
„Z    d d „Z
dd „Z d„Z dS(iÿÿÿÿNt ImagePalettecBsAeZdZddd„Zd„Zd„Zd„Zd„ZRS(s(Colour palette for palette mapped imagestRGBcCsx||_d|_|p.tdƒt|jƒ|_i|_d|_t|jƒdt|jƒkrttd‚ndS(Niswrong palette size(    tmodetNonetrawmodetrangetlentpalettetcolorstdirtyt
ValueError(tselfRR((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pyt__init__s        "        "cCs0|jr|j|jfS|jd|jƒfS(Ns;L(RRRttostring(R ((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytgetdata%s    cCsJ|jrtdƒ‚ntj|jƒr1|jStjd|jƒjƒS(Ns!palette contains raw palette datatB(RR
tImaget isStringTypeRtarrayR (R ((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pyR ,s
    cCs|jrtdƒ‚ntj|ƒróy|j|SWqtk
rïtj|jƒrptt    |jƒ|_nt
|jƒ}|dkrštdƒ‚n||j|<|d|j|<|d|j|d<|d|j|d<d|_ |SXntd|ƒ‚dS(    Ns!palette contains raw palette datais$cannot allocate more than 256 colorsiiiisunknown color specifier: %r( RR
Rt isTupleTypeRtKeyErrorRRtmaptintRR    (R tcolortindex((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytgetcolor4s$           cCsä|jrtdƒ‚nt|ƒtdƒkrBt|dƒ}n|jdƒ|jd|jƒxptdƒD]b}|jd|ƒx;t|t|jƒdƒD]}|jd|j|ƒq£W|jd    ƒqpW|j    ƒdS(
Ns!palette contains raw palette datattws
# Palette
s # Mode: %s
is%ds %ds
(
RR
ttypetopentwriteRRRRtclose(R tfptitj((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytsaveKs     "N(    t__name__t
__module__t__doc__RR RR RR#(((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pyRs                 cCs(tƒ}||_||_d|_|S(Ni(RRRR    (RtdataR((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytraw]s
                cCsKg}|dkrAx2tdƒD]}|j||dƒqWnt‚|S(Niiiÿ(RtappendtNotImplementedError(tblacktwhitetlutR!((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pyt_make_linear_lutgs  RcCsDg}x7tdƒD])}|jt|d|ddƒƒqW|S(Nigào@gà?(RR)R(texpRR-R!((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pyt_make_gamma_lutps'cCstjj||ƒS(N(Rtcoret new_palette(RR'((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytnewvscCs-tdƒ}|jƒt||t|ƒƒS(Ni(RtreverseRR(RR((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytnegativeys 
cCsZddlm}g}x4tdt|ƒƒD]}|j|ddƒƒq-Wt||ƒS(Niÿÿÿÿ(trandintiiiÿ(trandomR6RRR)R(RR6RR!((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pyR7~s
s#fff0c0cCsZtj|ƒ\}}}td|ƒ}td|ƒ}td|ƒ}td|||ƒS(NiR(t
ImageColortgetrgbR.R(R,trtgtb((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytsepia…s
cCst|tdƒt|ƒƒS(Ni(RRR(R((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytwedgeŒscCs<t|dƒ}d}|spy8ddl}|jdƒ|j|ƒ}|jƒ}Wqpttfk
rlqpXn|sËy8ddl}|jdƒ|j|ƒ}|jƒ}WqËttfk
rÇqËXn|s&y8ddl}|jdƒ|j|ƒ}|jƒ}Wq&ttfk
r"q&Xn|s8t    d‚n|S(Ntrbiÿÿÿÿiscannot load palette(
RRtGimpPaletteFiletseekt
getpalettet SyntaxErrorR
tGimpGradientFilet PaletteFiletIOError(tfilenameR R-R@tpRDRE((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pytloads:       (( RRR8RR(R.R0R3R5R7R=R>RI(((ss.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\PIL\ImagePalette.pyt<module>s D