ImFusion SDK 4.3
JpegIO Class Reference

#include <ImFusion/IO/JpegIO.h>

Class for reading and writing JPEG images. More...

Detailed Description

Class for reading and writing JPEG images.

Static Public Member Functions

static std::unique_ptr< MemImagereadImage (const std::string &filename)
 Read JPEG image from file.
 
static std::unique_ptr< MemImagereadImage (const ByteBuffer &buffer)
 Read JPEG image from memory.
 
static bool readImage (const ByteBuffer &buffer, MemImage *&img, std::string *header=0)
 Read JPEG image from buffer.
 
static bool readImage (const std::string &filename, MemImage *&img, std::string *header=0)
 Read JPEG image from file.
 
static bool writeImage (const std::string &filename, const MemImage *img, const std::string &header="", int sourceQuality=90)
 Write JPEG image to file.
 
static bool writeImage (ByteBuffer &buffer, const MemImage *img, const std::string &header="", int sourceQuality=90)
 Write JPEG image to memory buffer.
 

Member Function Documentation

◆ readImage() [1/4]

static std::unique_ptr< MemImage > readImage ( const std::string & filename)
static

Read JPEG image from file.

Parameters
filenamefile name
Returns
the image read from file

◆ readImage() [2/4]

static std::unique_ptr< MemImage > readImage ( const ByteBuffer & buffer)
static

Read JPEG image from memory.

Parameters
buffertemporary placeholder of the JPEG data
Returns
the image read from memory

◆ readImage() [3/4]

static bool readImage ( const ByteBuffer & buffer,
MemImage *& img,
std::string * header = 0 )
static

Read JPEG image from buffer.

Parameters
buffertemporary placeholder of the JPEG data
[out]imgreference to image pointer which will receive the loaded image
[out]headeroptional pointer to string which is to be placed in the header
Returns
true if successful, false otherwise

◆ readImage() [4/4]

static bool readImage ( const std::string & filename,
MemImage *& img,
std::string * header = 0 )
static

Read JPEG image from file.

Parameters
filenamefile name
[out]imgreference to image pointer which will receive the loaded image
[out]headeroptional pointer to string which is to be placed in the header
Returns
true if successful, false otherwise

◆ writeImage() [1/2]

static bool writeImage ( const std::string & filename,
const MemImage * img,
const std::string & header = "",
int sourceQuality = 90 )
static

Write JPEG image to file.

Parameters
filenamefile name
Returns
true if successful, false otherwise

◆ writeImage() [2/2]

static bool writeImage ( ByteBuffer & buffer,
const MemImage * img,
const std::string & header = "",
int sourceQuality = 90 )
static

Write JPEG image to memory buffer.

Parameters
[out]buffertemporary placeholder allocated by the JPEG library.
imgImage to be written
headeroptional string which is to be placed in the header
sourceQualityquality indicator

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close