/*! @file ********************************************************************************
Copyright (c) E-COM 2009-2017.  
All rights reserved. 

MODULE NAME: Collimator
FILE NAME:   CollimatorDetProcess.h
DESCRIPTION: This file is the header of collimator functions.
NOTES:       Reference 西门子RAD3项目需求的第316项.
AUTHOR:      Chen G.N
VERSION:     1.2
HISTORY:     2013-04-28   First version 
*******************************************************************************/ #pragma once #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #ifndef far #define far #endif typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; typedef void far *LPVOID; #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "CollimatorX64D.lib") #else #pragma comment(lib, "CollimatorX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "CollimatorD.lib") #else #pragma comment(lib, "Collimator.lib") #endif #endif /*! @function ********************************************************************************
FUNCTION NAME:  GetBeginEnd
DESCRIPTION:    Get the Begin and End of the histogram for image with a mask.
PARA:           [IN] pImage : pointer for the image 
                [IN] nWidth : image width 
				[IN] nHeight : image height 
				[IN] nFlag : image bits 
				[IN] nInvert : not used 
				[IN] nLeft, nRight, nTop, nBottom: mask boundary 
				[IN|OUT] nBegin, nEnd : begin or end of the histogram
HISTORY:        2013-09-29   First version 
*******************************************************************************/ extern "C" bool __declspec(dllexport) GetBeginEnd(int nFlag,int nInvert, const unsigned short* pData,int nWidth,int nHeight, int nLeft,int nRight,int nTop,int nBottom,int &nBegin,int &nEnd); /*! @function ********************************************************************************
FUNCTION NAME:  AutoCrop
DESCRIPTION:    interface of the autocrop.
PARA:           [IN] pImage : pointer for the image 
                [IN] nWidth : image width 
				[IN] nHeight : image height 
				[IN] ImageBit : image bits 
				[IN|OUT] leftside, rightside, upside, bottomside: output of the 
				boundary 
HISTORY:        2013-09-29   First version 
*******************************************************************************/ extern "C" int __declspec(dllexport) AutoCrop( WORD *pIn, int Width, int Height, int ImageBit,int &leftside, int &rightside,int &upside, int &bottomside ); /*! @function ********************************************************************************
FUNCTION NAME:  AutoCropReleaseALLMem
DESCRIPTION:    Memery release function for all InArray and OutArray.
PARA:           [IN|OUT] pInArray : pointer for InArray 
                [IN|OUT] pOutArray : pointer for OutArray 
HISTORY:        2013-09-29   First version 
                2016-08-15   Add memery release for AutoCropProcess_polygon
*******************************************************************************/ extern "C" int __declspec(dllexport) AutoCropReleaseALLMem( LPVOID *pInArray, LPVOID *pOutArray, int OutFlag ); /*! @function ********************************************************************************
FUNCTION NAME:  GetALLFunctionNum
DESCRIPTION:    get the number of all functions.
PARA:           [OUT] : number of all functions 
HISTORY:        2013-09-29   First version 
*******************************************************************************/ extern "C" int __declspec(dllexport) GetALLFunctionNum(); /*! @function ********************************************************************************
FUNCTION NAME:  GetALLFunctionNames
DESCRIPTION:    get the name of all functions.
PARA:           [IN|OUT] pFuncNameList : list of the functions' name 
                [IN] count : not used 
HISTORY:        2013-09-29   First version 
*******************************************************************************/ extern "C" int __declspec(dllexport) GetALLFunctionNames(char** pFuncNameList, int count); /*! @function ********************************************************************************
FUNCTION NAME:  AutoCropFunctionInfo
DESCRIPTION:    Get the info of autocrop function.
PARA:           [IN|OUT] nInputBufferCount : Input BufferCount 
                [IN|OUT] nMicroParamCount : Micro Parameters Count 
				[IN|OUT] nOutParamCount : Output Parameters Count 
HISTORY:        2013-09-29   First version 
*******************************************************************************/ extern "C" int __declspec(dllexport) AutoCropFunctionInfo(int* nInputBufferCount, int* nMicroParamCount, int* nOutParamCount); /*! @function ********************************************************************************
FUNCTION NAME:  AutoCropProcess
DESCRIPTION:    interface for DROC V2 device layer.
REFERENCE:      西门子RAD3项目需求的第316项.
PARA:           [IN|OUT] pInArray : input array 
                [IN|OUT] pMicroParam : micro parameters 
				[IN] MicroParamNum : number of micro parameters 
                [IN|OUT] pOutArray : output array 
				[IN] nOutParamNum : number of output parameters
RETURN:         OK : return 0; others : return error code
HISTORY:        2016-07-09   First version 
*******************************************************************************/ extern "C" int __declspec(dllexport) AutoCropProcess( LPVOID *pInArray, float* pMicroParam, int MicroParamNum, LPVOID *pOutArray, int nOutParamNum ); /*! @function ********************************************************************************
FUNCTION NAME:  AutoCropForNDT
DESCRIPTION:    AutoCrop function for NDT use.
PARA:           [IN] pImage : pointer for the image 
                [IN] nWidth : image width 
				[IN] nHeight : image height 
				[IN] ImageBit : image bits 
				[IN|OUT] leftside, rightside, upside, bottomside: output of the 
				boundary 
HISTORY:        2013-09-29   First version 
*******************************************************************************/ extern "C" int __declspec(dllexport) AutoCropForNDT( WORD *pImage, int nWidth, int nHeight, int ImageBit,int &leftside, int &rightside,int &upside, int &bottomside ); /*! @function ********************************************************************************
FUNCTION NAME:  AutoCropProcess_v3
DESCRIPTION:    new interface for DROC V3 device layer.
REFERENCE:      西门子RAD3项目需求的第316项.
PARA:           [IN|OUT] pInArray : input array 
                [IN|OUT] pMicroParam : micro parameters 
				[IN] MicroParamNum : number of micro parameters 
                [IN|OUT] pOutArray : output array 
				[IN] nOutParamNum : number of output parameters
RETURN:         OK : return 0; others : return error code
HISTORY:        2017-03-09   First version 
*******************************************************************************/ extern "C" int __declspec(dllexport) AutoCropProcess_v3( LPVOID *pInArray, float* pMicroParam, int MicroParamNum, LPVOID *pOutArray, int nOutParamNum );