Add mask transition to do MULTIPLY burn on crossfader
authorMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Thu, 19 Sep 2013 07:24:19 +0000 (00:24 -0700)
committerMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Thu, 19 Sep 2013 07:24:19 +0000 (00:24 -0700)
MarkSlee.pde
SugarCubes.pde
code/HeronLX.jar

index adc86d078e298deedf1c8ba2875676a7671cbbff..7e0f46f279eb8e59ff941d83a84d05dda72a7b22 100644 (file)
@@ -128,6 +128,34 @@ class SwipeTransition extends SCTransition {
   }
 }
 
+class MaskTransition extends SCTransition {
+  
+  MaskTransition(GLucose glucose) {
+    super(glucose);
+  }
+
+  void computeBlend(int[] c1, int[] c2, double progress) {
+    if (progress < 0.5) {
+      for (int i = 0; i < c1.length; ++i) {
+        colors[i] = lerpColor(
+          c1[i],
+          blendColor(c1[i], c2[i], MULTIPLY),
+          (float) (2.*progress),
+          RGB);
+      }
+    } else {
+      for (int i = 0; i < c1.length; ++i) {
+        colors[i] = lerpColor(
+          c2[i],
+          blendColor(c1[i], c2[i], MULTIPLY),
+          (float) (2.*(1. - progress)),
+          RGB);
+      }
+    }
+  }
+}
+
+
 class BassPod extends SCPattern {
 
   private GraphicEQ eq = null;
index ec68668b854b8f1aa5525e38553ef01ad6cdb84e..6b1a6c6f07dd7577f312c06e71e98dcafdcc25b2 100644 (file)
@@ -110,6 +110,7 @@ LXPattern[] patterns(GLucose glucose) {
 LXTransition[] transitions(GLucose glucose) {
   return new LXTransition[] {
     new DissolveTransition(lx),
+    new MaskTransition(glucose),
     new SwipeTransition(glucose),
     new FadeTransition(lx),
   };
index 145f480757192cea433b50366cc80e7fa57c6b2e..70a882684a54c7322dfe0a429ec44fd891a40685 100755 (executable)
Binary files a/code/HeronLX.jar and b/code/HeronLX.jar differ