if (visual.getEffect2() == null) {
return visual.getEffect1Buffer();
}
Generator gen1 = visual.getGenerator1();
//lazy init
if (flpX == -1) {
this.flpX = gen1.getInternalBufferXSize()/checkBoxSizeX;
//this.flpY = gen1.getInternalBufferYSize()/checkBoxSizeY;
this.flpY = gen1.getInternalBufferXSize()*gen1.getInternalBufferYSize()/checkBoxSizeY;
LOG.log(Level.FINE, "Checkbox Mixer lazy init, flpx: {0}, flpY: {1}", new Integer[] {flpX, flpY});
}
int[] src1 = visual.getEffect1Buffer();
int[] src2 = visual.getEffect2Buffer();
int[] dst = new int [src1.length];
boolean flip=true;
boolean flipY=true;
/* complicated but working implementation
*
* for (int y=0; y<checkBoxSizeY; y++) {
flip=!flip;
for (int m=0; m<flpY; m++) {
drawHorizontalLine(flip, src1, src2, dst);
}
}*/
for (int i=0; i<src1.length; i++) {
if (i%flpX==0) {
flip=!flip;
}
if (i%flpY==0) {
flipY=!flipY;
}
//reset flip state on the beginning of a line
if (i%gen1.getInternalBufferXSize()==0) {
flip=flipY;
}
try {
if (flip) {