<commit_before>// Part of SourceAFIS: https://sourceafis.machinezoo.com
package com.machinezoo.sourceafis;

import java.util.*;
import javax.imageio.*;

/**
 * Pixels and metadata of the fingerprint image.
 * This class captures all fingerprint information that is available prior to construction of {@link FingerprintTemplate}.
 * Since SourceAFIS algorithm is not scale-invariant, all images should have DPI configured explicitly by calling {@link #dpi(double)}.
 * <p>
 * Application should start fingerprint processing by constructing an instance of {@code FingerprintImage}
 * and then passing it to {@link FingerprintTemplate#FingerprintTemplate(FingerprintImage)}.
 * <p>
 * Fingerprint image can be either in one of the supported image formats (PNG, JPEG, ...),
 * in which case method {@link #decode(byte[])} is used,
 * or it can be a raw grayscale image, for which method {@link #grayscale(int, int, byte[])} is used.
 * 
 * @see FingerprintTemplate
 */
public class FingerprintImage {
	/*
	 * API roadmap:
	 * + position(FingerprintPosition)
	 * + other fingerprint properties
	 */
	double dpi = 500;
	/**
	 * Set DPI (dots per inch) of the fingerprint image.
	 * This is the DPI of the image passed to {@link #decode(byte[])} or {@link #grayscale(int, int, byte[])}.
	 * Check your fingerprint reader specification for correct DPI value. Default DPI is 500.
	 * 
	 * @param dpi
	 *            DPI of the fingerprint image, usually around 500
	 * @return {@code this} (fluent method)
	 * @throws IllegalArgumentException
	 *             if {@code dpi} is non-positive, impossibly low, or impossibly high
	 * 
	 * @see #decode(byte[])
	 */
	public FingerprintImage dpi(double dpi) {
		if (dpi < 20 || dpi > 20_000)
			throw new IllegalArgumentException();
		this.dpi = dpi;
		return this;
	}
	DoubleMatrix matrix;<commit_msg>Javadoc for the implicit default constructor<commit_after>// Part of SourceAFIS: https://sourceafis.machinezoo.com
package com.machinezoo.sourceafis;

import java.util.*;
import javax.imageio.*;

/**
 * Pixels and metadata of the fingerprint image.
 * This class captures all fingerprint information that is available prior to construction of {@link FingerprintTemplate}.
 * Since SourceAFIS algorithm is not scale-invariant, all images should have DPI configured explicitly by calling {@link #dpi(double)}.
 * <p>
 * Application should start fingerprint processing by constructing an instance of {@code FingerprintImage}
 * and then passing it to {@link FingerprintTemplate#FingerprintTemplate(FingerprintImage)}.
 * <p>
 * Fingerprint image can be either in one of the supported image formats (PNG, JPEG, ...),
 * in which case method {@link #decode(byte[])} is used,
 * or it can be a raw grayscale image, for which method {@link #grayscale(int, int, byte[])} is used.
 * 
 * @see FingerprintTemplate
 */
public class FingerprintImage {
	/*
	 * API roadmap:
	 * + position(FingerprintPosition)
	 * + other fingerprint properties
	 */
	/**
	 * Create new container for fingerprint image data.
	 * The newly constructed instance cannot be used to create {@link FingerprintTemplate}
	 * until at least fingerprint data is provided by calling {@link #decode(byte[])} or {@link #grayscale(int, int, byte[])}.
	 * 
	 * @see #decode(byte[])
	 * @see #grayscale(int, int, byte[])
	 */
	public FingerprintImage() {
	}
	double dpi = 500;
	/**
	 * Set DPI (dots per inch) of the fingerprint image.
	 * This is the DPI of the image passed to {@link #decode(byte[])} or {@link #grayscale(int, int, byte[])}.
	 * Check your fingerprint reader specification for correct DPI value. Default DPI is 500.
	 * 
	 * @param dpi
	 *            DPI of the fingerprint image, usually around 500
	 * @return {@code this} (fluent method)
	 * @throws IllegalArgumentException
	 *             if {@code dpi} is non-positive, impossibly low, or impossibly high
	 * 
	 * @see #decode(byte[])
	 */
	public FingerprintImage dpi(double dpi) {
		if (dpi < 20 || dpi > 20_000)
			throw new IllegalArgumentException();
		this.dpi = dpi;
		return this;
	}
	DoubleMatrix matrix;
{'fraction_non_alphanumeric': 0.10642471799901913, 'fraction_numerical': 0.00784698381559588, 'mean_word_length': 3.950242718446602, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6344609', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1140, 'n_words': 465}