Plasma Engine  2.0
Loading...
Searching...
No Matches
plStbImageFileFormats Class Reference

#include <StbImageFileFormats.h>

Inheritance diagram for plStbImageFileFormats:

Public Member Functions

virtual plResult ReadImageHeader (plStreamReader &inout_stream, plImageHeader &ref_header, plStringView sFileExtension) const override
 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 override
 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 override
 Writes the data to the given stream in this format. Errors are written to the given plLogInterface.
 
virtual bool CanReadFileType (plStringView sExtension) const override
 Should return true, if files with the given extension can be read.
 
virtual bool CanWriteFileType (plStringView sExtension) const override
 Should return true, if files with the given extension can be written.
 
- Public Member Functions inherited from plImageFileFormat
 PL_DECLARE_ENUMERABLE_CLASS (plImageFileFormat)
 

Additional Inherited Members

- Static Public Member Functions inherited from plImageFileFormat
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 ()
 
- Protected Attributes inherited from plEnumerable< plImageFileFormat >
plEnumerablem_pNextInstance
 

Detailed Description

Png and jpeg file format support using stb_image.

stb_image also supports other formats, but we stick to our own loader code where we can. Also, stb HDR image support is not handled here yet.

Member Function Documentation

◆ CanReadFileType()

bool plStbImageFileFormats::CanReadFileType ( plStringView sExtension) const
overridevirtual

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

Implements plImageFileFormat.

◆ CanWriteFileType()

bool plStbImageFileFormats::CanWriteFileType ( plStringView sExtension) const
overridevirtual

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

Implements plImageFileFormat.

◆ ReadImage()

plResult plStbImageFileFormats::ReadImage ( plStreamReader & inout_stream,
plImage & ref_image,
plStringView sFileExtension ) const
overridevirtual

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

Implements plImageFileFormat.

◆ ReadImageHeader()

plResult plStbImageFileFormats::ReadImageHeader ( plStreamReader & inout_stream,
plImageHeader & ref_header,
plStringView sFileExtension ) const
overridevirtual

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.

Implements plImageFileFormat.

◆ WriteImage()

plResult plStbImageFileFormats::WriteImage ( plStreamWriter & inout_stream,
const plImageView & image,
plStringView sFileExtension ) const
overridevirtual

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

Implements plImageFileFormat.


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