Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/PIL/__pycache__/ImagePalette.cpython-37.pyc

81 lines
5.3 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
(U<>]<5D><00>@s|ddlZddlmZmZmZmZGdd<05>de<06>Zdd<07>Zdd <09>Z d
d <0B>Z
dd d<0E>Z ddd<10>Z ddd<13>Z ddd<15>Zdd<17>ZdS)<1C>N<>)<04>GimpGradientFile<6C>GimpPaletteFile<6C>
ImageColor<EFBFBD> PaletteFilec@sFeZdZdZddd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>ZeZd d<0E>Z dd<10>Z
dS)<12> ImagePaletteas
Color palette for palette mapped images
:param mode: The mode to use for the Palette. See:
:ref:`concept-modes`. Defaults to "RGB"
:param palette: An optional palette. If given, it must be a bytearray,
an array or a list of ints between 0-255 and of length ``size``
times the number of colors in ``mode``. The list must be aligned
by channel (All R values must be contiguous in the list before G
and B values.) Defaults to 0 through 255 per channel.
:param size: An optional palette size. If given, it cannot be equal to
or greater than 256. Defaults to 0.
<20>RGBNrcCsv||_d|_|p$ttd<01><01>t|j<00>|_i|_d|_|dkrTt|j<00>dt|j<05>ksj|dkrr|t|j<05>krrtd<03><01>dS)N<>rzwrong palette size) <09>mode<64>rawmode<64> bytearray<61>range<67>len<65>palette<74>colors<72>dirty<74>
ValueError)<04>selfr
r<00>size<7A>r<00>4/tmp/pip-install-pc7tm5jb/Pillow/PIL/ImagePalette.py<70>__init__'s zImagePalette.__init__cCsHt<00>}|j|_|j|_|jdk r0|jdd<00>|_|j<04><05>|_|j|_|S)N)rr
r rr<00>copyr)r<00>newrrrr2s
 zImagePalette.copycCs$|jr|j|jfS|jd|<00><03>fS)z<>
Get palette contents in format suitable for the low-level
``im.putpalette`` primitive.
.. warning:: This method is experimental.
z;L)r rr
<00>tobytes)rrrr<00>getdata>s zImagePalette.getdatacCsH|jrtd<01><01>t|jt<04>r |jSt<05>d|j<03>}t|d<03>r@|<01><07>S|<01><08>S)zUConvert palette to bytes.
.. warning:: This method is experimental.
z!palette contains raw palette data<74>Br) r r<00>
isinstancer<00>bytes<65>array<61>hasattrr<00>tostring)rZarrrrrrIs 
zImagePalette.tobytescCs<>|jrtd<01><01>t|t<03>r<>y
|j|Stk
r<EFBFBD>t|jt<07>rJt|j<06>|_t |j<04>}|dkrdtd<03><01>||j|<|d|j|<|d|j|d<|d|j|d<d|_
|SXn td|<00><01>d S)
zgGiven an rgb tuple, allocate palette entry.
.. warning:: This method is experimental.
z!palette contains raw palette datar z$cannot allocate more than 256 colorsrr<00>izunknown color specifier: %rN) r rr<00>tupler<00>KeyErrorrrr rr)r<00>color<6F>indexrrr<00>getcolorZs$

  

zImagePalette.getcolorc
Cs<>|jrtd<01><01>t|t<03>r"t|d<02>}|<01>d<03>|<01>d|j<00>x<>td<05>D]<5D>}|<01>d|<00>xbt|t|j<06>|dt|j<06><00>D]<}y|<01>d|j |<00>Wq|t
k
r<EFBFBD>|<01>d <09>Yq|Xq|W|<01>d
<EFBFBD>qFW|<01> <0B>d S) zVSave palette to text file.
.. warning:: This method is experimental.
z!palette contains raw palette data<74>wz
# Palette
z # Mode: %s
r z%drz %dz 0<>
N) r rr<00>str<74>open<65>writer
r rr<00>
IndexError<EFBFBD>close)r<00>fp<66>i<>jrrr<00>savets


(zImagePalette.save)rNr) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rrrrr!r'r2rrrrrs 
  rcCst<00>}||_||_d|_|S)Nr)rr rr)r <00>datarrrr<00>raw<61>s
r8cCs:g}|dkr2x(td<02>D]}|<02>||d<00>qWnt<02>|S)Nrr <00><>)r <00>append<6E>NotImplementedError)Zblack<63>white<74>lutr0rrr<00>make_linear_lut<75>s r>cCs8g}x.td<01>D]"}|<01>t|d|dd<00><01>qW|S)Nr g<00>o@g<00>?)r r:<00>int)<03>expr=r0rrr<00>make_gamma_lut<75>s"rArcCs&ttd<01><01>}|<01><02>t||t|<00><00>S)Nr )<05>listr <00>reverserr)r
rrrr<00>negative<76>s rDcCsDddlm}g}x(tdt|<00><00>D]}|<02>|dd<04><02>q"Wt||<02>S)Nr)<01>randintr r9)<06>randomrEr rr:r)r
rErr0rrrrF<00>s
 rF<00>#fff0c0cCs@t<00>|<00>\}}}td|<01>}td|<02>}td|<03>}td|||<00>S)Nrr)rZgetrgbr>r)r<<00>r<>g<>brrr<00>sepia<69>s



rKcCst|ttd<01><01>t|<00><00>S)Nr )rrBr r)r
rrr<00>wedge<67>srLc Csvt|d<01><02>b}xZtjtjtjgD]>}y |<01>d<02>||<01><01><05>}|r@PWqttfk
rZYqXqWtd<03><01>WdQRX|S)N<>rbrzcannot load palette) r+rrr<00>seekZ
getpalette<EFBFBD> SyntaxErrorr<00>IOError)<04>filenamer/ZpaletteHandlerr=rrr<00>load<61>s  
 
rR)r)r)rG)r)r<00>rrrr<00>objectrr8r>rArDrFrKrLrRrrrr<00><module>sv