/ *   
 
   *   P R O J E C T :   N y A R T o o l k i t C S ( E x t e n s i o n ) 
 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
   *   T h e   N y A R T o o l k i t C S   i s   J a v a   e d i t i o n   A R T o o l K i t   c l a s s   l i b r a r y . 
 
   *   C o p y r i g h t   ( C ) 2 0 0 8 - 2 0 0 9   R y o   I i z u k a 
 
   * 
 
   *   T h i s   p r o g r a m   i s   f r e e   s o f t w a r e :   y o u   c a n   r e d i s t r i b u t e   i t   a n d / o r   m o d i f y 
 
   *   i t   u n d e r   t h e   t e r m s   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e   a s   p u b l i s h e d   b y 
 
   *   t h e   F r e e   S o f t w a r e   F o u n d a t i o n ,   e i t h e r   v e r s i o n   3   o f   t h e   L i c e n s e ,   o r 
 
   *   ( a t   y o u r   o p t i o n )   a n y   l a t e r   v e r s i o n . 
 
   *   
 
   *   T h i s   p r o g r a m   i s   d i s t r i b u t e d   i n   t h e   h o p e   t h a t   i t   w i l l   b e   u s e f u l , 
 
   *   b u t   W I T H O U T   A N Y   W A R R A N T Y ;   w i t h o u t   e v e n   t h e   i m p l i e d   w a r r a n t y   o f 
 
   *   M E R C H A N T A B I L I T Y   o r   F I T N E S S   F O R   A   P A R T I C U L A R   P U R P O S E .     S e e   t h e 
 
   *   G N U   G e n e r a l   P u b l i c   L i c e n s e   f o r   m o r e   d e t a i l s . 
 
   * 
 
   *   Y o u   s h o u l d   h a v e   r e c e i v e d   a   c o p y   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e 
 
   *   a l o n g   w i t h   t h i s   p r o g r a m .     I f   n o t ,   s e e   < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > . 
 
   *   
 
   *   F o r   f u r t h e r   i n f o r m a t i o n   p l e a s e   c o n t a c t . 
 
   * 	 h t t p : / / n y a t l a . j p / n y a t o o l k i t / 
 
   * 	 < a i r m a i l ( a t ) e b o n y . p l a l a . o r . j p >   o r   < n y a t l a ( a t ) n y a t l a . j p > 
 
   *   
 
   * / 
 
 u s i n g   j p . n y a t l a . n y a r t o o l k i t . c s . c o r e ; 
 
 u s i n g   j p . n y a t l a . n y a r t o o l k i t . c s . n y i d m a r k e r ; 
 
 u s i n g   S y s t e m . D i a g n o s t i c s ; 
 
 n a m e s p a c e   j p . n y a t l a . n y a r t o o l k i t . c s . p r o c e s s o r 
 
 { 
 
 
 
 
 
 
 
 
 
         / * * 
 
           *   S0n0000o001 Pn0N y A R 0000iQY00Qt0000000000k0Y00000000[W0~0Y00
 
           *   000n0Qs0yR0mn00]000000peg0wY00S0h0L0g0M0~0Y00
 
           *   000k0o0N y I d 000n0000000c[g0M0~0Y0000000n0.z^0	YH00S0h0g00puj00.z^n0N y I d 0000TX0000g0
 
           *   S0qbF0S0h0L0g0M0~0Y00TBfk0S0qbF0S0h0o0g0M0~0[000	
 
           *   < p > ]000000pen0f- 
 
           *   S0n0000k0o00Pn0]000000peL0B00~0Y00{ @ l i n k   S i n g l e A R M a r k e r P r o c e s s e r } o00NNn000000g0S0000|Ts0QW0~0Y00
 
           *   000o0}b000g0S000n0pek0[ň0LD000000ƙRn0000000000\Obg0M0~0Y00
 
           *   < u l > 
 
           *   < l i >  0{ @ l i n k   # o n E n t e r H a n d l e r }   -   {v2W0_0000L0R0f0d0K0c0_0Bfk0|Ts0QU00~0Y00S0S0k00zvW0_0000k0[_W0_0RgQt0fM0~0Y00
 
           *   < l i >  0{ @ l i n k   # o n L e a v e H a n d l e r }   -   iQ-Nn0000L0m1YW0_0Bfk0|Ts0QU00~0Y00S0S0k00000n0B}gQt0fM0~0Y00
 
           *   < l i >  0{ @ l i n k   # o n U p d a t e H a n d l e r } -   iQ-Nn0000n0MOnYRL0feU00_0h0M0k0|Ts0QU00~0Y00S0S0k00000MOnn0feQt0fM0~0Y00
 
           *   < / u l > 
 
           *   < / p > 
 
           *   < p > yr'`- 
 
           *   < u l > 
 
           *   < l i > RweE\$Pte0LF0_000tXIQn0	YSk0'`L0B00~0Y00
 
           *   < l i > pen0N y I d 000L0;uPk0B004XTo00 NjuR0k0XW0_0I d n00000*QHQW0f0XW0~0Y00
 
           *   < l i > pen0T NI D n0N y I d 000L0;uPk0B004XTo00:S%Rg0M0~0[000
 
           *   < / u l > 
 
           *   < / p > 
 
           * / 
 
         p u b l i c   a b s t r a c t   c l a s s   S i n g l e N y I d M a r k e r P r o c e s s e r 
 
         { 
 
                 / * * 
 
                   *   R l e wb_D e t e c t o r n00000
 
                   * / 
 
                 p r i v a t e   c l a s s   R l e D e t e c t o r   :   N y A R S q u a r e C o n t o u r D e t e c t o r _ R l e ,   N y A R S q u a r e C o n t o u r D e t e c t o r . C b H a n d l e r 
 
                 { 
 
                         / / lQ00000
 
                         p u b l i c   r e a d o n l y   N y A R S q u a r e   s q u a r e   =   n e w   N y A R S q u a r e ( ) ; 
 
                         p u b l i c   I N y I d M a r k e r D a t a   m a r k e r _ d a t a ; 
 
                         p u b l i c   i n t   t h r e s h o l d ; 
 
                         / / Sgq
 
                         p r i v a t e   I N y A R G r a y s c a l e R a s t e r   _ r e f _ r a s t e r ; 
 
                         / / @b	g000000
 
                         p r i v a t e   I N y I d M a r k e r D a t a   _ c u r r e n t _ d a t a ; 
 
                         p r i v a t e   r e a d o n l y   N y I d M a r k e r P i c k u p   _ i d _ p i c k u p ; 
 
                         p r i v a t e   N y A R C o o r d 2 L i n e a r   _ c o o r d l i n e ; 
 
                         p r i v a t e   I N y I d M a r k e r D a t a E n c o d e r   _ e n c o d e r ; 
 
                         p r i v a t e   I N y I d M a r k e r D a t a   _ d a t a _ t e m p ; 
 
                         p r i v a t e   I N y I d M a r k e r D a t a   _ p r e v _ d a t a ; 
 
 
 
                         p u b l i c   R l e D e t e c t o r ( N y A R P a r a m   i _ p a r a m ,   I N y I d M a r k e r D a t a E n c o d e r   i _ e n c o d e r ,   N y I d M a r k e r P i c k u p   i _ i d _ p i c k u p ) :   b a s e ( i _ p a r a m . g e t S c r e e n S i z e ( ) ) 
 
                         { 
 
                               
 
                                 t h i s . _ c o o r d l i n e   =   n e w   N y A R C o o r d 2 L i n e a r ( i _ p a r a m . g e t S c r e e n S i z e ( ) ,   i _ p a r a m . g e t D i s t o r t i o n F a c t o r ( ) ) ; 
 
                                 t h i s . _ d a t a _ t e m p   =   i _ e n c o d e r . c r e a t e D a t a I n s t a n c e ( ) ; 
 
                                 t h i s . _ c u r r e n t _ d a t a   =   i _ e n c o d e r . c r e a t e D a t a I n s t a n c e ( ) ; 
 
                                 t h i s . _ e n c o d e r   =   i _ e n c o d e r ; 
 
                                 t h i s . _ i d _ p i c k u p   =   i _ i d _ p i c k u p ; 
 
                                 r e t u r n ; 
 
                         } 
 
                         p r i v a t e   N y A R I n t P o i n t 2 d [ ]   _ _ r e f _ v e r t e x   =   n e w   N y A R I n t P o i n t 2 d [ 4 ] ; 
 
                         / * * 
 
                           *   I n i t i a l i z e   c a l l   b a c k   h a n d l e r . 
 
                           * / 
 
                         p u b l i c   v o i d   i n i t ( I N y A R G r a y s c a l e R a s t e r   i _ r a s t e r ,   I N y I d M a r k e r D a t a   i _ p r e v _ d a t a ) 
 
                         { 
 
                                 t h i s . m a r k e r _ d a t a   =   n u l l ; 
 
                                 t h i s . _ p r e v _ d a t a   =   i _ p r e v _ d a t a ; 
 
                                 t h i s . _ r e f _ r a s t e r   =   i _ r a s t e r ; 
 
                         } 
 
                         p r i v a t e   N y I d M a r k e r P a r a m   _ m a r k e r _ p a r a m   =   n e w   N y I d M a r k e r P a r a m ( ) ; 
 
                         p r i v a t e   N y I d M a r k e r P a t t e r n   _ m a r k e r _ d a t a   =   n e w   N y I d M a r k e r P a t t e r n ( ) ; 
 
 
 
                         / * * 
 
                           *   wb_L0NK00_0s0k0|Ts0QU00~0Y00
 
                           *   zvW0_0wb_n000000igW0f00eMO0naW0_0p0000xOW0~0Y00
 
                           * / 
 
 	 	         p u b l i c   v o i d   d e t e c t M a r k e r C a l l b a c k ( N y A R I n t C o o r d i n a t e s   i _ c o o r d , i n t [ ]   i _ v e r t e x _ i n d e x ) 
 
                         { 
 
                                 / / ek0zvnj00B}N
 
                                 i f   ( t h i s . m a r k e r _ d a t a   ! =   n u l l ) 
 
                                 { 
 
                                         r e t u r n ; 
 
                                 } 
 
                                 / / *퐧^jK00p000k0	Yc
 
                                 N y A R I n t P o i n t 2 d [ ]   v e r t e x   =   t h i s . _ _ r e f _ v e r t e x ; 
 
                                 v e r t e x [ 0 ]   =   i _ c o o r d . i t e m s [ i _ v e r t e x _ i n d e x [ 0 ] ] ; 
 
                                 v e r t e x [ 1 ]   =   i _ c o o r d . i t e m s [ i _ v e r t e x _ i n d e x [ 1 ] ] ; 
 
                                 v e r t e x [ 2 ]   =   i _ c o o r d . i t e m s [ i _ v e r t e x _ i n d e x [ 2 ] ] ; 
 
                                 v e r t e x [ 3 ]   =   i _ c o o r d . i t e m s [ i _ v e r t e x _ i n d e x [ 3 ] ] ; 
 
 
 
                                 N y I d M a r k e r P a r a m   p a r a m   =   t h i s . _ m a r k e r _ p a r a m ; 
 
                                 N y I d M a r k e r P a t t e r n   p a t t _ d a t a   =   t h i s . _ m a r k e r _ d a t a ; 
 
                                 / /   UOWnk0j00000000000K00R0QY0
 
                                 i f   ( ! t h i s . _ i d _ p i c k u p . p i c k F r o m R a s t e r ( t h i s . _ r e f _ r a s t e r . g e t G s P i x e l D r i v e r ( ) ,   v e r t e x ,   p a t t _ d a t a ,   p a r a m ) ) 
 
                                 { 
 
                                         r e t u r n ; 
 
                                 } 
 
                                 / / 00000
 
                                 i f   ( ! t h i s . _ e n c o d e r . e n c o d e ( p a t t _ d a t a ,   t h i s . _ d a t a _ t e m p ) ) 
 
                                 { 
 
                                         r e t u r n ; 
 
                                 } 
 
 
 
                                 / / }}XBlU00f0D00
 
                                 i f   ( t h i s . _ p r e v _ d a t a   = =   n u l l ) 
 
                                 { 
 
                                         / / }}XBlj0W0
 
                                         t h i s . _ c u r r e n t _ d a t a . c o p y F r o m ( t h i s . _ d a t a _ t e m p ) ; 
 
                                 } 
 
                                 e l s e 
 
                                 { 
 
                                         / / }}XBlB00
 
                                         i f   ( ! t h i s . _ p r e v _ d a t a . i s E q u a l ( ( t h i s . _ d a t a _ t e m p ) ) ) 
 
                                         { 
 
                                                 r e t u r n ; / / XˊBln0B0c0_0I D h0UF00
 
                                         } 
 
                                 } 
 
                                 / / eW0O0X0~0_0o0}}X-Nk0feL0B0c0_0h0M0`0Q00S q u a r e `1X0feY000
 
                                 / / 00K00HQo0S0n0agNg0W0K0[LU00j0D00
 
                                 N y A R S q u a r e   s q   =   t h i s . s q u a r e ; 
 
                                 / / d i r e c t i o n 0naW0f00s q u a r e 0feY000
 
                                 f o r   ( i n t   i   =   0 ;   i   <   4 ;   i + + ) 
 
                                 { 
 
                                         i n t   i d x   =   ( i   +   4   -   p a r a m . d i r e c t i o n )   %   4 ; 
 
                                         t h i s . _ c o o r d l i n e . c o o r d 2 L i n e ( i _ v e r t e x _ i n d e x [ i d x ] ,   i _ v e r t e x _ i n d e x [ ( i d x   +   1 )   %   4 ] ,   i _ c o o r d ,   s q . l i n e [ i ] ) ; 
 
                                 } 
 
                                 f o r   ( i n t   i   =   0 ;   i   <   4 ;   i + + ) 
 
                                 { 
 
                                         / / v}TXn0Np{
 
                                         i f   ( ! s q . l i n e [ i ] . c r o s s P o s ( s q . l i n e [ ( i   +   3 )   %   4 ] ,   s q . s q v e r t e x [ i ] ) ) 
 
                                         { 
 
                                                 t h r o w   n e w   N y A R E x c e p t i o n ( ) ; / / S0S0n0000_0^Y00j000000000k0Y00p0O K 
 
                                         } 
 
                                 } 
 
                                 t h i s . t h r e s h o l d   =   p a r a m . t h r e s h o l d ; 
 
                                 t h i s . m a r k e r _ d a t a   =   t h i s . _ c u r r e n t _ d a t a ; / / 0d0K0c0_00
 
                         } 
 
                 } 
 
 
 
 
 
                 / * *  00000L01uk0OH0000	Ypeg0Y00* / 
 
                 p u b l i c   o b j e c t   t a g ; 
 
 
 
                 / * * 
 
                   *   000E^n0{t
 
                   * / 
 
                 p r i v a t e   i n t   _ l o s t _ d e l a y _ c o u n t   =   0 ; 
 
                 p r i v a t e   i n t   _ l o s t _ d e l a y   =   5 ; 
 
 
 
                 p r i v a t e   R l e D e t e c t o r   _ s q u a r e _ d e t e c t ; 
 
                 p r o t e c t e d   I N y A R T r a n s M a t   _ t r a n s m a t ; 
 
                 p r i v a t e   N y A R R e c t O f f s e t   _ o f f s e t ; 
 
                 p r i v a t e   b o o l   _ i s _ a c t i v e ; 
 
                 p r i v a t e   i n t   _ c u r r e n t _ t h r e s h o l d   =   1 1 0 ; 
 
                 / /   [ A R ] iQP}gn0OX[(u
 
                 p r i v a t e   N y A R G r a y s c a l e R a s t e r   _ g s _ r a s t e r ; 
 
                 p r i v a t e   I N y I d M a r k e r D a t a   _ d a t a _ c u r r e n t ; 
 
                 p r i v a t e   N y A R H i s t o g r a m A n a l y z e r _ S l i d e P T i l e   _ t h r e s h o l d _ d e t e c t ; 
 
                 p r i v a t e   N y A R H i s t o g r a m   _ h i s t   =   n e w   N y A R H i s t o g r a m ( 2 5 6 ) ; 
 
                 p r i v a t e   I N y A R H i s t o g r a m F r o m R a s t e r   _ h i s t m a k e r ; 
 
                 / * * 
 
                   *   0000000000000
 
                   *   0000}bY00h0M0o00S0n000000000|Ts0QW0_0_k00{ @ l i n k   # i n i t I n s t a n c e } peg0000000n0RgSQt0[ňW0~0Y00
 
                   * / 
 
                 p r o t e c t e d   S i n g l e N y I d M a r k e r P r o c e s s e r ( ) 
 
                 { 
 
                         r e t u r n ; 
 
                 } 
 
                 p r i v a t e   b o o l   _ i n i t i a l i z e d   =   f a l s e ; 
 
                 / * * 
 
                   *   S0n0peo000000000RgSW0~0Y00
 
                   *   }bHQn0000K00|Ts0QW0f0O0`0U0D00
 
                   *   @ p a r a m   i _ p a r a m 
 
                   *   000000000000000S0n0000o00{ @ l i n k   # d e t e c t M a r k e r } k0eQRY00;uPh0TX0000g0B00_L0B00~0Y00
 
                   *   @ p a r a m   i _ e n c o d e r 
 
                   *   I D 000n0$P000000c[W0~0Y00
 
                   *   @ p a r a m   i _ m a r k e r _ w i d t h 
 
                   *   000n0irt&~*j0000m m XSMOg0c[W0~0Y00
 
                   *   @ 
 
                   * / 
 
                 p r o t e c t e d   v o i d   i n i t I n s t a n c e ( N y A R P a r a m   i _ p a r a m ,   I N y I d M a r k e r D a t a E n c o d e r   i _ e n c o d e r ,   d o u b l e   i _ m a r k e r _ w i d t h ) 
 
                 { 
 
                         / / RgSn
 
                         D e b u g . A s s e r t ( t h i s . _ i n i t i a l i z e d   = =   f a l s e ) ; 
 
 
 
                         N y A R I n t S i z e   s c r _ s i z e   =   i _ p a r a m . g e t S c r e e n S i z e ( ) ; 
 
                         / /   ㉐g0000000\O0
 
                         t h i s . _ s q u a r e _ d e t e c t   =   n e w   R l e D e t e c t o r ( 
 
                                 i _ p a r a m , 
 
                                 i _ e n c o d e r , 
 
                                 n e w   N y I d M a r k e r P i c k u p ( ) ) ; 
 
                         t h i s . _ t r a n s m a t   =   n e w   N y A R T r a n s M a t ( i _ p a r a m ) ; 
 
 
 
                         / /   $P;uP00000\O0
 
                         t h i s . _ g s _ r a s t e r   =   n e w   N y A R G r a y s c a l e R a s t e r ( s c r _ s i z e . w ,   s c r _ s i z e . h ) ; 
 
                         t h i s . _ h i s t m a k e r   =   ( I N y A R H i s t o g r a m F r o m R a s t e r ) t h i s . _ g s _ r a s t e r . c r e a t e I n t e r f a c e ( t y p e o f ( I N y A R H i s t o g r a m F r o m R a s t e r ) ) ; 
 
                         / / 000(un00000000000P\O0
 
                         t h i s . _ d a t a _ c u r r e n t   =   i _ e n c o d e r . c r e a t e D a t a I n s t a n c e ( ) ; 
 
                         t h i s . _ t h r e s h o l d _ d e t e c t   =   n e w   N y A R H i s t o g r a m A n a l y z e r _ S l i d e P T i l e ( 1 5 ) ; 
 
                         t h i s . _ i n i t i a l i z e d   =   t r u e ; 
 
                         t h i s . _ i s _ a c t i v e   =   f a l s e ; 
 
                         t h i s . _ o f f s e t   =   n e w   N y A R R e c t O f f s e t ( ) ; 
 
                         t h i s . _ o f f s e t . s e t S q u a r e ( i _ m a r k e r _ w i d t h ) ; 
 
                         r e t u r n ; 
 
 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000n0irt0000	YfW0~0Y00
 
                   *   @ p a r a m   i _ w i d t h 
 
                   *   000n0irt&~*j0000m m XSMOg0c[W0~0Y00
 
                   * / 
 
                 p u b l i c   v o i d   s e t M a r k e r W i d t h ( i n t   i _ w i d t h ) 
 
                 { 
 
                         t h i s . _ o f f s e t . s e t S q u a r e ( i _ w i d t h ) ; 
 
                         r e t u r n ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000000n0rKa00000W0~0Y00
 
                   *   rKa00000Y00h000W00000XW0f0D004XTk0o00{ @ l i n k   # o n L e a v e H a n d l e r } 00000000L0000U000*gXrKak0j00~0Y00
 
                   *   @ p a r a m   i _ i s _ f o r c e 
 
                   *   7_6R0000t r u e k0Y00h000000wj0W0k0000XrKa00000W0~0Y00
 
                   * / 
 
                 p u b l i c   v o i d   r e s e t ( b o o l   i _ i s _ f o r c e ) 
 
                 { 
 
                         i f   ( i _ i s _ f o r c e   = =   f a l s e   & &   t h i s . _ i s _ a c t i v e ) 
 
                         { 
 
                                 / /   7_6RfM0cH0g0j0Q00p00000000
 
                                 t h i s . o n L e a v e H a n d l e r ( ) ; 
 
                         } 
 
                         / / 000!qR
 
                         t h i s . _ i s _ a c t i v e   =   f a l s e ; 
 
                         r e t u r n ; 
 
                 } 
 
                 p r i v a t e   I N y A R R g b R a s t e r   _ l a s t _ i n p u t _ r a s t e r ; 
 
                 p r i v a t e   I N y A R R g b 2 G s F i l t e r   _ t o g s _ f i l t e r ; 
 
 
 
                 / * * 
 
                   *   S0n0peo00;uP0QtW0f00iRj0000iQ000000000|Ts0QW0~0Y00
 
                   *   00000000n0|Ts0QW0o00S0n0pe0|Ts0QW0_00000L00S0n0peL0B}NY00~0g0k0LD0~0Y00
 
                   *   @ p a r a m   i _ r a s t e r 
 
                   *   iQQt0Y00;uP0c[W0~0Y00
 
                   *   @ 
 
                   * / 
 
                 p u b l i c   v o i d   d e t e c t M a r k e r ( I N y A R R g b R a s t e r   i _ r a s t e r ) 
 
                 { 
 
                         / /   0000000
 
                         i f   ( ! t h i s . _ g s _ r a s t e r . g e t S i z e ( ) . i s E q u a l S i z e ( i _ r a s t e r . g e t S i z e ( ) . w ,   i _ r a s t e r . g e t S i z e ( ) . h ) ) 
 
                         { 
 
                                 t h r o w   n e w   N y A R E x c e p t i o n ( ) ; 
 
                         } 
 
                         / /   0000G S x0	YcY000
 
                         i f   ( t h i s . _ l a s t _ i n p u t _ r a s t e r   ! =   i _ r a s t e r ) 
 
                         { 
 
                                 t h i s . _ t o g s _ f i l t e r   =   ( I N y A R R g b 2 G s F i l t e r ) i _ r a s t e r . c r e a t e I n t e r f a c e ( t y p e o f ( I N y A R R g b 2 G s F i l t e r ) ) ; 
 
                                 t h i s . _ l a s t _ i n p u t _ r a s t e r   =   i _ r a s t e r ; 
 
                         } 
 
                         t h i s . _ t o g s _ f i l t e r . c o n v e r t ( t h i s . _ g s _ r a s t e r ) ; 
 
 
 
                         / /   00000000cY0( ,{N_pek0c[W0_000000W0O0o0eW0D00000cY00) 
 
                         t h i s . _ s q u a r e _ d e t e c t . i n i t ( t h i s . _ g s _ r a s t e r ,   t h i s . _ i s _ a c t i v e   ?   t h i s . _ d a t a _ c u r r e n t   :   n u l l ) ; 
 
                         t h i s . _ s q u a r e _ d e t e c t . d e t e c t M a r k e r ( t h i s . _ g s _ r a s t e r ,   t h i s . _ c u r r e n t _ t h r e s h o l d ,   t h i s . _ s q u a r e _ d e t e c t ) ; 
 
 
 
                         / /   XrKa0fe( 0000zvW0_0j000c u r r e n t _ d a t a 0!nY0K00X0) 
 
                         b o o l   i s _ i d _ f o u n d   =   u p d a t e S t a t u s ( t h i s . _ s q u a r e _ d e t e c t . s q u a r e ,   t h i s . _ s q u a r e _ d e t e c t . m a r k e r _ d a t a ) ; 
 
 
 
                         / / $P0000000( d e t e c t E x i s t M a r k e r k00B000) 
 
                         i f   ( i s _ i d _ f o u n d ) 
 
                         { 
 
                                 / / 000L0B00p00000n0hT$P0S f
 
                                 t h i s . _ c u r r e n t _ t h r e s h o l d   =   ( t h i s . _ c u r r e n t _ t h r e s h o l d   +   t h i s . _ s q u a r e _ d e t e c t . t h r e s h o l d )   /   2 ; 
 
                         } 
 
                         e l s e 
 
                         { 
 
                                 / / 000L0j0Q00p00c"}+ D u a l P T a i l g0Wn^i"}
 
                                 t h i s . _ h i s t m a k e r . c r e a t e H i s t o g r a m ( 4 ,   t h i s . _ h i s t ) ; 
 
                                 i n t   t h   =   t h i s . _ t h r e s h o l d _ d e t e c t . g e t T h r e s h o l d ( t h i s . _ h i s t ) ; 
 
                                 t h i s . _ c u r r e n t _ t h r e s h o l d   =   ( t h i s . _ c u r r e n t _ t h r e s h o l d   +   t h )   /   2 ; 
 
                         } 
 
                         r e t u r n ; 
 
                 } 
 
 
 
 
 
                 p r i v a t e   N y A R D o u b l e M a t r i x 4 4   _ t r a n s m a t _ r e s u l t   =   n e w   N y A R D o u b l e M a t r i x 4 4 ( ) ; 
 
                 p r i v a t e   N y A R T r a n s M a t R e s u l t P a r a m   _ l a s t _ r e s u l t _ p a r a m   =   n e w   N y A R T r a n s M a t R e s u l t P a r a m ( ) ; 
 
 
 
                 / * * 000000n0000000feW00_k0_X0f0]000000pe0ƙRW0~0Y00
 
                   * / 
 
                 p r i v a t e   b o o l   u p d a t e S t a t u s ( N y A R S q u a r e   i _ s q u a r e ,   I N y I d M a r k e r D a t a   i _ m a r k e r _ d a t a ) 
 
                 { 
 
                         b o o l   i s _ i d _ f o u n d   =   f a l s e ; 
 
                         i f   ( ! t h i s . _ i s _ a c t i v e ) 
 
                         { / /   *gX-N
 
                                 i f   ( i _ m a r k e r _ d a t a   = =   n u l l ) 
 
                                 { / /   *gXK00*gXn0wy
 
                                         / /   j0k00W0j0D00000
 
                                         t h i s . _ i s _ a c t i v e   =   f a l s e ; 
 
                                 } 
 
                                 e l s e 
 
                                 { / /   *gXK00Xn0wy
 
                                         t h i s . _ d a t a _ c u r r e n t . c o p y F r o m ( i _ m a r k e r _ d a t a ) ; 
 
                                         / /   0000ub
 
                                         / /   O n E n t e r 
 
                                         t h i s . o n E n t e r H a n d l e r ( t h i s . _ d a t a _ c u r r e n t ) ; 
 
                                         / /   	YcLR0\Ob
 
                                         t h i s . _ t r a n s m a t . t r a n s M a t ( i _ s q u a r e ,   t h i s . _ o f f s e t ,   t h i s . _ t r a n s m a t _ r e s u l t ,   t h i s . _ l a s t _ r e s u l t _ p a r a m ) ; 
 
                                         / /   O n U p d a t e 
 
                                         t h i s . o n U p d a t e H a n d l e r ( i _ s q u a r e ,   t h i s . _ t r a n s m a t _ r e s u l t ) ; 
 
                                         t h i s . _ l o s t _ d e l a y _ c o u n t   =   0 ; 
 
                                         t h i s . _ i s _ a c t i v e   =   t r u e ; 
 
                                         i s _ i d _ f o u n d   =   t r u e ; 
 
                                 } 
 
                         } 
 
                         e l s e 
 
                         { / /   X-N
 
                                 i f   ( i _ m a r k e r _ d a t a   = =   n u l l ) 
 
                                 { 
 
                                         / /   XK00*gXn0wy
 
                                         t h i s . _ l o s t _ d e l a y _ c o u n t + + ; 
 
                                         i f   ( t h i s . _ l o s t _ d e l a y   <   t h i s . _ l o s t _ d e l a y _ c o u n t ) 
 
                                         { 
 
                                                 / /   O n L e a v e 
 
                                                 t h i s . o n L e a v e H a n d l e r ( ) ; 
 
                                                 t h i s . _ i s _ a c t i v e   =   f a l s e ; 
 
                                         } 
 
                                 } 
 
                                 e l s e   i f   ( t h i s . _ d a t a _ c u r r e n t . i s E q u a l ( i _ m a r k e r _ d a t a ) ) 
 
                                 { 
 
                                         / / TX0i d n0QX
 
                                         i f   ( ! t h i s . _ t r a n s m a t . t r a n s M a t C o n t i n u e ( i _ s q u a r e ,   t h i s . _ o f f s e t ,   t h i s . _ t r a n s m a t _ r e s u l t ,   t h i s . _ l a s t _ r e s u l t _ p a r a m . l a s t _ e r r o r ,   t h i s . _ t r a n s m a t _ r e s u l t ,   t h i s . _ l a s t _ r e s u l t _ p a r a m ) ) 
 
                                         { 
 
                                                 t h i s . _ t r a n s m a t . t r a n s M a t ( i _ s q u a r e ,   t h i s . _ o f f s e t ,   t h i s . _ t r a n s m a t _ r e s u l t ,   t h i s . _ l a s t _ r e s u l t _ p a r a m ) ; 
 
                                         } 
 
                                         / /   O n U p d a t e 
 
                                         t h i s . o n U p d a t e H a n d l e r ( i _ s q u a r e ,   t h i s . _ t r a n s m a t _ r e s u l t ) ; 
 
                                         t h i s . _ l o s t _ d e l a y _ c o u n t   =   0 ; 
 
                                         i s _ i d _ f o u n d   =   t r u e ; 
 
                                 } 
 
                                 e l s e 
 
                                 { / /   puj00000n0X!No00000W0j0D00
 
                                         t h r o w   n e w   N y A R E x c e p t i o n ( ) ; 
 
                                 } 
 
                         } 
 
                         r e t u r n   i s _ i d _ f o u n d ; 
 
                 } 
 
                 / * * 
 
                   *   ]000000peg0Y00
 
                   *   }bW0_0000g00000zvBfn0Qt0[ňW0f0O0`0U0D00
 
                   *   @ p a r a m   i _ c o d e 
 
                   *   iQW0_0I D 000n0Q[000000W0_0000g0Y00
 
                   *   O(uW0_000000k0T[0f000000W0f0O0`0U0D00
 
                   *   ( OH0p00{ @ l i n k   N y I d M a r k e r D a t a E n c o d e r _ R a w B i t } 000000k0(uD0_0Bfo00{ @ l i n k   N y I d M a r k e r D a t a E n c o d e r _ R a w B i t } k00000g0M0~0Y00) 
 
                   * / 
 
                 p r o t e c t e d   a b s t r a c t   v o i d   o n E n t e r H a n d l e r ( I N y I d M a r k e r D a t a   i _ c o d e ) ; 
 
                 / * * 
 
                   *   ]000000peg0Y00
 
                   *   }bW0_0000g00000m1YBfn0Qt0[ňW0f0O0`0U0D00
 
                   * / 
 
                 p r o t e c t e d   a b s t r a c t   v o i d   o n L e a v e H a n d l e r ( ) ; 
 
                 / * * 
 
                   *   ]000000peg0Y00
 
                   *   }bW0_0000g00000feBfn0Qt0[ňW0f0O0`0U0D00
 
                   *   _pen0$Pn0	gRgo00peL0B}NY00~0g0g0Y00
 
                   *   @ p a r a m   i _ s q u a r e 
 
                   *   s(Wn0000iQMOng0Y00
 
                   *   @ p a r a m   o _ r e s u l t 
 
                   *   s(Wn0YR	YcLRg0Y00
 
                   * / 
 
                 p r o t e c t e d   a b s t r a c t   v o i d   o n U p d a t e H a n d l e r ( N y A R S q u a r e   i _ s q u a r e ,   N y A R D o u b l e M a t r i x 4 4   o _ r e s u l t ) ; 
 
         } 
 
 } 