Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by tomek ( 15 years ago )
// dllmain.cpp : Defines the entry point for the DLL application.
#include <windows.h>
#include "cmGeneric.h"
#include "cmnormal.h"
#include "brightness_contrast.h"
#include "HSL.h"
#include "cm_Equalize.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
__declspec(dllexport) mmInt __stdcall mmDLLGetSupportedImagesCalculationMethodsCount( void )
{
return 5;
}
//---------------------------------------------------------------------------
__declspec(dllexport) mmImages::mmImagesCalculationMethodI::sCalculationMethodParams __stdcall mmDLLGetSupportedImagesCalculationMethodDef( mmInt p_iImpIndex )
{
mmImages::mmImagesCalculationMethodI::sCalculationMethodParams v_sCMP;
mmImages::mmImagesCalculationMethodI* _v_sImagesCalculationMethod(NULL);
switch( p_iImpIndex ) {
case 0: {
_v_sImagesCalculationMethod = new mmImages::cmGeneric( NULL,NULL );
break;
}
case 1: {
_v_sImagesCalculationMethod = new mmImages::cmHSL( NULL,NULL );
break;
}
case 2: {
_v_sImagesCalculationMethod = new mmImages::cm_Equalize( NULL,NULL );
break;
}
case 3: {
_v_sImagesCalculationMethod = new mmImages::cmnormal( NULL,NULL );
break;
}
case 4: {
_v_sImagesCalculationMethod = new mmImages::cmProg( NULL,NULL );
break;
}
default: {
v_sCMP.sIDName[0] = 0;
v_sCMP.sShortName[0] = 0;
v_sCMP.sDescription[0] = 0;
v_sCMP.bIsMultithreaded = false;
}
}
if( _v_sImagesCalculationMethod != NULL ) {
v_sCMP = _v_sImagesCalculationMethod->GetCalculationMethodInfo();
delete _v_sImagesCalculationMethod;
}
return v_sCMP;
}
//---------------------------------------------------------------------------
__declspec(dllexport) mmImages::mmImagesCalculationMethodI* __stdcall mmDLLCreateImagesCalculationMethod( mmInterfacesStorage::mmGlobalInterfacesStorage* _p_sGlobalInterfaces, const wchar_t* _p_cImagesCalculationMethodName ) throw(mmError)
{
mmString v_sImagesCalculationMethodName = _p_cImagesCalculationMethodName;
mmInt v_iMethodIndex = -1;
mmInt v_iCoPCMCount = mmDLLGetSupportedImagesCalculationMethodsCount();
for( mmInt v_iCoPCM = 0; v_iCoPCM < v_iCoPCMCount; v_iCoPCM++ ) {
mmImages::mmImagesCalculationMethodI::sCalculationMethodParams v_sCMP = mmDLLGetSupportedImagesCalculationMethodDef( v_iCoPCM );
if( v_sImagesCalculationMethodName.compare( v_sCMP.sIDName ) == 0 ) {
v_iMethodIndex = v_iCoPCM;
break;
}
}
switch( v_iMethodIndex ) {
case 0:
return new mmImages::cmGeneric( _p_sGlobalInterfaces->GetMemoryManager(), _p_sGlobalInterfaces->GetLogReceiver() );
break;
case 1:
return new mmImages::cmHSL( _p_sGlobalInterfaces->GetMemoryManager(), _p_sGlobalInterfaces->GetLogReceiver() );
break;
case 2:
return new mmImages::cm_Equalize( _p_sGlobalInterfaces->GetMemoryManager(), _p_sGlobalInterfaces->GetLogReceiver() );
break;
case 3:
return new mmImages::cmnormal( _p_sGlobalInterfaces->GetMemoryManager(), _p_sGlobalInterfaces->GetLogReceiver() );
break;
case 4:
return new mmImages::cmProg( _p_sGlobalInterfaces->GetMemoryManager(), _p_sGlobalInterfaces->GetLogReceiver() );
break;
default:
return NULL;
}
}
//---------------------------------------------------------------------------
__declspec(dllexport) void __stdcall mmDLLDestroyImagesCalculationMethod( mmImages::mmImagesCalculationMethodI* _p_sImagesCalculationMethod )
{
delete _p_sImagesCalculationMethod;
}
Revise this Paste