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

📄 node.h

📁 相机传输图像程序源代码 拜耳模式(RAW格式文件)与RGB图像数据互相转换函数库
💻 H
📖 第 1 页 / 共 2 页
字号:
//=====================================================================
//[HEADER] Node
// LvNode class definition
//+



#ifndef ___NODE_H
#define ___NODE_H

#include <prvphlib.h>
#include <dsylib.h>
#include <port.h>

#include <dsydef.h>

#include <lvpackon.h>

#ifndef LF_Max
#define LF_Max 2
#endif

class LvStore;
LVDSYCLASS LvTargetNode;

typedef struct _tagLvOutputInfo {
    U16BIT ScreenWidth;
    U16BIT ScreenHeight;
    U8BIT  PixelDepth;
    U32BIT StartAddress;
    U32BIT MemorySize;
    char _Huge_ *BaseAddress;
    U8BIT  NrColorComponent;
    U8BIT  BitPerColor[4];
    } LvOutputInfo;

/*
typedef struct _tagLvMemInfo {
    U16BIT MemoryWidth;
    U16BIT MemoryHeight;
    char huge *BaseAddress;
    } LvMemInfo;

typedef struct _tagLvMemWindowInfo {
    U16BIT Width;
    U16BIT Height;
    U8BIT  PixelDepth;
    U16BIT StartRow;
    U16BIT StartCol;
    U32BIT StartAddress;
    U8BIT  NrColorComponent;
    U8BIT  BitPerColor[4];
    LvMemInfo Memory;
    } LvMemWindowInfo;
*/

enum _MsgCommand {
    MCmd_Live=0x10,                    // 0x10
    MCmd_Freeze,                       // 0x11
    MCmd_SetHue,                       // 0x12
    MCmd_SetSaturation,                // 0x13
    MCmd_SetContrast,                  // 0x14
    MCmd_SetBrightness,                // 0x15
    MCmd_SelectOneComponent,           // 0x16
    MCmd_SetMirrorType,                // 0x17
    MCmd_WaitSync,                     // 0x18
    MCmd_VcoBiasAdjust,                // 0x19
    MCmd_ROIChanged,                   // 0x1a
    MCmd_SetPacker,                    // 0x1b
    MCmd_SetLiveParam,                 // 0x1c
    MCmd_GetLiveParam,                 // 0x1d
    MCmd_IsCameraConnected,            // 0x1e
    MCmd_IsCameraLive,                 // 0x1f
    MCmd_SetScaleMode,                 // 0x20
    MCmd_LoadLUT,                      // 0x21
    MCmd_MuxSwitch,                    // 0x22
    MCmd_SetCamOption,                 // 0x23
    MCmd_AdviseTarget,                 // 0x24
    MCmd_IsCameraLocked,               // 0x25
    MCmd_CheckSync,                    // 0x26
    MCmd_SetADCLowerLevel,             // 0x27
    MCmd_SetADCUpperLevel,             // 0x28
    MCmd_GetADCLowerLimit,             // 0x29
    MCmd_GetADCUpperLimit,             // 0x2a
    MCmd_LiveShot,                     // 0x2b
    MCmd_GetDesiredHBS,                // 0x2c
    MCmd_GetActiveChannel,             // 0x2d
    MCmd_GetActiveDma,                 // 0x2e
    MCmd_GetActiveFifo,                // 0x2f
    MCmd_GetActiveClp,                 // 0x30
    MCmd_EqualizeColorImage,           // 0x31
    MCmd_GetCameraCommPort,            // 0x32
    MCmd_GetSubGrabber,                // 0x33
    MCmd_GetImageInfo,                 // 0x34
    MCmd_GetFMBInfo,                   // 0x35
    MCmd_ResetFifo,                    // 0x36
    MCmd_ShadingCorrectionEnable,      // 0x37
    MCmd_ShadingCorrectionParam,       // 0x38
    MCmd_SetImgProcessParam,           // 0x39
    MCmd_SetCameraGain,                // 0x3a
    MCmd_SetCameraExposure,            // 0x3b
    MCmd_UpdateImgProcessParam,        // 0x3c
    MCmd_SetCameraBlackLevel,          // 0x3d
    MCmd_SetProtocolParam,             // 0x3e
    MCmd_GetCameraExposureLimit,       // 0x3f
    MCmd_LastMCommand                  // 0x40
    };


