From: Mark Slee Date: Thu, 19 Sep 2013 07:24:19 +0000 (-0700) Subject: Add mask transition to do MULTIPLY burn on crossfader X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=commitdiff_plain;h=ed149627fb9ee9b77ff6204c8973a267c3c2eead Add mask transition to do MULTIPLY burn on crossfader --- diff --git a/MarkSlee.pde b/MarkSlee.pde index adc86d0..7e0f46f 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -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; diff --git a/SugarCubes.pde b/SugarCubes.pde index ec68668..6b1a6c6 100644 --- a/SugarCubes.pde +++ b/SugarCubes.pde @@ -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), }; diff --git a/code/HeronLX.jar b/code/HeronLX.jar index 145f480..70a8826 100755 Binary files a/code/HeronLX.jar and b/code/HeronLX.jar differ