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

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

#include <ImageHandler.h>

Inheritance diagram for ImageLoader:
OiioImageLoader 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 = "bmp"
 Standard image file extensions.
 
static const string EXR_EXTENSION = "exr"
 
static const string GIF_EXTENSION = "gif"
 
static const string HDR_EXTENSION = "hdr"
 
static const string JPG_EXTENSION = "jpg"
 
static const string JPEG_EXTENSION = "jpeg"
 
static const string PIC_EXTENSION = "pic"
 
static const string PNG_EXTENSION = "png"
 
static const string PSD_EXTENSION = "psd"
 
static const string TGA_EXTENSION = "tga"
 
static const string TIF_EXTENSION = "tif"
 
static const string TIFF_EXTENSION = "tiff"
 
static const string TXT_EXTENSION = "txt"
 
static const string TX_EXTENSION = "tx"
 
static const string TXR_EXTENSION = "txr"
 

Protected Attributes

StringSet _extensions
 

Detailed Description

Abstract base class for file-system image loaders.

Member Function Documentation

◆ loadImage()

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 OiioImageLoader, and StbImageLoader.

◆ saveImage()

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 OiioImageLoader, and 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 files: