Developing HDRHolic
Revision | 81496fa95919e4e693c251647d0337ba9adc36af (tree) |
---|---|
Time | 2013-10-31 22:50:51 |
Author | karaage0703 <karaage0703@user...> |
Commiter | karaage0703 |
size changed
@@ -39,8 +39,8 @@ int[] hdr_img_g; | ||
39 | 39 | int[] hdr_img_b; |
40 | 40 | |
41 | 41 | //Window Size |
42 | -int size_x = 1024; | |
43 | -int size_y = 768; | |
42 | +int size_x = 800; | |
43 | +int size_y = 600; | |
44 | 44 | int view_width, view_height; |
45 | 45 | |
46 | 46 | void setup(){ |
@@ -144,16 +144,9 @@ void setup(){ | ||
144 | 144 | |
145 | 145 | writeImg = createImage(img0.width, img0.height, RGB); |
146 | 146 | |
147 | -// long nt = System.nanoTime(); | |
148 | - | |
149 | 147 | MakeHDR(); |
150 | 148 | ToneMapping(); |
151 | 149 | |
152 | -// long nt2 = System.nanoTime(); | |
153 | - | |
154 | -// long a = nt2 -nt; | |
155 | -// println("time=" +a ); | |
156 | - | |
157 | 150 | readmeText.setText("Completed."); |
158 | 151 | |
159 | 152 | if(img0.width > size_x || img0.height > size_y){ |
@@ -243,28 +236,10 @@ void MakeHDR(){ | ||
243 | 236 | (int)((lut_u[(int)green(tmp_color0)] + lut_n[(int)green(tmp_color1)] + lut_o[(int)green(tmp_color2)])*color_gain/3); |
244 | 237 | hdr_img_b[i] = |
245 | 238 | (int)((lut_u[(int)blue(tmp_color0)] + lut_n[(int)blue(tmp_color1)] + lut_o[(int)blue(tmp_color2)])*color_gain/3); |
246 | - | |
247 | -// hdr_img_r[i] = hdr_img_r[i]/3*color_gain; | |
248 | -// hdr_img_g[i] = hdr_img_g[i]/3*color_gain; | |
249 | -// hdr_img_b[i] = hdr_img_b[i]/3*color_gain; | |
250 | - } | |
251 | - | |
252 | - //debug----- | |
253 | - /* | |
254 | - for(int y = 0; y < img0.height; y++){ | |
255 | - for(int x = 0; x < img0.width; x++){ | |
256 | - int pos = x + y*img0.width; | |
257 | - color tmp_color = color(hdr_img_r[pos], hdr_img_g[pos], hdr_img_b[pos]); | |
258 | - set(x, y, tmp_color); | |
259 | - } | |
260 | 239 | } |
261 | - */ | |
262 | - //----debug | |
263 | 240 | } |
264 | 241 | |
265 | 242 | void ToneMapping(){ |
266 | - long nt = millis(); | |
267 | - | |
268 | 243 | float lum_sum; |
269 | 244 | int sum_numb; |
270 | 245 |
@@ -272,18 +247,12 @@ void ToneMapping(){ | ||
272 | 247 | int scope_speed = (int)(scope * scope_speed_ratio/100)+1; |
273 | 248 | int average_speed = (int)(sqrt(img0.height*img0.width) * average_speed_ratio/100); |
274 | 249 | |
275 | - // debug | |
276 | -// println("scope= " + scope); | |
277 | -// println("scope_speed= " + scope_speed); | |
278 | -// println("average_speede= " + average_speed); | |
279 | - | |
280 | 250 | //ToneMapping---- |
281 | 251 | int tmp = average_speed; |
282 | 252 | float lum_sum_w = 0; |
283 | 253 | |
284 | 254 | int[] lum = new int[img0.height*img0.width]; |
285 | 255 | float[] lum_local = new float[img0.height*img0.width]; |
286 | -// int[] lum_local = new int[img0.height*img0.width]; | |
287 | 256 | int[] lum_class = new int[img0.height*img0.width]; |
288 | 257 | int[] u = new int[img0.height*img0.width]; |
289 | 258 | int[] v = new int[img0.height*img0.width]; |
@@ -293,7 +262,6 @@ void ToneMapping(){ | ||
293 | 262 | int pos = x + y*img0.width; |
294 | 263 | lum[pos] = (307*hdr_img_r[pos] + 604*hdr_img_g[pos] + 113*hdr_img_b[pos]) >> 10; |
295 | 264 | lum_local[pos] = log((float)(lum[pos]) / 256 + delta); |
296 | -// lum_local[pos] = (int)(log((float)(lum[pos]) / 256 + delta)); | |
297 | 265 | |
298 | 266 | u[pos] = (-174*hdr_img_r[pos] - 338*hdr_img_g[pos] + 512*hdr_img_b[pos]) >> 10; |
299 | 267 | v[pos] = (512*hdr_img_r[pos] -430*hdr_img_g[pos] - 82*hdr_img_b[pos]) >> 10; |
@@ -341,12 +309,5 @@ void ToneMapping(){ | ||
341 | 309 | } |
342 | 310 | } |
343 | 311 | writeImg.updatePixels(); |
344 | - | |
345 | - long nt2 = millis(); | |
346 | - | |
347 | - long a = nt2 -nt; | |
348 | - println("time=" +a ); | |
349 | - | |
350 | - | |
351 | 312 | } |
352 | 313 |