// Path: bpg-generator/src/main/java/org/bellard/bpg/exception/TechnicalException.java
// public class TechnicalException extends RuntimeException implements ExceptionDataHolder, ProcessDataHolder {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private ExceptionData data;
// 	private ProcessData processData;
// 	private String message;
// 
// 	public TechnicalException(ExceptionData data, String message) {
// 		super();
// 		this.data = data;
// 		this.message = message;
// 	}
// 
// 	public TechnicalException(ExceptionData data) {
// 		super();
// 		this.data = data;
// 	}
// 
// 	public TechnicalException(ExceptionData data, Exception cause) {
// 		super(cause);
// 		this.data = data;
// 	}
// 
// 	public TechnicalException(ExceptionData data, ProcessData processData) {
// 		super();
// 		this.data = data;
// 		this.processData = processData;
// 	}
// 
// 	public TechnicalException(ExceptionData data, ProcessData processData, Exception cause) {
// 		super(cause);
// 		this.data = data;
// 		this.processData = processData;
// 	}
// 
// 	public ExceptionData getData() {
// 		return data;
// 	}
// 
// 	public void setData(ExceptionData data) {
// 		this.data = data;
// 	}
// 
// 	public ProcessData getProcessData() {
// 		return processData;
// 	}
// 
// 	public void setProcessData(ProcessData processData) {
// 		this.processData = processData;
// 	}
// 
// 	public String getMessage() {
// 		return message;
// 	}
// 
// 	public void setMessage(String message) {
// 		this.message = message;
// 	}
// 
// }
// 
// Path: bpg-generator/src/main/java/org/bellard/bpg/model/ExceptionData.java
// public enum ExceptionData implements Serializable {
// 
// 	RESOURCE_CREATE("T100", "Problem when creating a resource"), 
// 	RESOURCE_DELETE("T101", "Problem when deleting a resource"), 
// 	RESOURCE_DOWNLOAD("T102", "Problem when downloading a resource"), 
// 	RESOURCE_NO_DOWNLOAD("T102", "No resource to download"), 
// 	RESOURCE_UPLOAD("T103", "Problem when uploading a resource"), 
// 	SPRING_BATCH_ISE("T200", "Spring batch illegal state exception"), 
// 	JSON_MAPPING_ERROR("T300", "Problem during json2Objec or object2Json transformation"), 
// 	THREAD_ENCODING_ERROR("T300", "Problem with thread during encoding"), 
// 	BPG_COMMAND_PARAMETER_ERROR("400", "Problem with the encoding command parameter"), 
// 
// 	BPGENC_ERROR("F100", "Problem with the bpegenc encoding process"),
// 	INPUT_IMAGE_CHECK_ERROR("F200", "Problem with the input message"),
// 	MAX_FILE_PER_SESSION_EXCEED("F300", "The maximum file upload for this session has been reached. Please update the web page and identify a new captcha."),
// 	NO_SESSION("F301", "The session does not exist."),
// 	NO_PROCESS_DATA("F301", "The process data does not exist.");
// 
// 	private String code;
// 	private String message;
// 
// 	private ExceptionData(String code, String message) {
// 		this.code = code;
// 		this.message = message;
// 	}
// 
// 	public String getCode() {
// 		return code;
// 	}
// 
// 	public String getMessage() {
// 		return message;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "ExceptionData[code=" + code + ",message=" + message + "]";
// 	}
// 
// }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.bellard.bpg.exception.TechnicalException;
import org.bellard.bpg.model.ExceptionData;
package org.bellard.bpg;



public class EncoderCommandBuilder {

	private String bpgEncoderCommandPath;
	private String inputFile;
	private String outputFile;
	private int quantizer = 28;
	private int chroma = 420;
	private String colorSpace = "ycbcr";
	private int level = 8;
	private int bitDepth = 8;

	private final Set<String> colorSpaces = new HashSet<String>(Arrays.asList("ycbcr", "rgb", "ycgco", "ycbcr_bt709",
			"ycbcr_bt2020"));

	public EncoderCommandBuilder(String bpgEncoderCommandPath, String inputFile, String outputFile) {
		super();
		this.bpgEncoderCommandPath = bpgEncoderCommandPath;
		this.inputFile = inputFile;
		this.outputFile = outputFile;
	}

