eLynx SDK v3.3.0
C++ image processing API reference
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

eLynx::Image::ImageFileManager Class Reference

Tool class to manage image file format via plugins. More...

#include <ImageFileManager.h>

List of all members.

Public Member Functions

 ImageFileManager ()
 Default constructor.
virtual ~ImageFileManager ()
 Destructor.
const char * GetInputFileFormatList (bool ibAllInOne=true)
const char * GetOutputFileFormatList (bool ibAllInOne=false)
const char * GetSupportedOutputFileFormatList (const ImageVariant &iImage, bool ibAllInOne=false)
Plugins registration
bool IsEmpty () const
 Retrieve if plugin are loaded.
bool Register (const char *iprPath)
 Register packages.
void Unregister ()
 Unregister all packages so all plugins.
void Unregister (const IPluginPackage &iPackage)
 Unregister a package, and his associated registered plugins.
void Unregister (const IImageFilePlugin &iPlugin)
 Unregister a plugin.
void UnregisterPackage (const char *iprFilename)
 Unregister a package from his filename.
void UnregisterPackage (const UUID &iUUID)
 Unregister a package from his UUID.
void UnregisterPlugin (const char *iprName)
 Unregister a plugin from his name.
void UnregisterPlugin (const UUID &iUUID)
 Unregister a plugin from his UUID.
bool UnregisterExt (const char *iprExt)
 Unregister a file extension for both input and output.
bool UnregisterInExt (const char *iprExt)
 Unregister a file extension for input.
bool UnregisterOutExt (const char *iprExt)
 Unregister a file extension for output.
size_t GetInputExtCount () const
 Get the number of supported file extension for input file.
size_t GetOutputExtCount () const
 Get the number of supported file extension for output file.
size_t GetPluginCount () const
 Get the number of registred plugin.
IImageFilePluginGetPlugin (const char *iprName)
 Get a pointer to a image file plugin.
IImageFilePluginGetPlugin (size_t iIndex) const
Image management
const char * GetDescription (size_t iPlugin) const
bool CanImport (const char *iprFilename, ImageFileInfo *oprInfo=NULL, bool ibPreview=false)
 Check is the file is supported by the manager for loading.
bool GeneratePreview (const char *iprFilenameIn, const char *iprFilenameOut, ProgressNotifier &iNotifier=ProgressNotifier_NULL)
 Generate a preview file from source file.
bool Import (ImageVariant &oImage, const char *iprFilename, ImageFileInfo *oprInfo=NULL, ProgressNotifier &iNotifier=ProgressNotifier_NULL)
 Import an ImageVariant from a filename.
bool CanExport (const ImageVariant &iImage, const char *iprFilename, const ImageFileOptions *iprOptions=NULL)
 Check is the file is supported by the manager for exporting.
bool Export (const ImageVariant &iImage, const char *iprFilename, ProgressNotifier &iNotifier, const ImageFileOptions *iprOptions=NULL)
 Export image to file.

Protected Types

typedef std::map< std::string,
IImageFilePlugin * > 
MapExt

Protected Member Functions

size_t GetPackageCount () const
IImageFilePluginGetPlugin (const UUID &iClass)
IImageFilePluginGetInPlugin (const char *iprFilename)
IImageFilePluginGetOutPlugin (const char *iprFilename)
void Register (IImageFilePlugin &iPlugin)

Protected Attributes

PluginManager _manager
size_t _nInputFileFormat
size_t _nOutputFileFormat
MapExt _inExts
MapExt _outExts
std::string _inFormatList
std::string _outFormatList

Detailed Description

Tool class to manage image file format via plugins.


Constructor & Destructor Documentation

eLynx::Image::ImageFileManager::ImageFileManager (  )

Default constructor.

While Register is not called the manager is not very usefull.


Member Function Documentation

bool eLynx::Image::ImageFileManager::CanExport ( const ImageVariant iImage,
const char *  iprFilename,
const ImageFileOptions iprOptions = NULL 
)

Check is the file is supported by the manager for exporting.

Check according filename extension and image format.

Parameters:
iImageThe image to export.
iprFilenameThe image filename.
iprOptionsSome specific format options.
Returns:
true if image can be exported, false otherwise.
bool eLynx::Image::ImageFileManager::CanImport ( const char *  iprFilename,
ImageFileInfo oprInfo = NULL,
bool  ibPreview = false 
)

Check is the file is supported by the manager for loading.

It checks filename extension and file header integrity. Be carefull, file can be valid but not supported !

