Nail to Nail Fingerprint Capture Challenge
API for participant-specific one-to-many template generation and template matching.
|
Represent attributes common to all images. More...
#include <be_image_image.h>
Public Types | |
using | statusCallback_t = std::function< void(const Framework::Status)> |
Public Member Functions | |
Image (const uint8_t *data, const uint64_t size, const Size dimensions, const uint32_t colorDepth, const uint16_t bitDepth, const Resolution resolution, const CompressionAlgorithm compression, const bool hasAlphaChannel, const std::string &identifier="", const statusCallback_t &statusCallback=Image::defaultStatusCallback) | |
Parent constructor for all Image classes. More... | |
Image (const uint8_t *data, const uint64_t size, const CompressionAlgorithm compression, const std::string &identifier="", const statusCallback_t &statusCallback=Image::defaultStatusCallback) | |
Parent constructor for all Image classes. More... | |
CompressionAlgorithm | getCompressionAlgorithm () const |
Accessor for the CompressionAlgorithm of the image. More... | |
Resolution | getResolution () const |
Accessor for the resolution of the image. More... | |
Memory::uint8Array | getData () const |
Accessor for the image data. More... | |
virtual Memory::uint8Array | getRawData () const =0 |
Accessor for the raw image data. More... | |
virtual Memory::uint8Array | getRawData (const bool removeAlphaChannelIfPresent) const |
Accessor for the raw image data. More... | |
virtual Memory::uint8Array | getRawGrayscaleData (uint8_t depth) const =0 |
Accessor for decompressed data in grayscale. More... | |
Size | getDimensions () const |
Accessor for the dimensions of the image in pixels. More... | |
uint32_t | getColorDepth () const |
Accessor for the color depth of the image in bits. More... | |
uint16_t | getBitDepth () const |
Accessor for the number of bits per color component. More... | |
bool | hasAlphaChannel () const |
Accessor for the presence of an alpha channel. More... | |
statusCallback_t | getStatusCallback () const |
Get handle to status callback function. More... | |
std::string | getIdentifier () const |
Obtain the assigned image identifier. More... | |
Static Public Member Functions | |
static uint64_t | valueInColorspace (uint64_t color, uint64_t maxColorValue, uint8_t depth) |
Calculate an equivalent color value for a color in an alternate colorspace. More... | |
static std::shared_ptr< Image > | openImage (const uint8_t *data, const uint64_t size, const std::string &identifier="", const statusCallback_t &statusCallback=Image::defaultStatusCallback) |
Determine the image type of a buffer of image data and create an Image object. More... | |
static std::shared_ptr< Image > | openImage (const Memory::uint8Array &data, const std::string &identifier="", const statusCallback_t &statusCallback=Image::defaultStatusCallback) |
Determine the image type of a buffer of image data and create an Image object. More... | |
static std::shared_ptr< Image > | openImage (const std::string &path, const statusCallback_t &statusCallback=Image::defaultStatusCallback) |
Determine the image type of an image file and create an Image object. More... | |
static CompressionAlgorithm | getCompressionAlgorithm (const uint8_t *data, const uint64_t size) |
Determine the compression algorithm of a buffer of image data. More... | |
static CompressionAlgorithm | getCompressionAlgorithm (const Memory::uint8Array &data) |
Determine the compression algorithm of a buffer of image data. More... | |
static CompressionAlgorithm | getCompressionAlgorithm (const std::string &path) |
Determine the compression algorithm of a file. More... | |
static BiometricEvaluation::Image::Raw | getRawImage (const std::shared_ptr< BiometricEvaluation::Image::Image > &image) |
Obtain Image::Raw version of an Image::Image. More... | |
static void | defaultStatusCallback (const Framework::Status &status) |
Default handling of statuses sent from image processing libraries. More... | |
Protected Member Functions | |
void | setResolution (const Resolution resolution) |
Mutator for the resolution of the image . More... | |
void | setDimensions (const Size dimensions) |
Mutator for the dimensions of the image in pixels. More... | |
void | setColorDepth (const uint32_t colorDepth) |
Mutator for the color depth of the image in bits. More... | |
void | setBitDepth (const uint16_t bitDepth) |
Mutator for the number of bits per component for color components in the image, in bits. More... | |
const uint8_t * | getDataPointer () const |
uint64_t | getDataSize () const |
void | setHasAlphaChannel (const bool hasAlphaChannel) |
Mutator for the presence of an alpha channel. More... | |
Represent attributes common to all images.
Images are represented by their size, depth, and resolution on the X and Y axes. The image data can be of any format, raw, JPEG, etc. Implementations of this abstraction provide the getRawData method to convert image data to 'raw' format.
Image resolution is in pixels per centimeter, and the coordinate system has the origin at the upper left of the image.
BiometricEvaluation::Image::Image::Image | ( | const uint8_t * | data, |
const uint64_t | size, | ||
const Size | dimensions, | ||
const uint32_t | colorDepth, | ||
const uint16_t | bitDepth, | ||
const Resolution | resolution, | ||
const CompressionAlgorithm | compression, | ||
const bool | hasAlphaChannel, | ||
const std::string & | identifier = "" , |
||
const statusCallback_t & | statusCallback = Image::defaultStatusCallback |
||
) |
Parent constructor for all Image classes.
[in] | data | The image data. |
[in] | size | The size of the image data, in bytes. |
[in] | dimensions | The width and height of the image in pixels. |
[in] | colorDepth | The image color depth, in bits-per-pixel. |
[in] | bitDepth | The number of bits per color component. |
[in] | resolution | The resolution of the image |
[in] | compression | The CompressionAlgorithm of data. |
[in] | hasAlphaChannel | Presence of an alpha channel. |
identifier | Identifier for the encapsulated data. | |
statusCallback | Function to handle statuses sent when processing images. |
Error::StrategyError | Error manipulating data. |
Error::StrategyError | Error while creating Image. |
BiometricEvaluation::Image::Image::Image | ( | const uint8_t * | data, |
const uint64_t | size, | ||
const CompressionAlgorithm | compression, | ||
const std::string & | identifier = "" , |
||
const statusCallback_t & | statusCallback = Image::defaultStatusCallback |
||
) |
Parent constructor for all Image classes.
[in] | data | The image data. |
[in] | size | The size of the image data, in bytes. |
[in] | compression | The CompressionAlgorithm of data. |
identifier | Identifier for the encapsulated data. | |
statusCallback | Function to handle statuses sent when processing images. |
Error::DataError | Error manipulating data. |
Error::StrategyError | Error while creating Image. |
|
static |
Default handling of statuses sent from image processing libraries.
status | Status received. |
Error::StrategyError | status.type == Framework::Status::Type::Error |
uint16_t BiometricEvaluation::Image::Image::getBitDepth | ( | ) | const |
Accessor for the number of bits per color component.
uint32_t BiometricEvaluation::Image::Image::getColorDepth | ( | ) | const |
Accessor for the color depth of the image in bits.
CompressionAlgorithm BiometricEvaluation::Image::Image::getCompressionAlgorithm | ( | ) | const |
Accessor for the CompressionAlgorithm of the image.
|
static |
Determine the compression algorithm of a buffer of image data.
[in] | data | The image data. |
|
static |
Determine the compression algorithm of a file.
[in] | path | Path to file. |
Error::ObjectDoesNotExist | path does not exist. |
Error::StrategyError | An error occurred when using the underlying storage system. |
|
static |
Determine the compression algorithm of a buffer of image data.
[in] | data | The image data. |
[in] | size | The size of the image data, in bytes. |
Memory::uint8Array BiometricEvaluation::Image::Image::getData | ( | ) | const |
Accessor for the image data.
The data returned is likely encoded in a specialized format.
|
protected |
|
protected |
Size BiometricEvaluation::Image::Image::getDimensions | ( | ) | const |
Accessor for the dimensions of the image in pixels.
std::string BiometricEvaluation::Image::Image::getIdentifier | ( | ) | const |
Obtain the assigned image identifier.
|
pure virtual |
Accessor for the raw image data.
The data returned should not be compressed or encoded.
@important Bit depth of data returned from this method is at least 8. If getBitDepth() < 8, data is losslessly converted to use 8 bits to represent a single color channel.
Error::DataError | Error decompressing image data. |
Implemented in BiometricEvaluation::Image::Raw.
|
virtual |
Accessor for the raw image data.
The data returned should not be compressed or encoded.
@important Bit depth of data returned from this method is at least 8. If getBitDepth() < 8, data is losslessly converted to use 8 bits to represent a single color channel.
[in] | removeAlphaChannelIfPresent | Whether or not to remove an alpha channel if one exists. |
Error::DataError | Error decompressing image data. |
Error::ParameterError | Propagated from Image::removeComponents. |
Error::StrategyError | Propagated from Image::removeComponents. |
|
pure virtual |
Accessor for decompressed data in grayscale.
depth | The desired bit depth of the resulting raw image. This value may either be 16, 8, or 1. |
Error::DataError | Error decompressing image data. |
Error::NotImplemented | Unsupported conversion based on source color depth. |
Error::ParameterError | Invalid value for depth. |
Implemented in BiometricEvaluation::Image::Raw.
|
static |
Obtain Image::Raw version of an Image::Image.
[in] | image | Shared pointer to an Image::Image. |
image
.image
is already an Image::Raw, image
is returned to avoid a copy. Resolution BiometricEvaluation::Image::Image::getResolution | ( | ) | const |
Accessor for the resolution of the image.
statusCallback_t BiometricEvaluation::Image::Image::getStatusCallback | ( | ) | const |
Get handle to status callback function.
|
inline |
Accessor for the presence of an alpha channel.
|
static |
Determine the image type of a buffer of image data and create an Image object.
[in] | data | The image data. |
identifier | Identifier for the encapsulated data. | |
statusCallback | Function to handle statuses sent when processing images. |
Error::DataError | Error manipulating data. |
Error::StrategyError | Error while creating Image. |
|
static |
Determine the image type of an image file and create an Image object.
[in] | path | Path to image data. |
statusCallback | Function to handle statuses sent when processing images. |
Error::DataError | Error manipulating data. |
Error::ObjectDoesNotExist | No file at specified path. |
Error::StrategyError | Error while creating Image. |
|
static |
Determine the image type of a buffer of image data and create an Image object.
[in] | data | The image data. |
[in] | size | The size of the image data, in bytes. |
identifier | Identifier for the encapsulated data. | |
statusCallback | Function to handle statuses sent when processing images. |
Error::DataError | Error manipulating data. |
Error::StrategyError | Error while creating Image. |
|
protected |
Mutator for the number of bits per component for color components in the image, in bits.
[in] | bitDepth | The number of bits per color component. |
|
protected |
Mutator for the color depth of the image in bits.
[in] | colorDepth | The color depth of the image (bit). |
|
protected |
Mutator for the dimensions of the image in pixels.
[in] | dimensions | Dimensions of image (pixel). |
|
inlineprotected |
Mutator for the presence of an alpha channel.
[in] | hasAlphaChannel | Whether or not image has an alpha channel. |
|
protected |
Mutator for the resolution of the image .
[in] | resolution | Resolution struct. |
|
static |
Calculate an equivalent color value for a color in an alternate colorspace.
color | Value for color in original colorspace. |
maxColorValue | Maximum value for colors in original colorspace. |
depth | Desired bit-depth of the new colorspace. |