	public EncoderCommandBuilder setQuantizer(int quantizer) {
		if (quantizer < 0 || quantizer > 51) {
// Path: bpg-generator/src/main/java/org/bellard/bpg/exception/TechnicalException.java
// public class TechnicalException extends RuntimeException implements ExceptionDataHolder, ProcessDataHolder {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private ExceptionData data;
// 	private ProcessData processData;
// 	private String message;
// 
// 	public TechnicalException(ExceptionData data, String message) {
// 		super();
// 		this.data = data;
// 		this.message = message;
// 	}
// 
// 	public TechnicalException(ExceptionData data) {
// 		super();
// 		this.data = data;
// 	}
// 
// 	public TechnicalException(ExceptionData data, Exception cause) {
// 		super(cause);
// 		this.data = data;
// 	}
// 
// 	public TechnicalException(ExceptionData data, ProcessData processData) {
// 		super();
// 		this.data = data;
// 		this.processData = processData;
// 	}
// 
// 	public TechnicalException(ExceptionData data, ProcessData processData, Exception cause) {
// 		super(cause);
// 		this.data = data;
// 		this.processData = processData;
// 	}
// 
// 	public ExceptionData getData() {
// 		return data;
// 	}
// 
// 	public void setData(ExceptionData data) {
// 		this.data = data;
// 	}
// 
// 	public ProcessData getProcessData() {
// 		return processData;
// 	}
// 
// 	public void setProcessData(ProcessData processData) {
// 		this.processData = processData;
// 	}
// 
// 	public String getMessage() {
// 		return message;
// 	}
// 
// 	public void setMessage(String message) {
// 		this.message = message;
// 	}
// 
// }
// 
// Path: bpg-generator/src/main/java/org/bellard/bpg/model/ExceptionData.java
// public enum ExceptionData implements Serializable {
// 
// 	RESOURCE_CREATE("T100", "Problem when creating a resource"), 
// 	RESOURCE_DELETE("T101", "Problem when deleting a resource"), 
// 	RESOURCE_DOWNLOAD("T102", "Problem when downloading a resource"), 
// 	RESOURCE_NO_DOWNLOAD("T102", "No resource to download"), 
// 	RESOURCE_UPLOAD("T103", "Problem when uploading a resource"), 
// 	SPRING_BATCH_ISE("T200", "Spring batch illegal state exception"), 
// 	JSON_MAPPING_ERROR("T300", "Problem during json2Objec or object2Json transformation"), 
// 	THREAD_ENCODING_ERROR("T300", "Problem with thread during encoding"), 
// 	BPG_COMMAND_PARAMETER_ERROR("400", "Problem with the encoding command parameter"), 
// 
// 	BPGENC_ERROR("F100", "Problem with the bpegenc encoding process"),
// 	INPUT_IMAGE_CHECK_ERROR("F200", "Problem with the input message"),
// 	MAX_FILE_PER_SESSION_EXCEED("F300", "The maximum file upload for this session has been reached. Please update the web page and identify a new captcha."),
// 	NO_SESSION("F301", "The session does not exist."),
// 	NO_PROCESS_DATA("F301", "The process data does not exist.");
// 
// 	private String code;
// 	private String message;
// 
// 	private ExceptionData(String code, String message) {
// 		this.code = code;
// 		this.message = message;
// 	}
// 
// 	public String getCode() {
// 		return code;
// 	}
// 
// 	public String getMessage() {
// 		return message;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "ExceptionData[code=" + code + ",message=" + message + "]";
// 	}
// 
// }


// Path: bpg-generator/src/main/java/org/bellard/bpg/EncoderCommandBuilder.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.bellard.bpg.exception.TechnicalException;
import org.bellard.bpg.model.ExceptionData;

package org.bellard.bpg;



public class EncoderCommandBuilder {

	private String bpgEncoderCommandPath;
	private String inputFile;
	private String outputFile;
	private int quantizer = 28;
	private int chroma = 420;
	private String colorSpace = "ycbcr";
	private int level = 8;
	private int bitDepth = 8;

	private final Set<String> colorSpaces = new HashSet<String>(Arrays.asList("ycbcr", "rgb", "ycgco", "ycbcr_bt709",
			"ycbcr_bt2020"));

	public EncoderCommandBuilder(String bpgEncoderCommandPath, String inputFile, String outputFile) {
		super();
		this.bpgEncoderCommandPath = bpgEncoderCommandPath;
		this.inputFile = inputFile;
		this.outputFile = outputFile;
	}

	public EncoderCommandBuilder setQuantizer(int quantizer) {
		if (quantizer < 0 || quantizer > 51) {
			throw new TechnicalException(ExceptionData.BPG_COMMAND_PARAMETER_ERROR, "quantizer value incorrect : "