Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ia‡%ã@sºddlZddlZy$ddlmZdZeƒZejeƒWn:ek rnZzddl m Z e eƒZZWYddZ[XnXej e ƒZ Gdd„dƒZGdd „d eƒZGd d „d eƒZGd d „d eƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZeeeeeeeeeeeeeeeedœZejdk�r„eed<eed<eed <eed!<eed"<n(eed<eed<eed <eed!<eed"<d&d$d%„ZdS)'éN)ÚFFIz| struct Pixel_RGBA { unsigned char r,g,b,a; }; struct Pixel_I16 { unsigned char l,r; }; é)Údeferred_errorc@s>eZdZd dd„Zdd„Zdd„Zdd „ZeZeZd d „Z d S)ÚPyAccessFcCs†t|jjƒ}||_tjd|dƒ|_tjd|dƒ|_tjd|dƒ|_|jj \|_ |_ ||_ |j|_ |j jdkrz|j|_|jƒdS)Nzunsigned char **Úimage8zint **Úimage32ÚimageÚP)ÚdictZimZ unsafe_ptrsÚreadonlyÚffiÚcastrrrÚsizeÚxsizeÚysizeÚ_imgÚ_imÚmodeZpaletteÚ_paletteÚ _post_init)ÚselfÚimgr Úvals©rú-/tmp/tmp5hum_rxs/lib64/python/PIL/PyAccess.pyÚ__init__2s  zPyAccess.__init__cCsdS)Nr)rrrrrEszPyAccess._post_initcCs�|jrtdƒ‚|\}}|dkr(|j|}|dkr:|j|}|j||fƒ\}}|jjdkr‚t|tt fƒr‚t |ƒdkr‚|j j ||j ƒ}|j|||ƒS)a0 Modifies the pixel at x,y. The color is given as a single numerical value for single band images, and a tuple for multi-band images :param xy: The pixel coordinate, given as (x, y). See :ref:`coordinate-system`. :param color: The pixel value. z%Attempt to putpixel a read only imagerr éé)rr)r Ú ValueErrorrrÚcheck_xyrrÚ isinstanceÚlistÚtupleÚlenrZgetcolorrÚ set_pixel)rÚxyÚcolorÚxÚyrrrÚ __setitem__Hs     zPyAccess.__setitem__cCsJ|\}}|dkr|j|}|dkr,|j|}|j||fƒ\}}|j||ƒS)aq Returns the pixel at x,y. The pixel is returned as a single value for single band images or a tuple for multiple band images :param xy: The pixel coordinate, given as (x, y). See :ref:`coordinate-system`. :returns: a pixel value for single band images, a tuple of pixel values for multiband images. r)rrrÚ get_pixel)rr%r'r(rrrÚ __getitem__es   zPyAccess.__getitem__cCsH|\}}d|ko|jkno:d|ko6|jknsDtdƒ‚|S)Nrzpixel location out of range)rrr)rr%r'r(rrrr{s4zPyAccess.check_xyN)F) Ú__name__Ú __module__Ú __qualname__rrr)r+ZputpixelZgetpixelrrrrrr1s rc@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú _PyAccess32_2z7PA, LA, stored in first and last bytes of a 32 bit wordcOstjd|jƒ|_dS)Nzstruct Pixel_RGBA **)r r rÚpixels)rÚargsÚkwargsrrrr…sz_PyAccess32_2._post_initcCs|j||}|j|jfS)N)r0ÚrÚa)rr'r(Úpixelrrrr*ˆsz_PyAccess32_2.get_pixelcCs2|j||}t|ddƒ|_t|ddƒ|_dS)Nréÿr)r0Úminr3r4)rr'r(r&r5rrrr$Œsz_PyAccess32_2.set_pixelN)r,r-r.Ú__doc__rr*r$rrrrr/‚sr/c@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú _PyAccess32_3zARGB and friends, stored in the first three bytes of a 32 bit wordcOstjd|jƒ|_dS)Nzstruct Pixel_RGBA **)r r rr0)rr1r2rrrr–sz_PyAccess32_3._post_initcCs|j||}|j|j|jfS)N)r0r3ÚgÚb)rr'r(r5rrrr*™sz_PyAccess32_3.get_pixelcCsH|j||}t|ddƒ|_t|ddƒ|_t|ddƒ|_d|_dS)Nrr6ré)r0r7r3r:r;r4)rr'r(r&r5rrrr$�s z_PyAccess32_3.set_pixelN)r,r-r.r8rr*r$rrrrr9“sr9c@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú _PyAccess32_4z&RGBA etc, all 4 bytes of a 32 bit wordcOstjd|jƒ|_dS)Nzstruct Pixel_RGBA **)r r rr0)rr1r2rrrr©sz_PyAccess32_4._post_initcCs"|j||}|j|j|j|jfS)N)r0r3r:r;r4)rr'r(r5rrrr*¬sz_PyAccess32_4.get_pixelcCsR|j||}t|ddƒ|_t|ddƒ|_t|ddƒ|_t|ddƒ|_dS)Nrr6rr<r)r0r7r3r:r;r4)rr'r(r&r5rrrr$°s z_PyAccess32_4.set_pixelN)r,r-r.r8rr*r$rrrrr=¦sr=c@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú _PyAccess8z%1, L, P, 8 bit images stored as uint8cOs |j|_dS)N)rr0)rr1r2rrrr¼sz_PyAccess8._post_initcCs|j||S)N)r0)rr'r(rrrr*¿sz_PyAccess8.get_pixelc CsJyt|dƒ|j||<Wn,tk rDt|ddƒ|j||<YnXdS)Nr6r)r7r0Ú TypeError)rr'r(r&rrrr$Âsz_PyAccess8.set_pixelN)r,r-r.r8rr*r$rrrrr>¹sr>c@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú_PyAccessI16_Nz0I;16 access, native bitendian without conversioncOstjd|jƒ|_dS)Nzunsigned short **)r r rr0)rr1r2rrrrÎsz_PyAccessI16_N._post_initcCs|j||S)N)r0)rr'r(rrrr*Ñsz_PyAccessI16_N.get_pixelc CsJyt|dƒ|j||<Wn,tk rDt|ddƒ|j||<YnXdS)Niÿÿr)r7r0r?)rr'r(r&rrrr$Ôsz_PyAccessI16_N.set_pixelN)r,r-r.r8rr*r$rrrrr@Ësr@c@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú_PyAccessI16_LzI;16L access, with conversioncOstjd|jƒ|_dS)Nzstruct Pixel_I16 **)r r rr0)rr1r2rrrràsz_PyAccessI16_L._post_initcCs|j||}|j|jdS)Né)r0Úlr3)rr'r(r5rrrr*ãsz_PyAccessI16_L.get_pixelc CsX|j||}yt|dƒ}Wn"tk r>t|ddƒ}YnX|d@|_|d?|_dS)Niÿÿrr6é)r0r7r?rCr3)rr'r(r&r5rrrr$çs z_PyAccessI16_L.set_pixelN)r,r-r.r8rr*r$rrrrrAÝsrAc@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú_PyAccessI16_BzI;16B access, with conversioncOstjd|jƒ|_dS)Nzstruct Pixel_I16 **)r r rr0)rr1r2rrrrõsz_PyAccessI16_B._post_initcCs|j||}|jd|jS)NrB)r0rCr3)rr'r(r5rrrr*øsz_PyAccessI16_B.get_pixelc CsX|j||}yt|dƒ}Wn"tk r>t|ddƒ}YnX|d?|_|d@|_dS)NiÿÿrrDr6)r0r7Ú ExceptionrCr3)rr'r(r&r5rrrr$üs z_PyAccessI16_B.set_pixelN)r,r-r.r8rr*r$rrrrrEòsrEc@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú_PyAccessI32_Nz"Signed Int32 access, native endiancOs |j|_dS)N)rr0)rr1r2rrrr sz_PyAccessI32_N._post_initcCs|j||S)N)r0)rr'r(rrrr* sz_PyAccessI32_N.get_pixelcCs||j||<dS)N)r0)rr'r(r&rrrr$sz_PyAccessI32_N.set_pixelN)r,r-r.r8rr*r$rrrrrGsrGc@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) Ú_PyAccessI32_Swapz,I;32L/B access, with byteswapping conversioncOs |j|_dS)N)rr0)rr1r2rrrrsz_PyAccessI32_Swap._post_initcCs\tjd|ƒ}tjd|ƒ}|d|d|d|df\|d<|d<|d<|d<tjd|ƒdS)Nzint *zunsigned char *rr<rr)r Únewr )rÚiÚorigÚcharsrrrÚreverses  4z_PyAccessI32_Swap.reversecCs|j|j||ƒS)N)rMr0)rr'r(rrrr* sz_PyAccessI32_Swap.get_pixelcCs|j|ƒ|j||<dS)N)rMr0)rr'r(r&rrrr$#sz_PyAccessI32_Swap.set_pixelN)r,r-r.r8rrMr*r$rrrrrHs rHc@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú _PyAccessFz32 bit float accesscOstjd|jƒ|_dS)Nzfloat **)r r rr0)rr1r2rrrr*sz_PyAccessF._post_initcCs|j||S)N)r0)rr'r(rrrr*-sz_PyAccessF.get_pixelc Cs>y||j||<Wn&tk r8|d|j||<YnXdS)Nr)r0r?)rr'r(r&rrrr$0sz_PyAccessF.set_pixelN)r,r-r.r8rr*r$rrrrrN'srN)Ú1ÚLr ZLAZLaZPAZRGBZLABZHSVZYCbCrZRGBAZRGBaZRGBXZCMYKÚFÚIÚlittlezI;16zI;16LzI;16BzI;32LzI;32BFcCs.tj|jdƒ}|s$tjd|jƒdS|||ƒS)NzPyAccess Not Implemented: %s)Úmode_mapÚgetrÚloggerÚdebug)rr Z access_typerrrrI\s rI)F)ÚloggingÚsysZcffirÚdefsr ZcdefÚ ImportErrorÚexZ_utilrÚ getLoggerr,rVrr/r9r=r>r@rArErGrHrNrTÚ byteorderrIrrrrÚsb   Q