com.machinezoo.sourceafis

Class FingerprintTransparency

SourceAFIS » API Reference

    • Constructor Detail

      • FingerprintTransparency

        protected FingerprintTransparency()
        Creates an instance of FingerprintTransparency. FingerprintTransparency is an abstract class. This empty constructor is only called by subclasses.
    • Method Detail

      • log

        protected abstract void log(String keyword,
                                    Map<String,Supplier<ByteBuffer>> data)
        Record transparency data. This is an abstract method that subclasses must override. If algorithm transparency is enabled by passing an instance of FingerprintTransparency to FingerprintTemplate.transparency(FingerprintTransparency) or FingerprintMatcher.transparency(FingerprintTransparency), this method is called with transparency data in its parameters.
        Parameter keyword specifies the kind of transparency data being logged, usually corresponding to some stage in the algorithm. For convenience, several related pieces of transparency data are reported together. All pieces are available via map in parameter data, keyed by file suffix identifying the kind of data, usually .json or .dat for JSON and binary data respectively. See algorithm transparency on SourceAFIS website for documentation of the structure of the transparency data.
        Transparency data is offered indirectly via Supplier. If this Supplier is not evaluated, the data is never serialized. This allows applications to efficiently collect only transparency data that is actually needed.
        Parameters:
        keyword - specifies the kind of transparency data being reported
        data - a map of suffixes (like .json or .dat) to Supplier of the available transparency data
        See Also:
        Algorithm transparency in SourceAFIS, zip(OutputStream)
      • close

        public void close()
        Release system resources held by this instance if any. Subclasses can override this method to perform cleanup. Default implementation of this method is empty.
        Specified by:
        close in interface AutoCloseable
      • zip

        public static FingerprintTransparency zip(OutputStream stream)
        Write all transparency data to a ZIP file. This is a convenience method to enable easy exploration of the available data. Programmatic processing of transparency data should be done by subclassing FingerprintTransparency and overriding log(String, Map) method.
        The returned FingerprintTransparency object holds system resources and callers are responsible for calling close() method, perhaps using try-with-resources construct. Failure to close the returned FingerprintTransparency instance may result in damaged ZIP file.
        Parameters:
        stream - output stream where ZIP file will be written (will be closed when the returned FingerprintTransparency is closed)
        Returns:
        algorithm transparency logger that writes data to a ZIP file
        See Also:
        close(), log(String, Map)