package com.elphel.imagej.orthomosaic;

public class AffineImport {
	public static final String AFFINE_TAG = "AFFINE";
	public static final int    AFFINE_LEN = 8;
	public String name;
	public double [][] affine;
	public static boolean matches(String [] tokens) {
		return ((tokens.length == AFFINE_LEN) && AFFINE_TAG.equals(tokens[0]));
	}
	public AffineImport(
			String [] tokens) {
		if (!matches(tokens)) {
			throw new IllegalArgumentException ("Not AffineImport tokens");
		}
		int indx = 1;
		name = tokens[indx++];
		affine = new double [2][3];
		for (int i = 0; i < affine.length; i++) {
			for (int j = 0; j < affine[i].length; j++) {
				affine[i][j] = Double.parseDouble(tokens[indx++]);
			}
		}
	}
	
// String[] tokens	
}
