// Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// 	String translation = null;
// 	if (captions != null) {
// 		try {
// 			translation = captions.getString(key);
// 		} catch(MissingResourceException ignore){}
// 	}
// 	// We're missing a key's value, use the key as the value :(
// 	if (translation == null || translation.trim().length()==0) {
// 		translation=key;
// 	}
// 	return translation;
// }


import static uk.co.silentsoftware.config.LanguageSupport.getCaption;
/* Image to ZX Spec
 * Copyright (C) 2020 Silent Software (Benjamin Brown)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Affero General Public License
 * as published by the Free Software Foundation, either version 3
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package uk.co.silentsoftware.core.converters.image.orderedditherstrategy;

/**
 * Ordered dithering algorithm based on an even distribution devised by 
 * Omega from World of Spectrum forums, revised by Benjamin Brown 
 */
public class OmegaOrderedDitherStrategy extends AbstractOrderedDitherStrategy implements OrderedDitherStrategy {

	private static final int[] COEFFS = new int[]{ 
		0,1,
		1,0
	};
	
	/*
	 * {@inheritDoc}
	 */
	public int[] getCoefficients() {
		return COEFFS;
	}
	
	/*
	 * {@inheritDoc}
	 */
	public int getMatrixWidth() {
		return 2;
	}
	
	/*
	 * {@inheritDoc}
	 */
	public int getMatrixHeight() {
		return 2;
	}

	/*
	 * {@inheritDoc}
	 */
	public String toString() {
// Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// 	String translation = null;
// 	if (captions != null) {
// 		try {
// 			translation = captions.getString(key);
// 		} catch(MissingResourceException ignore){}
// 	}
// 	// We're missing a key's value, use the key as the value :(
// 	if (translation == null || translation.trim().length()==0) {
// 		translation=key;
// 	}
// 	return translation;
// }


// Path: src/main/java/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/OmegaOrderedDitherStrategy.java
import static uk.co.silentsoftware.config.LanguageSupport.getCaption;

/* Image to ZX Spec
 * Copyright (C) 2020 Silent Software (Benjamin Brown)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Affero General Public License
 * as published by the Free Software Foundation, either version 3
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package uk.co.silentsoftware.core.converters.image.orderedditherstrategy;

/**
 * Ordered dithering algorithm based on an even distribution devised by 
 * Omega from World of Spectrum forums, revised by Benjamin Brown 
 */
public class OmegaOrderedDitherStrategy extends AbstractOrderedDitherStrategy implements OrderedDitherStrategy {

	private static final int[] COEFFS = new int[]{ 
		0,1,
		1,0
	};
	
	/*
	 * {@inheritDoc}
	 */
	public int[] getCoefficients() {
		return COEFFS;
	}
	
	/*
	 * {@inheritDoc}
	 */
	public int getMatrixWidth() {
		return 2;
	}
	
	/*
	 * {@inheritDoc}
	 */
	public int getMatrixHeight() {
		return 2;
	}

	/*
	 * {@inheritDoc}
	 */
	public String toString() {
		return "Omega Ordered 2x2 ("+getCaption("ordered_dither")+")";