// MCmd_ROIChanged flags
#define ChR_PixelDepth 0x0001
#define ChR_Dimension  0x0002


enum _MappedFunction {
    Fn_FirstFunction=100,
    // Here the functions that can be everywhere in the tree
    Fn_TestFn=Fn_FirstFunction,
    Fn_LastFunction
    };



#define SCW_Save          0x0001
#define SCW_Restore       0x0002
#define SCW_Delete        0x0003
#define SCW_Activate      0x0010
#define SCW_Deactivate    0x0011
#define SCW_Destroy       0x0012
#define SCW_Change        0x0013


// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
//[CLASS/OEM] LvNode
// Base class for each specialized node.
//+
//[DESCRIPTION]
// The LvNode class is the base class for all specialized node types; it provides
//& basic functionalities to manage ports and connection as well as a default
//& message handling procedure; it handles also the flow of 'internal only' messages.
// A LvNode object can have Ports in order to communicate with other nodes.
// A node can be Atomic, an object that directly performs its job, or a Supernode,
//& an object that is 'composed' by other nodes and rules the connection among them;
//& this kind of object usually has no direct access to the hardware but
//& will 'command' actions to the nodes belonging to it.
//
// Subnodes & Supernodes
// The nodes belonging to a non-atomic node are called Subnodes; a Subnode can
//& be a Supernode of other nodes.
// A Supernode knows only its Subnodes, the way of connecting them and which
//& functionality they can provide.
// When a supernode is created during the initialization, it creates first
//& its subnodes, so that it can connect their Ports (created with the
//& subnodes themselves) in order to reflect the hardware it represents.
//.

LVDSYCLASS LvNode {

    private:

    protected:

        LvROIInfo *OutputInfo;

        BOOL CanCallParent;
        HDEVICE hDevice;
        U8BIT Module;
        U8BIT DigitalModule;

        BOOL UseRegisteredFunction;
        BOOL UseAccessPort;
        LvNode **NodeFn;

        U16BIT NrInputPort;
        LvPort **TheInputPort;

        U16BIT NrOutputPort;
        LvPort **TheOutputPort;

        U16BIT NrNode;
        LvNode **TheSubNode;

        U16BIT Id;
        BOOL   Target;
        BOOL   MsgToAllPort;

        U8BIT  CanBeDestroyed;
        void   AddToDestroyNodeList(void);

        LvNode *ParentNode;
        char Name[41];
        char TheExtName[41];
        // ***********
        U16BIT NrRegFn;
        U16BIT *RegisteredFn;
                void RegisterFunction(U16BIT Fn);
                void CollectNodeFn(void);
                BOOL IsFunctionRegistered(U16BIT Fn);
                U16BIT GetNrRegFn(void) { return NrRegFn; }
                U16BIT GetRegFnId(U16BIT Index) { return (U16BIT)(Index<NrRegFn ? RegisteredFn[Index] : 0xffff); }
        virtual void RegisterNodeFunctions(void) {}
                LvNode *GetNodeFn(U16BIT FnId);
                // friend class LvGrabberNode;
                friend BOOL FindTarget(LvNode *, LvPort *, U32BIT , LPSTR );
        // ***********

                LVSTATUS AddSubNode(LvNode *Node);
                LvPort *FindPort(U8BIT Dir, U16BIT Id, U16BIT PortType, BOOL IdInternal=FALSE, U16BIT *Index=NULL);
                LvPort **GetPtrLimit(U8BIT Direction, U16BIT *Limit);
                void   RemoveFromSubNodeList(LvNode *aNode);

        virtual LVSTATUS TouchHardware(LvDFlowPortCfg *Cfg) { return I_NoError; }
        virtual LVSTATUS ExecuteMCommand(U16BIT CmdId, U16BIT wParam, LVRAWPTR lParam, LVSTATUS *RetVal, LvPort *FromPort, U8BIT Direction);
        virtual LVSTATUS ExecuteMCommandOnReturn(U16BIT CmdId, U16BIT wParam, LVRAWPTR lParam, LVSTATUS *RetVal, LvPort *FromPort, U8BIT Direction) { return I_NoError; }

⌨️ 快捷键说明

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