class ImgBuffer{ int[][] imgBuffer; boolean antialias = false; color[] spectrum; //----------------- ImgBuffer( int w, int h ){ imgBuffer = new int[w][h]; setSpectrum( color(0), color(0,32,0), color(255) ); //setSpectrum( color(0), color(0), color(255) ); } //----------------- void setSpectrum(color base, color lift, color slope){ spectrum = new color[2000]; float r = red(slope) / (float)spectrum.length; float g = green(slope) / (float)spectrum.length; float b = blue(slope) / (float)spectrum.length; for(int i=0;i=width-2) return; if( sy<=0 || sy>=height-2) return; if(antialias){ double xP = x-(int)x; double yP = y-(int)y; double xN = 1-xP; double yN = 1-xP; imgBuffer[sx ][sy ] += (int)(64*xN*yN); imgBuffer[sx+1][sy ] += (int)(64*xP*yN); imgBuffer[sx ][sy+1] += (int)(64*xN*yP); imgBuffer[sx+1][sy+1] += (int)(64*xP*yP); } else{ imgBuffer[ sx ][ sy ]+=1; } } }