Your IP : 216.73.216.213
�ʴWt � @ sb d d l m Z d d l m Z d d l Z d
Z Gd d � d e � Z Gd d � d e � Z d S)� )�Image)�
_imagingmorphN� � c @ sp e Z d Z d Z d d d d � Z d d � Z d d � Z d d
� Z d d � Z d
d � Z d d � Z
d S)�
LutBuildera~ 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 s� | d k r | | _ n g | _ d | _ | d k r� d d d g d d g d d d g d d g d
d d g d d d
d g i } | | k r� t d | d � � | | | _ d S)NZcornerz1:(... ... ...)->0z4:(00. 01. ...)->1Z dilation4z4:(... .0. .1.)->1Z dilation8z4:(... .0. ..1)->1Zerosion4z4:(... .1. .0.)->0Zerosion8z4:(... .1. ..0)->0Zedgez4:(.0. .1. ...)->1z4:(01. .1. ...)->1zUnknown pattern �!)�patterns�lut� Exception)�selfr �op_nameZknown_patterns� r
�A/opt/alt/python35/lib64/python3.5/site-packages/PIL/ImageMorph.py�__init__2 s&