PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/main/java/com/wet/wired/jrc/frame/Frame.java

http://java-remote-control.googlecode.com/
Java | 36 lines | 30 code | 6 blank | 0 comment | 1 complexity | 6be750b1afd09ca717fdb231a6dc4354 MD5 | raw file
 1package com.wet.wired.jrc.frame;
 2
 3import java.awt.Dimension;
 4
 5public class Frame {
 6
 7	private int[] data;
 8	private Dimension size;
 9	
10	public Frame(int width,int height) {
11		size = new Dimension(width,height);
12		data = new int[width*height];
13	}
14	
15	public int getDataSize() {
16		return data.length;
17	}
18	public Dimension getFrameSize() {
19		return size;
20	}
21	public int[] getData() {
22		return data;
23	}
24	public void setData(int[] data) {
25		this.data=data;
26	}
27	
28	public void setPixel(int width,int height,int color) {
29		data[width+(size.width*height)]=color;
30	}
31	public void setAllPixels(int color) {
32		for(int i=0;i<size.width*size.height;i++) {
33			data[i] = color;
34		}
35	}
36}