#include <mil.h>
MIL_INT MFTYPE SynchronousFunction(MIL_ID SrcImage, MIL_ID DstImage, MIL_INT Option);
void MFTYPE AsynchronousFunction(MIL_ID SrcImage, MIL_ID DstImage, MIL_INT Option);
#define SYNC_FUNCTION_OPCODE (M_USER_FUNCTION+2)
#define SYNC_FUNCTION_NB_PARAM 4
#define SLAVE_SYNC_FUNC_NAME MIL_TEXT("SlaveSynchronousFunction")
#define SLAVE_DLL_NAME MIL_TEXT("DMilSyncAsyncSlave")
MIL_INT MFTYPE SynchronousFunction(MIL_ID SrcImage, MIL_ID DstImage, MIL_INT Option)
{
MIL_ID Func;
MIL_INT ReturnValue;
MfuncAlloc(MIL_TEXT("SynchronousFunction"), SYNC_FUNCTION_NB_PARAM,
M_NULL, SLAVE_DLL_NAME, SLAVE_SYNC_FUNC_NAME,
SYNC_FUNCTION_OPCODE,
M_SYNCHRONOUS_FUNCTION,
&Func);
MfuncParamMilId (Func, 1, SrcImage, M_IMAGE, M_IN + M_PROC);
MfuncParamMilId (Func, 2, DstImage, M_IMAGE, M_OUT + M_PROC);
MfuncParamMilInt (Func, 3, Option);
MfuncParamArrayMilInt(Func, 4, &ReturnValue, 1, M_OUT);
MfuncCall(Func);
MfuncFree(Func);
return(ReturnValue);
}
#define ASYNC_FUNCTION_OPCODE (M_USER_FUNCTION+3)
#define ASYNC_FUNCTION_NB_PARAM 3
#define SLAVE_ASYNC_FUNC_NAME MIL_TEXT("SlaveAsynchronousFunction")
void MFTYPE AsynchronousFunction(MIL_ID SrcImage, MIL_ID DstImage, MIL_INT Option)
{
MIL_ID Func;
MfuncAlloc(MIL_TEXT("AsynchronousFunction"),
ASYNC_FUNCTION_NB_PARAM,
M_NULL, SLAVE_DLL_NAME, SLAVE_ASYNC_FUNC_NAME,
ASYNC_FUNCTION_OPCODE,
M_ASYNCHRONOUS_FUNCTION,
&Func);
MfuncParamMilId (Func, 1, SrcImage, M_IMAGE, M_IN + M_PROC);
MfuncParamMilId (Func, 2, DstImage, M_IMAGE, M_OUT + M_PROC);
MfuncParamMilInt(Func, 3, Option);
MfuncCall(Func);
MfuncFree(Func);
}