XII Release 0.1.0
Loading...
Searching...
No Matches
xiiStbImageFileFormats Class Reference

#include <StbImageFileFormats.h>

Inheritance diagram for xiiStbImageFileFormats:
[legend]

Public Member Functions

virtual xiiResult ReadImageHeader (xiiStreamReader &inout_stream, xiiImageHeader &ref_header, xiiStringView 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 xiiResult ReadImage (xiiStreamReader &inout_stream, xiiImage &ref_image, xiiStringView sFileExtension) const override
 Reads the data from the given stream and creates the image from it. Errors are written to the given xiiLogInterface.
 
virtual xiiResult WriteImage (xiiStreamWriter &inout_stream, const xiiImageView &image, xiiStringView sFileExtension) const override
 Writes the data to the given stream in this format. Errors are written to the given xiiLogInterface.
 
virtual bool CanReadFileType (xiiStringView sExtension) const override
 Should return true, if files with the given extension can be read.
 
virtual bool CanWriteFileType (xiiStringView sExtension) const override
 Should return true, if files with the given extension can be written.
 

Additional Inherited Members

- Static Public Member Functions inherited from xiiImageFileFormat
static const xiiImageFileFormatGetReaderFormat (xiiStringView sExtension)
 Returns a xiiImageFileFormat that can read the given extension. Returns nullptr if there is no appropriate xiiImageFileFormat.
 
static const xiiImageFileFormatGetWriterFormat (xiiStringView sExtension)
 Returns a xiiImageFileFormat that can write the given extension. Returns nullptr if there is no appropriate xiiImageFileFormat.
 
static xiiResult ReadImageHeader (xiiStringView sFileName, xiiImageHeader &ref_header)
 

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 xiiStbImageFileFormats::CanReadFileType ( xiiStringView sExtension) const
overridevirtual

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

Implements xiiImageFileFormat.

◆ CanWriteFileType()

bool xiiStbImageFileFormats::CanWriteFileType ( xiiStringView sExtension) const
overridevirtual

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

Implements xiiImageFileFormat.

◆ ReadImage()

xiiResult xiiStbImageFileFormats::ReadImage ( xiiStreamReader & inout_stream,
xiiImage & ref_image,
xiiStringView sFileExtension ) const
overridevirtual

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

Implements xiiImageFileFormat.

◆ ReadImageHeader()

xiiResult xiiStbImageFileFormats::ReadImageHeader ( xiiStreamReader & inout_stream,
xiiImageHeader & ref_header,
xiiStringView 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 xiiImageFileFormat.

◆ WriteImage()

xiiResult xiiStbImageFileFormats::WriteImage ( xiiStreamWriter & inout_stream,
const xiiImageView & image,
xiiStringView sFileExtension ) const
overridevirtual

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

Implements xiiImageFileFormat.


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