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

📄 grabber.h

📁 相机传输图像程序源代码 拜耳模式(RAW格式文件)与RGB图像数据互相转换函数库
💻 H
📖 第 1 页 / 共 5 页
字号:
         * reported in the buffered status returned by GetOptocouplerBank()
         * function.
         * @param OptoNrInBank Determines which optocoupler in the
         *                     specified bank is being configured. The value in
         *                     this parameter is the index inside the 32 opto
         *                     bank.
         * @param Bank         Determines in which bank is the optocoupler
         *                     whose configuration is returned.
         * @return The configuration of the required input optocoupler or @ref OptoCfg_Disable if
         *         the board does not support the buffered optocoupler state..
         */
        virtual U32BIT   GetOptocouplerBankCfg(int OptoNrInBank, int Bank=0);

                /** Gets the number of optocouplers on the board.
                 * Returns the number of the available input and output optocouplers on the grabber.
                 * @param NrOptoIn                  pointer to 32 bits variable where Daisy copies
                 *                                  the number of input optocouplers
                 * @param NrOptoOut                 pointer to 32 bits variable where Daisy copies
                 *                                  the number of output optocouplers
                 * @return Always @a DSY_I_NoError
                 * @sa SetOptocouplerBank(), GetOptocouplerBank()
                 */
                U32BIT   GetNrOptocoupler(U32BIT *NrOptoIn, U32BIT *NrOptoOut);

                /** Retrieves the number of the grabber targets.
                 * Gets the number of the available targets in the actual grabber.
                 * @return The number of the available targets in the actual grabber.
                 * @sa GetTargetDescription(), ActivateCamera()
                 */
                int    GetNrTarget(void) { return NrTarget; }

                /** Retrieves the description for a target.
                 * Query function to retrieve information about available targets on the actual
                 * grabber.\n
                 * It has to be called, incrementing the @a Index parameter, until it returns a
                 * value different from @b DSY_I_NoError; the user application can then use these
                 * info as needed.
                 * @param Index          Positive integer specifying the requested
                 *                       target.
                 * @param Id             Pointer to a U16BIT variable where the
                 *                       identifier of the selected target will be placed.\n
                 *                       This id is one of the @ref Targets definitions.
                 * @param Descr          Pointer to a user supplied buffer where to
                 *                       store a ASCII description of the target. This
                 *                       parameter can be NULL if no description is
                 *                       needed.
                 * @param DescrSize      Size of the user buffer supplied in the Descr
                 *                       parameter.
                 * @return @ref ErrorDefinitions
                 */
                LVSTATUS GetTargetDescription(int Index, U16BIT *Id, LPSTR Descr=NULL, int DescrSize=0);

        /** Adds a 'notify on interrupt' request.
         * A grabber object representing hardware that generates interrupts on
         * specific events maintain a list of 'notify on interrupt' requests.
         * The way an application is notified about income interrupts depends
         * on the operating system.\n
         * \n
         * In general, when an interrupt occurs, Daisy will catch it and defines which
         * type of interrupt was generated; then, for each task/thread that requested
         * notification on interrupt a certain action, depending on the operating system, 
         * is performed in order to give control to the waiting task/thread in 
         * the smallest possible amount of time.
         * 
         * @note Daisy will not enable interrupt processing until a task/thread requests a notification.
         *       - \b Windows \b systems \n
         *           When an interrupt of the specified type occurs, Daisy will signal the @b Event
         *           identified by the @b Handle parameter. This is a user defined @b Event @b object;
         *           depending on the application construction it can be auto-reseting  or it can
         *           have to be reset manually; in this last case, the application is responsible to reset 
         *           the event when needed.\n
         *           An application using 'notify on interrupt' requests should have a secondary thread
         *           waiting for the event getting signaled, leaving free the main thread to continue
         *           normal processing.
         *       - \b Linux \b systems \n
         *           When an interrupt of the specified type occurs, @a Daisy will raise the signal
         *           identified by the @b Handle parameter. An application using 'notify on interrupt' requests 
         *           should have a signal handler for the specified signal.
         * @param Handle
         *               - \b Windows: @b Handle to a user defined @b Event object. The event will be signaled whenever
         *                          an interrupt of the specified type occurs.
         *               - \b Linux: @b Signal number to be raised when an interrupt occurs.
         *               This parameter may also be @b NULL. In this case, the interrupts are enabled on the board
         *               but no notification is sent to the requesting task.
         * @param WhichInt 
         *          Type of interrupt for which the task/thread is requesting the notification
         *               - For \b PicPort boards, one of the @ref PicPort_InterruptType definitions.
         *               - For \b PicPortPro boards, one of the _RxxIT enumeration.
         *               - For \b PicProdigy boards, one of the _PkxIT enumeration.
         *               - For \b PicPort Elite boards, one of the _YXEIT enumeration.
         * @param NotifyId Pointer to a 32-bit variable where @a Daisy stores the identifier for the actual request;
         *                 this value has to be passed back to @a Daisy when calling the RemoveInterruptNotify() method
         *                 to let @a Daisy to perform some cleanup.
         * @return @ref ErrorDefinitions
         */
        virtual LVSTATUS AddInterruptNotify(INTHANDLE Handle, U32BIT WhichInt, U32BIT *NotifyId);
        virtual LVSTATUS AddInterruptQueue(LvIntQueue *Q, U32BIT NotifyId);

        /** Removes a 'notify on interrupt' request.
         * This function instructs @a Daisy to stop notifications on the request specified
         * by the @a NotifyId parameter.
         * @param NotifyId          Notification identifier for the request being
         *                          canceled; it has to be retrieved by a previous
         *                          call to AddInterruptNotify().
         * @return @ref ErrorDefinitions
         * @sa AddInterruptNotify()
         */
        virtual LVSTATUS RemoveInterruptNotify(U32BIT NotifyId);
        virtual LVSTATUS RemoveInterruptQueue(U32BIT NotifyId);

        /** Gets the number of occurrences of the specified interrupt.
         * This function retrieves the number of occurrences for the interrupt
         * specified by the @a WhichInt parameter.
         * @param WhichInt            Type of interrupt.\n
         *                            - For \b PicPort boards, one of the @ref PicPort_InterruptType definitions.
         *                            - For \b PicPortPro boards, one of the _RxxIT enumeration.
         *                            - For \b PicProdigy boards, one of the _PkxIT enumeration.
         *                            - For \b PicPort Elite boards, one of the _YXEIT enumeration.
         *
         * @param IntCount            Pointer to a 32-bit variable where Daisy will
         *                            store the actual count of the WhichInt
         *                            interrupt. When the count reaches
         *                            @a 0xffffffff, it will wrap to zero.
         *                            Applications basing their processing time on
         *                            interrupt count should take in account this
         *                            fact.
         * @return @ref ErrorDefinitions
         * @note Daisy should have been requested for interrupt notification before this
         *       function being called.
         * @sa AddInterruptNotify()
         */         
        virtual LVSTATUS GetInterruptCount(U32BIT WhichInt, U32BIT *IntCount);

        /** Sets the priority for the Daisy interrupt thread.
         * Sets the priority for the Daisy thread handling interrupts.\n
         * Daisy creates one thread per grabber in order to handle interrupts; this
         * thread is responsible for notifying the user application about HW events.
         * @warning Due to the different way of interrupt handling, this function is not supported under Linux.
         * @param Priority      New thread priority: one of the Windows'
         *                      @b THREAD_PRIORITY_XXX definitions.
         *                      The default (2) is @b THREAD_PRIORITY_HIGHEST
         * @return @ref ErrorDefinitions
         * @sa AddInterruptNotify(), RemoveInterruptNotify()
         */
        LVSTATUS SetInterruptThreadPriority(int Priority=2); // THREAD_PRIORITY_HIGHEST

        /** Gets the current priority for the Daisy interrupt thread.
         * Gets the current priority for the Daisy thread handling interrupts.\n
         * Daisy creates one thread per grabber in order to handle interrupts; this
         * thread is responsible for notifying the user application about HW events.
         * @warning Due to the different way of interrupt handling, this function is not supported under Linux.
         * @return The current thread priority : one of the @a Windows' @b THREAD_PRIORITY_XXX definitions.
         * @sa AddInterruptNotify(), RemoveInterruptNotify()
         */
        int    GetInterruptThreadPriority(void);

        /** Sets a new buffer for the DMA buffer.
         * Windows NT and Linux only. This function is not supported under Windows 95.\n
         * \n
         * Allows changing the buffer which will be used for the DMA transfers with
         * PicPort boards.\n
         * This function has no influence when used with PrimaView boards.\n
         * \n
         * @param hMem handle to new buffer
         * @return @ref ErrorDefinitions
         */
        virtual LVSTATUS SetDMABuffer(HANDLE hMem);

        /** Sets a new dimension for the DMA buffer.
         * @b Windows @b NT and @b Linux only. This function is not supported under
         * @b Windows @b 95 .\n
         * \n
         * Allows changing the size of the buffer used for the DMA transfers with
         * @a PicPort boards.\n
         * \n
         * This function has no influence when used with @a PrimaView boards.\n
         * When the requested size is close to the amount of physical memory
         * installed in the system, this routine can take several time to complete, so it
         * is responsibility of the user application to request appropriate sizes for the
         * @a Daisy buffer.
         * @param NewSize          Specifies the new size of the buffer in bytes.
         * @param OldSize          Pointer to a @a U32BIT variable to store the
         *                         actual size of the buffer; this parameter can
         *                         be @b NULL.
         * @param AllocatedSize    Pointer to a @a U32BIT variable to store the
         *                         actual size of the allocated buffer. User
         *                         applications should always check this value
         *                         since the actually allocated size may differ
         *                         from the requested size, depending on
         *                         system resources availability and/or @a Daisy
         *                         registry settings. This parameter can be
         *                         @b NULL.
         * @param Adjust           When @b TRUE, this parameter instructs @a Daisy
         *                         to find the maximum amount of physical
         *                         memory it can allocate when the original
         *                         request fails to allocate the requested buffer
         *                         size. When this parameter is set to @b FALSE
         *                         and the request fails Daisy will half the
         *                         requested size until it can successfully
         *                         allocate and lock the buffer. This parameter
         *                         defaults to @b TRUE when not specified.
         * @param SubGrb           Which subgrabber has to be used
         * @return @ref ErrorDefinitions
         */
        virtual LVSTATUS SetDMABufferSize(U32BIT NewSize, U32BIT *OldSize=NULL, U32BIT *AllocatedSize=NULL, BOOL Adjust=TRUE, int SubGrb=0);

        /** Sets ownership of DMA buffer to the calling application and allocates a new buffer for internal use.
         * If there is a need to use DMA buffer, set ownership of this buffer to your application by calling this function.
         * @warning This buffer must be released by calling ReleaseDMABuffer()
         * @param hMem pointer to handle which will point to this buffer
         * @param Size if present, this parameter will contain size of this buffer
         * @param DataOffset if present, this pointer will contain the start of image data offset from the start of the buffer
         * @param SubGrb which subgrabber DMA buffer will be owner-shipped
         * @param BufferRef Reference to this ownership, it must be passed as-is to ReleaseDMABuffer()
         * @return @ref ErrorDefinitions
         */
        virtual LVSTATUS GetDMABufferOwnership(HANDLE *hMem, U32BIT *Size=NULL, U32BIT *DataOffset=NULL, int SubGrb=0, LVRAWPTR *BufferRef=NULL) { return DSY_E_NotSupported; }

        /** Releases owner-shipped DMA buffer.
         * After there are no other use of your owner-shipped DMA buffer you have to release this buffer.
         * @param hMem handle of this buffer

⌨️ 快捷键说明

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