public void resize(int sx,int sy){
		int ns = sx*sy;
		if (data==null || ns!=data.length){
			if (ns>0)
				data=new float[ns];
			if (ns==0)
				data=null;
			if (ns<0)
				throw new ArrayIndexOutOfBoundsException(ns);
			width=sx;
			height=sy;
		}
		if (offsets==null || offsets.length!=height)
			offsets=new int[height];
		
		for (int y=0;y<height;++y){
			offsets[y]=y*width;
		}
	}