Friction Ridge Image and Features
API for participating in NIST's Friction Ridge Image and Features Technology Evaluations.
Loading...
Searching...
No Matches
FRIF::Image Struct Reference

Data and metadata for an image. More...

#include <common.h>

Public Types

enum class  BitsPerPixel { Eight = 8 , Sixteen = 16 , TwentyFour = 24 , FortyEight = 48 }
 Number of bits comprising a single image pixel. More...
 
enum class  BitsPerChannel { Eight = 8 , Sixteen = 16 }
 Number of bits comprising a single color channel of a single pixel. More...
 
enum class  Colorspace { Grayscale , RGB }
 
using BPP = BitsPerPixel
 
using BPC = BitsPerChannel
 

Public Member Functions

 Image ()
 
 Image (const uint8_t identifier, const uint16_t width, const uint16_t height, const uint16_t ppi, const Colorspace colorspace, const BitsPerChannel bpc, const BitsPerPixel bpp, const std::vector< std::byte > &pixels)
 Image constructor.
 
void sanityCheck () const
 Validate that the properties of this Image appear to correspond to valid image data.
 

Public Attributes

uint8_t identifier {}
 An identifier for this image.
 
uint16_t width {}
 Width of the image.
 
uint16_t height {}
 Height of the image.
 
uint16_t ppi {}
 Resolution of the image in pixels per inch.
 
Colorspace colorspace {Colorspace::Grayscale}
 Representation of color in each byte within pixels.
 
BitsPerChannel bpc {BitsPerChannel::Eight}
 Number of bits used by each color component.
 
BitsPerPixel bpp {BitsPerPixel::Eight}
 Number of bits comprising a single pixel.
 
std::vector< std::byte > pixels {}
 Raw pixel data of image.
 

Detailed Description

Data and metadata for an image.

Definition at line 57 of file common.h.

Member Typedef Documentation

◆ BPP

Definition at line 67 of file common.h.

◆ BPC

Definition at line 78 of file common.h.

Member Enumeration Documentation

◆ BitsPerPixel

enum class FRIF::Image::BitsPerPixel
strong

Number of bits comprising a single image pixel.

Enumerator
Eight 
Sixteen 
TwentyFour 
FortyEight 

Definition at line 60 of file common.h.

◆ BitsPerChannel

enum class FRIF::Image::BitsPerChannel
strong

Number of bits comprising a single color channel of a single pixel.

Enumerator
Eight 
Sixteen 

Definition at line 73 of file common.h.

◆ Colorspace

enum class FRIF::Image::Colorspace
strong
Enumerator
Grayscale 

Single channel (shades of gray)

RGB 

Three channels, with equal bit widths representing red, green, and blue, in order.

Definition at line 80 of file common.h.

Constructor & Destructor Documentation

◆ Image() [1/2]

FRIF::Image::Image ( )
default

◆ Image() [2/2]

FRIF::Image::Image ( const uint8_t identifier,
const uint16_t width,
const uint16_t height,
const uint16_t ppi,
const Colorspace colorspace,
const BitsPerChannel bpc,
const BitsPerPixel bpp,
const std::vector< std::byte > & pixels )

Image constructor.

Parameters
identifierAn identifier for this image. Used to link Image to TemplateData and Correspondence.
widthWidth of the image in pixels.
heightHeight of the image in pixels.
ppiResolution of the image in pixels per inch.
colorspaceRepresentation of color in each byte within pixels.
bpcNumber of bits used by each color component.
bppNumber of bits comprising a single pixel.
pixelswidth * height * (bpp / bpc) bytes of image data, with pixels.front() representing the first byte of the top-left pixel, and pixels.back() representing the last byte of the bottom-right pixel. It is decompressed big endian image data, canonically coded as defined in ISO/IEC 19794-4:2005, section 6.2. For example, the value 0xFF00 when bpc is BPC::Sixteen, bpp is BPP::Sixteen and colorspace is Colorspace::Grayscale is significantly closer to white than it is to black.
Note
You may call sanityCheck on this object to have some confidence that the image properties make sense.

Definition at line 52 of file libfrif_common.cpp.

Member Function Documentation

◆ sanityCheck()

void FRIF::Image::sanityCheck ( ) const

Validate that the properties of this Image appear to correspond to valid image data.

Exceptions
std::logic_errorSome combination of properties appears invalid.

Definition at line 74 of file libfrif_common.cpp.

Member Data Documentation

◆ identifier

uint8_t FRIF::Image::identifier {}

An identifier for this image.

Used to link Image to EFS, TemplateData, and Correspondence.

Definition at line 153 of file common.h.

◆ width

uint16_t FRIF::Image::width {}

Width of the image.

Definition at line 155 of file common.h.

◆ height

uint16_t FRIF::Image::height {}

Height of the image.

Definition at line 157 of file common.h.

◆ ppi

uint16_t FRIF::Image::ppi {}

Resolution of the image in pixels per inch.

Definition at line 159 of file common.h.

◆ colorspace

Colorspace FRIF::Image::colorspace {Colorspace::Grayscale}

Representation of color in each byte within pixels.

Definition at line 161 of file common.h.

◆ bpc

Number of bits used by each color component.

Definition at line 163 of file common.h.

◆ bpp

BitsPerPixel FRIF::Image::bpp {BitsPerPixel::Eight}

Number of bits comprising a single pixel.

Definition at line 165 of file common.h.

◆ pixels

std::vector<std::byte> FRIF::Image::pixels {}

Raw pixel data of image.

width * height * (bpp / bpc) bytes of image data, with pixels .front() representing the first byte of the top-left pixel, and pixels .back() representing the last byte of the bottom-right pixel. It is decompressed big endian image data, canonically coded as defined in ISO/IEC 19794-4:2005, section 6.2. For example, the value 0xFF00 when bpc is BPC::Sixteen, bpp is BPP::Sixteen and colorspace is Colorspace::Grayscale is significantly closer to white than it is to black.

Note
To pass pixels to a C-style array, invoke pixel's data() method (pixels.data()). You may safely reinterpret_cast this value to std::vector<uint8_t> if needed (e.g., to obtain a uint8_t* from data()).

Definition at line 187 of file common.h.


The documentation for this struct was generated from the following files: