/ *   
 
   *   P R O J E C T :   N y A R T o o l k i t 
 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
   *   T h i s   w o r k   i s   b a s e d   o n   t h e   o r i g i n a l   A R T o o l K i t   d e v e l o p e d   b y 
 
   *       H i r o k a z u   K a t o 
 
   *       M a r k   B i l l i n g h u r s t 
 
   *       H I T L a b ,   U n i v e r s i t y   o f   W a s h i n g t o n ,   S e a t t l e 
 
   *   h t t p : / / w w w . h i t l . w a s h i n g t o n . e d u / a r t o o l k i t / 
 
   * 
 
   *   T h e   N y A R T o o l k i t   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   S y s t e m ; 
 
 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 . c o r e 
 
 { 
 
 
 
         / * * 
 
           *   S0n0000o00;uPK0000000S_Y00_j0PH0_0R G B 000g0Y00
 
           *   A R T o o l K i t 1uegn0000000g0;uPK000000S_Y00_j0cOW0~0Y00
 
           *   S0n0peo0S'`0͑W0f0D00_00NOg0Y00ؚj0{ @ l i n k   N y A R C o l o r P a t t _ O 3 } 0Oc0f0O0`0U0D00
 
           * / 
 
         p u b l i c   c l a s s   N y A R C o l o r P a t t _ B a s e   :   I N y A R C o l o r P a t t 
 
         { 
 
                 p r o t e c t e d   c o n s t   i n t   A R _ P A T T _ S A M P L E _ N U M   =   6 4 ; 
 
                 p r o t e c t e d   c o n s t   i n t   B U F F E R _ F O R M A T   =   N y A R B u f f e r T y p e . I N T 1 D _ X 8 R 8 G 8 B 8 _ 3 2 ; 
 
                 p r o t e c t e d   r e a d o n l y   d o u b l e [ ] [ ]   C P A R A M _ W O R L D   =   {   n e w   d o u b l e [ ]   {   1 0 0 . 0 ,   1 0 0 . 0   } ,   n e w   d o u b l e [ ]   {   1 0 0 . 0   +   1 0 . 0 ,   1 0 0 . 0   } ,   n e w   d o u b l e [ ]   {   1 0 0 . 0   +   1 0 . 0 ,   1 0 0 . 0   +   1 0 . 0   } ,   n e w   d o u b l e [ ]   {   1 0 0 . 0 ,   1 0 0 . 0   +   1 0 . 0   }   } ; 
 
 
 
                 p r o t e c t e d   N y A R I n t S i z e   _ s i z e ; 
 
                 p r o t e c t e d   i n t [ ]   _ p a t d a t a ; 
 
 
 
                 p r o t e c t e d   I N y A R R g b P i x e l D r i v e r   _ p i x e l r e a d e r ; 
 
                 / * * 
 
                   *   0000000g0Y00
 
                   *   P^0c[W0f000000000ubW0~0Y00
 
                   *   @ p a r a m   i _ w i d t h 
 
                   *   000n0000
 
                   *   @ p a r a m   i _ h e i g h t 
 
                   *   000n0000
 
                   *   @   
 
                   * / 
 
                 p u b l i c   N y A R C o l o r P a t t _ B a s e ( i n t   i _ w i d t h ,   i n t   i _ h e i g h t ) 
 
                 { 
 
                         / / eQR6RP
 
                         D e b u g . A s s e r t ( i _ w i d t h   < =   6 4   & &   i _ h e i g h t   < =   6 4 ) ; 
 
                         t h i s . _ s i z e   =   n e w   N y A R I n t S i z e ( i _ w i d t h ,   i _ h e i g h t ) ; 
 
                         t h i s . _ p a t d a t a   =   n e w   i n t [ i _ h e i g h t   *   i _ w i d t h ] ; 
 
                         t h i s . _ p i x e l r e a d e r   =   N y A R R g b P i x e l D r i v e r F a c t o r y . c r e a t e D r i v e r ( t h i s ) ; 
 
                         r e t u r n ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo0000n0E^0ԏW0~0Y00
 
                   * / 
 
                 p u b l i c   i n t   g e t W i d t h ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ s i z e . w ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo0000n0ؚU00ԏW0~0Y00
 
                   * / 
 
                 p u b l i c   i n t   g e t H e i g h t ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ s i z e . h ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo0000n0000n0Sgq$P0ԏW0~0Y00
 
                   * / 
 
                 p u b l i c   N y A R I n t S i z e   g e t S i z e ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ s i z e ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000n0;u }0S0000000n0Sgq$P0ԏW0~0Y00
 
                   * / 
 
                 p u b l i c   I N y A R R g b P i x e l D r i v e r   g e t R g b P i x e l D r i v e r ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ p i x e l r e a d e r ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000;uPn000000ԏW0~0Y00
 
                   *   0000b__o00{ @ l i n k   N y A R B u f f e r T y p e # I N T 1 D _ X 8 R 8 G 8 B 8 _ 3 2 } ( i n t [ ] ) g0Y00
 
                   * / 
 
                 p u b l i c   o b j e c t   g e t B u f f e r ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ p a t d a t a ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000000L000000@b	gW0f0D00K00ԏW0~0Y00W,gvk0t r u e g0Y00
 
                   * / 
 
                 p u b l i c   b o o l   h a s B u f f e r ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ p a t d a t a   ! =   n u l l ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo0O(u
NSg0Y00
 
                   * / 
 
                 p u b l i c   v o i d   w r a p B u f f e r ( o b j e c t   i _ r e f _ b u f ) 
 
                 { 
 
                         N y A R E x c e p t i o n . n o t I m p l e m e n t ( ) ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo000000000n0[pe0ԏW0~0Y00
 
                   * / 
 
                 p u b l i c   i n t   g e t B u f f e r T y p e ( ) 
 
                 { 
 
                         r e t u r n   B U F F E R _ F O R M A T ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000000n00000000L0_pen00n0h0 NW0f0D00K0$R[W0~0Y00
 
                   * / 
 
                 p u b l i c   b o o l   i s E q u a l B u f f e r T y p e ( i n t   i _ t y p e _ v a l u e ) 
 
                 { 
 
                         r e t u r n   B U F F E R _ F O R M A T   = =   i _ t y p e _ v a l u e ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00\q_	Yc000000{W0~0Y00
 
                   *   @ p a r a m   i _ v e r t e x 
 
                   *   	YcCQn0҉|0[Y00pMR0pg0B00_L0B000
 
                   *   @ p a r a m   o _ p a r a 
 
                   *   {W0_000000n0QRHQMR
 
                   *   @ r e t u r n 
 
                   *   {k0bRY00h0t r u e g0Y00
 
                   *   @ 
 
                   * / 
 
                 p r i v a t e   b o o l   g e t _ c p a r a ( N y A R I n t P o i n t 2 d [ ]   i _ v e r t e x ,   N y A R M a t   o _ p a r a ) 
 
                 { 
 
                         d o u b l e [ ] [ ]   w o r l d   =   C P A R A M _ W O R L D ; 
 
                         N y A R M a t   a   =   n e w   N y A R M a t ( 8 ,   8 ) ; / /   !kQtg0$P0-[Y00n0g00RgS
N/ /   n e w   N y A R M a t (   8 ,   8   ) ; 
 
                         d o u b l e [ ] [ ]   a _ a r r a y   =   a . g e t A r r a y ( ) ; 
 
                         N y A R M a t   b   =   n e w   N y A R M a t ( 8 ,   1 ) ; / /   !kQtg0$P0-[Y00n0g00RgS
N/ /   n e w   N y A R M a t (   8 ,   1   ) ; 
 
                         d o u b l e [ ] [ ]   b _ a r r a y   =   b . g e t A r r a y ( ) ; 
 
                         d o u b l e [ ]   a _ p t 0 ,   a _ p t 1 ; 
 
                         d o u b l e [ ]   w o r l d _ p t i ; 
 
 
 
                         f o r   ( i n t   i   =   0 ;   i   <   4 ;   i + + ) 
 
                         { 
 
                                 a _ p t 0   =   a _ a r r a y [ i   *   2 ] ; 
 
                                 a _ p t 1   =   a _ a r r a y [ i   *   2   +   1 ] ; 
 
                                 w o r l d _ p t i   =   w o r l d [ i ] ; 
 
 
 
                                 a _ p t 0 [ 0 ]   =   ( d o u b l e ) w o r l d _ p t i [ 0 ] ; / /   a - > m [ i * 1 6 + 0 ]   =   w o r l d [ i ] [ 0 ] ; 
 
                                 a _ p t 0 [ 1 ]   =   ( d o u b l e ) w o r l d _ p t i [ 1 ] ; / /   a - > m [ i * 1 6 + 1 ]   =   w o r l d [ i ] [ 1 ] ; 
 
                                 a _ p t 0 [ 2 ]   =   1 . 0 ; / /   a - > m [ i * 1 6 + 2 ]   =   1 . 0 ; 
 
                                 a _ p t 0 [ 3 ]   =   0 . 0 ; / /   a - > m [ i * 1 6 + 3 ]   =   0 . 0 ; 
 
                                 a _ p t 0 [ 4 ]   =   0 . 0 ; / /   a - > m [ i * 1 6 + 4 ]   =   0 . 0 ; 
 
                                 a _ p t 0 [ 5 ]   =   0 . 0 ; / /   a - > m [ i * 1 6 + 5 ]   =   0 . 0 ; 
 
                                 a _ p t 0 [ 6 ]   =   ( d o u b l e ) ( - w o r l d _ p t i [ 0 ]   *   i _ v e r t e x [ i ] . x ) ; / /   a - > m [ i * 1 6 + 6 ] =   - w o r l d [ i ] [ 0 ] * v e r t e x [ i ] [ 0 ] ; 
 
                                 a _ p t 0 [ 7 ]   =   ( d o u b l e ) ( - w o r l d _ p t i [ 1 ]   *   i _ v e r t e x [ i ] . x ) ; / /   a - > m [ i * 1 6 + 7 ] = - w o r l d [ i ] [ 1 ] * v e r t e x [ i ] [ 0 ] ; 
 
                                 a _ p t 1 [ 0 ]   =   0 . 0 ; / /   a - > m [ i * 1 6 + 8 ]   =   0 . 0 ; 
 
                                 a _ p t 1 [ 1 ]   =   0 . 0 ; / /   a - > m [ i * 1 6 + 9 ]   =   0 . 0 ; 
 
                                 a _ p t 1 [ 2 ]   =   0 . 0 ; / /   a - > m [ i * 1 6 + 1 0 ]   =   0 . 0 ; 
 
                                 a _ p t 1 [ 3 ]   =   ( d o u b l e ) w o r l d _ p t i [ 0 ] ; / /   a - > m [ i * 1 6 + 1 1 ]   =   w o r l d [ i ] [ 0 ] ; 
 
                                 a _ p t 1 [ 4 ]   =   ( d o u b l e ) w o r l d _ p t i [ 1 ] ; / /   a - > m [ i * 1 6 + 1 2 ]   =   w o r l d [ i ] [ 1 ] ; 
 
                                 a _ p t 1 [ 5 ]   =   1 . 0 ; / /   a - > m [ i * 1 6 + 1 3 ]   =   1 . 0 ; 
 
                                 a _ p t 1 [ 6 ]   =   ( d o u b l e ) ( - w o r l d _ p t i [ 0 ]   *   i _ v e r t e x [ i ] . y ) ; / /   a - > m [ i * 1 6 + 1 4 ] = - w o r l d [ i ] [ 0 ] * v e r t e x [ i ] [ 1 ] ; 
 
                                 a _ p t 1 [ 7 ]   =   ( d o u b l e ) ( - w o r l d _ p t i [ 1 ]   *   i _ v e r t e x [ i ] . y ) ; / /   a - > m [ i * 1 6 + 1 5 ] = - w o r l d [ i ] [ 1 ] * v e r t e x [ i ] [ 1 ] ; 
 
                                 b _ a r r a y [ i   *   2   +   0 ] [ 0 ]   =   ( d o u b l e ) i _ v e r t e x [ i ] . x ; / /   b - > m [ i * 2 + 0 ]   = v e r t e x [ i ] [ 0 ] ; 
 
                                 b _ a r r a y [ i   *   2   +   1 ] [ 0 ]   =   ( d o u b l e ) i _ v e r t e x [ i ] . y ; / /   b - > m [ i * 2 + 1 ]   = v e r t e x [ i ] [ 1 ] ; 
 
                         } 
 
                         i f   ( ! a . i n v e r s e ( ) ) 
 
                         { 
 
                                 r e t u r n   f a l s e ; 
 
                         } 
 
 
 
                         o _ p a r a . m u l ( a ,   b ) ; 
 
                         r e t u r n   t r u e ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000n0i _ v e r t e x s g0[U000V҉b_K0000000S_W0f00000000k0<h
}W0~0Y00
 
                   * / 
 
                 p u b l i c   v i r t u a l   b o o l   p i c k F r o m R a s t e r ( I N y A R R g b R a s t e r   i m a g e ,   N y A R I n t P o i n t 2 d [ ]   i _ v e r t e x s ) 
 
                 { 
 
                         / /   0000n0R0QW0k01YWeY00S0h00B000
 
                         N y A R M a t   c p a r a   =   n e w   N y A R M a t ( 8 ,   1 ) ; 
 
                         i f   ( ! g e t _ c p a r a ( i _ v e r t e x s ,   c p a r a ) ) 
 
                         { 
 
                                 r e t u r n   f a l s e ; 
 
                         } 
 
                         d o u b l e [ ] [ ]   p a r a   =   c p a r a . g e t A r r a y ( ) ; 
 
                         d o u b l e   p a r a 0 0   =   p a r a [ 0   *   3   +   0 ] [ 0 ] ; 
 
                         d o u b l e   p a r a 0 1   =   p a r a [ 0   *   3   +   1 ] [ 0 ] ; 
 
                         d o u b l e   p a r a 0 2   =   p a r a [ 0   *   3   +   2 ] [ 0 ] ; 
 
                         d o u b l e   p a r a 1 0   =   p a r a [ 1   *   3   +   0 ] [ 0 ] ; 
 
                         d o u b l e   p a r a 1 1   =   p a r a [ 1   *   3   +   1 ] [ 0 ] ; 
 
                         d o u b l e   p a r a 1 2   =   p a r a [ 1   *   3   +   2 ] [ 0 ] ; 
 
                         d o u b l e   p a r a 2 0   =   p a r a [ 2   *   3   +   0 ] [ 0 ] ; 
 
                         d o u b l e   p a r a 2 1   =   p a r a [ 2   *   3   +   1 ] [ 0 ] ; 
 
                         d o u b l e   p a r a 2 2   =   1 . 0 ; 
 
 
 
                         i n t   l x 1   =   ( i n t ) ( ( i _ v e r t e x s [ 0 ] . x   -   i _ v e r t e x s [ 1 ] . x )   *   ( i _ v e r t e x s [ 0 ] . x   -   i _ v e r t e x s [ 1 ] . x )   +   ( i _ v e r t e x s [ 0 ] . y   -   i _ v e r t e x s [ 1 ] . y )   *   ( i _ v e r t e x s [ 0 ] . y   -   i _ v e r t e x s [ 1 ] . y ) ) ; 
 
                         i n t   l x 2   =   ( i n t ) ( ( i _ v e r t e x s [ 2 ] . x   -   i _ v e r t e x s [ 3 ] . x )   *   ( i _ v e r t e x s [ 2 ] . x   -   i _ v e r t e x s [ 3 ] . x )   +   ( i _ v e r t e x s [ 2 ] . y   -   i _ v e r t e x s [ 3 ] . y )   *   ( i _ v e r t e x s [ 2 ] . y   -   i _ v e r t e x s [ 3 ] . y ) ) ; 
 
                         i n t   l y 1   =   ( i n t ) ( ( i _ v e r t e x s [ 1 ] . x   -   i _ v e r t e x s [ 2 ] . x )   *   ( i _ v e r t e x s [ 1 ] . x   -   i _ v e r t e x s [ 2 ] . x )   +   ( i _ v e r t e x s [ 1 ] . y   -   i _ v e r t e x s [ 2 ] . y )   *   ( i _ v e r t e x s [ 1 ] . y   -   i _ v e r t e x s [ 2 ] . y ) ) ; 
 
                         i n t   l y 2   =   ( i n t ) ( ( i _ v e r t e x s [ 3 ] . x   -   i _ v e r t e x s [ 0 ] . x )   *   ( i _ v e r t e x s [ 3 ] . x   -   i _ v e r t e x s [ 0 ] . x )   +   ( i _ v e r t e x s [ 3 ] . y   -   i _ v e r t e x s [ 0 ] . y )   *   ( i _ v e r t e x s [ 3 ] . y   -   i _ v e r t e x s [ 0 ] . y ) ) ; 
 
                         i f   ( l x 2   >   l x 1 ) 
 
                         { 
 
                                 l x 1   =   l x 2 ; 
 
                         } 
 
                         i f   ( l y 2   >   l y 1 ) 
 
                         { 
 
                                 l y 1   =   l y 2 ; 
 
                         } 
 
 
 
                         i n t   s a m p l e _ p i x e l _ x   =   t h i s . _ s i z e . w ; 
 
                         i n t   s a m p l e _ p i x e l _ y   =   t h i s . _ s i z e . h ; 
 
                         w h i l e   ( s a m p l e _ p i x e l _ x   *   s a m p l e _ p i x e l _ x   <   l x 1   /   4 ) 
 
                         { 
 
                                 s a m p l e _ p i x e l _ x   * =   2 ; 
 
                         } 
 
                         w h i l e   ( s a m p l e _ p i x e l _ y   *   s a m p l e _ p i x e l _ y   <   l y 1   /   4 ) 
 
                         { 
 
                                 s a m p l e _ p i x e l _ y   * =   2 ; 
 
                         } 
 
 
 
                         i f   ( s a m p l e _ p i x e l _ x   >   A R _ P A T T _ S A M P L E _ N U M ) 
 
                         { 
 
                                 s a m p l e _ p i x e l _ x   =   A R _ P A T T _ S A M P L E _ N U M ; 
 
                         } 
 
                         i f   ( s a m p l e _ p i x e l _ y   >   A R _ P A T T _ S A M P L E _ N U M ) 
 
                         { 
 
                                 s a m p l e _ p i x e l _ y   =   A R _ P A T T _ S A M P L E _ N U M ; 
 
                         } 
 
 
 
                         i n t   x d i v   =   s a m p l e _ p i x e l _ x   /   t h i s . _ s i z e . w ; / /   x d i v   =   x d i v 2 / C o n f i g . A R _ P A T T _ S I Z E _ X ; 
 
                         i n t   y d i v   =   s a m p l e _ p i x e l _ y   /   t h i s . _ s i z e . h ; / /   y d i v   =   y d i v 2 / C o n f i g . A R _ P A T T _ S I Z E _ Y ; 
 
 
 
 
 
                         i n t   i m g _ x   =   i m a g e . g e t W i d t h ( ) ; 
 
                         i n t   i m g _ y   =   i m a g e . g e t H e i g h t ( ) ; 
 
 
 
                         d o u b l e   x d i v 2 _ r e c i p r o c a l   =   1 . 0   /   s a m p l e _ p i x e l _ x ; 
 
                         d o u b l e   y d i v 2 _ r e c i p r o c a l   =   1 . 0   /   s a m p l e _ p i x e l _ y ; 
 
                         i n t   r ,   g ,   b ; 
 
                         i n t [ ]   r g b _ t m p   =   n e w   i n t [ 3 ] ; 
 
 
 
                         / / 000000000S_
 
                         I N y A R R g b P i x e l D r i v e r   r e a d e r   =   i m a g e . g e t R g b P i x e l D r i v e r ( ) ; 
 
                         i n t   x d i v _ x _ y d i v   =   x d i v   *   y d i v ; 
 
 
 
                         f o r   ( i n t   i y   =   0 ;   i y   <   t h i s . _ s i z e . h ;   i y + + ) 
 
                         { 
 
                                 f o r   ( i n t   i x   =   0 ;   i x   <   t h i s . _ s i z e . w ;   i x + + ) 
 
                                 { 
 
                                         r   =   g   =   b   =   0 ; 
 
                                         / / 1 00000\Ob
 
                                         f o r   ( i n t   j   =   0 ;   j   <   y d i v ;   j + + ) 
 
                                         { 
 
                                                 d o u b l e   y w   =   1 0 2 . 5   +   5 . 0   *   ( i y   *   y d i v   +   j   +   0 . 5 )   *   y d i v 2 _ r e c i p r o c a l ; 
 
                                                 f o r   ( i n t   i   =   0 ;   i   <   x d i v ;   i + + ) 
 
                                                 { 
 
                                                         d o u b l e   x w   =   1 0 2 . 5   +   5 . 0   *   ( i x   *   x d i v   +   i   +   0 . 5 )   *   x d i v 2 _ r e c i p r o c a l ; 
 
                                                         d o u b l e   d   =   p a r a 2 0   *   x w   +   p a r a 2 1   *   y w   +   p a r a 2 2 ; 
 
                                                         i f   ( d   = =   0 ) 
 
                                                         { 
 
                                                                 t h r o w   n e w   N y A R E x c e p t i o n ( ) ; 
 
                                                         } 
 
                                                         i n t   x c   =   ( i n t ) ( ( p a r a 0 0   *   x w   +   p a r a 0 1   *   y w   +   p a r a 0 2 )   /   d ) ; 
 
                                                         i n t   y c   =   ( i n t ) ( ( p a r a 1 0   *   x w   +   p a r a 1 1   *   y w   +   p a r a 1 2 )   /   d ) ; 
 
 
 
                                                         i f   ( x c   > =   0   & &   x c   <   i m g _ x   & &   y c   > =   0   & &   y c   <   i m g _ y ) 
 
                                                         { 
 
                                                                 r e a d e r . g e t P i x e l ( x c ,   y c ,   r g b _ t m p ) ; 
 
                                                                 r   + =   r g b _ t m p [ 0 ] ; / /   R 
 
                                                                 g   + =   r g b _ t m p [ 1 ] ; / /   G 
 
                                                                 b   + =   r g b _ t m p [ 2 ] ; / /   B 
 
                                                                 / /   S y s t e m . o u t . p r i n t l n ( x c + " : " + y c + " : " + r g b _ t m p [ 0 ] + " : " + r g b _ t m p [ 1 ] + " : " + r g b _ t m p [ 2 ] ) ; 
 
                                                         } 
 
                                                 } 
 
                                         } 
 
                                         t h i s . _ p a t d a t a [ i y   *   t h i s . _ s i z e . w   +   i x ]   =   ( ( ( r   /   x d i v _ x _ y d i v )   &   0 x f f )   < <   1 6 )   |   ( ( ( g   /   x d i v _ x _ y d i v )   &   0 x f f )   < <   8 )   |   ( ( ( b   /   x d i v _ x _ y d i v )   &   0 x f f ) ) ; 
 
                                 } 
 
                         } 
 
                         r e t u r n   t r u e ; 
 
                 } 
 
                 p u b l i c   o b j e c t   c r e a t e I n t e r f a c e ( T y p e   i I i d ) 
 
                 { 
 
                         i f   ( i I i d   = =   t y p e o f ( I N y A R P e r s p e c t i v e C o p y ) ) 
 
                         { 
 
                                 r e t u r n   N y A R P e r s p e c t i v e C o p y F a c t o r y . c r e a t e D r i v e r ( t h i s ) ; 
 
                         } 
 
                         t h r o w   n e w   N y A R E x c e p t i o n ( ) ; 
 
                 } 
 
 
 
         } 
 
 } 