Represent attributes common to all images.
More...
#include <be_image_image.h>
Inherited by BiometricEvaluation::Image::BMP, BiometricEvaluation::Image::JPEG, BiometricEvaluation::Image::JPEG2000, BiometricEvaluation::Image::JPEGL, BiometricEvaluation::Image::NetPBM, BiometricEvaluation::Image::PNG, BiometricEvaluation::Image::Raw, BiometricEvaluation::Image::TIFF, and BiometricEvaluation::Image::WSQ.
|
| | 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...
|
| |
| virtual | ~Image () |
| |
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.
Definition at line 50 of file be_image_image.h.
◆ statusCallback_t
◆ Image() [1/2]
Parent constructor for all Image classes.
- Parameters
-
| [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. |
- Exceptions
-
◆ Image() [2/2]
Parent constructor for all Image classes.
- Parameters
-
| [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. |
- Exceptions
-
◆ ~Image()
| virtual BiometricEvaluation::Image::Image::~Image |
( |
| ) |
|
|
virtual |
◆ getCompressionAlgorithm() [1/4]
Accessor for the CompressionAlgorithm of the image.
- Returns
- Type of compression used on the data that will be returned from getData().
◆ getResolution()
| Resolution BiometricEvaluation::Image::Image::getResolution |
( |
| ) |
const |
Accessor for the resolution of the image.
- Returns
- Resolution struct
◆ getData()
Accessor for the image data.
The data returned is likely encoded in a specialized format.
- Returns
- AutoArray holding image data.
◆ getRawData() [1/2]
◆ getRawData() [2/2]
| virtual Memory::uint8Array BiometricEvaluation::Image::Image::getRawData |
( |
const bool |
removeAlphaChannelIfPresent | ) |
const |
|
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.
- Parameters
-
| [in] | removeAlphaChannelIfPresent | Whether or not to remove an alpha channel if one exists. |
- Returns
- AutoArray holding raw image data, without an alpha channel if requested.
- Exceptions
-
◆ getRawGrayscaleData()
| virtual Memory::uint8Array BiometricEvaluation::Image::Image::getRawGrayscaleData |
( |
uint8_t |
depth | ) |
const |
|
pure virtual |
Accessor for decompressed data in grayscale.
- Parameters
-
| depth | The desired bit depth of the resulting raw image. This value may either be 16, 8, or 1. |
- Returns
- AutoArray holding raw grayscale image data.
- Exceptions
-
- Note
- This method does not save a cached copy of the decompressed image because the bit depth of the image can be changed between calls.
-
When depth is 1, this method returns an image that uses 8 bits to represent a single pixel. The depth parameter is used to adjust the number of gray levels. When depth is 1, there are only 2 gray levels (black and white), despite using 8 bits to represent each pixel.
-
Alpha channels are completely ignored when converting to grayscale.
Implemented in BiometricEvaluation::Image::BMP, BiometricEvaluation::Image::JPEG, BiometricEvaluation::Image::JPEG2000, BiometricEvaluation::Image::JPEGL, BiometricEvaluation::Image::NetPBM, BiometricEvaluation::Image::PNG, BiometricEvaluation::Image::Raw, BiometricEvaluation::Image::TIFF, and BiometricEvaluation::Image::WSQ.
◆ getDimensions()
| Size BiometricEvaluation::Image::Image::getDimensions |
( |
| ) |
const |
Accessor for the dimensions of the image in pixels.
- Returns
- Coordinate object containing dimensions in pixels.
◆ getColorDepth()
| uint32_t BiometricEvaluation::Image::Image::getColorDepth |
( |
| ) |
const |
Accessor for the color depth of the image in bits.
- Returns
- The color depth of the image (bit).
◆ getBitDepth()
| uint16_t BiometricEvaluation::Image::Image::getBitDepth |
( |
| ) |
const |
Accessor for the number of bits per color component.
- Returns
- The bit depth of the image (in bits).
◆ hasAlphaChannel()
| bool BiometricEvaluation::Image::Image::hasAlphaChannel |
( |
| ) |
const |
|
inline |
Accessor for the presence of an alpha channel.
- Returns
- Whether or not an alpha channel is present.
Definition at line 296 of file be_image_image.h.
◆ getStatusCallback()
Get handle to status callback function.
- Returns
- Status callback function.
◆ getIdentifier()
| std::string BiometricEvaluation::Image::Image::getIdentifier |
( |
| ) |
const |
Obtain the assigned image identifier.
- Returns
- Image identifier.
◆ valueInColorspace()
| static uint64_t BiometricEvaluation::Image::Image::valueInColorspace |
( |
uint64_t |
color, |
|
|
uint64_t |
maxColorValue, |
|
|
uint8_t |
depth |
|
) |
| |
|
static |
Calculate an equivalent color value for a color in an alternate colorspace.
- Parameters
-
| color | Value for color in original colorspace. |
| maxColorValue | Maximum value for colors in original colorspace. |
| depth | Desired bit-depth of the new colorspace. |
- Returns
- A value equivalent to color in depth-bit space.
◆ openImage() [1/3]
Determine the image type of a buffer of image data and create an Image object.
- Parameters
-
| [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. |
- Returns
- Image representation of the input data buffer.
- Exceptions
-
◆ openImage() [2/3]
Determine the image type of a buffer of image data and create an Image object.
- Parameters
-
| [in] | data | The image data. |
| identifier | Identifier for the encapsulated data. |
| statusCallback | Function to handle statuses sent when processing images. |
- Returns
- Image representation of the input data buffer.
- Exceptions
-
◆ openImage() [3/3]
Determine the image type of an image file and create an Image object.
- Parameters
-
| [in] | path | Path to image data. |
| statusCallback | Function to handle statuses sent when processing images. |
- Returns
- Image representation of the input data buffer.
- Exceptions
-
◆ getCompressionAlgorithm() [2/4]
| static CompressionAlgorithm BiometricEvaluation::Image::Image::getCompressionAlgorithm |
( |
const uint8_t * |
data, |
|
|
const uint64_t |
size |
|
) |
| |
|
static |
Determine the compression algorithm of a buffer of image data.
- Parameters
-
| [in] | data | The image data. |
| [in] | size | The size of the image data, in bytes. |
- Returns
- Compression algorithm used in the buffer.
- Attention
- CompressionAlgorithm::None is returned if no compression algorithm known to the Biometric Evaluation Framework is found.
◆ getCompressionAlgorithm() [3/4]
Determine the compression algorithm of a buffer of image data.
- Parameters
-
- Returns
- Compression algorithm used in the buffer.
- Attention
- CompressionAlgorithm::None is returned if no compression algorithm known to the Biometric Evaluation Framework is found.
◆ getCompressionAlgorithm() [4/4]
| static CompressionAlgorithm BiometricEvaluation::Image::Image::getCompressionAlgorithm |
( |
const std::string & |
path | ) |
|
|
static |
Determine the compression algorithm of a file.
- Parameters
-
- Returns
- Compression algorithm used in the file.
- Exceptions
-
- Attention
- CompressionAlgorithm::None is returned if no compression algorithm known to the Biometric Evaluation Framework is found.
◆ getRawImage()
◆ defaultStatusCallback()
| static void BiometricEvaluation::Image::Image::defaultStatusCallback |
( |
const Framework::Status & |
status | ) |
|
|
static |
Default handling of statuses sent from image processing libraries.
- Parameters
-
- Exceptions
-
- Note
- Custom implementations of signature statusCallback_t should throw an exception when status.type == Framework::Status::Type::Error.
◆ setResolution()
| void BiometricEvaluation::Image::Image::setResolution |
( |
const Resolution |
resolution | ) |
|
|
protected |
Mutator for the resolution of the image .
- Parameters
-
◆ setDimensions()
| void BiometricEvaluation::Image::Image::setDimensions |
( |
const Size |
dimensions | ) |
|
|
protected |
Mutator for the dimensions of the image in pixels.
- Parameters
-
| [in] | dimensions | Dimensions of image (pixel). |
◆ setColorDepth()
| void BiometricEvaluation::Image::Image::setColorDepth |
( |
const uint32_t |
colorDepth | ) |
|
|
protected |
Mutator for the color depth of the image in bits.
- Parameters
-
| [in] | colorDepth | The color depth of the image (bit). |
◆ setBitDepth()
| void BiometricEvaluation::Image::Image::setBitDepth |
( |
const uint16_t |
bitDepth | ) |
|
|
protected |
Mutator for the number of bits per component for color components in the image, in bits.
- Parameters
-
| [in] | bitDepth | The number of bits per color component. |
◆ getDataPointer()
| const uint8_t * BiometricEvaluation::Image::Image::getDataPointer |
( |
| ) |
const |
|
protected |
- Returns
- Const pointer to buffer underlying _data.
◆ getDataSize()
| uint64_t BiometricEvaluation::Image::Image::getDataSize |
( |
| ) |
const |
|
protected |
◆ setHasAlphaChannel()
| void BiometricEvaluation::Image::Image::setHasAlphaChannel |
( |
const bool |
hasAlphaChannel | ) |
|
|
inlineprotected |
Mutator for the presence of an alpha channel.
- Parameters
-
| [in] | hasAlphaChannel | Whether or not image has an alpha channel. |
Definition at line 612 of file be_image_image.h.
The documentation for this class was generated from the following file: