FlowEngine 7.530
Photogrammetry Software Development Kit
Loading...
Searching...
No Matches
FlowEngine::ImageIO Class Referencefinal

Utility methods related to image files. More...

#include <ImageIO.h>

Static Public Member Functions

static FLE_DLL ImagingEngine getImagingEngine ()
 
static FLE_DLL void setImagingEngine (ImagingEngine imagingEngine)
 
static FLE_DLL Result save (const Image &image, ConstStringBuffer filePath, Size bitDepth=0)
 
static FLE_DLL Result getDimensions (ConstStringBuffer filePath, int &outWidth, int &outHeight)
 
static FLE_DLL Result load (Image &image, ConstStringBuffer filePath)
 
static FLE_DLL Index getImageFormatCount ()
 
static FLE_DLL Size getImageFormatNameSize (Index index)
 
static FLE_DLL Result getImageFormatName (Index index, StringBuffer outFormatName)
 
static FLE_DLL Result getImageFormatCapabilities (ConstStringBuffer formatName, bool &outCanRead, bool &outCanWrite)
 
static FLE_DLL Size getImageFormatDescriptionSize (ConstStringBuffer formatName)
 
static FLE_DLL Result getImageFormatDescription (ConstStringBuffer formatName, StringBuffer outFormatDescription)
 

Detailed Description

Utility methods related to image files.

Input/Output methods for Image data.
Query available image formats:
Various APIs throughout FlowEngine (and in this class) require to specify an image format explicitly or implicitly (usually in the file path), use the functions provided by this class to query at runtime what your installation supports.

Member Function Documentation

◆ getDimensions()

FLE_DLL Result FlowEngine::ImageIO::getDimensions ( ConstStringBuffer  filePath,
int &  outWidth,
int &  outHeight 
)
static
Returns
the dimensions of the image located at the specified path.
Parameters
[in]filePatha string buffer containing the path where to save the image to.
[out]outWidththe width of the image in pixels.
[out]outHeightthe height of the image in pixels.
Returns
One of the following result codes:

◆ getImageFormatCapabilities()

Result FlowEngine::ImageIO::getImageFormatCapabilities ( ConstStringBuffer  formatName,
bool &  outCanRead,
bool &  outCanWrite 
)
static

Queries the capabilities available for the specified format.

Parameters
[in]formatNamethe name of the format. See getImageFormatName().
[out]outCanReadset to true if a decoder is available for this format, false otherwise.
[out]outCanWriteset to true if an encoder is available for this format, false otherwise.
Returns
One of the following result codes:

◆ getImageFormatCount()

Index FlowEngine::ImageIO::getImageFormatCount ( )
static
Returns
the number of available image formats supported.

◆ getImageFormatDescription()

Result FlowEngine::ImageIO::getImageFormatDescription ( ConstStringBuffer  formatName,
StringBuffer  outFormatDescription 
)
static
Returns
the description of the specified image format.
Parameters
[in]formatNamethe name of the format. See getImageFormatName().
[in]outFormatDescriptiona string buffer that will receive the format description. Must be big enough to receive the full text. See getImageFormatDescriptionSize().
Returns
One of the following result codes:

◆ getImageFormatDescriptionSize()

Size FlowEngine::ImageIO::getImageFormatDescriptionSize ( ConstStringBuffer  formatName)
static
Returns
the name size of the specified image format 0 in case of error.
Parameters
[in]formatNamethe name of the format. See getImageFormatName().

◆ getImageFormatName()

Result FlowEngine::ImageIO::getImageFormatName ( Index  index,
StringBuffer  outFormatName 
)
static
Returns
the name of the image format at the specified index.
Parameters
[in]indexthe index of the format to query. Must be in the range [0, getInputFormatCount())
[in]outFormatNamea string buffer that will receive the format name. Must be big enough to receive the full name. See getInputFormatNameSize().
Returns
One of the following result codes:

◆ getImageFormatNameSize()

Size FlowEngine::ImageIO::getImageFormatNameSize ( Index  index)
static
Returns
the name size of the image format at the specified index or 0 in case of error.
Parameters
[in]indexthe index of the format to query. Must be in the range [0, getInputFormatCount())

◆ getImagingEngine()

ImagingEngine FlowEngine::ImageIO::getImagingEngine ( )
static
Returns
the current imaging engine

◆ load()

FLE_DLL Result FlowEngine::ImageIO::load ( Image image,
ConstStringBuffer  filePath 
)
static

Loads an image from a file.

Parameters
[in,out]imagethe image that will receive the loaded image. The image data buffer must be big enough to receive the image data. Use getDimensions to know the exact size required.
[in]filePatha string buffer containing the path where to save the image to.
Returns
One of the following result codes:

◆ save()

Result FlowEngine::ImageIO::save ( const Image image,
ConstStringBuffer  filePath,
Size  bitDepth = 0 
)
static

Saves an image to a file.

Parameters
[in]imagethe image to be saved
[in]filePatha string buffer containing the path where to save the image to.
[in]bitDepth(optional) the bitdepth (per channel) of the image. Use default (0) for automatic.
Returns
One of the following result codes:
  • Result::Success – if inOutImage data buffer was filled with the computed equirectangular image.
  • Result::InvalidArgument
    • if image has not valid dimensions.
    • if image data buffer is not valid.
    • if filePath is not a valid constant string buffer.
  • Result::DiskWriteError – if the operating system reported a write error.
  • Result::GenericError – if any other error occurred. Check the log for more information.

◆ setImagingEngine()

void FlowEngine::ImageIO::setImagingEngine ( ImagingEngine  imagingEngine)
static

Set the default imaging engine to use for read / write operations

Parameters
[in]imagingEnginethe new imaging engine to use. See ImagingEngine.