⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
PIL
/
__pycache__
/
View File Name :
ImageMorph.cpython-310.pyc
o Z#a] @ sL d dl Z ddlmZmZ dZg dZg dZG dd dZG d d d ZdS ) N )Image _imagingmorphi ) r r ) r r r r r r r r r c @ J e Zd ZdZdddZdd Zdd Zd d Zdd Zd d Z dd Z dS ) LutBuilderaT A class for building a MorphLut from a descriptive language The input patterns is a list of a strings sequences like these:: 4:(... .1. 111)->1 (whitespaces including linebreaks are ignored). The option 4 describes a series of symmetry operations (in this case a 4-rotation), the pattern is described by: - . or X - Ignore - 1 - Pixel is on - 0 - Pixel is off The result of the operation is described after "->" string. The default is to return the current pixel value, which is returned if no other match is found. Operations: - 4 - 4 way rotation - N - Negate - 1 - Dummy op for no other operation (an op must always be given) - M - Mirroring Example:: lb = LutBuilder(patterns = ["4:(... .1. 111)->1"]) lut = lb.build_lut() Nc C st |d ur|| _ ng | _ d | _|d ur8ddgdgddgdgddgg dd}||vr1td | d || | _ d S d S )N1:(... ... ...)->0z4:(00. 01. ...)->1z4:(... .0. .1.)->1z4:(... .0. ..1)->1z4:(... .1. .0.)->0z4:(... .1. ..0)->0)r z4:(.0. .1. ...)->1z4:(01. .1. ...)->1)corner dilation4 dilation8erosion4erosion8edgezUnknown pattern !)patternslut Exception)selfr op_nameknown_patterns r 0/usr/lib/python3/dist-packages/PIL/ImageMorph.py__init__@ s zLutBuilder.__init__c C s | j |7 _ d S Nr )r r r r r add_patternsX s zLutBuilder.add_patternsc s. ddgd t fddttD | _d S )Nr r c 3 s | ]}| @ d k V qdS )r Nr ).0imsymbolsr r
^ s z/LutBuilder.build_default_lut.
.
) bytearrayrangeLUT_SIZEr r r r% r build_default_lut[ s "zLutBuilder.build_default_lutc C s | j S r r r, r r r get_lut` s zLutBuilder.get_lutc s( t |dksJ d fdd|D S )zstring_permute takes a pattern and a permutation and returns the string permuted according to the permutation list. c 3 s | ]} | V qd S r r )r# ppatternr r r( h s z-LutBuilder._string_permute.
.
)lenjoin)r r4 permutationr r3 r _string_permutec s zLutBuilder._string_permutec C s ||fg}d|v r%|d d }t dD ]}|| |d d t|f qd|v rCt|}|d| D ]\}}|| |t|f q3d|v rqt|}|d| D ]\}}|dd d dd d }dt| }|||f qQ|S )zpattern_permute takes a basic pattern and its result and clones the pattern according to the modifications described in the $options parameter. It returns a list of all cloned patterns.4r r r MN0Z1)r* appendr8 ROTATION_MATRIXr5 MIRROR_MATRIXreplaceint) r basic_patternoptionsbasic_resultr resr$ nr4 r r r _pattern_permutej s$ zLutBuilder._pattern_permutec C s8 | g }| jD ]:}td|dd}|std| d |d}|d}t|d}|d ddd}|| |||7 }q t |D ]\}}|d dddd }t |}||d f||<