Exemplo n.º 1
0
 private void drawSingle(Surface input, Surface output) {
   if (mix == 0.0) {
     output.copy(input);
   } else if (mix == 1.0) {
     output.clear();
   } else {
     output.process(new Blit().setBlendMode(BlendMode.Normal).setOpacity(1 - mix), input);
   }
   input.release();
 }
Exemplo n.º 2
0
 private void renderBlend(Surface input1, Surface input2, Surface output) {
   if (output.hasAlpha()) {
     output.process(new Blit().setBlendMode(BlendMode.Add).setOpacity(1 - mix), input1);
     output.process(new Blit().setBlendMode(BlendMode.Add).setOpacity(mix), input2);
     input1.release();
   } else {
     output.copy(input1);
     input1.release();
     output.process(new Blit().setBlendMode(BlendMode.Normal).setOpacity(mix), input2);
   }
   input2.release();
 }
Exemplo n.º 3
0
 private void renderDifference(Surface input1, Surface input2, Surface output) {
   double alpha;
   Surface src;
   Surface dst;
   if (mix >= 0.5) {
     alpha = (1.0 - mix) * 2;
     src = input1;
     dst = input2;
   } else {
     alpha = mix * 2;
     src = input2;
     dst = input1;
   }
   output.copy(dst);
   dst.release();
   output.process(new Blit().setBlendMode(BlendMode.Difference).setOpacity(alpha), src);
   src.release();
 }