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