⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dapproc.h

📁 相机传输图像程序源代码 拜耳模式(RAW格式文件)与RGB图像数据互相转换函数库
💻 H
字号:
#ifndef ___DAPPROC_H
#define ___DAPPROC_H
                                                      
#include <dsapp.h>
#include <dapproc.ah>


class _LVEXPCLASS DsyApp_ImagePreProcess : public LvDsyApplication {

        HWND hDestWnd;

    public:
        DsyApp_ImagePreProcess(void);
        #ifdef __UNIX__
        virtual ~DsyApp_ImagePreProcess(void);
        #endif

        // Do it!
        LVSTATUS PreProcessImage(U32BIT Offset=0, BOOL TimeStat=FALSE);

        // Preprocess functions
        LVSTATUS AddPreProcessFunction(int WhichProcess, DWORD Param=0, DWORD Flags=0);
        LVSTATUS ClearPreProcessFunctionList(void);
        LVSTATUS ChangePreProcessParam(int WhichProcess, DWORD Param=0, int Order=0);
        LVSTATUS ResetPreProcess(int WhichProcess, int Order=0);

        // Set destination buffers
        HWND   GetDestinationWindow(void) { return hDestWnd; }
        LVSTATUS SetDestinationWindow(HWND hWnd);
        LVSTATUS SetDestinationBuffer(unsigned char *Buffer, int Size, int Format, U32BIT *NeededSize=NULL);
        U32BIT GetUserBufferSize(void);
        LVSTATUS SetNoDestinationBuffer(void);

        // Set source info
        LVSTATUS SetInputROI(LvROIInfo *Roi);

        // Destination image info
        LPBITMAPINFO GetUserBufferBitmapInfo(void);
        LvROIInfo * GetUserBufferROI(void);

        // Areas to process
        U32BIT AddPreProcessRect(RECT *r);
        U32BIT EmptyPreProcessRectList(void);

        // Noise reduction
        LVSTATUS AddNoiseReduction(DWORD Factor, DWORD Flags=0);
        LVSTATUS SetNoiseReductionFactor(DWORD Factor, int Order=0);
        LVSTATUS ResetNoiseReduction(int Order=0);
        BOOL   NoiseReductionReady(int Order=0);

        // Color decoder
        LVSTATUS AddColorDecoder(U16BIT CameraId, DWORD Flags=0);
        LVSTATUS AddColorDecoder(char *CameraName, DWORD Flags=0);
        LVSTATUS EqualizeColorImage(RECT *r=NULL);
        LVSTATUS SetColorLUT(unsigned char *Red, unsigned char *Green, unsigned char *Blue);
        LVSTATUS GetColorLUT(unsigned char *Red, unsigned char *Green, unsigned char *Blue);
        // SPa 2004-02-20 
        LVSTATUS AddWhiteBalance(DWORD Param, DWORD Flags=0);
        LVSTATUS AddColorSpaceCorrection(DWORD Param, DWORD Flags=0);
        LVSTATUS AddShadingCorrection(DWORD Param, DWORD Flags=0);

        LVSTATUS ChangeWhiteBalanceParam(DWORD Param=0, int Order=0);
        LVSTATUS ChangeColorSpaceCorrectionParam(DWORD Param=0, int Order=0);
        LVSTATUS ChangeShadingCorrectionParam(DWORD Param=0, int Order=0);

        #ifdef __UNIX__

        virtual int    DSA_GetNrIfEntry(void);
        virtual int    DSA_GetIfEntry(void FAR *Buffer);
        virtual void   DSA_SetDefaultCfg(void FAR *Buffer);
        virtual int    DSA_GetCfgSize(void);
        virtual LVSTATUS DSA_ActivateCfg(void far *Buffer);
        virtual int    DSA_GetAppDataSize(void);
        virtual int    DSA_CfgUI(HWND ParentWnd);
        virtual int    DSA_CleanUp(void);
        virtual int    DSA_GetStatusSize(void);
        virtual LVSTATUS DSA_GetStatus(void *Status);

        #endif

    };

inline
DsyApp_ImagePreProcess::DsyApp_ImagePreProcess(void) : LvDsyApplication(DaPProc_Name)
{
hDestWnd=NULL;
#ifdef __UNIX__
LoadDsApp(DaPProc_Name);
#endif
}

