@@ -122,10 +122,12 @@ define(["require", "exports", "./bitmap"], function (require, exports, bitmap_1)
122122 var scaleHeight = + document . getElementById ( "scaleHeight" ) . value ;
123123 if ( document . getElementsByName ( "algorithm" ) [ 0 ] . checked ) {
124124 bmp . scale ( scaleWidth , scaleHeight , "neighbor" ) ;
125+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
125126 bmp . drawOnCanvas ( canvas ) ;
126127 }
127128 else {
128129 bmp . scale ( scaleWidth , scaleHeight , "interpolation" ) ;
130+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
129131 bmp . drawOnCanvas ( canvas ) ;
130132 }
131133 } ) ;
@@ -138,24 +140,28 @@ define(["require", "exports", "./bitmap"], function (require, exports, bitmap_1)
138140 var input = + document . getElementById ( "inputKernel" ) . value ;
139141 bmp . kernel ( input , input ) ;
140142 bmp . blur ( "box" ) ;
143+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
141144 bmp . drawOnCanvas ( canvas ) ;
142145 } ) ;
143146 document . getElementById ( "gaussBlur" ) . addEventListener ( "click" , function ( ) {
144147 var input = + document . getElementById ( "inputKernel" ) . value ;
145148 bmp . kernel ( input , input ) ;
146149 bmp . blur ( "gauss" ) ;
150+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
147151 bmp . drawOnCanvas ( canvas ) ;
148152 } ) ;
149153 document . getElementById ( "prewittEdge" ) . addEventListener ( "click" , function ( ) {
150154 var input = + document . getElementById ( "inputKernel" ) . value ;
151155 bmp . kernel ( 3 , 3 ) ;
152156 bmp . edge ( "prewitt" ) ;
157+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
153158 bmp . drawOnCanvas ( canvas ) ;
154159 } ) ;
155160 document . getElementById ( "sobelEdge" ) . addEventListener ( "click" , function ( ) {
156161 var input = + document . getElementById ( "inputKernel" ) . value ;
157162 bmp . kernel ( 3 , 3 ) ;
158163 bmp . edge ( "sobel" ) ;
164+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
159165 bmp . drawOnCanvas ( canvas ) ;
160166 } ) ;
161167 document . getElementById ( "customFilter" ) . addEventListener ( "click" , function ( ) {
@@ -185,15 +191,20 @@ define(["require", "exports", "./bitmap"], function (require, exports, bitmap_1)
185191 document . getElementById ( "custom" ) . style . display = "none" ;
186192 bmp . kernel ( input , input , custom ) ;
187193 bmp . customFilter ( ) ;
194+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
188195 bmp . drawOnCanvas ( canvas ) ;
189196 } ) ;
190197 } ) ;
191198 document . getElementById ( "undo" ) . addEventListener ( "click" , function ( ) {
192- if ( bmp . undo ( ) )
199+ if ( bmp . undo ( ) ) {
200+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
193201 bmp . drawOnCanvas ( canvas , true ) ;
202+ }
194203 } ) ;
195204 document . getElementById ( "redo" ) . addEventListener ( "click" , function ( ) {
196- if ( bmp . redo ( ) )
205+ if ( bmp . redo ( ) ) {
206+ bmp . drawHistogram ( histogram_r , histogram_g , histogram_b , histogram_avg ) ;
197207 bmp . drawOnCanvas ( canvas , true ) ;
208+ }
198209 } ) ;
199210} ) ;
0 commit comments