All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.machinezoo.sourceafis.engine.primitives.IntMatrix Maven / Gradle / Ivy

Go to download

Fingerprint recognition engine that takes a pair of human fingerprint images and returns their similarity score. Supports efficient 1:N search.

There is a newer version: 3.18.1
Show newest version
// Part of SourceAFIS for Java: https://sourceafis.machinezoo.com/java
package com.machinezoo.sourceafis.engine.primitives;

public class IntMatrix {
	public final int width;
	public final int height;
	private final int[] array;
	public IntMatrix(int width, int height) {
		this.width = width;
		this.height = height;
		array = new int[width * height];
	}
	public IntMatrix(IntPoint size) {
		this(size.x, size.y);
	}
	public IntPoint size() {
		return new IntPoint(width, height);
	}
	public int get(int x, int y) {
		return array[offset(x, y)];
	}
	public int get(IntPoint at) {
		return get(at.x, at.y);
	}
	public void set(int x, int y, int value) {
		array[offset(x, y)] = value;
	}
	public void set(IntPoint at, int value) {
		set(at.x, at.y, value);
	}
	private int offset(int x, int y) {
		return y * width + x;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy