/ *   
 
   *   P R O J E C T :   N y A R T o o l k i t ( E x t e n s i o n ) 
 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
   *   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 1 2   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 > 
 
   *   
 
   * / 
 
 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 
 
 { 
 
         p u b l i c   a b s t r a c t   c l a s s   N y A R P e r s p e c t i v e C o p y _ B a s e   :   I N y A R P e r s p e c t i v e C o p y 
 
         { 
 
                 p r i v a t e   c o n s t   i n t   L O C A L _ L T   =   1 ; 
 
                 p r o t e c t e d   N y A R P e r s p e c t i v e P a r a m G e n e r a t o r   _ p e r s p e c t i v e _ g e n ; 
 
                 p r o t e c t e d   r e a d o n l y   d o u b l e [ ]   _ _ p i c k F r o m R a s t e r _ c p a r a   =   n e w   d o u b l e [ 8 ] ; 
 
                 p r o t e c t e d   N y A R P e r s p e c t i v e C o p y _ B a s e ( ) 
 
                 { 
 
                         t h i s . _ p e r s p e c t i v e _ g e n   =   n e w   N y A R P e r s p e c t i v e P a r a m G e n e r a t o r _ O 1 ( L O C A L _ L T ,   L O C A L _ L T ) ; 
 
                 } 
 
                 p u b l i c   b o o l   c o p y P a t t ( d o u b l e   i _ x 1 ,   d o u b l e   i _ y 1 ,   d o u b l e   i _ x 2 ,   d o u b l e   i _ y 2 ,   d o u b l e   i _ x 3 ,   d o u b l e   i _ y 3 ,   d o u b l e   i _ x 4 ,   d o u b l e   i _ y 4 ,   i n t   i _ e d g e _ x ,   i n t   i _ e d g e _ y ,   i n t   i _ r e s o l u t i o n ,   I N y A R R g b R a s t e r   i _ o u t ) 
 
                 { 
 
                         N y A R I n t S i z e   o u t _ s i z e   =   i _ o u t . g e t S i z e ( ) ; 
 
                         i n t   x e   =   o u t _ s i z e . w   *   i _ e d g e _ x   /   5 0 ; 
 
                         i n t   y e   =   o u t _ s i z e . h   *   i _ e d g e _ y   /   5 0 ; 
 
 
 
                         / / 000000P^g0R\
 
                         i f   ( i _ r e s o l u t i o n   = =   1 ) 
 
                         { 
 
                                 i f   ( ! t h i s . _ p e r s p e c t i v e _ g e n . g e t P a r a m ( ( x e   *   2   +   o u t _ s i z e . w ) ,   ( y e   *   2   +   o u t _ s i z e . h ) ,   i _ x 1 ,   i _ y 1 ,   i _ x 2 ,   i _ y 2 ,   i _ x 3 ,   i _ y 3 ,   i _ x 4 ,   i _ y 4 ,   t h i s . _ _ p i c k F r o m R a s t e r _ c p a r a ) ) 
 
                                 { 
 
                                         r e t u r n   f a l s e ; 
 
                                 } 
 
                                 t h i s . o n e P i x e l ( x e   +   L O C A L _ L T ,   y e   +   L O C A L _ L T ,   t h i s . _ _ p i c k F r o m R a s t e r _ c p a r a ,   i _ o u t ) ; 
 
                         } 
 
                         e l s e 
 
                         { 
 
                                 i f   ( ! t h i s . _ p e r s p e c t i v e _ g e n . g e t P a r a m ( ( x e   *   2   +   o u t _ s i z e . w )   *   i _ r e s o l u t i o n ,   ( y e   *   2   +   o u t _ s i z e . h )   *   i _ r e s o l u t i o n ,   i _ x 1 ,   i _ y 1 ,   i _ x 2 ,   i _ y 2 ,   i _ x 3 ,   i _ y 3 ,   i _ x 4 ,   i _ y 4 ,   t h i s . _ _ p i c k F r o m R a s t e r _ c p a r a ) ) 
 
                                 { 
 
                                         r e t u r n   f a l s e ; 
 
                                 } 
 
                                 t h i s . m u l t i P i x e l ( x e   *   i _ r e s o l u t i o n   +   L O C A L _ L T ,   y e   *   i _ r e s o l u t i o n   +   L O C A L _ L T ,   t h i s . _ _ p i c k F r o m R a s t e r _ c p a r a ,   i _ r e s o l u t i o n ,   i _ o u t ) ; 
 
                         } 
 
                         r e t u r n   t r u e ; 
 
                 } 
 
 
 
                 p u b l i c   b o o l   c o p y P a t t ( N y A R D o u b l e P o i n t 2 d [ ]   i _ v e r t e x ,   i n t   i _ e d g e _ x ,   i n t   i _ e d g e _ y ,   i n t   i _ r e s o l u t i o n ,   I N y A R R g b R a s t e r   i _ o u t ) 
 
                 { 
 
                         r e t u r n   t h i s . c o p y P a t t ( i _ v e r t e x [ 0 ] . x ,   i _ v e r t e x [ 0 ] . y ,   i _ v e r t e x [ 1 ] . x ,   i _ v e r t e x [ 1 ] . y ,   i _ v e r t e x [ 2 ] . x ,   i _ v e r t e x [ 2 ] . y ,   i _ v e r t e x [ 3 ] . x ,   i _ v e r t e x [ 3 ] . y ,   i _ e d g e _ x ,   i _ e d g e _ y ,   i _ r e s o l u t i o n ,   i _ o u t ) ; 
 
                 } 
 
                 p u b l i c   b o o l   c o p y P a t t ( N y A R I n t P o i n t 2 d [ ]   i _ v e r t e x ,   i n t   i _ e d g e _ x ,   i n t   i _ e d g e _ y ,   i n t   i _ r e s o l u t i o n ,   I N y A R R g b R a s t e r   i _ o u t ) 
 
                 { 
 
                         r e t u r n   t h i s . c o p y P a t t ( i _ v e r t e x [ 0 ] . x ,   i _ v e r t e x [ 0 ] . y ,   i _ v e r t e x [ 1 ] . x ,   i _ v e r t e x [ 1 ] . y ,   i _ v e r t e x [ 2 ] . x ,   i _ v e r t e x [ 2 ] . y ,   i _ v e r t e x [ 3 ] . x ,   i _ v e r t e x [ 3 ] . y ,   i _ e d g e _ x ,   i _ e d g e _ y ,   i _ r e s o l u t i o n ,   i _ o u t ) ; 
 
                 } 
 
                 p r o t e c t e d   a b s t r a c t   b o o l   o n e P i x e l ( i n t   p k _ l ,   i n t   p k _ t ,   d o u b l e [ ]   c p a r a ,   I N y A R R a s t e r   o _ o u t ) ; 
 
                 p r o t e c t e d   a b s t r a c t   b o o l   m u l t i P i x e l ( i n t   p k _ l ,   i n t   p k _ t ,   d o u b l e [ ]   c p a r a ,   i n t   i _ r e s o l u t i o n ,   I N y A R R a s t e r   o _ o u t ) ; 
 
 
 
         } 
 
 } 