|
ISIS Core Library 0.7.2 (api 3.0.0)
|
Base class for image-io-plugins. More...
#include <io_interface.h>
Public Types | |
| enum | io_modes { read_only = 1, write_only = 2, both = 3 } |
Public Member Functions | |
| virtual util::istring | dialects (const std::string &) const |
| virtual std::string | getName () const =0 |
| std::list< util::istring > | getSuffixes (io_modes mode=both) const |
| get all file suffixes a plugin suggests to handle The string returned by suffixes is tokenized at the spaces and every leading "." is stripped. | |
| virtual int | load (std::list< data::Chunk > &chunks, const std::string &filename, const util::istring &dialect, boost::shared_ptr< util::ProgressFeedback > feedback)=0 throw ( std::runtime_error & ) |
| Load data into the given chunk list. | |
| virtual std::pair< std::string, std::string > | makeBasename (const std::string &filename) const |
| splits the suffix (and the ".") from the filename (or path) and returns a pair made of both parts | |
| std::list< std::string > | makeUniqueFilenames (const std::list< data::Image > &images, const std::string &namePattern) const |
| virtual bool | tainted () const |
| virtual void | write (const std::list< data::Image > &images, const std::string &filename, const util::istring &dialect, boost::shared_ptr< util::ProgressFeedback > feedback) throw ( std::runtime_error & ) |
| Write a image list. | |
| virtual void | write (const data::Image &image, const std::string &filename, const util::istring &dialect, boost::shared_ptr< util::ProgressFeedback > feedback)=0 throw ( std::runtime_error & ) |
| Write a single image to a file. | |
| virtual | ~FileFormat () |
Static Public Member Functions | |
| static std::string | makeFilename (const util::PropertyMap &img, std::string namePattern) |
| static void | throwGenericError (std::string desc) |
| static void | throwSystemError (int err, std::string desc="") |
Data Fields | |
| boost::filesystem::path | plugin_file |
Protected Member Functions | |
| virtual util::istring | suffixes (io_modes modes=both) const =0 |
Static Protected Member Functions | |
| static bool | hasOrTell (const util::PropertyMap::KeyType &name, const util::PropertyMap &object, LogLevel level) |
| Check if a given property exists in the given PropMap. | |
| static bool | setGender (util::PropertyMap &object, const char *set, const char *entries="female,male,other") |
| Check if a given property exists in the given PropMap. | |
| template<typename TYPE > | |
| static bool | transformOrTell (const util::PropertyMap::KeyType &from, const util::PropertyMap::KeyType &to, util::PropertyMap &object, LogLevel level) |
| Transform a given property into another and remove the original in the given PropMap. | |
Static Protected Attributes | |
| static const float | invalid_float = -std::numeric_limits<float>::infinity() |
Base class for image-io-plugins.
Definition at line 30 of file io_interface.h.
Definition at line 33 of file io_interface.h.
| virtual isis::image_io::FileFormat::~FileFormat | ( | ) | [inline, virtual] |
Definition at line 133 of file io_interface.h.
| virtual util::istring isis::image_io::FileFormat::dialects | ( | const std::string & | ) | const [inline, virtual] |
Definition at line 93 of file io_interface.h.
| virtual std::string isis::image_io::FileFormat::getName | ( | ) | const [pure virtual] |
| std::list< util::istring > isis::image_io::FileFormat::getSuffixes | ( | io_modes | mode = both | ) | const |
get all file suffixes a plugin suggests to handle The string returned by suffixes is tokenized at the spaces and every leading "." is stripped.
The result is returned in a string-list sorted by the length of the suffix (longest first).
| mode | the io mode you are asking for
|
Definition at line 81 of file io_interface.cpp.
| bool isis::image_io::FileFormat::hasOrTell | ( | const util::PropertyMap::KeyType & | name, |
| const util::PropertyMap & | object, | ||
| LogLevel | level | ||
| ) | [static, protected] |
Check if a given property exists in the given PropMap.
If the property doesn't exist a message will be sent to Log using the given loglevel.
Definition at line 61 of file io_interface.cpp.
| virtual int isis::image_io::FileFormat::load | ( | std::list< data::Chunk > & | chunks, |
| const std::string & | filename, | ||
| const util::istring & | dialect, | ||
| boost::shared_ptr< util::ProgressFeedback > | feedback | ||
| ) | throw ( std::runtime_error & ) [pure virtual] |
Load data into the given chunk list.
I case of an error std::runtime_error will be thrown.
| chunks | the chunk list where the loaded chunks shall be added to |
| filename | the name of the file to load from (the system does NOT check if this file exists) |
| dialect | the dialect to be used when loading the file (use "" to not define a dialect) |
| feedback | a shared_ptr to a ProgressFeedback-object to inform about loading progress. Not used if zero. |
| std::pair< std::string, std::string > isis::image_io::FileFormat::makeBasename | ( | const std::string & | filename | ) | const [virtual] |
splits the suffix (and the ".") from the filename (or path) and returns a pair made of both parts
Definition at line 91 of file io_interface.cpp.
| std::string isis::image_io::FileFormat::makeFilename | ( | const util::PropertyMap & | img, |
| std::string | namePattern | ||
| ) | [static] |
Definition at line 105 of file io_interface.cpp.
| std::list< std::string > isis::image_io::FileFormat::makeUniqueFilenames | ( | const std::list< data::Image > & | images, |
| const std::string & | namePattern | ||
| ) | const |
Definition at line 187 of file io_interface.cpp.
| bool isis::image_io::FileFormat::setGender | ( | util::PropertyMap & | object, |
| const char * | set, | ||
| const char * | entries = "female,male,other" |
||
| ) | [static, protected] |
Check if a given property exists in the given PropMap.
If the property doesn't exist a message will be sent to Log using the given loglevel.
Definition at line 49 of file io_interface.cpp.
| virtual util::istring isis::image_io::FileFormat::suffixes | ( | io_modes | modes = both | ) | const [protected, pure virtual] |
| virtual bool isis::image_io::FileFormat::tainted | ( | ) | const [inline, virtual] |
Definition at line 96 of file io_interface.h.
| void isis::image_io::FileFormat::throwGenericError | ( | std::string | desc | ) | [static] |
Definition at line 71 of file io_interface.cpp.
| void isis::image_io::FileFormat::throwSystemError | ( | int | err, |
| std::string | desc = "" |
||
| ) | [static] |
Definition at line 76 of file io_interface.cpp.
| static bool isis::image_io::FileFormat::transformOrTell | ( | const util::PropertyMap::KeyType & | from, |
| const util::PropertyMap::KeyType & | to, | ||
| util::PropertyMap & | object, | ||
| LogLevel | level | ||
| ) | [inline, static, protected] |
Transform a given property into another and remove the original in the given PropMap.
If the property doesn't exist a message will be sent to Log using the given loglevel.
Definition at line 53 of file io_interface.h.
| API_EXCLUDE_BEGIN _internal API_EXCLUDE_END void isis::image_io::FileFormat::write | ( | const std::list< data::Image > & | images, |
| const std::string & | filename, | ||
| const util::istring & | dialect, | ||
| boost::shared_ptr< util::ProgressFeedback > | feedback | ||
| ) | throw ( std::runtime_error & ) [virtual] |
Write a image list.
I case of an error std::runtime_error will be thrown. The default implementation will call write( const data::Image &, const std::string&, const std::string&) for every image using a generated unique filename.
| images | a list of the images to be written |
| filename | the name to be used as base for the filename generation if neccessary. |
| dialect | the dialect to be used when loading the file (use "" to not define a dialect) |
| feedback | a shared_ptr to a ProgressFeedback-object to inform about loading progress. Not used if zero. |
Definition at line 28 of file io_interface.cpp.
| virtual void isis::image_io::FileFormat::write | ( | const data::Image & | image, |
| const std::string & | filename, | ||
| const util::istring & | dialect, | ||
| boost::shared_ptr< util::ProgressFeedback > | feedback | ||
| ) | throw ( std::runtime_error & ) [pure virtual] |
Write a single image to a file.
I case of an error std::runtime_error will be thrown.
| image | the image to be written |
| filename | the name of the file to write (the system does NOT check if this file exists/is writeable) |
| dialect | the dialect to be used when loading the file (use "" to not define a dialect) |
| feedback | a shared_ptr to a ProgressFeedback-object to inform about loading progress. Not used if zero. |
const float isis::image_io::FileFormat::invalid_float = -std::numeric_limits<float>::infinity() [static, protected] |
Definition at line 63 of file io_interface.h.
| boost::filesystem::path isis::image_io::FileFormat::plugin_file |
Definition at line 67 of file io_interface.h.
1.7.3