Description
Conversion between objects and streams. There are static functions for
-
loading a single bitmap from a stream, and
-
saving a single bitmap to a stream.
Author: Benjamin Eikel
Date: 2011-09-08
Classes
Functions
Reference < Bitmap > | loadBitmap(const FileName & url) |
Reference < Bitmap > | loadBitmap(const std::string & extension, const std::string & data) |
bool | saveBitmap(const Bitmap & bitmap, const FileName & url) |
bool | saveBitmap(const Bitmap & bitmap, const std::string & extension, std::ostream & output) |
bool | registerBitmapLoader(const std::string & extension, std::function< AbstractBitmapStreamer *()> loaderCreator) |
bool | registerBitmapSaver(const std::string & extension, std::function< AbstractBitmapStreamer *()> saverCreator) |
Documentation
function
Util::Serialization::loadBitmap
public |
Reference < Bitmap > loadBitmap( | const FileName & | url ) |
Load a single bitmap from the given address. The type of the bitmap is determined by the file extension.
Parameters
- file
- Address to the file containing the bitmap data.
Returns
A single bitmap.
Defined in Util/Serialization/Serialization.h:42
function
Util::Serialization::loadBitmap
public |
Reference < Bitmap > loadBitmap( | const std::string & | extension, |
const std::string & | data | |
) |
Create a single bitmap from the given data. The type of the bitmap has to be given as parameter.
Parameters
- extension
- File extension specifying the type of the bitmap.
- data
- Bitmap data.
Returns
A single bitmap.
Defined in Util/Serialization/Serialization.h:52
function
Util::Serialization::saveBitmap
public |
bool saveBitmap( | const Bitmap & | bitmap, |
const FileName & | url | |
) |
Write a single bitmap to the given address. The type of the bitmap is determined by the file extension.
Parameters
- bitmap
- Bitmap object to save.
- file
- Address to the file that shall be written.
Returns
true
if successful,false
otherwise.
Defined in Util/Serialization/Serialization.h:62
function
Util::Serialization::saveBitmap
public |
bool saveBitmap( | const Bitmap & | bitmap, |
const std::string & | extension, | |
std::ostream & | output | |
) |
Write a single bitmap to the given stream. The type of the bitmap has to be given as parameter.
Parameters
- bitmap
- Bitmap object to save.
- extension
- File extension specifying the type of the bitmap.
- output
- Stream to which the data shall be written.
Returns
true
if successful,false
otherwise.
Defined in Util/Serialization/Serialization.h:73
function
Util::Serialization::registerBitmapLoader
public |
bool registerBitmapLoader( | const std::string & | extension, |
std::function< AbstractBitmapStreamer *()> | loaderCreator | |
) |
Register a new streamer for the given file extension that supports loading of bitmaps.
Parameters
- extension
- File extension specifying the type of the bitmap.
- loaderCreator
- A function that creates a new streamer when called.
Parameters
:
Defined in Util/Serialization/Serialization.h:83
function
Util::Serialization::registerBitmapSaver
public |
bool registerBitmapSaver( | const std::string & | extension, |
std::function< AbstractBitmapStreamer *()> | saverCreator | |
) |
Register a new streamer for the given file extension that supports saving of bitmaps.
Parameters
- extension
- File extension specifying the type of the bitmap.
- saverCreator
- A function that creates a new streamer when called.
Parameters
:
Defined in Util/Serialization/Serialization.h:93