}
logger.verbose(minmax.toString());
boolean hasneg = (minmax.getMin() < -1E-3);
LinearScaling scale;
if(!hasneg) {
scale = new LinearScaling(minmax);
}
else {
scale = LinearScaling.fromMinMax(0.0, Math.max(minmax.getMax(), -minmax.getMin()));
}
BufferedImage img = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
for(int x = 0; x < size; x++) {
for(int y = x; y < size; y++) {
double val = data[x][y];
val = scale.getScaled(val);
// Compute color:
final int col;
{
if(!hasneg) {
int ival = 0xFF & (int) (255 * Math.max(0, val));