[opengtl-commits] [469] * make GTLImageIO a public library |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 469
Author: cyrille
Date: 2008-11-09 23:24:45 +0100 (Sun, 09 Nov 2008)
Log Message:
-----------
* make GTLImageIO a public library
* add a filter for use in dialogs to the registry
Modified Paths:
--------------
trunk/OpenGTL/OpenGTL/GTLImageIO/CMakeLists.txt
trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.cpp
trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.h
trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDCRegistry.cpp
trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDCRegistry.h
trunk/OpenGTL/OpenGTL/GTLImageIO/Version.h
Added Paths:
-----------
trunk/OpenGTL/OpenGTL/GTLImageIO/GTLImageIO.pc.cmake
Modified: trunk/OpenGTL/OpenGTL/GTLImageIO/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLImageIO/CMakeLists.txt 2008-11-03 19:14:35 UTC (rev 468)
+++ trunk/OpenGTL/OpenGTL/GTLImageIO/CMakeLists.txt 2008-11-09 22:24:45 UTC (rev 469)
@@ -22,4 +22,9 @@
# Install target
install(TARGETS GTLImageIO DESTINATION ${LIB_INSTALL_DIR} )
-# install( FILES ImageDC.h DESTINATION ${INCLUDE_INSTALL_DIR}/GTLImageIO ) # NO REASON TO INSTALL HEADERS FOR NOW
+install( FILES ImageDC.h ImageDCRegistry.h DESTINATION ${INCLUDE_INSTALL_DIR}/GTLImageIO )
+
+# Create and install pc file
+configure_file("GTLImageIO.pc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/GTLImageIO.pc" @ONLY)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GTLImageIO.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
Added: trunk/OpenGTL/OpenGTL/GTLImageIO/GTLImageIO.pc.cmake
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLImageIO/GTLImageIO.pc.cmake (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLImageIO/GTLImageIO.pc.cmake 2008-11-09 22:24:45 UTC (rev 469)
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+
+Name: GTLImageIO
+Description: OpenGTL Image Input/Output
+Version: @OPENGTL_VERSION@
+Requires:
+Libs: -L${libdir} -lGTLImageIO -lGTLCore
+Cflags: -I${includedir}
Modified: trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.cpp 2008-11-03 19:14:35 UTC (rev 468)
+++ trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.cpp 2008-11-09 22:24:45 UTC (rev 469)
@@ -30,6 +30,8 @@
struct ImageDC::Private {
std::list< GTLCore::String > readExtension;
std::list< GTLCore::String > writeExtension;
+ GTLCore::String decodableFilter;
+ GTLCore::String encodableFilter;
};
ImageDC::ImageDC() : d(new Private)
@@ -66,11 +68,13 @@
void ImageDC::addReadExtension( const GTLCore::String& _extension )
{
d->readExtension.push_back( _extension );
+ d->decodableFilter += " *." + _extension;
}
void ImageDC::addWriteExtension( const GTLCore::String& _extension )
{
d->writeExtension.push_back( _extension );
+ d->encodableFilter += " *." + _extension;
}
void ImageDC::addReadWriteExtension( const GTLCore::String& _extension )
@@ -78,3 +82,13 @@
addReadExtension(_extension);
addWriteExtension(_extension);
}
+
+const GTLCore::String& ImageDC::decodableFilter() const
+{
+ return d->decodableFilter;
+}
+
+const GTLCore::String& ImageDC::encodableFilter() const
+{
+ return d->encodableFilter;
+}
Modified: trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.h 2008-11-03 19:14:35 UTC (rev 468)
+++ trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.h 2008-11-09 22:24:45 UTC (rev 469)
@@ -74,6 +74,8 @@
* @return true if this \ref ImageDC can encode images.
*/
virtual bool canEncodeImage( const GTLCore::String& _fileName ) const;
+ const GTLCore::String& decodableFilter() const;
+ const GTLCore::String& encodableFilter() const;
protected:
/**
* Add an extension that can be read by this \ref ImageDC .
Modified: trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDCRegistry.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDCRegistry.cpp 2008-11-03 19:14:35 UTC (rev 468)
+++ trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDCRegistry.cpp 2008-11-09 22:24:45 UTC (rev 469)
@@ -29,6 +29,8 @@
struct ImageDCRegistry::Private {
std::list< ImageDC* > imageDCS;
+ GTLCore::String decodableFilter;
+ GTLCore::String encodableFilter;
};
ImageDCRegistry* global_instance = 0;
@@ -77,6 +79,8 @@
void ImageDCRegistry::registerDC( ImageDC* _imageDC )
{
d->imageDCS.push_back( _imageDC );
+ d->decodableFilter += _imageDC->decodableFilter();
+ d->encodableFilter += _imageDC->encodableFilter();
}
const ImageDC* ImageDCRegistry::decoder( const GTLCore::String& _fileName ) const
@@ -104,3 +108,13 @@
}
return 0;
}
+
+const GTLCore::String& ImageDCRegistry::decodableFilter() const
+{
+ return d->decodableFilter;
+}
+
+const GTLCore::String& ImageDCRegistry::encodableFilter() const
+{
+ return d->encodableFilter;
+}
Modified: trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDCRegistry.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDCRegistry.h 2008-11-03 19:14:35 UTC (rev 468)
+++ trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDCRegistry.h 2008-11-09 22:24:45 UTC (rev 469)
@@ -24,14 +24,41 @@
namespace GTLImageIO {
class ImageDC;
+ /**
+ * This is a registry of all \ref ImageDC coder/decoder that are available.
+ *
+ * @ingroup GTLImageIO
+ */
class ImageDCRegistry {
ImageDCRegistry();
virtual ~ImageDCRegistry();
void initialise();
public:
+ /**
+ * @return the registry instance.
+ */
static ImageDCRegistry* instance();
+ /**
+ * Filter for use in dialogs for the list of all image types that can be
+ * decoded.
+ */
+ const GTLCore::String& decodableFilter() const;
+ /**
+ * Filter for use in dialogs for the list of all image types that can be
+ * encoded.
+ */
+ const GTLCore::String& encodableFilter() const;
+ /**
+ * Add a \ref ImageDC to the registry.
+ */
void registerDC( ImageDC* _imageDC );
+ /**
+ * Find the decoder for the given image.
+ */
const ImageDC* decoder( const GTLCore::String& _fileName ) const;
+ /**
+ * Find the encoder for the given image.
+ */
const ImageDC* encoder( const GTLCore::String& _fileName ) const;
private:
struct Private;
Modified: trunk/OpenGTL/OpenGTL/GTLImageIO/Version.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLImageIO/Version.h 2008-11-03 19:14:35 UTC (rev 468)
+++ trunk/OpenGTL/OpenGTL/GTLImageIO/Version.h 2008-11-09 22:24:45 UTC (rev 469)
@@ -25,10 +25,10 @@
const char* LibraryName = "Open Graphics Transformation Languages Image Input/Output";
const char* LibraryCopyright = "Copyright (c) 2008 Cyrille Berger (cberger@xxxxxxxxxxx)";
const char* LibraryLicence = "GNU Lesser General Public License Version 2";
- const char* LibraryVersionString = "0.9.5";
+ const char* LibraryVersionString = "0.9.6";
int LibraryVersionMajor = 0;
int LibraryVersionMinor = 9;
- int LibraryVersionRevision = 5;
+ int LibraryVersionRevision = 6;
}
#endif