u s i n g   U n i t y E n g i n e ; 
 u s i n g   S y s t e m . C o l l e c t i o n s ; 
 u s i n g   N y A R U n i t y U t i l s ; 
 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 . m a r k e r s y s t e m ; 
 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   N y A R U n i t y U t i l s 
 { 
 	 / / /   < s u m m a r y > 
 	 / / /   T h i s   c l a s s   p r o v i d e s   W e b C a m T e x t u r e   w r a p p e r   d e r i v e d     f r o m   N y A R M a r k e r S y s t e m S e n s o r . 
 	 / / /   < / s u m m a r y > 
 	 / / /   < e x c e p t i o n   c r e f = ' N y A R E x c e p t i o n ' > 
 	 / / /   I s   t h r o w n   w h e n   t h e   n y   A R   e x c e p t i o n . 
 	 / / /   < / e x c e p t i o n > 
 	 p u b l i c   c l a s s   N y A R U n i t y W e b C a m   : N y A R S e n s o r 
 	 { 
 	 	 / / /   < s u m m a r y > 
 	 	 / / /   T h i s   f u n c t i o n   c r e a t e s   W e b C a m T e x t u r e   w r a p e d   S e n s o r . 
 	 	 / / /   < / s u m m a r y > 
 	 	 / / /   < p a r a m   n a m e = " i _ w t x " > 
 	 	 / / /   A   < s e e   c r e f = " W e b C a m T e x t u r e " / > 
 	 	 / / /   < / p a r a m > 
 	 	 / / /   < r e t u r n s > 
 	 	 / / /   A   < s e e   c r e f = " N y A R U n i t y W e b C a m " / > 
 	 	 / / /   < / r e t u r n s > 
 	 	 p u b l i c   s t a t i c   N y A R U n i t y W e b C a m   c r e a t e I n s t a n c e ( W e b C a m T e x t u r e   i _ w t x ) 
 	 	 { 
 	 	 	 i f ( i _ w t x . i s P l a y i n g ) 
 	 	 	 { 
 	 	 	 	 / / wR-N
 	 	 	 	 r e t u r n   n e w   N y A R U n i t y W e b C a m ( i _ w t x ) ; 
 	 	 	 } e l s e { 
 	 	 	 	 / /  NBfvk0O N 
 	 	 	 	 N y A R U n i t y W e b C a m   r e t ; 
 	 	 	 	 i _ w t x . P l a y ( ) ; 
 	 	 	 	 r e t = n e w   N y A R U n i t y W e b C a m ( i _ w t x ) ; 
 	 	 	 	 i _ w t x . S t o p ( ) ; 
 	 	 	 	 r e t u r n   r e t ; 
 	 	 	 } 
 	 	 } 
 
 	 	 p u b l i c   i n t   w i d t h { 
 	 	 	 g e t { r e t u r n   t h i s . _ r a s t e r . g e t W i d t h ( ) ; } 
 	 	 } 
 	 	 p u b l i c   i n t   h e i g h t { 
 	 	 	 g e t { r e t u r n   t h i s . _ r a s t e r . g e t H e i g h t ( ) ; } 
 	 	 } 
 	 	 p r i v a t e   W e b C a m T e x t u r e   _ w t x ; 
 	         p r i v a t e   N y A R U n i t y R a s t e r   _ r a s t e r ; 
 	 	 / * * 
 	 	   *   W e b c a m T e x t u r e 0CQk00000000ubW0~0Y0. 
 	 	   *   ;uP0000Rg0-[g0M0~0Y0. 
 	 	   *   @ p a r a m   i _ w t x 
 	 	   *   W e b 000o0YU00f0D00_L0B00~0Y0. 
 	 	   *   
 	 	   * / 
 	 	 p r o t e c t e d   N y A R U n i t y W e b C a m ( W e b C a m T e x t u r e   i _ w t x ) :   b a s e ( n e w   N y A R I n t S i z e ( i _ w t x . w i d t h , i _ w t x . h e i g h t ) ) 
 	 	 { 
 	 	 	 / / _n0_000000
 	 	 	 i f ( ! i _ w t x . i s P l a y i n g ) { 
 	 	 	 	 t h r o w   n e w   N y A R E x c e p t i o n ( " W e b C a m T e x t u r e   m u s t   b e   s t a r t i n g s . " ) ; 
 	 	 	 } 
 	                 / / R G B 000n0ub( W e b t e x t u r e o0
NNS_) 
 	                 t h i s . _ r a s t e r   =   n e w   N y A R U n i t y R a s t e r ( i _ w t x . w i d t h , i _ w t x . h e i g h t , t r u e ) ; 
 	                 / / 000n0000
 	                 b a s e . u p d a t e ( t h i s . _ r a s t e r ) ; 
 	 	 	 t h i s . _ w t x = i _ w t x ; 
 	 	 } 
 	         / * * 
 	           *   S0n0peo00J M F n0^Tgfe0\PbkW0~0Y00
 	           * / 
 	         p u b l i c   v o i d   s t o p ( ) 
 	         { 
 	                 t h i s . _ w t x . S t o p ( ) ; 
 	         } 
 	         / * * 
 	           *   S0n0peo00J M F n0^Tgfe0YW0~0Y00
 	           * / 
 	         p u b l i c   v o i d   s t a r t ( ) 
 	         { 
 	                 t h i s . _ w t x . P l a y ( ) ; 
 	         } 
 	 	 / * * 
 	 	   *   C a l l   t h i s   f u n c t i o n   o n   u p d a t e ! 
 	 	   * / 
 	 	 p u b l i c   v o i d   u p d a t e ( ) 
 	 	 { 
 	 	 	 i f ( ! t h i s . _ w t x . d i d U p d a t e T h i s F r a m e ) { 
 	 	 	 	 r e t u r n ; 
 	 	 	 } 
 	 	 	 / / 00000L0000000U00f0D0_0000000fe
 	 	 	 t h i s . _ r a s t e r . u p d a t e B y W e b C a m T e x t u r e ( t h i s . _ w t x ) ; 
 	 	 	 / / 000n000000000fe
 	 	 	 b a s e . u p d a t e T i m e S t a m p ( ) ; 
 	 	 	 r e t u r n ; 
 	 	 } 
 	 	 p u b l i c   o v e r r i d e   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 ) 
 	 	 { 
 	 	 	 t h r o w   n e w   N y A R E x c e p t i o n ( ) ; 
 	 	 } 
 	 	 p u b l i c   v o i d   d G e t G s T e x ( T e x t u r e 2 D   t x ) 
 	 	 { 
 	 	 	 i n t [ ]   s = ( i n t [ ] ) t h i s . _ g s _ r a s t e r . g e t B u f f e r ( ) ; 
 	 	 	 C o l o r 3 2 [ ]   c = n e w   C o l o r 3 2 [ 3 2 0 * 2 4 0 ] ; 
 	 	 	 f o r ( i n t   i = 0 ; i < 2 4 0 ; i + + ) { 
 	 	 	 	 f o r ( i n t   i 2 = 0 ; i 2 < 3 2 0 ; i 2 + + ) { 
 	 	 	 	 	 c [ i * 3 2 0 + i 2 ] . r = c [ i * 3 2 0 + i 2 ] . g = c [ i * 3 2 0 + i 2 ] . b = ( b y t e ) s [ i * 3 2 0 + i 2 ] ; 
 	 	 	 	 	 c [ i * 3 2 0 + i 2 ] . a = 0 x f f ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 t x . S e t P i x e l s 3 2 ( c ) ; 
 	 	 	 t x . A p p l y (   f a l s e   ) ; 
 	 	 } 
 	 } 
 
 } 
 
 