[Hdrflow-svn] SF.net SVN: hdrflow: [137] trunk/lib/openlibraries/src/openimagelib/plugins
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-05-22 19:28:19
|
Revision: 137
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=137&view=rev
Author: glslang
Date: 2007-05-22 12:28:17 -0700 (Tue, 22 May 2007)
Log Message:
-----------
+ more tidy-ups
Modified Paths:
--------------
trunk/lib/openlibraries/src/openimagelib/plugins/exr/Makefile.am
trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_plugin.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_vc8.vcproj
trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_plugin.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_vc8.vcproj
trunk/lib/openlibraries/src/openimagelib/plugins/hdr/Makefile.am
trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_vc8.vcproj
trunk/lib/openlibraries/src/openimagelib/plugins/jpg/Makefile.am
trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_vc8.vcproj
trunk/lib/openlibraries/src/openimagelib/plugins/png/Makefile.am
trunk/lib/openlibraries/src/openimagelib/plugins/png/png_plugin.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/png/png_vc8.vcproj
trunk/lib/openlibraries/src/openimagelib/plugins/psd/Makefile.am
trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_plugin.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_vc8.vcproj
trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/Makefile.am
trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_vc8.vcproj
Removed Paths:
-------------
trunk/lib/openlibraries/src/openimagelib/plugins/exr/config.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_plugin.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/config.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_plugin.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/hdr/config.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/jpg/config.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/png/config.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/png/png.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/png/png_plugin.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/psd/config.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_plugin.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/config.hpp
trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime.cpp
trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.hpp
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/exr/Makefile.am
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/exr/Makefile.am 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/exr/Makefile.am 2007-05-22 19:28:17 UTC (rev 137)
@@ -9,11 +9,7 @@
lib_LTLIBRARIES = libopenimagelib_exr.la
libopenimagelib_exr_la_SOURCES = \
- config.hpp \
- exr.cpp \
- exr_plugin.hpp \
- exr_plugin.cpp \
- openexr.hpp
+ exr_plugin.cpp
libopenimagelib_exr_la_CXXFLAGS = \
$(OLIB_CXXFLAGS) \
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/exr/config.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/exr/config.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/exr/config.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,25 +0,0 @@
-
-// EXR - An ILM OpenEXR plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef EXR_CONFIG_INC_
-#define EXR_CONFIG_INC_
-
-#ifdef WIN32
- #ifdef EXR_EXPORTS
- #define EXR_DECLSPEC __declspec( dllexport )
- #else
- #define EXR_DECLSPEC __declspec( dllimport )
- #endif // EXR_EXPORTS
-#else
- #ifdef EXR_EXPORTS
- #define EXR_DECLSPEC
- #else
- #define EXR_DECLSPEC
- #endif // EXR_EXPORTS
-#endif // WIN32
-
-#endif // EXR_CONFIG_INC_
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,33 +0,0 @@
-
-// EXR - An ILM OpenEXR plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#include <openimagelib/plugins/exr/exr_plugin.hpp>
-
-namespace opl = olib::openpluginlib;
-namespace EXR = olib::openimagelib::plugins::EXR;
-
-extern "C"
-{
- EXR_DECLSPEC bool openplugin_init( void )
- {
- return true;
- }
-
- EXR_DECLSPEC bool openplugin_uninit( void )
- {
- return true;
- }
-
- EXR_DECLSPEC bool openplugin_create_plugin( const char*, opl::openplugin** plug )
- {
- *plug = new EXR::EXR_plugin;
- return true;
- }
-
- EXR_DECLSPEC void openplugin_destroy_plugin( opl::openplugin* plug )
- { delete static_cast<EXR::EXR_plugin*>( plug ); }
-}
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_plugin.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_plugin.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_plugin.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -9,13 +9,13 @@
#include <ImfCRgbaFile.h>
#include <ImfArray.h>
-#include <openimagelib/plugins/exr/exr_plugin.hpp>
+#include <openimagelib/il/openimagelib_plugin.hpp>
-namespace fs = boost::filesystem;
-namespace il = olib::openimagelib::il;
-namespace opl = olib::openpluginlib;
+namespace fs = boost::filesystem;
+namespace il = olib::openimagelib::il;
+namespace pl = olib::openpluginlib;
-namespace olib { namespace openimagelib { namespace plugins { namespace EXR {
+namespace olib { namespace openimagelib { namespace il {
namespace
{
@@ -57,10 +57,46 @@
}
}
-il::image_type_ptr EXR_plugin::load( const fs::path& path )
-{ return load_exr( path ); }
+struct exr_plugin : public il::openimagelib_plugin
+{
+ virtual il::image_type_ptr load( const fs::path& path )
+ { return load_exr( path ); }
+
+ virtual bool store( const fs::path&, const il::image_type_ptr& )
+ { return false; }
+};
-bool EXR_plugin::store( const fs::path& /*path*/, const il::image_type_ptr& /*im*/)
-{ return false; }
+} } }
-} } } }
+extern "C"
+{
+ IL_DECLSPEC bool openplugin_init( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_uninit( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_create_plugin( const char*, pl::openplugin** plug )
+ {
+ *plug = new il::exr_plugin;
+ return true;
+ }
+
+ IL_DECLSPEC void openplugin_destroy_plugin( pl::openplugin* plug )
+ { delete static_cast<il::exr_plugin*>( plug ); }
+}
+
+#ifdef WIN32
+extern "C" BOOL WINAPI DllMain( HINSTANCE hInstDLL, DWORD fdwReason, LPVOID )
+{
+ if( fdwReason == DLL_PROCESS_ATTACH )
+ DisableThreadLibraryCalls( hInstDLL );
+
+ return TRUE;
+}
+#endif
+
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_plugin.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_plugin.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_plugin.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,26 +0,0 @@
-
-// EXR - An ILM OpenEXR plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef EXR_PLUGIN_INC_
-#define EXR_PLUGIN_INC_
-
-#include <boost/filesystem/path.hpp>
-
-#include <openimagelib/plugins/exr/config.hpp>
-#include <openimagelib/il/openimagelib_plugin.hpp>
-
-namespace olib { namespace openimagelib { namespace plugins { namespace EXR {
-
-struct EXR_DECLSPEC EXR_plugin : public olib::openimagelib::il::openimagelib_plugin
-{
- virtual il::image_type_ptr load( const boost::filesystem::path& path );
- virtual bool store( const boost::filesystem::path& path, const il::image_type_ptr& image );
-};
-
-} } } }
-
-#endif
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_vc8.vcproj
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_vc8.vcproj 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/exr/exr_vc8.vcproj 2007-05-22 19:28:17 UTC (rev 137)
@@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34";"C:\openexr-1.4.0-vs2005\include\OpenEXR""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;EXR_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING;OPENEXR_DLL"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING;OPENEXR_DLL"
MinimalRebuild="true"
ExceptionHandling="2"
BasicRuntimeChecks="3"
@@ -125,7 +125,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34";"C:\openexr-1.4.0-vs2005\include\OpenEXR""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;EXR_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING;OPENEXR_DLL"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING;OPENEXR_DLL"
ExceptionHandling="2"
RuntimeLibrary="2"
BufferSecurityCheck="false"
@@ -194,10 +194,6 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath=".\exr.cpp"
- >
- </File>
- <File
RelativePath=".\exr_plugin.cpp"
>
</File>
@@ -207,14 +203,6 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
- <File
- RelativePath=".\config.hpp"
- >
- </File>
- <File
- RelativePath=".\exr_plugin.hpp"
- >
- </File>
</Filter>
<Filter
Name="Resource Files"
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/config.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/config.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/config.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,25 +0,0 @@
-
-// GDI+ - An GDI+ plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef GDI_CONFIG_INC_
-#define GDI_CONFIG_INC_
-
-#ifdef WIN32
- #ifdef GDI_EXPORTS
- #define GDI_DECLSPEC __declspec( dllexport )
- #else
- #define GDI_DECLSPEC __declspec( dllimport )
- #endif // GDI_EXPORTS
-#else
- #ifdef GDI_EXPORTS
- #define GDI_DECLSPEC __attribute__( ( visibility( "default" ) ) )
- #else
- #define GDI_DECLSPEC
- #endif // GDI_EXPORTS
-#endif // WIN32
-
-#endif // GDI_CONFIG_INC_
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,79 +0,0 @@
-
-// GDI+ - An GDI+ plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifdef WIN32
-#include <windows.h>
-#include <gdiplus.h>
-#endif // WIN32
-
-#include <boost/thread/recursive_mutex.hpp>
-
-#include <openimagelib/plugins/gdi+/gdi+_plugin.hpp>
-
-namespace opl = olib::openpluginlib;
-namespace GDI = olib::openimagelib::plugins::GDI;
-
-namespace
-{
- void reflib( int init )
- {
- static long refs = 0;
-#ifdef WIN32
- static ULONG_PTR gdiplusToken;
-#endif // WIN32
-
- assert( refs >= 0 && L" GDI+_plugin::refinit: refs is negative." );
-
- if( init > 0 && ++refs )
- {
-# ifdef WIN32
- Gdiplus::GdiplusStartupInput gdiplusStartupInput;
-
- Gdiplus::GdiplusStartup( &gdiplusToken, &gdiplusStartupInput, NULL );
-# endif
- }
- else if( init < 0 && --refs == 0 )
- {
-# ifdef WIN32
- Gdiplus::GdiplusShutdown( gdiplusToken );
-# endif
- }
- }
-
- boost::recursive_mutex mutex;
-}
-
-extern "C"
-{
- GDI_DECLSPEC bool openplugin_init( void )
- {
- boost::recursive_mutex::scoped_lock lock( mutex );
-
- reflib( 1 );
-
- return true;
- }
-
- GDI_DECLSPEC bool openplugin_uninit( void )
- {
- boost::recursive_mutex::scoped_lock lock( mutex );
-
- reflib( -1 );
-
- return true;
- }
-
- GDI_DECLSPEC bool openplugin_create_plugin( const char*, opl::openplugin** plug )
- {
- *plug = new GDI::GDI_plugin;
-
- return true;
- }
-
- GDI_DECLSPEC void openplugin_destroy_plugin( opl::openplugin* plug )
- { delete static_cast<GDI::GDI_plugin*>( plug ); }
-}
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_plugin.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_plugin.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_plugin.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -14,35 +14,22 @@
#include <vector>
#include <string>
-#include <openimagelib/plugins/gdi+/gdi+_plugin.hpp>
+#include <boost/thread/recursive_mutex.hpp>
+#include <openpluginlib/pl/utf8_utils.hpp>
+#include <openimagelib/il/openimagelib_plugin.hpp>
+
namespace il = olib::openimagelib::il;
namespace fs = boost::filesystem;
+namespace pl = olib::openpluginlib;
-namespace olib { namespace openimagelib { namespace plugins { namespace GDI {
+namespace olib { namespace openimagelib { namespace il {
-typedef il::image<unsigned char, il::surface_format> image_type;
-
namespace
{
- void destroy( image_type* im )
+ void destroy( il::image_type* im )
{ delete im; }
-
- std::wstring to_wstring( const std::string& str )
- {
- std::vector<wchar_t> ws;
- ws.resize( str.size( ) + 1 );
-#if _MSC_VER >= 1400
- size_t size;
- mbstowcs_s( &size, &ws[ 0 ], ws.size( ), str.c_str( ), str.size( ) );
-#else
- mbstowcs( &ws[ 0 ], str.c_str( ), str.size( ) );
-#endif // _MSC_VER >= 0x1400
-
- return std::wstring( ws.begin( ), ws.end( ) );
- }
-
struct mime_type_equals_png
: public std::unary_function<bool, Gdiplus::ImageCodecInfo>
{
@@ -79,29 +66,23 @@
il::image_type_ptr gdiplus_pixelformat_to_image_type( Gdiplus::PixelFormat pixelformat, int width, int height )
{
- using namespace olib::openimagelib::il;
-
- typedef image<unsigned char, b8g8r8> b8g8r8_image_type;
- typedef image<unsigned char, b8g8r8a8> b8g8r8a8_image_type;
- typedef image<unsigned char, r8g8b8a8> r8g8b8a8_image_type;
-
switch( pixelformat )
{
case PixelFormat24bppRGB:
- return il::image_type_ptr( new image_type( b8g8r8_image_type( width, height, 1 ) ), destroy );
+ return il::allocate( L"b8g8r8", width, height );
case PixelFormat32bppARGB:
- return il::image_type_ptr( new image_type( b8g8r8a8_image_type( width, height, 1 ) ), destroy );
+ return il::allocate( L"b8g8r8a8", width, height );
case PixelFormat32bppPARGB:
default:
- return il::image_type_ptr( static_cast<image_type*>( 0 ) );
+ return il::image_type_ptr( );
}
}
il::image_type_ptr load_image( const fs::path& path )
{
- Gdiplus::Bitmap bitmap( ( to_wstring( path.native_directory_string( ) ) ).c_str( ) );
+ Gdiplus::Bitmap bitmap( ( pl::to_wstring( path.native_directory_string( ) ) ).c_str( ) );
Gdiplus::BitmapData bitmapData;
Gdiplus::Rect rect( 0, 0, bitmap.GetWidth( ), bitmap.GetHeight( ) );
@@ -164,10 +145,85 @@
*/
}
-il::image_type_ptr GDI_plugin::load( const fs::path& path )
-{ return load_image( path ); }
+class gdi_plugin : public il::openimagelib_plugin
+{
+public:
+ virtual il::image_type_ptr load( const fs::path& path )
+ { return load_image( path ); }
+
+ virtual bool store( const fs::path&, const il::image_type_ptr& )
+ { return false; }
+};
-bool GDI_plugin::store( const fs::path& path, const il::image_type_ptr& )
-{ return false; }
+} } }
-} } } }
+namespace
+{
+ void reflib( int init )
+ {
+ static long refs = 0;
+#ifdef WIN32
+ static ULONG_PTR gdiplusToken;
+#endif // WIN32
+
+ assert( refs >= 0 && L" GDI+_plugin::refinit: refs is negative." );
+
+ if( init > 0 && ++refs )
+ {
+# ifdef WIN32
+ Gdiplus::GdiplusStartupInput gdiplusStartupInput;
+
+ Gdiplus::GdiplusStartup( &gdiplusToken, &gdiplusStartupInput, NULL );
+# endif
+ }
+ else if( init < 0 && --refs == 0 )
+ {
+# ifdef WIN32
+ Gdiplus::GdiplusShutdown( gdiplusToken );
+# endif
+ }
+ }
+
+ boost::recursive_mutex mutex;
+}
+
+extern "C"
+{
+ IL_DECLSPEC bool openplugin_init( void )
+ {
+ boost::recursive_mutex::scoped_lock lock( mutex );
+
+ reflib( 1 );
+
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_uninit( void )
+ {
+ boost::recursive_mutex::scoped_lock lock( mutex );
+
+ reflib( -1 );
+
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_create_plugin( const char*, pl::openplugin** plug )
+ {
+ *plug = new il::gdi_plugin;
+
+ return true;
+ }
+
+ IL_DECLSPEC void openplugin_destroy_plugin( pl::openplugin* plug )
+ { delete static_cast<il::gdi_plugin*>( plug ); }
+}
+
+#ifdef WIN32
+extern "C" BOOL WINAPI DllMain( HINSTANCE hInstDLL, DWORD fdwReason, LPVOID )
+{
+ if( fdwReason == DLL_PROCESS_ATTACH )
+ DisableThreadLibraryCalls( hInstDLL );
+
+ return TRUE;
+}
+#endif
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_plugin.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_plugin.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_plugin.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,27 +0,0 @@
-
-// GDI+ - A GDI+ plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef GDI_PLUGIN_INC_
-#define GDI_PLUGIN_INC_
-
-#include <boost/filesystem/path.hpp>
-
-#include <openimagelib/plugins/gdi+/config.hpp>
-#include <openimagelib/il/openimagelib_plugin.hpp>
-
-namespace olib { namespace openimagelib { namespace plugins { namespace GDI {
-
-class GDI_DECLSPEC GDI_plugin : public olib::openimagelib::il::openimagelib_plugin
-{
-public:
- virtual il::image_type_ptr load( const boost::filesystem::path& path );
- virtual bool store( const boost::filesystem::path& path, const il::image_type_ptr& image );
-};
-
-} } } }
-
-#endif
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_vc8.vcproj
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_vc8.vcproj 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/gdi+/gdi+_vc8.vcproj 2007-05-22 19:28:17 UTC (rev 137)
@@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GDI_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
MinimalRebuild="true"
ExceptionHandling="2"
BasicRuntimeChecks="3"
@@ -125,7 +125,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GDI_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
ExceptionHandling="2"
RuntimeLibrary="2"
BufferSecurityCheck="false"
@@ -194,10 +194,6 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath=".\gdi+.cpp"
- >
- </File>
- <File
RelativePath=".\gdi+_plugin.cpp"
>
</File>
@@ -207,14 +203,6 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
- <File
- RelativePath=".\config.hpp"
- >
- </File>
- <File
- RelativePath=".\gdi+_plugin.hpp"
- >
- </File>
</Filter>
<Filter
Name="Resource Files"
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/hdr/Makefile.am
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/hdr/Makefile.am 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/hdr/Makefile.am 2007-05-22 19:28:17 UTC (rev 137)
@@ -8,15 +8,11 @@
lib_LTLIBRARIES = libopenimagelib_hdr.la
libopenimagelib_hdr_la_SOURCES = \
- config.hpp \
- hdr.cpp \
- hdr_plugin.hpp \
hdr_plugin.cpp
libopenimagelib_hdr_la_CXXFLAGS = \
$(OLIB_CXXFLAGS) \
- $(BOOST_INCLUDE_PATH) \
- # end
+ $(BOOST_INCLUDE_PATH)
libopenimagelib_hdr_la_LIBADD = \
$(BOOST_FILESYSTEM_LIBS)
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/hdr/config.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/hdr/config.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/hdr/config.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,25 +0,0 @@
-
-// HDR - An HDR plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef HDR_CONFIG_INC_
-#define HDR_CONFIG_INC_
-
-#ifdef WIN32
- #ifdef HDR_EXPORTS
- #define HDR_DECLSPEC __declspec( dllexport )
- #else
- #define HDR_DECLSPEC __declspec( dllimport )
- #endif // HDR_EXPORTS
-#else
- #ifdef HDR_EXPORTS
- #define HDR_DECLSPEC extern
- #else
- #define HDR_DECLSPEC
- #endif // HDR_EXPORTS
-#endif // WIN32
-
-#endif // HDR_CONFIG_INC_
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,34 +0,0 @@
-
-// HDR - An HDR plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#include <openimagelib/plugins/hdr/hdr_plugin.hpp>
-
-namespace opl = olib::openpluginlib;
-namespace HDR = olib::openimagelib::plugins::HDR;
-
-extern "C"
-{
- HDR_DECLSPEC bool openplugin_init( void )
- {
- return true;
- }
-
- HDR_DECLSPEC bool openplugin_uninit( void )
- {
- return true;
- }
-
- HDR_DECLSPEC bool openplugin_create_plugin( const char*, opl::openplugin** plug )
- {
- *plug = new HDR::HDR_plugin;
-
- return true;
- }
-
- HDR_DECLSPEC void openplugin_destroy_plugin( opl::openplugin* plug )
- { delete static_cast<HDR::HDR_plugin*>( plug ); }
-}
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -15,12 +15,13 @@
#include <boost/filesystem/fstream.hpp>
-#include <openimagelib/plugins/hdr/hdr_plugin.hpp>
+#include <openimagelib/il/openimagelib_plugin.hpp>
namespace il = olib::openimagelib::il;
namespace fs = boost::filesystem;
+namespace pl = olib::openpluginlib;
-namespace olib { namespace openimagelib { namespace plugins { namespace HDR {
+namespace olib { namespace openimagelib { namespace il {
namespace
{
@@ -278,10 +279,45 @@
}
}
-il::image_type_ptr HDR_plugin::load( const fs::path& path )
-{ return load_hdr( path ); }
+struct hdr_plugin : public il::openimagelib_plugin
+{
+ virtual il::image_type_ptr load( const boost::filesystem::path& path )
+ { return load_hdr( path ); }
+
+ virtual bool store( const boost::filesystem::path& path, const il::image_type_ptr& im )
+ { return store_hdr( path, im ); }
+};
-bool HDR_plugin::store( const fs::path& path, const il::image_type_ptr& im )
-{ return store_hdr( path, im ); }
+} } }
-} } } }
+extern "C"
+{
+ IL_DECLSPEC bool openplugin_init( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_uninit( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_create_plugin( const char*, pl::openplugin** plug )
+ {
+ *plug = new il::hdr_plugin;
+ return true;
+ }
+
+ IL_DECLSPEC void openplugin_destroy_plugin( pl::openplugin* plug )
+ { delete static_cast<il::hdr_plugin*>( plug ); }
+}
+
+#ifdef WIN32
+extern "C" BOOL WINAPI DllMain( HINSTANCE hInstDLL, DWORD fdwReason, LPVOID )
+{
+ if( fdwReason == DLL_PROCESS_ATTACH )
+ DisableThreadLibraryCalls( hInstDLL );
+
+ return TRUE;
+}
+#endif
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_plugin.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,26 +0,0 @@
-
-// HDR - A HDR plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef HDR_PLUGIN_INC_
-#define HDR_PLUGIN_INC_
-
-#include <boost/filesystem/path.hpp>
-
-#include <openimagelib/plugins/hdr/config.hpp>
-#include <openimagelib/il/openimagelib_plugin.hpp>
-
-namespace olib { namespace openimagelib { namespace plugins { namespace HDR {
-
-struct HDR_DECLSPEC HDR_plugin : public olib::openimagelib::il::openimagelib_plugin
-{
- virtual il::image_type_ptr load( const boost::filesystem::path& path );
- virtual bool store( const boost::filesystem::path& path, const il::image_type_ptr& image );
-};
-
-} } } }
-
-#endif
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_vc8.vcproj
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_vc8.vcproj 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/hdr/hdr_vc8.vcproj 2007-05-22 19:28:17 UTC (rev 137)
@@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HDR_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
MinimalRebuild="true"
ExceptionHandling="2"
BasicRuntimeChecks="3"
@@ -128,7 +128,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HDR_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
ExceptionHandling="2"
RuntimeLibrary="2"
BufferSecurityCheck="false"
@@ -198,10 +198,6 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath=".\hdr.cpp"
- >
- </File>
- <File
RelativePath=".\hdr_plugin.cpp"
>
</File>
@@ -211,14 +207,6 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
- <File
- RelativePath=".\config.hpp"
- >
- </File>
- <File
- RelativePath=".\hdr_plugin.hpp"
- >
- </File>
</Filter>
<Filter
Name="Resource Files"
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/jpg/Makefile.am
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/jpg/Makefile.am 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/jpg/Makefile.am 2007-05-22 19:28:17 UTC (rev 137)
@@ -9,15 +9,11 @@
lib_LTLIBRARIES = libopenimagelib_jpg.la
libopenimagelib_jpg_la_SOURCES = \
- config.hpp \
- jpg.cpp \
- jpg_plugin.hpp \
jpg_plugin.cpp
libopenimagelib_jpg_la_CXXFLAGS = \
$(OLIB_CXXFLAGS) \
- $(BOOST_INCLUDE_PATH) \
- # end
+ $(BOOST_INCLUDE_PATH)s
libopenimagelib_jpg_la_LIBADD = \
$(BOOST_FILESYSTEM_LIBS) \
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/jpg/config.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/jpg/config.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/jpg/config.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,25 +0,0 @@
-
-// JPG - An JPG plugin to il.
-
-// Copyright (C) 2005-2007 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef JPG_CONFIG_INC_
-#define JPG_CONFIG_INC_
-
-#ifdef WIN32
- #ifdef JPG_EXPORTS
- #define JPG_DECLSPEC __declspec( dllexport )
- #else
- #define JPG_DECLSPEC __declspec( dllimport )
- #endif // JPG_EXPORTS
-#else
- #ifdef JPG_EXPORTS
- #define JPG_DECLSPEC extern
- #else
- #define JPG_DECLSPEC
- #endif // JPG_EXPORTS
-#endif // WIN32
-
-#endif // JPG_CONFIG_INC_
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,34 +0,0 @@
-
-// JPG - An JPG plugin to il.
-
-// Copyright (C) 2005-2007 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#include <openimagelib/plugins/jpg/jpg_plugin.hpp>
-
-namespace opl = olib::openpluginlib;
-namespace JPG = olib::openimagelib::plugins::JPG;
-
-extern "C"
-{
- JPG_DECLSPEC bool openplugin_init( void )
- {
- return true;
- }
-
- JPG_DECLSPEC bool openplugin_uninit( void )
- {
- return true;
- }
-
- JPG_DECLSPEC bool openplugin_create_plugin( const char*, opl::openplugin** plug )
- {
- *plug = new JPG::JPG_plugin;
-
- return true;
- }
-
- JPG_DECLSPEC void openplugin_destroy_plugin( opl::openplugin* plug )
- { delete static_cast<JPG::JPG_plugin*>( plug ); }
-}
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -13,7 +13,7 @@
#include <vector>
#include <string>
-#include <openimagelib/plugins/jpg/jpg_plugin.hpp>
+#include <openimagelib/il/openimagelib_plugin.hpp>
extern "C" {
#include <jpeglib.h>
@@ -24,9 +24,11 @@
#include <color.h>
#endif
+namespace il = olib::openimagelib::il;
+namespace fs = boost::filesystem;
namespace pl = olib::openpluginlib;
-namespace olib { namespace openimagelib { namespace plugins { namespace JPG {
+namespace olib { namespace openimagelib { namespace il {
namespace
{
@@ -190,11 +192,47 @@
return false;
}
}
-
-il::image_type_ptr JPG_plugin::load( const boost::filesystem::path& path )
-{ return load_jpg( path ); }
-bool JPG_plugin::store( const boost::filesystem::path& path, const il::image_type_ptr& image )
-{ return store_jpg( path, image ); }
+class jpg_plugin : public il::openimagelib_plugin
+{
+public:
+ virtual il::image_type_ptr load( const fs::path& path )
+ { return load_jpg( path ); }
+
+ virtual bool store( const fs::path& path, const il::image_type_ptr& im )
+ { return store_jpg( path, im ); }
+};
-} } } }
+} } }
+
+extern "C"
+{
+ IL_DECLSPEC bool openplugin_init( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_uninit( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_create_plugin( const char*, pl::openplugin** plug )
+ {
+ *plug = new il::jpg_plugin;
+ return true;
+ }
+
+ IL_DECLSPEC void openplugin_destroy_plugin( pl::openplugin* plug )
+ { delete static_cast<il::jpg_plugin*>( plug ); }
+}
+
+#ifdef WIN32
+extern "C" BOOL WINAPI DllMain( HINSTANCE hInstDLL, DWORD fdwReason, LPVOID )
+{
+ if( fdwReason == DLL_PROCESS_ATTACH )
+ DisableThreadLibraryCalls( hInstDLL );
+
+ return TRUE;
+}
+#endif
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,27 +0,0 @@
-
-// JPG - A JPG plugin to il.
-
-// Copyright (C) 2005-2007 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef JPG_PLUGIN_INC_
-#define JPG_PLUGIN_INC_
-
-#include <boost/filesystem/path.hpp>
-
-#include <openimagelib/plugins/jpg/config.hpp>
-#include <openimagelib/il/openimagelib_plugin.hpp>
-
-namespace olib { namespace openimagelib { namespace plugins { namespace JPG {
-
-class JPG_DECLSPEC JPG_plugin : public il::openimagelib_plugin
-{
-public:
- virtual il::image_type_ptr load( const boost::filesystem::path& path );
- virtual bool store( const boost::filesystem::path& path, const il::image_type_ptr& image );
-};
-
-} } } }
-
-#endif
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_vc8.vcproj
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_vc8.vcproj 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/jpg/jpg_vc8.vcproj 2007-05-22 19:28:17 UTC (rev 137)
@@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34";"C:\Program Files\HDR\include""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JPG_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING;HAVE_JPEGHDR"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING;HAVE_JPEGHDR"
MinimalRebuild="true"
ExceptionHandling="2"
BasicRuntimeChecks="3"
@@ -131,7 +131,7 @@
Name="VCCLCompilerTool"
Optimization="3"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34";"C:\Program Files\HDR\include""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JPG_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING;HAVE_JPEGHDR"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING;HAVE_JPEGHDR"
ExceptionHandling="2"
RuntimeLibrary="0"
BufferSecurityCheck="false"
@@ -205,10 +205,6 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath=".\jpg.cpp"
- >
- </File>
- <File
RelativePath=".\jpg_plugin.cpp"
>
</File>
@@ -218,14 +214,6 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
- <File
- RelativePath=".\config.hpp"
- >
- </File>
- <File
- RelativePath=".\jpg_plugin.hpp"
- >
- </File>
</Filter>
<Filter
Name="Resource Files"
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/png/Makefile.am
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/png/Makefile.am 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/png/Makefile.am 2007-05-22 19:28:17 UTC (rev 137)
@@ -9,9 +9,6 @@
lib_LTLIBRARIES = libopenimagelib_png.la
libopenimagelib_png_la_SOURCES = \
- config.hpp \
- png.cpp \
- png_plugin.hpp \
png_plugin.cpp
libopenimagelib_png_la_CXXFLAGS = \
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/png/config.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/png/config.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/png/config.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,25 +0,0 @@
-
-// PNG - A PNG plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef PNG_CONFIG_INC_
-#define PNG_CONFIG_INC_
-
-#ifdef WIN32
- #ifdef PNG_EXPORTS
- #define PNG_DECLSPEC __declspec( dllexport )
- #else
- #define PNG_DECLSPEC __declspec( dllimport )
- #endif // PNG_EXPORTS
-#else
- #ifdef PNG_EXPORTS
- #define PNG_DECLSPEC extern
- #else
- #define PNG_DECLSPEC
- #endif // PNG_EXPORTS
-#endif // WIN32
-
-#endif // PNG_CONFIG_INC_
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/png/png.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/png/png.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/png/png.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,33 +0,0 @@
-
-// PNG - An PNG plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#include <openimagelib/plugins/png/png_plugin.hpp>
-
-namespace opl = olib::openpluginlib;
-namespace PNG = olib::openimagelib::plugins::PNG;
-
-extern "C"
-{
- PNG_DECLSPEC bool openplugin_init( void )
- {
- return true;
- }
-
- PNG_DECLSPEC bool openplugin_uninit( void )
- {
- return true;
- }
-
- PNG_DECLSPEC bool openplugin_create_plugin( const char*, opl::openplugin** plug )
- {
- *plug = new PNG::PNG_plugin;
- return true;
- }
-
- PNG_DECLSPEC void openplugin_destroy_plugin( opl::openplugin* plug )
- { delete static_cast<PNG::PNG_plugin*>( plug ); }
-}
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/png/png_plugin.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/png/png_plugin.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/png/png_plugin.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -12,33 +12,29 @@
#include <png.h>
-#include <openimagelib/plugins/png/png_plugin.hpp>
+#include <openimagelib/il/openimagelib_plugin.hpp>
+namespace pl = olib::openpluginlib;
namespace il = olib::openimagelib::il;
namespace fs = boost::filesystem;
-namespace olib { namespace openimagelib { namespace plugins { namespace PNG {
+namespace olib { namespace openimagelib { namespace il {
-typedef il::image<unsigned char, il::surface_format> image_type;
-
namespace
{
- void destroy( image_type* im )
+ void destroy( il::image_type* im )
{ delete im; }
- boost::shared_ptr<image_type> png_pixelformat_to_image_type( int channels, int width, int height )
+ il::image_type_ptr png_pixelformat_to_image_type( int channels, int width, int height )
{
- typedef il::image<unsigned char, il::r8g8b8> r8g8b8_image_type;
- typedef il::image<unsigned char, il::r8g8b8a8> r8g8b8a8_image_type;
-
switch( channels )
{
case 4:
- return il::image_type_ptr( new image_type( r8g8b8a8_image_type( width, height, 1 ) ), destroy );
+ return il::allocate( L"r8g8b8a8", width, height );
case 3:
- return il::image_type_ptr( new image_type( r8g8b8_image_type( width, height, 1 ) ), destroy );
-
+ return il::allocate( L"r8g8b8", width, height );
+
default:
return il::image_type_ptr( );
}
@@ -102,10 +98,45 @@
}
}
-il::image_type_ptr PNG_plugin::load( const fs::path& path )
-{ return il::image_type_ptr( load_png( path ) ); }
+struct png_plugin : public il::openimagelib_plugin
+{
+ virtual il::image_type_ptr load( const fs::path& path )
+ { return load_png( path ); }
+
+ virtual bool store( const fs::path&, const il::image_type_ptr& )
+ { return false; }
+};
-bool PNG_plugin::store( const fs::path& /*path*/, const il::image_type_ptr& /*image*/ )
-{ return false; }
+} } }
-} } } }
+extern "C"
+{
+ IL_DECLSPEC bool openplugin_init( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_uninit( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_create_plugin( const char*, pl::openplugin** plug )
+ {
+ *plug = new il::png_plugin;
+ return true;
+ }
+
+ IL_DECLSPEC void openplugin_destroy_plugin( pl::openplugin* plug )
+ { delete static_cast<il::png_plugin*>( plug ); }
+}
+
+#ifdef WIN32
+extern "C" BOOL WINAPI DllMain( HINSTANCE hInstDLL, DWORD fdwReason, LPVOID )
+{
+ if( fdwReason == DLL_PROCESS_ATTACH )
+ DisableThreadLibraryCalls( hInstDLL );
+
+ return TRUE;
+}
+#endif
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/png/png_plugin.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/png/png_plugin.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/png/png_plugin.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,27 +0,0 @@
-
-// PNG - A PNG plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef PNG_PLUGIN_INC_
-#define PNG_PLUGIN_INC_
-
-#include <boost/filesystem/path.hpp>
-
-#include <openimagelib/il/openimagelib_plugin.hpp>
-
-#include <openimagelib/plugins/png/config.hpp>
-
-namespace olib { namespace openimagelib { namespace plugins { namespace PNG {
-
-struct PNG_DECLSPEC PNG_plugin : public olib::openimagelib::il::openimagelib_plugin
-{
- virtual il::image_type_ptr load( const boost::filesystem::path& path );
- virtual bool store( const boost::filesystem::path& path, const il::image_type_ptr& image );
-};
-
-} } } }
-
-#endif
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/png/png_vc8.vcproj
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/png/png_vc8.vcproj 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/png/png_vc8.vcproj 2007-05-22 19:28:17 UTC (rev 137)
@@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34";C:\libpng\include;C:\zlib\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PNG_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
MinimalRebuild="true"
ExceptionHandling="2"
BasicRuntimeChecks="3"
@@ -126,7 +126,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34";C:\libpng\include;C:\zlib\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PNG_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
ExceptionHandling="2"
RuntimeLibrary="2"
BufferSecurityCheck="false"
@@ -197,10 +197,6 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath=".\png.cpp"
- >
- </File>
- <File
RelativePath=".\png_plugin.cpp"
>
</File>
@@ -210,14 +206,6 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
- <File
- RelativePath=".\config.hpp"
- >
- </File>
- <File
- RelativePath=".\png_plugin.hpp"
- >
- </File>
</Filter>
<Filter
Name="Resource Files"
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/psd/Makefile.am
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/psd/Makefile.am 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/psd/Makefile.am 2007-05-22 19:28:17 UTC (rev 137)
@@ -8,15 +8,11 @@
lib_LTLIBRARIES = libopenimagelib_psd.la
libopenimagelib_psd_la_SOURCES = \
- config.hpp \
- psd.cpp \
- psd_plugin.hpp \
psd_plugin.cpp
libopenimagelib_psd_la_CXXFLAGS = \
$(OLIB_CXXFLAGS) \
- $(BOOST_INCLUDE_PATH) \
- # end
+ $(BOOST_INCLUDE_PATH)
libopenimagelib_psd_la_LIBADD = \
$(BOOST_FILESYSTEM_LIBS)
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/psd/config.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/psd/config.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/psd/config.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,25 +0,0 @@
-
-// PSD - An PSD plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef PSD_CONFIG_INC_
-#define PSD_CONFIG_INC_
-
-#ifdef WIN32
- #ifdef PSD_EXPORTS
- #define PSD_DECLSPEC __declspec( dllexport )
- #else
- #define PSD_DECLSPEC __declspec( dllimport )
- #endif // PSD_EXPORTS
-#else
- #ifdef PSD_EXPORTS
- #define PSD_DECLSPEC extern
- #else
- #define PSD_DECLSPEC
- #endif // PSD_EXPORTS
-#endif // WIN32
-
-#endif // PSD_CONFIG_INC_
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,34 +0,0 @@
-
-// PSD - An PSD plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#include <openimagelib/plugins/psd/psd_plugin.hpp>
-
-namespace opl = olib::openpluginlib;
-namespace PSD = olib::openimagelib::plugins::PSD;
-
-extern "C"
-{
- PSD_DECLSPEC bool openplugin_init( void )
- {
- return true;
- }
-
- PSD_DECLSPEC bool openplugin_uninit( void )
- {
- return true;
- }
-
- PSD_DECLSPEC bool openplugin_create_plugin( const char*, opl::openplugin** plug )
- {
- *plug = new PSD::PSD_plugin;
-
- return true;
- }
-
- PSD_DECLSPEC void openplugin_destroy_plugin( opl::openplugin* plug )
- { delete static_cast<PSD::PSD_plugin*>( plug ); }
-}
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_plugin.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_plugin.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_plugin.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -11,12 +11,13 @@
#include <boost/filesystem/fstream.hpp>
-#include <openimagelib/plugins/psd/psd_plugin.hpp>
+#include <openimagelib/il/openimagelib_plugin.hpp>
+namespace pl = olib::openpluginlib;
namespace il = olib::openimagelib::il;
namespace fs = boost::filesystem;
-namespace olib { namespace openimagelib { namespace plugins { namespace PSD {
+namespace olib { namespace openimagelib { namespace il {
namespace
{
@@ -36,21 +37,6 @@
assert( !file.fail( ) && L"PSD_image_loader::Read_s" );
}
-
- std::wstring to_wstring( const std::string& str )
- {
- std::vector<wchar_t> ws;
- ws.resize( str.size( ) + 1 );
-
-#if _MSC_VER >= 1400
- size_t size;
- mbstowcs_s( &size, &ws[ 0 ], ws.size( ), str.c_str( ), str.size( ) );
-#else
- mbstowcs( &ws[ 0 ], str.c_str( ), str.size( ) );
-#endif // _MSC_VER >= 0x1400
-
- return std::wstring( ws.begin( ), ws.end( ) );
- }
}
template<typename T>
@@ -99,10 +85,46 @@
return il::image_type_ptr( );
}
-il::image_type_ptr PSD_plugin::load( const fs::path& path )
-{ return il::image_type_ptr( load_psd( path ) ); }
+class psd_plugin : public il::openimagelib_plugin
+{
+public:
+ virtual il::image_type_ptr load( const fs::path& path )
+ { return load_psd( path ); }
+
+ virtual bool store( const fs::path&, const il::image_type_ptr& )
+ { return false; }
+};
-bool PSD_plugin::store( const fs::path& path, const il::image_type_ptr& )
-{ return false; }
+} } }
-} } } }
+extern "C"
+{
+ IL_DECLSPEC bool openplugin_init( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_uninit( void )
+ {
+ return true;
+ }
+
+ IL_DECLSPEC bool openplugin_create_plugin( const char*, pl::openplugin** plug )
+ {
+ *plug = new il::psd_plugin;
+ return true;
+ }
+
+ IL_DECLSPEC void openplugin_destroy_plugin( pl::openplugin* plug )
+ { delete static_cast<il::psd_plugin*>( plug ); }
+}
+
+#ifdef WIN32
+extern "C" BOOL WINAPI DllMain( HINSTANCE hInstDLL, DWORD fdwReason, LPVOID )
+{
+ if( fdwReason == DLL_PROCESS_ATTACH )
+ DisableThreadLibraryCalls( hInstDLL );
+
+ return TRUE;
+}
+#endif
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_plugin.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_plugin.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_plugin.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,27 +0,0 @@
-
-// PSD - A PSD plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef PSD_PLUGIN_INC_
-#define PSD_PLUGIN_INC_
-
-#include <boost/filesystem/path.hpp>
-
-#include <openimagelib/plugins/psd/config.hpp>
-#include <openimagelib/il/openimagelib_plugin.hpp>
-
-namespace olib { namespace openimagelib { namespace plugins { namespace PSD {
-
-class PSD_DECLSPEC PSD_plugin : public olib::openimagelib::il::openimagelib_plugin
-{
-public:
- virtual il::image_type_ptr load( const boost::filesystem::path& path );
- virtual bool store( const boost::filesystem::path& path, const il::image_type_ptr& image );
-};
-
-} } } }
-
-#endif
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_vc8.vcproj
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_vc8.vcproj 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/psd/psd_vc8.vcproj 2007-05-22 19:28:17 UTC (rev 137)
@@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PSD_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -125,7 +125,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_34""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PSD_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IL_EXPORTS;OPENIMAGELIB_BUILD;HAVE_FLEX_STRING"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="0"
@@ -194,10 +194,6 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath=".\psd.cpp"
- >
- </File>
- <File
RelativePath=".\psd_plugin.cpp"
>
</File>
@@ -207,14 +203,6 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
- <File
- RelativePath=".\config.hpp"
- >
- </File>
- <File
- RelativePath=".\psd_plugin.hpp"
- >
- </File>
</Filter>
<Filter
Name="Resource Files"
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/Makefile.am
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/Makefile.am 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/Makefile.am 2007-05-22 19:28:17 UTC (rev 137)
@@ -10,9 +10,6 @@
lib_LTLIBRARIES = libopenimagelib_quicktime.la
libopenimagelib_quicktime_la_SOURCES = \
- config.hpp \
- quicktime.cpp \
- quicktime_plugin.hpp \
quicktime_plugin.cpp
libopenimagelib_quicktime_la_CXXFLAGS = \
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/config.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/config.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/config.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,25 +0,0 @@
-
-// QuickTime - An QuickTime plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef QUICKTIME_CONFIG_INC_
-#define QUICKTIME_CONFIG_INC_
-
-#ifdef WIN32
- #ifdef QUICKTIME_EXPORTS
- #define QUICKTIME_DECLSPEC __declspec( dllexport )
- #else
- #define QUICKTIME_DECLSPEC __declspec( dllimport )
- #endif
-#else
- #ifdef QUICKTIME_EXPORTS
- #define QUICKTIME_DECLSPEC extern
- #else
- #define QUICKTIME_DECLSPEC
- #endif
-#endif
-
-#endif
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,77 +0,0 @@
-
-// QuickTime - An QuickTime plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifdef WIN32
-#include <QTML.h>
-
-#include <boost/thread/recursive_mutex.hpp>
-#endif
-
-#include <openimagelib/plugins/quicktime/quicktime_plugin.hpp>
-
-namespace opl = olib::openpluginlib;
-namespace QT = olib::openimagelib::plugins::QT;
-
-#ifdef WIN32
-namespace
-{
- bool reflib( int init )
- {
- static long refs = 0;
-
- assert( refs >= 0 && L" QuickTime_plugin::refinit: refs is negative." );
-
- if( init > 0 && ++refs == 1 )
- {
- OSStatus err = InitializeQTML( 0L );
- if( err != noErr )
- return false;
- }
- else if( init < 0 && --refs == 0 )
- {
- }
-
- return true;
- }
-
- boost::recursive_mutex mutex;
-}
-#endif
-
-extern "C"
-{
- QUICKTIME_DECLSPEC bool openplugin_init( void )
- {
-#ifdef WIN32
- boost::recursive_mutex::scoped_lock lock( mutex );
-
- return reflib( 1 );
-#else
- return true;
-#endif
- }
-
- QUICKTIME_DECLSPEC bool openplugin_uninit( void )
- {
-#ifdef WIN32
- boost::recursive_mutex::scoped_lock lock( mutex );
-
- return reflib( -1 );
-#else
- return true;
-#endif
- }
-
- QUICKTIME_DECLSPEC bool openplugin_create_plugin( const char*, opl::openplugin** plug )
- {
- *plug = new QT::QT_plugin;
- return true;
- }
-
- QUICKTIME_DECLSPEC void openplugin_destroy_plugin( opl::openplugin* plug )
- { delete static_cast<QT::QT_plugin*>( plug ); }
-}
Modified: trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.cpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.cpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -15,28 +15,21 @@
#endif
#include <boost/filesystem/fstream.hpp>
+#include <boost/thread/recursive_mutex.hpp>
#include <openpluginlib/pl/utf8_utils.hpp>
+#include <openimagelib/il/openimagelib_plugin.hpp>
-#include <openimagelib/plugins/quicktime/quicktime_plugin.hpp>
-
namespace il = olib::openimagelib::il;
namespace fs = boost::filesystem;
namespace pl = olib::openpluginlib;
-namespace olib { namespace openimagelib { namespace plugins { namespace QT {
+namespace olib { namespace openimagelib { namespace il {
namespace
{
void destroy( il::image_type* im )
{ delete im; }
-
- il::image_type_ptr quicktime_image_type_to_image_type( int width, int height )
- {
- typedef il::image<unsigned char, il::a8r8g8b8> a8r8g8b8_image_type;
-
- return il::image_type_ptr( new il::image_type( a8r8g8b8_image_type( width, height, 1 ) ), destroy );
- }
il::image_type_ptr load_quicktime( const fs::path& path )
{
@@ -78,7 +71,7 @@
int width = rect.right - rect.left;
int height = rect.bottom - rect.top;
- il::image_type_ptr im = quicktime_image_type_to_image_type( width, height );
+ il::image_type_ptr im = il::allocate( L"a8r8g8b8", width, height );
if( !im )
return il::image_type_ptr( );
@@ -122,10 +115,83 @@
}
}
-il::image_type_ptr QT_plugin::load( const fs::path& path )
-{ return load_quicktime( path ); }
+struct qt_plugin : public il::openimagelib_plugin
+{
+ virtual il::image_type_ptr load( const fs::path& path )
+ { return load_quicktime( path ); }
+
+ virtual bool store( const fs::path&, const il::image_type_ptr& )
+ { return false; }
+};
-bool QT_plugin::store( const fs::path& /*path*/, const il::image_type_ptr& )
-{ return false; }
+} } }
-} } } }
+#ifdef WIN32
+namespace
+{
+ bool reflib( int init )
+ {
+ static long refs = 0;
+
+ assert( refs >= 0 && L" QuickTime_plugin::refinit: refs is negative." );
+
+ if( init > 0 && ++refs == 1 )
+ {
+ OSStatus err = InitializeQTML( 0L );
+ if( err != noErr )
+ return false;
+ }
+ else if( init < 0 && --refs == 0 )
+ {
+ }
+
+ return true;
+ }
+
+ boost::recursive_mutex mutex;
+}
+#endif
+
+extern "C"
+{
+ IL_DECLSPEC bool openplugin_init( void )
+ {
+#ifdef WIN32
+ boost::recursive_mutex::scoped_lock lock( mutex );
+
+ return reflib( 1 );
+#else
+ return true;
+#endif
+ }
+
+ IL_DECLSPEC bool openplugin_uninit( void )
+ {
+#ifdef WIN32
+ boost::recursive_mutex::scoped_lock lock( mutex );
+
+ return reflib( -1 );
+#else
+ return true;
+#endif
+ }
+
+ IL_DECLSPEC bool openplugin_create_plugin( const char*, pl::openplugin** plug )
+ {
+ *plug = new il::qt_plugin;
+ return true;
+ }
+
+ IL_DECLSPEC void openplugin_destroy_plugin( pl::openplugin* plug )
+ { delete static_cast<il::qt_plugin*>( plug ); }
+}
+
+#ifdef WIN32
+extern "C" BOOL WINAPI DllMain( HINSTANCE hInstDLL, DWORD fdwReason, LPVOID )
+{
+ if( fdwReason == DLL_PROCESS_ATTACH )
+ DisableThreadLibraryCalls( hInstDLL );
+
+ return TRUE;
+}
+#endif
Deleted: trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.hpp 2007-05-21 22:04:39 UTC (rev 136)
+++ trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.hpp 2007-05-22 19:28:17 UTC (rev 137)
@@ -1,26 +0,0 @@
-
-// QuickTime - An QuickTime plugin to il.
-
-// Copyright (C) 2005-2006 VM Inc.
-// Released under the LGPL.
-// For more information, see http://www.openlibraries.org.
-
-#ifndef QUICKTIME_PLUGIN_INC_
-#de...
[truncated message content] |