Plasma Engine  2.0
Loading...
Searching...
No Matches
plImageFileFormat Class Referenceabstract
Inheritance diagram for plImageFileFormat:

Public Member Functions

virtual plResult ReadImageHeader (plStreamReader &inout_stream, plImageHeader &ref_header, plStringView sFileExtension) const =0
 Reads only the header information for an image and ignores the data. Much faster than reading the entire image, if the pixel data is not needed.
 
virtual plResult ReadImage (plStreamReader &inout_stream, plImage &ref_image, plStringView sFileExtension) const =0
 Reads the data from the given stream and creates the image from it. Errors are written to the given plLogInterface.
 
virtual plResult WriteImage (plStreamWriter &inout_stream, const plImageView &image, plStringView sFileExtension) const =0
 Writes the data to the given stream in this format. Errors are written to the given plLogInterface.
 
virtual bool CanReadFileType (plStringView sExtension) const =0
 Should return true, if files with the given extension can be read.
 
virtual bool CanWriteFileType (plStringView sExtension) const =0
 Should return true, if files with the given extension can be written.
 
 PL_DECLARE_ENUMERABLE_CLASS (plImageFileFormat)
 

Static Public Member Functions

static plImageFileFormatGetReaderFormat (plStringView sExtension)
 Returns an plImageFileFormat that can read the given extension. Returns nullptr if there is no appropriate plImageFileFormat.
 
static plImageFileFormatGetWriterFormat (plStringView sExtension)
 Returns an plImageFileFormat that can write the given extension. Returns nullptr if there is no appropriate plImageFileFormat.
 
static plResult ReadImageHeader (plStringView sFileName, plImageHeader &ref_header)
 
- Static Public Member Functions inherited from plNoBase
static const plRTTIGetStaticRTTI ()
 

Additional Inherited Members

- Protected Attributes inherited from plEnumerable< plImageFileFormat >
plEnumerablem_pNextInstance
 

Member Function Documentation

◆ CanReadFileType()

virtual bool plImageFileFormat::CanReadFileType ( plStringView sExtension) const
pure virtual

Should return true, if files with the given extension can be read.

Implemented in plBmpFileFormat, plDdsFileFormat, plStbImageFileFormats, and plTgaFileFormat.

◆ CanWriteFileType()

virtual bool plImageFileFormat::CanWriteFileType ( plStringView sExtension) const
pure virtual

Should return true, if files with the given extension can be written.

Implemented in plBmpFileFormat, plDdsFileFormat, plStbImageFileFormats, and plTgaFileFormat.

◆ ReadImage()

virtual plResult plImageFileFormat::ReadImage ( plStreamReader & inout_stream,
plImage & ref_image,
plStringView sFileExtension ) const
pure virtual

Reads the data from the given stream and creates the image from it. Errors are written to the given plLogInterface.

Implemented in plBmpFileFormat, plDdsFileFormat, plStbImageFileFormats, and plTgaFileFormat.

◆ ReadImageHeader()

virtual plResult plImageFileFormat::ReadImageHeader ( plStreamReader & inout_stream,
plImageHeader & ref_header,
plStringView sFileExtension ) const
pure virtual

Reads only the header information for an image and ignores the data. Much faster than reading the entire image, if the pixel data is not needed.

Implemented in plBmpFileFormat, plDdsFileFormat, plStbImageFileFormats, and plTgaFileFormat.

◆ WriteImage()

virtual plResult plImageFileFormat::WriteImage ( plStreamWriter & inout_stream,
const plImageView & image,
plStringView sFileExtension ) const
pure virtual

Writes the data to the given stream in this format. Errors are written to the given plLogInterface.

Implemented in plBmpFileFormat, plDdsFileFormat, plStbImageFileFormats, and plTgaFileFormat.


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