diff --git a/openjpeg-dotnet/DllOpenJPEG.vcproj b/openjpeg-dotnet/DllOpenJPEG.vcproj index 604ee680..4ccaa022 100644 --- a/openjpeg-dotnet/DllOpenJPEG.vcproj +++ b/openjpeg-dotnet/DllOpenJPEG.vcproj @@ -113,6 +113,101 @@ CommandLine="" /> + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - -bool DotNetAllocEncoded64(MarshalledImage* image) +bool LibomvFunc(DotNetAllocEncoded)(MarshalledImage* image) { - return DotNetAllocEncoded(image); -} - -bool DotNetAllocEncoded(MarshalledImage* image) -{ - DotNetFree(image); + LibomvFunc(DotNetFree)(image); try { @@ -27,14 +22,10 @@ bool DotNetAllocEncoded(MarshalledImage* image) return true; } -bool DotNetAllocDecoded64(MarshalledImage* image) -{ - return DotNetAllocDecoded(image); -} -bool DotNetAllocDecoded(MarshalledImage* image) +bool LibomvFunc(DotNetAllocDecoded)(MarshalledImage* image) { - DotNetFree(image); + LibomvFunc(DotNetFree)(image); try { @@ -48,23 +39,15 @@ bool DotNetAllocDecoded(MarshalledImage* image) return true; } -void DotNetFree64(MarshalledImage* image) -{ - DotNetFree(image); -} -void DotNetFree(MarshalledImage* image) +void LibomvFunc(DotNetFree)(MarshalledImage* image) { if (image->encoded != 0) delete[] image->encoded; if (image->decoded != 0) delete[] image->decoded; } -bool DotNetEncode64(MarshalledImage* image, bool lossless) -{ - return DotNetEncode(image, lossless); -} -bool DotNetEncode(MarshalledImage* image, bool lossless) +bool LibomvFunc(DotNetEncode)(MarshalledImage* image, bool lossless) { try { @@ -148,12 +131,7 @@ bool DotNetEncode(MarshalledImage* image, bool lossless) } } -bool DotNetDecode64(MarshalledImage* image) -{ - return DotNetDecode(image); -} - -bool DotNetDecode(MarshalledImage* image) +bool LibomvFunc(DotNetDecode)(MarshalledImage* image) { opj_dparameters dparameters; @@ -188,12 +166,8 @@ bool DotNetDecode(MarshalledImage* image) return false; } } -bool DotNetDecodeWithInfo64(MarshalledImage* image) -{ - return DotNetDecodeWithInfo(image); -} -bool DotNetDecodeWithInfo(MarshalledImage* image) +bool LibomvFunc(DotNetDecodeWithInfo)(MarshalledImage* image) { opj_dparameters dparameters; opj_codestream_info_t info; diff --git a/openjpeg-dotnet/dotnet/dotnet.h b/openjpeg-dotnet/dotnet/dotnet.h index 67c87e8c..4c6b1db2 100644 --- a/openjpeg-dotnet/dotnet/dotnet.h +++ b/openjpeg-dotnet/dotnet/dotnet.h @@ -4,6 +4,12 @@ #include "../libopenjpeg/openjpeg.h" +#ifdef WIN64 +# define LibomvFunc(name) name ## 64 +#else +# define LibomvFunc(name) name +#endif + struct MarshalledImage { unsigned char* encoded; @@ -27,18 +33,11 @@ struct MarshalledImage #endif // uncompresed images are raw RGBA 8bit/channel -DLLEXPORT bool DotNetEncode(MarshalledImage* image, bool lossless); -DLLEXPORT bool DotNetDecode(MarshalledImage* image); -DLLEXPORT bool DotNetDecodeWithInfo(MarshalledImage* image); -DLLEXPORT bool DotNetAllocEncoded(MarshalledImage* image); -DLLEXPORT bool DotNetAllocDecoded(MarshalledImage* image); -DLLEXPORT void DotNetFree(MarshalledImage* image); - -DLLEXPORT bool DotNetEncode64(MarshalledImage* image, bool lossless); -DLLEXPORT bool DotNetDecode64(MarshalledImage* image); -DLLEXPORT bool DotNetDecodeWithInfo64(MarshalledImage* image); -DLLEXPORT bool DotNetAllocEncoded64(MarshalledImage* image); -DLLEXPORT bool DotNetAllocDecoded64(MarshalledImage* image); -DLLEXPORT void DotNetFree64(MarshalledImage* image); +DLLEXPORT bool LibomvFunc(DotNetEncode)(MarshalledImage* image, bool lossless); +DLLEXPORT bool LibomvFunc(DotNetDecode)(MarshalledImage* image); +DLLEXPORT bool LibomvFunc(DotNetDecodeWithInfo)(MarshalledImage* image); +DLLEXPORT bool LibomvFunc(DotNetAllocEncoded)(MarshalledImage* image); +DLLEXPORT bool LibomvFunc(DotNetAllocDecoded)(MarshalledImage* image); +DLLEXPORT void LibomvFunc(DotNetFree)(MarshalledImage* image); #endif