11#ifndef __BE_IMAGE_IMAGE_H__
12#define __BE_IMAGE_IMAGE_H__
89 const Size dimensions,
90 const uint32_t colorDepth,
91 const uint16_t bitDepth,
95 const std::string &identifier =
"",
124 const std::string &identifier =
"",
212 const bool removeAlphaChannelIfPresent)
299 return (this->_hasAlphaChannel);
348 uint64_t maxColorValue,
378 static std::shared_ptr<Image>
382 const std::string &identifier =
"",
407 static std::shared_ptr<Image>
410 const std::string &identifier =
"",
435 static std::shared_ptr<Image>
437 const std::string &path,
462 const uint64_t size);
507 const std::string &path);
569 const Size dimensions);
580 const uint32_t colorDepth);
592 const uint16_t bitDepth);
623 uint32_t _colorDepth;
626 bool _hasAlphaChannel;
641 const std::string _identifier{};
Information communicated back from framework methods.
Represent attributes common to all images.
virtual Memory::uint8Array getRawData() const =0
Accessor for the raw image data.
uint64_t getDataSize() const
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.
static void defaultStatusCallback(const Framework::Status &status)
Default handling of statuses sent from image processing libraries.
void setResolution(const Resolution resolution)
Mutator for the resolution of the image .
uint32_t getColorDepth() const
Accessor for the color depth of the image in bits.
static CompressionAlgorithm getCompressionAlgorithm(const Memory::uint8Array &data)
Determine the compression algorithm of a buffer of image data.
std::function< void(const Framework::Status)> statusCallback_t
bool hasAlphaChannel() const
Accessor for the presence of an alpha channel.
Memory::uint8Array getData() const
Accessor for the image data.
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.
std::string getIdentifier() const
Obtain the assigned image identifier.
Size getDimensions() const
Accessor for the dimensions of the image in pixels.
static BiometricEvaluation::Image::Raw getRawImage(const std::shared_ptr< BiometricEvaluation::Image::Image > &image)
Obtain Image::Raw version of an Image::Image.
virtual Memory::uint8Array getRawGrayscaleData(uint8_t depth) const =0
Accessor for decompressed data in grayscale.
statusCallback_t getStatusCallback() const
Get handle to status callback function.
const uint8_t * getDataPointer() const
uint16_t getBitDepth() const
Accessor for the number of bits per color component.
void setDimensions(const Size dimensions)
Mutator for the dimensions of the image in pixels.
void setBitDepth(const uint16_t bitDepth)
Mutator for the number of bits per component for color components in the image, in bits.
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.
virtual Memory::uint8Array getRawData(const bool removeAlphaChannelIfPresent) const
Accessor for the raw image data.
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.
Resolution getResolution() const
Accessor for the resolution of the 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.
CompressionAlgorithm getCompressionAlgorithm() const
Accessor for the CompressionAlgorithm of the image.
void setColorDepth(const uint32_t colorDepth)
Mutator for the color depth of the image in bits.
void setHasAlphaChannel(const bool hasAlphaChannel)
Mutator for the presence of an alpha channel.
static CompressionAlgorithm getCompressionAlgorithm(const std::string &path)
Determine the compression algorithm of a file.
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.
static CompressionAlgorithm getCompressionAlgorithm(const uint8_t *data, const uint64_t size)
Determine the compression algorithm of a buffer of image data.
An image with no encoding or compression.
Basic information relating to images.
CompressionAlgorithm
Image compression algorithms.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...
A structure to represent the resolution of an image.
A structure to represent the size of an image, in pixels.