// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/DisplayDirection.java
// public enum DisplayDirection {
// 	NORMAL, ROTATION_180;
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/EPaperClient.java
// public interface EPaperClient extends Closeable {
// 	static final int WIDTH = 800;
// 
// 	static final int HEIGHT = 600;
// 
// 	void drawImage(int x, int y, InputStream inputStream) throws IOException, EPaperException;
// 
// 	void refreshAndUpdate() throws IOException, EPaperException;
// 
// 	void clear() throws IOException, EPaperException;
// 
// 	void drawPoint(int x, int y) throws IOException, EPaperException;
// 
// 	void drawLine(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void drawRectangle(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void drawTable(int x0, int y0, int x1, int y1, Table table) throws IOException, EPaperException;
// 
// 	void fillRectangle(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void displayText(int x, int y, String text) throws IOException, EPaperException;
// 
// 	void displayText(int x0, int y0, int x1, int y1, FontSize fontSize, int lineSpacing,
// 			HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, String text)
// 			throws IOException, EPaperException;
// 
// 	DrawingColors getDrawingColors() throws IOException, EPaperException;
// 
// 	void setDrawingColors(DrawingColors drawingColors) throws IOException, EPaperException;
// 
// 	FontSize getFontSize() throws IOException, EPaperException;
// 
// 	void setFontSize(FontSize fontSize) throws IOException, EPaperException;
// 
// 	void setDisplayDirection(DisplayDirection displayDirection) throws IOException, EPaperException;
// 
// 	DisplayDirection getDisplayDirection() throws IOException, EPaperException;
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/EPaperValidationException.java
// public class EPaperValidationException extends EPaperException {
// 	private static final long serialVersionUID = 1L;
// 
// 	public EPaperValidationException(String message) {
// 		super(message);
// 	}
// }


import fr.romainmoreau.epaper.client.api.DisplayDirection;
import fr.romainmoreau.epaper.client.api.EPaperClient;
import fr.romainmoreau.epaper.client.api.EPaperValidationException;
package fr.romainmoreau.epaper.client.common;


public class Coordinates {
	public static int getTopLeftX(int x0, int x1) {
		return Math.min(x0, x1);
	}

	public static int getTopLeftY(int y0, int y1) {
		return Math.min(y0, y1);
	}

	public static int getBottomRightX(int x0, int x1) {
		return Math.max(x0, x1);
	}

	public static int getBottomRightY(int y0, int y1) {
		return Math.max(y0, y1);
	}

	public static void validateCoordinates(int x, int y) throws EPaperValidationException {
		if (x < 0 || x >= EPaperClient.WIDTH) {
			throw new EPaperValidationException("Invalid x: " + x);
		}
		if (y < 0 || y >= EPaperClient.HEIGHT) {
			throw new EPaperValidationException("Invalid y: " + y);
		}
	}

// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/DisplayDirection.java
// public enum DisplayDirection {
// 	NORMAL, ROTATION_180;
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/EPaperClient.java
// public interface EPaperClient extends Closeable {
// 	static final int WIDTH = 800;
// 
// 	static final int HEIGHT = 600;
// 
// 	void drawImage(int x, int y, InputStream inputStream) throws IOException, EPaperException;
// 
// 	void refreshAndUpdate() throws IOException, EPaperException;
// 
// 	void clear() throws IOException, EPaperException;
// 
// 	void drawPoint(int x, int y) throws IOException, EPaperException;
// 
// 	void drawLine(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void drawRectangle(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void drawTable(int x0, int y0, int x1, int y1, Table table) throws IOException, EPaperException;
// 
// 	void fillRectangle(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void displayText(int x, int y, String text) throws IOException, EPaperException;
// 
// 	void displayText(int x0, int y0, int x1, int y1, FontSize fontSize, int lineSpacing,
// 			HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, String text)
// 			throws IOException, EPaperException;
// 
// 	DrawingColors getDrawingColors() throws IOException, EPaperException;
// 
// 	void setDrawingColors(DrawingColors drawingColors) throws IOException, EPaperException;
// 
// 	FontSize getFontSize() throws IOException, EPaperException;
// 
// 	void setFontSize(FontSize fontSize) throws IOException, EPaperException;
// 
// 	void setDisplayDirection(DisplayDirection displayDirection) throws IOException, EPaperException;
// 
// 	DisplayDirection getDisplayDirection() throws IOException, EPaperException;
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/EPaperValidationException.java
// public class EPaperValidationException extends EPaperException {
// 	private static final long serialVersionUID = 1L;
// 
// 	public EPaperValidationException(String message) {
// 		super(message);
// 	}
// }


// Path: e-paper-client-common/src/main/java/fr/romainmoreau/epaper/client/common/Coordinates.java
import fr.romainmoreau.epaper.client.api.DisplayDirection;
import fr.romainmoreau.epaper.client.api.EPaperClient;
import fr.romainmoreau.epaper.client.api.EPaperValidationException;

package fr.romainmoreau.epaper.client.common;


public class Coordinates {
	public static int getTopLeftX(int x0, int x1) {
		return Math.min(x0, x1);
	}

	public static int getTopLeftY(int y0, int y1) {
		return Math.min(y0, y1);
	}

	public static int getBottomRightX(int x0, int x1) {
		return Math.max(x0, x1);
	}

	public static int getBottomRightY(int y0, int y1) {
		return Math.max(y0, y1);
	}

	public static void validateCoordinates(int x, int y) throws EPaperValidationException {
		if (x < 0 || x >= EPaperClient.WIDTH) {
			throw new EPaperValidationException("Invalid x: " + x);
		}
		if (y < 0 || y >= EPaperClient.HEIGHT) {
			throw new EPaperValidationException("Invalid y: " + y);
		}
	}

	public static void validateDisplayDirection(DisplayDirection displayDirection) throws EPaperValidationException {