Parameters:
iprFilenameThe filename of the file to check.
oprInfoInformations that could be retrieved from file.
ibPreviewSet to true if preview is requested in informations.
Returns:
true if file can be created with Import, false otherwise.
bool eLynx::Image::ImageFileManager::Export ( const ImageVariant iImage,
const char *  iprFilename,
ProgressNotifier iNotifier,
const ImageFileOptions iprOptions = NULL 
)

Export image to file.

Parameters:
iImageThe image to export.
iprFilenameThe image filename.
iNotifiera notifier for progression and cancel.
iprOptionsSome specific format options.
Returns:
true if image has been exported, false otherwise.
bool eLynx::Image::ImageFileManager::GeneratePreview ( const char *  iprFilenameIn,
const char *  iprFilenameOut,
ProgressNotifier iNotifier = ProgressNotifier_NULL 
)

Generate a preview file from source file.

Parameters:
iprFilenameInThe input file name, file to be readed.
iprFilenameOutThe preview file name, file to be writen.
iNotifiera notifier for progression and cancel.
Returns:
true if preview has been generated, false otherwise.
size_t eLynx::Image::ImageFileManager::GetInputExtCount (  ) const

Get the number of supported file extension for input file.

Returns:
The number of supported file extension for reading.
size_t eLynx::Image::ImageFileManager::GetOutputExtCount (  ) const

Get the number of supported file extension for output file.

Returns:
The number of supported file extension for writing.
IImageFilePlugin* eLynx::Image::ImageFileManager::GetPlugin ( const char *  iprName )

Get a pointer to a image file plugin.

Parameters:
iprNameThe plugin name like: jpeg, png, tiff, fits...
Returns:
A pointer on image file plugin to get access to more information.
size_t eLynx::Image::ImageFileManager::GetPluginCount (  ) const

Get the number of registred plugin.

This is the total number of registred plugins.

Returns:
The number of registred plugin.
bool eLynx::Image::ImageFileManager::Import ( ImageVariant oImage,
const char *  iprFilename,
ImageFileInfo oprInfo = NULL,
ProgressNotifier iNotifier = ProgressNotifier_NULL 
)

Import an ImageVariant from a filename.

Parameters:
oImageThe image to be loaded.
iprFilenameThe image filename to create.
oprInfoInformations that could be retrieved from file.
iNotifiera notifier for progression and cancel.
Returns:
true if import succeeded, false otherwise.
bool eLynx::Image::ImageFileManager::IsEmpty (  ) const

Retrieve if plugin are loaded.

Returns:
true if no plugin where found, false if at least one plugin is loaded.
bool eLynx::Image::ImageFileManager::Register ( const char *  iprPath )

Register packages.

Load all plugin packages (*.iio) adhering to UUID_IImageFilePlugin from a given path.

Parameters:
iprPathThe base path where to seach packages.
void eLynx::Image::ImageFileManager::Unregister ( const IPluginPackage iPackage )

Unregister a package, and his associated registered plugins.

Parameters:
iPackageThe package to unregister.
void eLynx::Image::ImageFileManager::Unregister ( const IImageFilePlugin iPlugin )

Unregister a plugin.

Parameters:
iPluginThe plugin to unregister.
bool eLynx::Image::ImageFileManager::UnregisterExt ( const char *  iprExt )

Unregister a file extension for both input and output.

Parameters:
iprExtThe file extension.
Returns:
true if succeeded, false otherwise.
bool eLynx::Image::ImageFileManager::UnregisterInExt ( const char *  iprExt )

Unregister a file extension for input.

This extension will be disable with Import.

Parameters:
iprExtThe file extension.
Returns:
true if succeeded, false otherwise.
bool eLynx::Image::ImageFileManager::UnregisterOutExt ( const char *  iprExt )

Unregister a file extension for output.

This extension will be disable with Export.

Parameters:
iprExtThe file extension.
Returns:
true if succeeded, false otherwise.
void eLynx::Image::ImageFileManager::UnregisterPackage ( const UUID iUUID )

Unregister a package from his UUID.

Parameters:
iUUIDThe package UUID.
void eLynx::Image::ImageFileManager::UnregisterPackage ( const char *  iprFilename )

Unregister a package from his filename.

Parameters:
iprFilenameThe package filename.
void eLynx::Image::ImageFileManager::UnregisterPlugin ( const char *  iprName )

Unregister a plugin from his name.

Parameters:
iprNameThe plugin name.
void eLynx::Image::ImageFileManager::UnregisterPlugin ( const UUID iUUID )

Unregister a plugin from his UUID.

Parameters:
iUUIDThe UUID that identifie the plugin to unregister.

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

Generated on Thu Dec 9 2010 by doxygen 1.7.2