MaterialX 1.39.0
Loading...
Searching...
No Matches
ImageLoader Class Reference

Abstract base class for file-system image loaders. More...

#include <ImageHandler.h>

Inheritance diagram for ImageLoader:
StbImageLoader

Public Member Functions

const StringSetsupportedExtensions () const
 Returns a list of supported extensions. More...
 
virtual bool saveImage (const FilePath &filePath, ConstImagePtr image, bool verticalFlip=false)
 Save an image to the file system. More...
 
virtual ImagePtr loadImage (const FilePath &filePath)
 Load an image from the file system. More...
 

Static Public Attributes

static const string BMP_EXTENSION
 Standard image file extensions.
 
static const string EXR_EXTENSION
 
static const string GIF_EXTENSION
 
static const string HDR_EXTENSION
 
static const string JPG_EXTENSION
 
static const string JPEG_EXTENSION
 
static const string PIC_EXTENSION
 
static const string PNG_EXTENSION
 
static const string PSD_EXTENSION
 
static const string TGA_EXTENSION
 
static const string TIF_EXTENSION
 
static const string TIFF_EXTENSION
 
static const string TXT_EXTENSION
 
static const string TX_EXTENSION
 
static const string TXR_EXTENSION
 

Protected Attributes

StringSet _extensions
 

Detailed Description

Abstract base class for file-system image loaders.

Member Function Documentation

◆ loadImage()

virtual ImagePtr loadImage ( const FilePath filePath)
virtual

Load an image from the file system.

This method must be implemented by derived classes.

Parameters
filePathThe requested image file path.
Returns
On success, a shared pointer to the loaded image; otherwise an empty shared pointer.

Reimplemented in StbImageLoader.

◆ saveImage()

virtual bool saveImage ( const FilePath filePath,
ConstImagePtr  image,
bool  verticalFlip = false 
)
virtual

Save an image to the file system.

This method must be implemented by derived classes.

Parameters
filePathFile path to be written
imageThe image to be saved
verticalFlipWhether the image should be flipped in Y during save
Returns
if save succeeded

Reimplemented in StbImageLoader.

◆ supportedExtensions()

const StringSet & supportedExtensions ( ) const
inline

Returns a list of supported extensions.

Returns
List of support extensions

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