#ifndef __UNIX__
inline
U32BIT DsyApp_ImagePreProcess::AddPreProcessRect(RECT *r)
{
return Interface ? ((DaPProcIf *)Interface)->AddPreProcessRect(this, r) : 0;
}
inline
U32BIT DsyApp_ImagePreProcess::EmptyPreProcessRectList(void)
{
return Interface ? ((DaPProcIf *)Interface)->EmptyPreProcessRectList(this) : 0;
}
inline
LVSTATUS DsyApp_ImagePreProcess::PreProcessImage(U32BIT Offset, BOOL TimeStat)
{
return Interface ? ((DaPProcIf *)Interface)->PreProcessImage(this, Offset, TimeStat) : DSY_E_NotSupported;
}
inline
LVSTATUS DsyApp_ImagePreProcess::EqualizeColorImage(RECT *r)
{
return Interface ? ((DaPProcIf *)Interface)->EqualizeColorImage(this, r) : DSY_E_NotSupported;
}
inline
LVSTATUS DsyApp_ImagePreProcess::SetDestinationWindow(HWND hWnd)
{
hDestWnd=Interface ? hWnd : NULL;
return Interface ? ((DaPProcIf *)Interface)->SetDestinationWindow(this, hWnd) : DSY_E_NotSupported;
}
inline
LVSTATUS DsyApp_ImagePreProcess::SetColorLUT(unsigned char *Red, unsigned char *Green, unsigned char *Blue)
{
return Interface ? ((DaPProcIf *)Interface)->SetColorLUT(this, Red, Green, Blue) : DSY_E_NotSupported;
}
inline
LVSTATUS DsyApp_ImagePreProcess::GetColorLUT(unsigned char *Red, unsigned char *Green, unsigned char *Blue)
{
return Interface ? ((DaPProcIf *)Interface)->GetColorLUT(this, Red, Green, Blue) : DSY_E_NotSupported;
}
inline
LvROIInfo *DsyApp_ImagePreProcess::GetUserBufferROI(void)
{
return Interface ? ((DaPProcIf *)Interface)->GetUserBufferROI(this) : NULL;
}
inline
LPBITMAPINFO DsyApp_ImagePreProcess::GetUserBufferBitmapInfo(void)
{
return Interface ? ((DaPProcIf *)Interface)->GetUserBufferBitmapInfo(this) : NULL;
}
inline
LVSTATUS DsyApp_ImagePreProcess::AddPreProcessFunction(int WhichProcess, DWORD Param, DWORD Flags)
{
return Interface ? ((DaPProcIf *)Interface)->AddPreProcessFunction(this, WhichProcess, Flags, Param) : DSY_E_NotSupported;
}
inline
LVSTATUS DsyApp_ImagePreProcess::ChangePreProcessParam(int WhichProcess, DWORD Param, int Order)
{
return Interface ? ((DaPProcIf *)Interface)->ChangePreProcessParam(this, WhichProcess, Param, Order) : DSY_E_NotSupported;
}
inline
LVSTATUS DsyApp_ImagePreProcess::ResetPreProcess(int WhichProcess, int Order)
{
return Interface ? ((DaPProcIf *)Interface)->ResetPreProcess(this, WhichProcess, Order) : DSY_E_NotSupported;
}
inline
BOOL DsyApp_ImagePreProcess::NoiseReductionReady(int Order)
{
return Interface ? ((DaPProcIf *)Interface)->NoiseReductionReady(this, Order) : FALSE;
}
inline
LVSTATUS DsyApp_ImagePreProcess::SetDestinationBuffer(unsigned char *Buffer, int Size, int Format, U32BIT *NeededSize)
{
return Interface ? ((DaPProcIf *)Interface)->SetDestinationBuffer(this, Buffer, Size, Format, NeededSize) : DSY_E_NotSupported;
}
inline
LVSTATUS DsyApp_ImagePreProcess::SetInputROI(LvROIInfo *Roi)
{
return Interface ? ((DaPProcIf *)Interface)->SetInputROI(this, Roi) : DSY_E_NotSupported;
}
inline
U32BIT DsyApp_ImagePreProcess::GetUserBufferSize(void)
{
return Interface ? ((DaPProcIf *)Interface)->GetUserBufferSize(this) : 0;
}
#endif
inline
LVSTATUS DsyApp_ImagePreProcess::AddColorDecoder(U16BIT CameraId, DWORD Flags)
{
return AddPreProcessFunction(DaPProcess_ColorDecode, (DWORD)CameraId, Flags);
}
inline
LVSTATUS DsyApp_ImagePreProcess::AddColorDecoder(char *CameraName, DWORD Flags)
{
return AddPreProcessFunction(DaPProcess_ColorDecode, (DWORD)CameraName, Flags);
}
inline
LVSTATUS DsyApp_ImagePreProcess::AddNoiseReduction(DWORD Factor, DWORD Flags)
{
return AddPreProcessFunction(DaPProcess_NoiseReduction, (DWORD)Factor, Flags);
}
inline
LVSTATUS DsyApp_ImagePreProcess::ClearPreProcessFunctionList(void)
{
return AddPreProcessFunction(DaPProcess_ClearAll);
}
inline
LVSTATUS DsyApp_ImagePreProcess::SetNoDestinationBuffer(void)
{
return SetDestinationBuffer((unsigned char *)NULL, 0, 0);
}
inline
LVSTATUS DsyApp_ImagePreProcess::ResetNoiseReduction(int Order)
{
return ResetPreProcess(DaPProcess_NoiseReduction, Order);
}
inline
LVSTATUS DsyApp_ImagePreProcess::SetNoiseReductionFactor(DWORD Param, int Order)
{
return ChangePreProcessParam(DaPProcess_NoiseReduction, Param, Order);
}
// SPa 2004-02-20 
inline
LVSTATUS DsyApp_ImagePreProcess::AddWhiteBalance(DWORD Param, DWORD Flags)
{
return AddPreProcessFunction(DaPProcess_WhiteBalance, (DWORD)Param, Flags);
}
inline
LVSTATUS DsyApp_ImagePreProcess::AddColorSpaceCorrection(DWORD Param, DWORD Flags)
{
return AddPreProcessFunction(DaPProcess_ColorSpace, (DWORD)Param, Flags);
}
inline
LVSTATUS DsyApp_ImagePreProcess::AddShadingCorrection(DWORD Param, DWORD Flags)
{
return AddPreProcessFunction(DaPProcess_ShadingCorrection, (DWORD)Param, Flags);
}
inline
LVSTATUS DsyApp_ImagePreProcess::ChangeWhiteBalanceParam(DWORD Param,  int Order)
{
return ChangePreProcessParam(DaPProcess_WhiteBalance, Param, Order);
}
inline
LVSTATUS DsyApp_ImagePreProcess::ChangeColorSpaceCorrectionParam(DWORD Param,  int Order)
{
return ChangePreProcessParam(DaPProcess_ColorSpace, Param, Order);
}
inline
LVSTATUS DsyApp_ImagePreProcess::ChangeShadingCorrectionParam(DWORD Param,  int Order)
{
return ChangePreProcessParam(DaPProcess_ShadingCorrection, Param, Order);
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -