package speiger.src.coreengine.platform.graphics.api.texture.drawable;

import speiger.src.coreengine.math.color.ColorSpaces;

public interface IDrawable {
	public ColorSpaces colorspace();
	public int width();
	public int height();
	
	public void set(int index, int data);
	public default void set(int x, int y, int data) { set((y * width()) + x, data); }
	
	public default void set(int index, int red, int green, int blue, int alpha) { set(index, colorspace().color(red, green, blue, alpha)); }
	public default void set(int x, int y, int red, int green, int blue, int alpha) { set((y * width()) + x, colorspace().color(red, green, blue, alpha)); }
	
	public void setR(int index, int red);
	public default void setR(int x, int y, int red) { setR((y * width()) + x, red); }
	
	public void setG(int index, int green);
	public default void setG(int x, int y, int green) { setG((y * width()) + x, green); }

	public void setB(int index, int blue);
	public default void setB(int x, int y, int blue) { setB((y * width()) + x, blue); }
	
	public void setA(int index, int alpha);
	public default void setA(int x, int y, int alpha) { setA((y * width()) + x, alpha); }
	
	public void fill(int x, int y, int width, int height, int data);
	public default void fill(int x, int y, int width, int height, int red, int green, int blue, int alpha) { fill(x, y, width, height, colorspace().color(red, green, blue, alpha)); }
	
	public int get(int index);
	public default int get(int x, int y) { return get((y * width()) + x); }
	
	public int getR(int index);
	public default int getR(int x, int y) { return getR((y * width()) + x); }
	public int getG(int index);
	public default int getG(int x, int y) { return getG((y * width()) + x); }
	public int getB(int index);
	public default int getB(int x, int y) { return getB((y * width()) + x); }
	public int getA(int index);
	public default int getA(int x, int y) { return getA((y * width()) + x); }

}
