public Channel copy() { Channel channel = new Channel(width, height); for(int x =0;x<this.getWidth();x++) for(int y =0;y<this.getWidth();y++) channel.putPixel(x,y,pixels[y,x]); return channel; }
public Layer(int width, int height) { this.width = width; this.height = height; Channel empty = new Channel(width, height); empty.fill(1f); this.r = empty; this.g = empty.copy(); this.b = empty.copy(); this.a = null; }