• R/O
  • HTTP
  • SSH
  • HTTPS

multipleexposedholic: Commit

git


Commit MetaInfo

Revisionf31372c9d65e249279d0a43d55fc4b84b2229f84 (tree)
Time2014-08-03 16:31:08
Authorkaraage0703 <karaage0703@user...>
Commiterkaraage0703

Log Message

add lightenmode

Change Summary

Incremental Difference

--- a/MultiExposedHolic.pde
+++ b/MultiExposedHolic.pde
@@ -27,7 +27,7 @@ float[] lut_s = new float[256];
2727 float[] lut_m = new float[256];
2828
2929 //Window Size
30-int view_width=800, view_height=600;
30+int view_width=1024, view_height=768;
3131 int view_swidth0, view_sheight0;
3232 int view_swidth1, view_sheight1;
3333
@@ -35,7 +35,7 @@ int size_sx = 160;
3535 int size_sy = 120;
3636
3737 int size_x = 800;
38-int size_y = 600;
38+int size_y = 640;
3939
4040
4141 void TuneImage(){
@@ -151,6 +151,32 @@ void ImageMultiExposed(){
151151 writeimg.pixels[i] = color(r,g,b);
152152 }
153153 break;
154+ case 4: // Lighten
155+ for(int i = 0; i < img0.width*img0.height; i++){
156+ color tmp_color0 = tuned_img0.pixels[i];
157+ color tmp_color1 = tuned_img1.pixels[i];
158+ int r, g, b;
159+ if((int)red(tmp_color0) > (int)red(tmp_color1)){
160+ r =(int)red(tmp_color0);
161+ }else{
162+ r =(int)red(tmp_color1);
163+ }
164+
165+ if((int)green(tmp_color0) > (int)green(tmp_color1)){
166+ g =(int)green(tmp_color0);
167+ }else{
168+ g =(int)green(tmp_color1);
169+ }
170+
171+ if((int)blue(tmp_color0) > (int)blue(tmp_color1)){
172+ b =(int)blue(tmp_color0);
173+ }else{
174+ b =(int)blue(tmp_color1);
175+ }
176+
177+ writeimg.pixels[i] = color(r,g,b);
178+ }
179+ break;
154180 default:
155181 break;
156182 }
@@ -209,7 +235,7 @@ void setup(){
209235
210236 l = cp5.addListBox("myList")
211237 .setPosition(40, 250)
212- .setSize(120, 120)
238+ .setSize(120, 180)
213239 .setItemHeight(39)
214240 .setBarHeight(20)
215241 .setColorBackground(color(40, 128))
@@ -230,7 +256,8 @@ void setup(){
230256 lbi.setColorBackground(0xffff0000);
231257 lbi = l.addItem("Overlay", 2);
232258 lbi.setColorBackground(0xffff0000);
233-
259+ lbi = l.addItem("Lighten", 3);
260+ lbi.setColorBackground(0xffff0000);
234261
235262 cp5.addButton("Save Image")
236263 .setPosition(40,500)
@@ -326,4 +353,4 @@ void draw(){
326353 if(img0.width == img1.width && img0.height == img0.height){
327354 image(writeimg, 0, size_sy, view_width, view_height);
328355 }
329-}
356+}
\ No newline at end of file
Show on old repository browser