NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
be_data_interchange_an2k.h
Go to the documentation of this file.
1/*
2 * This software was developed at the National Institute of Standards and
3 * Technology (NIST) by employees of the Federal Government in the course
4 * of their official duties. Pursuant to title 17 Section 105 of the
5 * United States Code, this software is not subject to copyright protection
6 * and is in the public domain. NIST assumes no responsibility whatsoever for
7 * its use by other parties, and makes no guarantees, expressed or implied,
8 * about its quality, reliability, or any other characteristic.
9 */
10
11#ifndef __BE_DATA_INTERCHANGE_AN2K__
12#define __BE_DATA_INTERCHANGE_AN2K__
13
14#include <map>
15#include <set>
16#include <string>
17#include <vector>
18
21#include <be_latent_an2kview.h>
23#include <be_io_utility.h>
25#include <be_palm_an2kview.h>
26
28{
29 namespace DataInterchange
30 {
39 class AN2KRecord {
40 public:
46 struct DomainName {
59 std::string identifier = "",
60 std::string version = "") :
62 version(version) {};
63
68 std::string identifier;
70 std::string version;
71 };
73 using DomainName = struct DomainName;
74
75 struct CharacterSet {
89 uint16_t identifier = 0,
90 std::string commonName = "",
91 std::string version = "") :
94 version(version) {};
95
97 uint16_t identifier;
99 std::string commonName;
101 std::string version;
102 };
105
106
125 static std::set<int>
128 const View::AN2KView::RecordType recordType);
129
144 static std::set<int>
146 const ANSI_NIST *an2k,
147 const View::AN2KView::RecordType recordType);
148
164 const std::string filename);
165
178 Memory::uint8Array &buf);
179
184 std::string getVersionNumber() const;
185
190 std::string getDate() const;
191
196 std::string getDestinationAgency() const;
197
202 std::string getOriginatingAgency() const;
203
208 std::string getTransactionControlNumber() const;
209
214 std::string getNativeScanningResolution() const;
215
221
228 uint32_t getFingerLatentCount() const;
229
240 std::vector<Latent::AN2KView>
242
249 uint32_t getFingerCaptureCount() const;
250
261 std::vector<Finger::AN2KViewCapture>
263
273 uint32_t
275 const;
276
277
290 uint32_t
293 const;
294
309 std::vector<Finger::AN2KViewFixedResolution>
311 const;
312
313
330 std::vector<Finger::AN2KViewFixedResolution>
333 const;
334
342 uint32_t
344 const;
345
357 std::vector<Palm::AN2KView>
359 const;
360
368 std::vector<Finger::AN2KMinutiaeDataRecord>
370 const;
371
379 uint8_t
381 const;
382
394 const;
395
404 struct tm
406 const;
407
417 std::vector<CharacterSet>
419 const;
420
433 static bool
435 const std::string &filename);
436
449 static bool
452
453 protected:
455
456 private:
457 std::string _version;
458 std::string _date;
459 std::string _dai;
460 std::string _ori;
461 std::string _tcn;
462 std::string _nsr;
463 std::string _ntr;
465 uint8_t _pry;
467 std::string _tcr;
469 DomainName _domainName;
471 struct tm _gmt;
473 std::vector<CharacterSet> _dcs;
474
476 std::vector<Finger::AN2KViewFixedResolution>>
477 _fingerFixedResolutionCaptures;
478 std::vector<Latent::AN2KView> _fingerLatents;
479 std::vector<Finger::AN2KViewCapture> _fingerCaptures;
480 std::vector<Palm::AN2KView> _palmCaptures;
482 std::vector<Finger::AN2KMinutiaeDataRecord>
483 _minutiaeDataRecordSet;
484
493 void readAN2KRecord(Memory::uint8Array &buf);
494 void readType1Record(Memory::uint8Array &buf);
495
503 void readMinutiaeData(Memory::uint8Array &buf);
504 void readFingerCaptures(Memory::uint8Array &buf);
505 void readFingerLatents(Memory::uint8Array &buf);
506 void readFixedResolutionCaptures(Memory::uint8Array
507 &buf);
508 void readPalmCaptures(Memory::uint8Array &buf);
509 };
510 }
511}
512#endif
513
ansi_nist ANSI_NIST
A class to represent an entire ANSI/NIST record.
std::vector< Finger::AN2KViewCapture > getFingerCaptures() const
Obtain all capture (Type-14) finger views.
std::vector< Latent::AN2KView > getFingerLatents() const
Obtain all latent (Type-13) finger views.
DomainName getDomainName() const
Obtain the idntifier of the domain name for the user-defined Type-2 logical record implementation.
std::vector< Finger::AN2KMinutiaeDataRecord > getMinutiaeDataRecordSet() const
Obtain all minutiae (Type-9) data.
uint32_t getFingerLatentCount() const
Obtain the count of latent (Type-13) finger views.
static bool isAN2KRecord(BiometricEvaluation::Memory::uint8Array &buf)
Determine if file appears to be an ANSI/NIST record.
struct tm getGreenwichMeanTime() const
Obain the date and time of encoding in terms of GMT units.
uint32_t getFingerFixedResolutionCaptureCount() const
Obtain the count of all fixed resolution (Type 3-6) views.
uint8_t getPriority() const
Obtain the urgency with which a response is required.
static std::set< int > recordLocations(const ANSI_NIST *an2k, const View::AN2KView::RecordType recordType)
Find the position within an ANSI_NIST struct of all Records of a particular type.
std::vector< Palm::AN2KView > getPalmCaptures() const
Obtain all capture (Type-15) palm views.
uint32_t getPalmCaptureCount() const
Obtain the count of capture (Type-15) palm views.
uint32_t getFingerCaptureCount() const
Obtain the count of capture (Type-14) finger views.
std::vector< Finger::AN2KViewFixedResolution > getFingerFixedResolutionCaptures() const
Obtain all fixed resolution (Type 3-6) views.
std::vector< Finger::AN2KViewFixedResolution > getFingerFixedResolutionCaptures(const View::AN2KView::RecordType type) const
Obtain all fixed resolution (Type 3-6) views of a particular type.
static bool isAN2KRecord(const std::string &filename)
Determine if file appears to be an ANSI/NIST record.
static std::set< int > recordLocations(Memory::uint8Array &buf, const View::AN2KView::RecordType recordType)
Find the position within a buffer of all Records of a particular type.
uint32_t getFingerFixedResolutionCaptureCount(const View::AN2KView::RecordType type) const
Obtain the count of fixed resolution (Type 3-6) views.
AN2KRecord(Memory::uint8Array &buf)
Constructor taking an AN2K record from a buffer.
AN2KRecord(const std::string filename)
Constructor taking an AN2K record from a file.
DomainName DomainName
Convenience alias for struct DomainName.
std::vector< CharacterSet > getDirectoryOfCharacterSets() const
Obtain the list of character sets other than 7-bit ASCII that may appear in the transaction.
RecordType
The type of AN2K record.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...
std::string version
Optional version of the character set.
CharacterSet(uint16_t identifier=0, std::string commonName="", std::string version="")
Create a new CharacterSet struct.
Representation of a domain name for the user-defined Type-2 logical record implementation.
std::string version
Optional version of the implementation.
DomainName(std::string identifier="", std::string version="")
Create a DomainName struct.
std::string identifier
Unique identifier for agency, entity, or implementation.