CamSim  0.0.0
A rasterization-based simulator for various types of cameras
Public Member Functions | Static Public Member Functions | List of all members
CamSim::Exporter Class Reference

Export simulation results to various file formats. More...

Public Member Functions

 Exporter ()
 Constructor. More...
 
bool exportData (const QString &fileName, FileFormat format, const QList< TexData > &dataList, const QList< QList< int >> &channelsList=QList< QList< int >>(), int compressionLevel=0)
 Same as exportData for multiple data sets, but you can choose the file format explicitly. More...
 
bool asyncExportData (const QString &fileName, const TexData &data, const QList< int > &channels=QList< int >(), int compressionLevel=0)
 Same as exportData, but the export is started asynchronously in a separate thread and this function returns immediately. More...
 
bool asyncExportData (const QString &fileName, FileFormat format, const TexData &data, const QList< int > &channels=QList< int >(), int compressionLevel=0)
 Same as asyncExportData, but you can choose the file format explicitly. More...
 
bool asyncExportData (const QString &fileName, const QList< TexData > &dataList, const QList< QList< int >> &channelsList=QList< QList< int >>(), int compressionLevel=0)
 Same as asyncExportData, but for multiple data sets destined for the same file. More...
 
bool asyncExportData (const QString &fileName, FileFormat format, const QList< TexData > &dataList, const QList< QList< int >> &channelsList=QList< QList< int >>(), int compressionLevel=0)
 Same as asyncExportData, but you can choose the file format explicitly. More...
 
bool waitForAsyncExports ()
 Wait for all asynchronous exports to finish. Returns true if all of them were successful, and false if at least one of them failed. More...
 

Static Public Member Functions

static bool isFileFormatSupported (FileFormat format)
 Return whether the given file format is supported (it may not be if a library was missing at build time) More...
 
static bool isFileFormatCompatible (FileFormat format, const TexData &data, const QList< int > &channels=QList< int >())
 Return whether the given file format can store the subset of the data that is selected by channels. More...
 
static FileFormat fileFormatFromName (const QString &fileName)
 Return a file format based on fileName. More...
 
static bool exportData (const QString &fileName, const TexData &data, const QList< int > &channels=QList< int >(), int compressionLevel=0)
 Export the data to the file named fileName. Optionally select a list of channels to export. More...
 
static bool exportData (const QString &fileName, FileFormat format, const TexData &data, const QList< int > &channels=QList< int >(), int compressionLevel=0)
 Same as exportData, but you can choose the file format explicitly. More...
 
static bool exportData (const QString &fileName, const QList< TexData > &dataList, const QList< QList< int >> &channelsList=QList< QList< int >>(), int compressionLevel=0)
 Same as exportData, but for multiple data sets destined for the same file. More...
 

Detailed Description

Export simulation results to various file formats.

Constructor & Destructor Documentation

◆ Exporter()

CamSim::Exporter::Exporter ( )

Constructor.

Member Function Documentation

◆ asyncExportData() [1/4]

bool CamSim::Exporter::asyncExportData ( const QString &  fileName,
const QList< TexData > &  dataList,
const QList< QList< int >> &  channelsList = QList<QList<int>>(),
int  compressionLevel = 0 
)
inline

Same as asyncExportData, but for multiple data sets destined for the same file.

◆ asyncExportData() [2/4]

bool CamSim::Exporter::asyncExportData ( const QString &  fileName,
const TexData data,
const QList< int > &  channels = QList<int>(),
int  compressionLevel = 0 
)
inline

Same as exportData, but the export is started asynchronously in a separate thread and this function returns immediately.

You can use this to make best use of both the GPU and your CPU cores: export all of the data from the last simulated frame while simulating the new frame. This is useful especially for compressing file formats where the export eats a lot of CPU cycles.

This function returns success if the export was successfully launched.

Call waitForAsyncExports to wait for all asynchronously started exports to finish.

◆ asyncExportData() [3/4]

bool CamSim::Exporter::asyncExportData ( const QString &  fileName,
FileFormat  format,
const QList< TexData > &  dataList,
const QList< QList< int >> &  channelsList = QList<QList<int>>(),
int  compressionLevel = 0 
)
inline

Same as asyncExportData, but you can choose the file format explicitly.

◆ asyncExportData() [4/4]

bool CamSim::Exporter::asyncExportData ( const QString &  fileName,
FileFormat  format,
const TexData data,
const QList< int > &  channels = QList<int>(),
int  compressionLevel = 0 
)
inline

Same as asyncExportData, but you can choose the file format explicitly.

◆ exportData() [1/4]

static bool CamSim::Exporter::exportData ( const QString &  fileName,
const QList< TexData > &  dataList,
const QList< QList< int >> &  channelsList = QList<QList<int>>(),
int  compressionLevel = 0 
)
inlinestatic

Same as exportData, but for multiple data sets destined for the same file.

◆ exportData() [2/4]

static bool CamSim::Exporter::exportData ( const QString &  fileName,
const TexData data,
const QList< int > &  channels = QList<int>(),
int  compressionLevel = 0 
)
inlinestatic

Export the data to the file named fileName. Optionally select a list of channels to export.

The file format is determined automatically from the filename, see fileFormatFromName().

If the file already exists, the data is appended to it (RAW, PFS, GTA). Otherwise, the existing file is overwritten (CSV, PNG, MAT).

If channels is empty, all the channels contained in data are exported.

The effect of the compressionLevel parameter depends on the file format. Values between 0 and 9 are allowed, where 0 corresponds to no compression and 9 to best compression.

Return true on success, false on error.

Example: exportData("file.csv", data, { 0, 1, 2 });

◆ exportData() [3/4]

bool CamSim::Exporter::exportData ( const QString &  fileName,
FileFormat  format,
const QList< TexData > &  dataList,
const QList< QList< int >> &  channelsList = QList<QList<int>>(),
int  compressionLevel = 0 
)
inline

Same as exportData for multiple data sets, but you can choose the file format explicitly.

◆ exportData() [4/4]

static bool CamSim::Exporter::exportData ( const QString &  fileName,
FileFormat  format,
const TexData data,
const QList< int > &  channels = QList<int>(),
int  compressionLevel = 0 
)
inlinestatic

Same as exportData, but you can choose the file format explicitly.

◆ fileFormatFromName()

static FileFormat CamSim::Exporter::fileFormatFromName ( const QString &  fileName)
static

Return a file format based on fileName.

◆ isFileFormatCompatible()

static bool CamSim::Exporter::isFileFormatCompatible ( FileFormat  format,
const TexData data,
const QList< int > &  channels = QList< int >() 
)
static

Return whether the given file format can store the subset of the data that is selected by channels.

◆ isFileFormatSupported()

static bool CamSim::Exporter::isFileFormatSupported ( FileFormat  format)
static

Return whether the given file format is supported (it may not be if a library was missing at build time)

◆ waitForAsyncExports()

bool CamSim::Exporter::waitForAsyncExports ( )

Wait for all asynchronous exports to finish. Returns true if all of them were successful, and false if at least one of them failed.


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