Jafar
|
00001 # $Id$ 00002 00003 namespace eval image { 00004 00005 variable cont 00006 variable image 00007 variable capture 00008 variable captureLoopId 00009 00010 proc captureStart { {cameraIndex 0} } { 00011 variable capture 00012 variable captureLoopId 00013 00014 package require display 00015 00016 set capture [image::new_Capture $cameraIndex] 00017 00018 display::show [$capture image] 00019 00020 set captureLoopId [after 100 ::image::captureRefresh] 00021 } 00022 00023 proc captureRefresh {} { 00024 variable capture 00025 variable captureLoopId 00026 00027 $capture grabFrame 00028 display::refresh [$capture image] 00029 00030 set captureLoopId [after 100 ::image::captureRefresh] 00031 } 00032 00033 proc captureStop {} { 00034 variable capture 00035 variable captureLoopId 00036 after cancel $captureLoopId 00037 ::display::destroy [$capture image] 00038 ::image::delete_Capture $capture 00039 } 00040 00041 proc captureGui { {cameraIndex 0} } { 00042 variable cont 00043 variable capture 00044 variable captureLoopId 00045 00046 package require display 00047 00048 set cont 0 00049 set capture [image::new_Capture $cameraIndex] 00050 display::show [$capture image] 00051 frame .[$capture image].control 00052 button .[$capture image].control.stop -text "Stop" -command {image::captureGui_stop} 00053 grid configure .[$capture image].control.stop -column 0 -row 0 00054 button .[$capture image].control.step -text "Step" -command {image::captureGui_step} 00055 grid configure .[$capture image].control.step -column 1 -row 0 00056 button .[$capture image].control.play -text "Play" -command {image::captureGui_play} 00057 grid configure .[$capture image].control.play -column 2 -row 0 00058 button .[$capture image].control.quit -text "Quit" -command {image::captureGui_quit} 00059 grid configure .[$capture image].control.quit -column 4 -row 0 00060 pack .[$capture image].control -side left 00061 00062 return [$capture image] 00063 } 00064 00065 proc captureGui_stop {} { 00066 variable cont 00067 set cont 0 00068 } 00069 00070 proc captureGui_play {} { 00071 variable cont 00072 variable captureLoopId 00073 set cont 1 00074 set captureLoopId [after 100 ::image::captureGui_refresh] 00075 } 00076 00077 proc captureGui_step {} { 00078 variable cont 00079 variable capture 00080 variable captureLoopId 00081 captureGui_stop 00082 $capture grabFrame 00083 display::refresh [$capture image] 00084 } 00085 00086 proc captureGui_refresh {} { 00087 variable cont 00088 variable capture 00089 variable captureLoopId 00090 $capture grabFrame 00091 display::refresh [$capture image] 00092 if {[expr !$cont]} { 00093 return 00094 } 00095 set captureLoopId [after 100 ::image::captureGui_refresh] 00096 } 00097 00098 proc captureGui_quit {} { 00099 variable cont 00100 variable capture 00101 variable captureLoopId 00102 after cancel $captureLoopId 00103 ::display::destroy [$capture image] 00104 ::image::delete_Capture $capture 00105 } 00106 00107 } 00108 00109 package provide image 2.0
Generated on Wed Oct 15 2014 00:37:21 for Jafar by doxygen 1.7.6.1 |