package speiger.src.coreengine.rendering.texturesOld.custom;

import speiger.src.coreengine.rendering.texturesOld.base.ITexture;

public interface IDynamicTexture extends ITexture
{
	public void markDirty(int x, int z);
	public default void markDirty(int index) { markDirty(index % getWidth(), index / getWidth()); }
	
	public default void setData(int x, int z, int value) { setData((z * getWidth()) + x, value); }
	public void setData(int index, int value);
	
	public default void setRGB(int x, int z, int red, int green, int blue, int alpha) { setRGB((z * getWidth()) + x, red, green, blue, alpha); }
	public default void setRGB(int index, int red, int green, int blue, int alpha) { setData(index, ((alpha & 0xFF) << 24) | ((red & 0xFF) << 16) | ((green & 0xFF) << 8) | (blue & 0xFF)); }
	
	public default void setRed(int x, int z, int red) { setRed((z * getWidth()) + x, red); }
	public void setRed(int index, int red);
	public default void setGreen(int x, int z, int green) { setGreen((z * getWidth()) + x, green); }
	public void setGreen(int index, int green);
	public default void setBlue(int x, int z, int blue) { setBlue((z * getWidth()) + x, blue); }
	public void setBlue(int index, int blue);
	public default void setAlpha(int x, int z, int alpha) { setAlpha((z * getWidth()) + x, alpha); }
	public void setAlpha(int index, int alpha);
	
	public default int getRGB(int x, int z) { return getRGB((z * getWidth()) + x); }
	public int getRGB(int index);
	
	public default int getRed(int x, int z) { return getRed((z * getWidth()) + x); }
	public int getRed(int index);
	public default int getGreen(int x, int z) { return getGreen((z * getWidth()) + x); }
	public int getGreen(int index);
	public default int getBlue(int x, int z) { return getBlue((z * getWidth()) + x); }
	public int getBlue(int index);
	public default int getAlpha(int x, int z) { return getAlpha((z * getWidth()) + x); }
	public int getAlpha(int index);
	
	public boolean isDirty();
	public void processChanges(boolean full);
}
