<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> from panda3d . core import ComputeNode , Vec4 , Vec3 <EOL> from direct . gui . DirectFrame import DirectFrame <EOL> from rpcore . gui . sprite import Sprite <EOL> from rpcore . gui . text import Text <EOL> from rpcore . rpobject import RPObject <EOL> from rpcore . image import Image <EOL> from rpcore . globals import Globals <EOL> from rpcore . loader import RPLoader <EOL> class ExposureWidget ( RPObject ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , pipeline , parent ) : <EOL> """<STR_LIT>""" <EOL> RPObject . __init__ ( self ) <EOL> self . _pipeline = pipeline <EOL> self . _parent = parent <EOL> self . _node = self . _parent . attach_new_node ( "<STR_LIT>" ) <EOL> self . _create_components ( ) <EOL> def _create_components ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _node . hide ( ) <EOL> self . _storage_tex = Image . create_2d ( "<STR_LIT>" , <NUM_LIT> , <NUM_LIT:20> , "<STR_LIT>" ) <EOL> self . _storage_tex . set_clear_color ( Vec4 ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1.0> , <NUM_LIT:1.0> ) ) <EOL> self . _storage_tex . clear_image ( ) <EOL> self . _bg_frame = DirectFrame ( <EOL> parent = self . _node , frameColor = ( <NUM_LIT:0.1> , <NUM_LIT:0.1> , <NUM_LIT:0.1> , <NUM_LIT:1.0> ) , <EOL> frameSize = ( <NUM_LIT:200> , <NUM_LIT:0> , - <NUM_LIT:10> , - <NUM_LIT> ) , pos = ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> self . _display_img = Sprite ( <EOL> image = self . _storage_tex , parent = self . _node , w = <NUM_LIT> , h = <NUM_LIT:20> , x = <NUM_LIT:20> , y = <NUM_LIT:50> ) <EOL> self . _display_txt = Text ( <EOL> text = "<STR_LIT>" . upper ( ) , parent = self . _node , x = <NUM_LIT> , y = <NUM_LIT> , <EOL> size = <NUM_LIT> , color = Vec3 ( <NUM_LIT> ) , align = "<STR_LIT:right>" ) <EOL> self . _cshader_node = ComputeNode ( "<STR_LIT>" ) <EOL> self . _cshader_node . add_dispatch ( <NUM_LIT> // <NUM_LIT:10> , <NUM_LIT:20> // <NUM_LIT:4> , <NUM_LIT:1> ) <EOL> self . _cshader_np = self . _node . attach_new_node ( self . _cshader_node ) <EOL> Globals . base . taskMgr . doMethodLater ( <NUM_LIT:1.0> , self . _late_init , "<STR_LIT>" ) <EOL> def _late_init ( self , task ) : <EOL> """<STR_LIT>""" <EOL> stage_mgr = self . _pipeline . stage_mgr <EOL> if "<STR_LIT>" not in stage_mgr . pipes : <EOL> self . debug ( "<STR_LIT>" ) <EOL> self . _node . remove_node ( ) <EOL> return <EOL> self . _node . show ( ) <EOL> exposure_tex = stage_mgr . pipes [ "<STR_LIT>" ] <EOL> self . _cshader = RPLoader . load_shader ( "<STR_LIT>" ) <EOL> self . _cshader_np . set_shader ( self . _cshader ) <EOL> self . _cshader_np . set_shader_input ( "<STR_LIT>" , self . _storage_tex ) <EOL> self . _cshader_np . set_shader_input ( "<STR_LIT>" , exposure_tex ) <EOL> return task . done </s>
