NDEVR
API Documentation
ImageFormatHandlerabstract

Can be used to add functionality to the ImageFactory. More...

Inheritance diagram for ImageFormatHandler:
[legend]

Public Member Functions

virtual bool canRead (const File &file) const =0
 Checks whether this handler can read the given file.
virtual bool canRead (StringView format) const =0
 Checks whether this handler can read the given format extension.
virtual bool canWrite (StringView format) const =0
 Checks whether this handler can write the given format extension.
virtual StringView compressionFormat (const uint01 *, uint04)
 Tries to determine what the format is of the image's compressed_data field.
virtual bool getCompressed (ImageCacheData &, StringView)
 Compresses the image into the specified format and populates the compressed_data field.
virtual bool getMetaData (ImageCacheData &)
 Reads metadata (e.g., EXIF data) from the image and populates it in the cache data.
virtual bool getSize (ImageCacheData &)
 Calculates the size of the image, if possible.
virtual void getSupportedFormats (AlocatingAlignedBuffer< FileFormat, 64 > &formats, bool is_read) const =0
 Populates a buffer with the file formats this handler supports.
virtual bool getUncompressed (ImageCacheData &)
 Decompresses the image and populates the decompressed_data field of the cache data.
virtual bool hasTransparency (ImageCacheData &)
 Calculates whether the image truly has transparancy (not just a transparancy channel).
virtual UUID id () const =0
 Returns the unique identifier for this format handler.

Detailed Description

Can be used to add functionality to the ImageFactory.


Definition at line 138 of file ImageFactory.h.

Member Function Documentation

◆ canRead() [1/2]

virtual bool ImageFormatHandler::canRead ( const File & file) const
pure virtual

Checks whether this handler can read the given file.

Parameters
[in]fileThe file to check.
Returns
True if the file can be read by this handler.

Implemented in PNGImageFactory, and TIFImageFactory.

◆ canRead() [2/2]

virtual bool ImageFormatHandler::canRead ( StringView format) const
pure virtual

Checks whether this handler can read the given format extension.

Parameters
[in]formatThe file format extension to check (e.g., ".png").
Returns
True if the format can be read by this handler.

Implemented in PNGImageFactory, and TIFImageFactory.

◆ canWrite()

virtual bool ImageFormatHandler::canWrite ( StringView format) const
pure virtual

Checks whether this handler can write the given format extension.

Parameters
[in]formatThe file format extension to check (e.g., ".jpg").
Returns
True if the format can be written by this handler.

Implemented in PNGImageFactory, and TIFImageFactory.

◆ compressionFormat()

virtual StringView ImageFormatHandler::compressionFormat ( const uint01 * ,
uint04  )
inlinevirtual

Tries to determine what the format is of the image's compressed_data field.

Returns
The extension if determined, otherwise blank.

Reimplemented in PNGImageFactory, and TIFImageFactory.

Definition at line 203 of file ImageFactory.h.

◆ getCompressed()

virtual bool ImageFormatHandler::getCompressed ( ImageCacheData & ,
StringView  )
inlinevirtual

Compresses the image into the specified format and populates the compressed_data field.

Parameters
[in]dataThe image cache data to populate with compressed data.
[in]formatThe target compression format extension.
Returns
True if compression succeeded, false otherwise.

Reimplemented in PNGImageFactory, and TIFImageFactory.

Definition at line 188 of file ImageFactory.h.

◆ getMetaData()

virtual bool ImageFormatHandler::getMetaData ( ImageCacheData & )
inlinevirtual

Reads metadata (e.g., EXIF data) from the image and populates it in the cache data.

Parameters
[in]dataThe image cache data to populate with metadata.
Returns
True if metadata was successfully read, false otherwise.

Reimplemented in PNGImageFactory, and TIFImageFactory.

Definition at line 175 of file ImageFactory.h.

◆ getSize()

virtual bool ImageFormatHandler::getSize ( ImageCacheData & )
inlinevirtual

Calculates the size of the image, if possible.

Returns
True if size determined, false otherwise

Reimplemented in PNGImageFactory, and TIFImageFactory.

Definition at line 198 of file ImageFactory.h.

◆ getSupportedFormats()

virtual void ImageFormatHandler::getSupportedFormats ( AlocatingAlignedBuffer< FileFormat, 64 > & formats,
bool is_read ) const
pure virtual

Populates a buffer with the file formats this handler supports.

Parameters
[in]formatsThe buffer to populate with supported FileFormat entries.
[in]is_readWhether to return read-supported formats (true) or write-supported formats (false).

Implemented in PNGImageFactory, and TIFImageFactory.

◆ getUncompressed()

virtual bool ImageFormatHandler::getUncompressed ( ImageCacheData & )
inlinevirtual

Decompresses the image and populates the decompressed_data field of the cache data.

Parameters
[in]dataThe image cache data to populate with uncompressed pixel data.
Returns
True if decompression succeeded, false otherwise.

Reimplemented in PNGImageFactory, and TIFImageFactory.

Definition at line 181 of file ImageFactory.h.

◆ hasTransparency()

virtual bool ImageFormatHandler::hasTransparency ( ImageCacheData & )
inlinevirtual

Calculates whether the image truly has transparancy (not just a transparancy channel).

Returns
True if size determined, false otherwise

Reimplemented in PNGImageFactory, and TIFImageFactory.

Definition at line 193 of file ImageFactory.h.

◆ id()

virtual UUID ImageFormatHandler::id ( ) const
pure virtual

Returns the unique identifier for this format handler.

Returns
The UUID of this handler.

Implemented in PNGImageFactory, and TIFImageFactory.


The documentation for this class was generated from the following file: