LWJGL.init();
main();
}
public static void main() {
DoubleMap sourceMap = new DoubleMap( mapSize, mapSize );
sourceMap.drawCircle( mapSize * 0.375d, mapSize * 0.375d, mapSize * 0.35d, 0.6d );
draw( sourceMap.toNewImage(), "Source map" );
DoubleMap targetMap = new DoubleMap( mapSize, mapSize );
targetMap.drawCircle( mapSize * 0.625d, mapSize * 0.625d, mapSize * 0.35d, 0.8d );
draw( targetMap.toNewImage(), "Target map" );
DoubleMap doubleMap = new DoubleMap( mapSize, mapSize );
doubleMap.paste( targetMap );
doubleMap.paste( sourceMap, 0, 0, DoubleMap.PasteMode.ADD );
doubleMap.limit();
draw( doubleMap.toNewImage(), "Adding source map to target map" );
doubleMap.paste( targetMap );
doubleMap.paste( sourceMap, 0, 0, DoubleMap.PasteMode.MULTIPLY );
draw( doubleMap.toNewImage(), "Multiplying source map with target map" );
doubleMap.paste( targetMap );
doubleMap.paste( sourceMap, 0, 0, DoubleMap.PasteMode.MAXIMUM );
draw( doubleMap.toNewImage(), "Maximum of source map and target map" );
doubleMap.paste( targetMap );
doubleMap.paste( sourceMap, 0, 0, DoubleMap.PasteMode.MINIMUM );
draw( doubleMap.toNewImage(), "Minimum of source map and target map" );
ImageBuffer buffer = sourceMap.toNewImageBuffer( DoubleMap.Channel.RED );
targetMap.paste( buffer, DoubleMap.Channel.GREEN );
draw( buffer.toImage(), "Pasting maps to different color channels" );
}