NDEVR
API Documentation
PNGImageFactory

An ImageFormatHandler implementation for reading and writing PNG image files. More...

Inheritance diagram for PNGImageFactory:
[legend]
Collaboration diagram for PNGImageFactory:
[legend]

Public Member Functions

virtual bool canRead (const File &format) const override
 Checks whether the given file can be read by this handler.
virtual bool canRead (StringView format) const override
 Checks whether the given format string can be read by this handler.
virtual bool canWrite (StringView format) const override
 Checks whether the given format string can be written by this handler.
virtual StringView compressionFormat (const uint01 *data, uint04 size) override
 Determines the compression format from raw image data.
virtual bool getCompressed (ImageCacheData &, StringView) override
 Reads compressed data from a PNG image.
virtual bool getMetaData (ImageCacheData &) override
 Reads metadata from a PNG image.
virtual bool getSize (ImageCacheData &) override
 Reads the image dimensions from a PNG file.
virtual void getSupportedFormats (AlocatingAlignedBuffer< FileFormat, 64 > &formats, bool is_read) const override
 Populates the buffer with supported image formats.
virtual bool getUncompressed (ImageCacheData &) override
 Reads uncompressed pixel data from a PNG image.
virtual bool hasTransparency (ImageCacheData &) override
 Checks whether the PNG image has an alpha transparency channel.
virtual UUID id () const override
 Returns the unique identifier for this factory.

Static Public Member Functions

static PNGImageFactoryDefaultFactory ()
 Returns the singleton default PNGImageFactory instance.

Detailed Description

An ImageFormatHandler implementation for reading and writing PNG image files.


Definition at line 9 of file PNGImageFactory.h.

Member Function Documentation

◆ canRead() [1/2]

virtual bool PNGImageFactory::canRead ( const File & format) const
overridevirtual

Checks whether the given file can be read by this handler.

Parameters
[in]formatThe file to check.
Returns
True if the file can be read.

Implements ImageFormatHandler.

◆ canRead() [2/2]

virtual bool PNGImageFactory::canRead ( StringView format) const
overridevirtual

Checks whether the given format string can be read by this handler.

Parameters
[in]formatThe format string to check.
Returns
True if the format can be read.

Implements ImageFormatHandler.

◆ canWrite()

virtual bool PNGImageFactory::canWrite ( StringView format) const
overridevirtual

Checks whether the given format string can be written by this handler.

Parameters
[in]formatThe format string to check.
Returns
True if the format can be written.

Implements ImageFormatHandler.

◆ compressionFormat()

virtual StringView PNGImageFactory::compressionFormat ( const uint01 * data,
uint04 size )
overridevirtual

Determines the compression format from raw image data.

Parameters
[in]dataThe raw image data.
[in]sizeThe size of the data in bytes.
Returns
The compression format identifier string.

Reimplemented from ImageFormatHandler.

◆ DefaultFactory()

PNGImageFactory & PNGImageFactory::DefaultFactory ( )
static

Returns the singleton default PNGImageFactory instance.

Returns
A reference to the default factory.

◆ getCompressed()

virtual bool PNGImageFactory::getCompressed ( ImageCacheData & ,
StringView  )
overridevirtual

Reads compressed data from a PNG image.

Parameters
[in]dataThe image cache data to populate.
[in]formatThe target compression format.
Returns
True if data was read successfully.

Reimplemented from ImageFormatHandler.

◆ getMetaData()

virtual bool PNGImageFactory::getMetaData ( ImageCacheData & )
overridevirtual

Reads metadata from a PNG image.

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

Reimplemented from ImageFormatHandler.

◆ getSize()

virtual bool PNGImageFactory::getSize ( ImageCacheData & )
overridevirtual

Reads the image dimensions from a PNG file.

Parameters
[in]dataThe image cache data to populate with size.
Returns
True if the size was read successfully.

Reimplemented from ImageFormatHandler.

◆ getSupportedFormats()

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

Populates the buffer with supported image formats.

Parameters
[in]formatsThe buffer to populate.
[in]is_readWhether to list read formats (true) or write formats (false).

Implements ImageFormatHandler.

◆ getUncompressed()

virtual bool PNGImageFactory::getUncompressed ( ImageCacheData & )
overridevirtual

Reads uncompressed pixel data from a PNG image.

Parameters
[in]dataThe image cache data to populate.
Returns
True if data was read successfully.

Reimplemented from ImageFormatHandler.

◆ hasTransparency()

virtual bool PNGImageFactory::hasTransparency ( ImageCacheData & )
overridevirtual

Checks whether the PNG image has an alpha transparency channel.

Parameters
[in]dataThe image cache data to check.
Returns
True if the image has transparency.

Reimplemented from ImageFormatHandler.

◆ id()

virtual UUID PNGImageFactory::id ( ) const
inlineoverridevirtual

Returns the unique identifier for this factory.

Returns
The factory UUID.

Implements ImageFormatHandler.

Definition at line 17 of file PNGImageFactory.h.

References UUID::CreateUUID().


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