/ *   
 
   *   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 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 ; 
 
 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 . m a r k e r s y s t e m 
 
 { 
 
 
 
 
 
         / * * 
 
           *   M a r k e r S y s t e m n0eQR0000{tY00000000g0Y00u000n000000000{t0LD0~0Y00
 
           * / 
 
         p u b l i c   c l a s s   N y A R S e n s o r 
 
         { 
 
                 p r o t e c t e d   N y A R H i s t o g r a m   _ g s _ h i s t ; 
 
                 p r o t e c t e d   I N y A R R g b R a s t e r   _ r e f _ r a s t e r   =   n u l l ; 
 
                 p r o t e c t e d   I 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 o t e c t e d   l o n g   _ s r c _ t s ; 
 
                 p r o t e c t e d   l o n g   _ g s _ i d _ t s ; 
 
                 p r o t e c t e d   l o n g   _ g s _ h i s t _ t s ; 
 
                 p u b l i c   N y A R S e n s o r ( N y A R I n t S i z e   i _ s i z e ) 
 
                 { 
 
                         t h i s . i n i t I n s t a n c e ( i _ s i z e ) ; 
 
                         t h i s . _ h i s t _ d r v   =   ( 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 ) ) ; 
 
                 } 
 
                 / * * 
 
                   *   ;uP0000k0OX[Y00000000n0ub0
 
                   *   }b000g0
NfM0Y000
 
                   *   @ p a r a m   s 
 
                   *   @ 
 
                   * / 
 
                 p r o t e c t e d   v o i d   i n i t R e s o u r c e ( N y A R I n t S i z e   s ) 
 
                 { 
 
                         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 . w ,   s . h ,   N y A R B u f f e r T y p e . I N T 1 D _ G R A Y _ 8 ,   t r u e ) ; 
 
                 } 
 
                 / * * 
 
                   *   qQRgSpe0
 
                   *   @ p a r a m   i _ p a r a m 
 
                   *   @ p a r a m   i _ d r v _ f a c t o r y 
 
                   *   0000000n0000000
 
                   *   @ p a r a m   i _ g s _ t y p e 
 
                   *   @ p a r a m   i _ r g b _ t y p e 
 
                   *   @ r e t u r n 
 
                   *   @ 
 
                   * / 
 
                 p r i v a t e   v o i d   i n i t I n s t a n c e ( N y A R I n t S i z e   i _ s i z e ) 
 
                 { 
 
                         / / 0000n0ub
 
                         t h i s . i n i t R e s o u r c e ( i _ s i z e ) ; 
 
                         t h i s . _ g s _ h i s t   =   n e w   N y A R H i s t o g r a m ( 2 5 6 ) ; 
 
                         t h i s . _ s r c _ t s   =   0 ; 
 
                         t h i s . _ g s _ i d _ t s   =   0 ; 
 
                         t h i s . _ g s _ h i s t _ t s   =   0 ; 
 
                 } 
 
                 / * * 
 
                   *   00000W0f0D00\q_	Yc00000ԏW0~0Y00
 
                   *   S0n0peo00QQtTQ0n0peg0Y00
 
                   *   @ r e t u r n 
 
                   *   [ r e a d o n l y ] 
 
                   * / 
 
                 p u b l i c   I N y A R P e r s p e c t i v e C o p y   g e t P e r s p e c t i v e C o p y ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ p c o p y ; 
 
                 } 
 
                 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 _ d r v   =   n u l l ; 
 
                 p r i v a t e   I N y A R P e r s p e c t i v e C o p y   _ p c o p y ; 
 
                 p r i v a t e   I N y A R R g b 2 G s F i l t e r   _ r g b 2 g s   =   n u l l ; 
 
                 / * * 
 
                   *   S0n0peo00eQR;uP0CQk00000000n0rKa0feW0~0Y00
 
                   *   S0n0peo00000000000000000W0~0Y00
 
                   *   @ p a r a m   i _ i n p u t 
 
                   *   @   
 
                   * / 
 
                 p u b l i c   v i r t u a l   v o i d   u p d a t e ( I N y A R R g b R a s t e r   i _ i n p u t ) 
 
                 { 
 
                         / / 0000000n0nP
 
                         i f   ( t h i s . _ r e f _ r a s t e r   ! =   i _ i n p u t ) 
 
                         { 
 
                                 t h i s . _ r g b 2 g s   =   ( I N y A R R g b 2 G s F i l t e r ) i _ i n p u t . 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 . _ p c o p y   =   ( I N y A R P e r s p e c t i v e C o p y ) i _ i n p u t . 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 P e r s p e c t i v e C o p y ) ) ; 
 
                                 t h i s . _ r e f _ r a s t e r   =   i _ i n p u t ; 
 
                         } 
 
                         / / 000i d n00000000
 
                         t h i s . _ s r c _ t s + + ; 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00000000007_6Rvk00000000W0~0Y00
 
                   * / 
 
                 p u b l i c   v o i d   u p d a t e T i m e S t a m p ( ) 
 
                 { 
 
                         t h i s . _ s r c _ t s + + ; 
 
                 } 
 
                 / * * 
 
                   *   s(Wn000000000ԏW0~0Y00
 
                   *   @ r e t u r n 
 
                   * / 
 
                 p u b l i c   l o n g   g e t T i m e S t a m p ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ s r c _ t s ; 
 
                 } 
 
 
 
                 / * * 
 
                   *   S0n0peo000000000k0	YcW0_0s(Wn0;uP0ԏW0~0Y00
 
                   *   @ r e t u r n 
 
                   *   @   
 
                   * / 
 
                 p u b l i c   I N y A R G r a y s c a l e R a s t e r   g e t G s I m a g e ( ) 
 
                 { 
 
                         / / _k0_X0f00000000;uPn0ub
 
                         i f   ( t h i s . _ s r c _ t s   ! =   t h i s . _ g s _ i d _ t s ) 
 
                         { 
 
                                 t h i s . _ r g b 2 g s . c o n v e r t ( t h i s . _ g s _ r a s t e r ) ; 
 
                                 t h i s . _ g s _ i d _ t s   =   t h i s . _ s r c _ t s ; 
 
                         } 
 
                         r e t u r n   t h i s . _ g s _ r a s t e r ; 
 
                         / / 
 
                 } 
 
                 / * * 
 
                   *   S0n0peo00s(Wn0G S ;uPn0}x0ԏW0~0Y00
 
                   *   @   
 
                   * / 
 
                 p u b l i c   N y A R H i s t o g r a m   g e t G s H i s t o g r a m ( ) 
 
                 { 
 
                         / / _k0_X0f00000000ub
 
                         i f   ( t h i s . _ g s _ i d _ t s   ! =   t h i s . _ g s _ h i s t _ t s ) 
 
                         { 
 
                                 t h i s . _ h i s t _ d r v . c r e a t e H i s t o g r a m ( 4 ,   t h i s . _ g s _ h i s t ) ; 
 
                                 t h i s . _ g s _ h i s t _ t s   =   t h i s . _ g s _ i d _ t s ; 
 
                         } 
 
                         r e t u r n   t h i s . _ g s _ h i s t ; 
 
                 } 
 
                 / * * 
 
                   *   s(Wn0eQR;uPn0Sgq$P0ԏW0~0Y00
 
                   *   @ r e t u r n 
 
                   * / 
 
                 p u b l i c   I N y A R R g b R a s t e r   g e t S o u r c e I m a g e ( ) 
 
                 { 
 
                         r e t u r n   t h i s . _ r e f _ r a s t e r ; 
 
                 } 
 
 
 
                 / * * 
 
                   *   Nan04 pW0\q_	YcW0f0S_W0~0Y00
 
                   *   @ p a r a m   i _ x 1 
 
                   *   @ p a r a m   i _ y 1 
 
                   *   @ p a r a m   i _ x 2 
 
                   *   @ p a r a m   i _ y 2 
 
                   *   @ p a r a m   i _ x 3 
 
                   *   @ p a r a m   i _ y 3 
 
                   *   @ p a r a m   i _ x 4 
 
                   *   @ p a r a m   i _ y 4 
 
                   *   @ r e t u r n 
 
                   *   @   
 
                   * / 
 
                 p u b l i c   I N y A R R g b R a s t e r   g e t P e r s p e c t i v e I m a g e ( 
 
                         i n t   i _ x 1 ,   i n t   i _ y 1 , 
 
                         i n t   i _ x 2 ,   i n t   i _ y 2 , 
 
                         i n t   i _ x 3 ,   i n t   i _ y 3 , 
 
                         i n t   i _ x 4 ,   i n t   i _ y 4 , 
 
                         I N y A R R g b R a s t e r   i _ r a s t e r ) 
 
                 { 
 
                         t h i s . _ p c o p y . c o p y P a t t ( i _ x 1 ,   i _ y 1 ,   i _ x 2 ,   i _ y 2 ,   i _ x 3 ,   i _ y 3 ,   i _ x 4 ,   i _ y 4 ,   0 ,   0 ,   1 ,   i _ r a s t e r ) ; 
 
                         r e t u r n   i _ r a s t e r ; 
 
                 } 
 
                 / * * 
 
                   *   Nan04 pW0\q_	YcW0f0S_W0~0Y00
 
                   *   @ p a r a m   i _ x 1 
 
                   *   @ p a r a m   i _ y 1 
 
                   *   @ p a r a m   i _ x 2 
 
                   *   @ p a r a m   i _ y 2 
 
                   *   @ p a r a m   i _ x 3 
 
                   *   @ p a r a m   i _ y 3 
 
                   *   @ p a r a m   i _ x 4 
 
                   *   @ p a r a m   i _ y 4 
 
                   *   @ p a r a m   i _ r a s t e r 
 
                   *   @ r e t u r n 
 
                   *   @ 
 
                   * / 
 
                 p u b l i c   I N y A R R g b R a s t e r   g e t P e r s p e c t i v e I m a g e ( 
 
                                 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 y A R R g b R a s t e r   i _ r a s t e r ) 
 
                 { 
 
                         t h i s . _ p c o p y . c o p y P a t t ( i _ x 1 ,   i _ y 1 ,   i _ x 2 ,   i _ y 2 ,   i _ x 3 ,   i _ y 3 ,   i _ x 4 ,   i _ y 4 ,   0 ,   0 ,   1 ,   i _ r a s t e r ) ; 
 
                         r e t u r n   i _ r a s t e r ; 
 
                 } 
 
         } 
 
 } 